Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1804 commits
Select commit Hold shift + click to select a range
56f0f93
Change grammar used for Haskell highlighting (#3147)
Alhadis Aug 19, 2016
ff042a8
Grammar for REXX from Sublime Text package
pchaigno Aug 24, 2016
216d63f
Merge pull request #3162 from pchaigno/grammar-rexx
arfon Aug 24, 2016
06e80f3
Grammar update
arfon Aug 24, 2016
c802ba3
Grammar update
arfon Aug 24, 2016
6adec16
Updating version to v4.8.9
arfon Aug 24, 2016
2f50aa4
Removing nuked grammars
arfon Aug 24, 2016
7715254
Moving blitzmax grammar to GitHub-hosted copy
arfon Aug 25, 2016
17fc3d0
Blitzmax license
arfon Aug 25, 2016
4204078
Updating location of Cython grammar
arfon Aug 25, 2016
c13e384
Updating location of Forth grammar
arfon Aug 25, 2016
e8a700e
Updating location of Parrot grammar
arfon Aug 25, 2016
510abc7
Updating location of SecondLife LSL grammar
arfon Aug 25, 2016
ae10395
Updating location of VHDL grammar
arfon Aug 25, 2016
6a2cebe
Updating location of XQuery grammar
arfon Aug 25, 2016
8d0a2d9
Grammar re-ordering
arfon Aug 25, 2016
4da0463
Typo fix
arfon Aug 25, 2016
9171ee6
Ordering
arfon Aug 25, 2016
cb5bc91
Grammar update
arfon Aug 25, 2016
5c3744d
Merge pull request #3165 from github/cut-release-v4.8.9
arfon Aug 26, 2016
6763b73
Fix .ts heuristic rule (#3171)
pchaigno Aug 27, 2016
742faeb
Add RPM Spec files to languages list
Alhadis Aug 28, 2016
ed71855
Add sample .spec files
Alhadis Aug 28, 2016
51d7c8f
Use a dedicated grammar to highlight Emacs Lisp
Alhadis Aug 28, 2016
5ddccaa
Add ".spacemacs" as a recognised filename
Alhadis Aug 28, 2016
f953659
Separate CSON from CoffeeScript
Alhadis Aug 28, 2016
48b64c2
Add CSON samples
Alhadis Aug 28, 2016
e930ee1
Fix typos
Alhadis Aug 28, 2016
00647be
Exclude "dist" directory from language statistics
ad-si Aug 31, 2016
50bd2cc
Add support for Schematron XML validation files (.sch)
akhtars Aug 31, 2016
4268181
Merge pull request #3176 from Alhadis/typo-fixes
arfon Sep 4, 2016
dd7b125
Merge pull request #3174 from Alhadis/emacs-lisp
pchaigno Sep 4, 2016
04e1cc6
Merge pull request #3079 from pchaigno/yaml-grammars
arfon Sep 4, 2016
a8719f3
Add script to generate grammars-list in Markdown
Alhadis Sep 6, 2016
49e9ee4
Make grammar-listing code more modular
Alhadis Sep 6, 2016
09612ae
Add logic to update Markdown file
Alhadis Sep 6, 2016
2a4150b
Butcher whitespace to appease tab-hating heretics
Alhadis Sep 6, 2016
9d57e1e
Remove debugging vestige
Alhadis Sep 6, 2016
f382abc
Add logic to consume and parse options
Alhadis Sep 6, 2016
4584963
Add logic to update submodules and licenses
Alhadis Sep 6, 2016
68c45be
Flatten whitespace
Alhadis Sep 6, 2016
be316c2
Update contributor notes to mention new script
Alhadis Sep 6, 2016
3112e6d
Normalise .gitmodules formatting
Alhadis Sep 6, 2016
1ec84da
Remove dangling submodules
Alhadis Sep 6, 2016
98118eb
Add new grammar for MSDOS Batchfile highlighting
Alhadis Sep 6, 2016
df98c86
Merge pull request #3183 from akhtars/master
arfon Sep 6, 2016
2d51a5d
Recognise R comments in heuristic.
larsbrinkhoff Sep 7, 2016
983ff20
Merge pull request #3195 from larsbrinkhoff/r
larsbrinkhoff Sep 7, 2016
56fb48e
Merge branch 'master' into specfiles
Alhadis Sep 8, 2016
35a13b3
Add .spec as a supported Python and Ruby extension
Alhadis Sep 8, 2016
dad3191
Add Filebench Workload Model Language.
larsbrinkhoff Sep 9, 2016
3247d46
Chop trailing slashes before looking up language
Alhadis Sep 9, 2016
22d4865
Revise patterns for Vim modeline detection
Alhadis Sep 10, 2016
5e4e38b
Lock language-babel grammar to v2.22.0
pchaigno Sep 11, 2016
e6c849d
Document --verbose option in usage message
Alhadis Sep 11, 2016
b61fe90
Terminate script if submodule registration failed
Alhadis Sep 11, 2016
ab2e640
Merge pull request #3189 from Alhadis/batch-fix
arfon Sep 12, 2016
879c63a
Merge pull request #3201 from pchaigno/lock-babel-grammar
arfon Sep 12, 2016
6df0e45
Merge pull request #3198 from larsbrinkhoff/filebench
arfon Sep 12, 2016
28be728
Merge pull request #3173 from Alhadis/specfiles
arfon Sep 12, 2016
6e40de4
Grammar update
arfon Sep 12, 2016
fdec52c
Bumping to v4.8.10
arfon Sep 12, 2016
1fc4c9f
Merge pull request #3203 from github/cut-release-v4.8.10
arfon Sep 12, 2016
70779c9
Merge branch 'master' into modelines
Alhadis Sep 12, 2016
e73a4ec
Allow " ex:" to match at beginning of file
Alhadis Sep 12, 2016
abf7bee
Include tests for version-specific Vim modelines
Alhadis Sep 12, 2016
e0d8902
Adding basic script for adding language_id fields to languages.yml
arfon Sep 13, 2016
7cda13a
A Language should know about it's language_id
arfon Sep 13, 2016
1f43664
Adding some tests for some known language_ids
arfon Sep 13, 2016
b71bf19
Fix Elm highlighting
pchaigno Sep 13, 2016
65201b3
Test the uniqueness of language ids
pchaigno Sep 13, 2016
3310d92
Lock awk grammar to last working version
pchaigno Sep 13, 2016
8a62282
Lock NSIS grammar to last working version
pchaigno Sep 13, 2016
b4a77ab
Lock SourcePawn grammar to last working version
pchaigno Sep 13, 2016
53c9b2b
Merge pull request #3207 from pchaigno/test-uniqueness-language-ids
arfon Sep 13, 2016
c7a0d7b
Merge pull request #3208 from pchaigno/lock-grammar-versions
arfon Sep 13, 2016
9f1c950
Merge pull request #3206 from pchaigno/fix-elm-highlighting
arfon Sep 13, 2016
a3227c2
Adding basic find_by_id functionality to Language
arfon Sep 13, 2016
e1216ea
Merge branch 'language-id' of github.com:github/linguist into languag…
arfon Sep 13, 2016
02f3ba1
Merge pull request #3205 from github/language-id
arfon Sep 13, 2016
a53423b
Grammar updates
arfon Sep 13, 2016
6841b4d
Updating to v4.8.11
arfon Sep 13, 2016
8dc4a13
Merge pull request #3212 from github/cut-release-v4.8.11
arfon Sep 13, 2016
65491d4
Remove support for .sublime-syntax
pchaigno Sep 14, 2016
e57273c
Merge pull request #3214 from pchaigno/remove-sublime-syntax
arfon Sep 14, 2016
600115a
Bumping to v4.8.12
arfon Sep 14, 2016
a8d84f3
Merge pull request #3215 from github/cut-release-v4.8.12
arfon Sep 14, 2016
cd288a8
Add .gnus, .viper and Project.ede as Emacs Lisp extensions
Alhadis Sep 15, 2016
81ca6e7
Add "abbrev_defs" and "_emacs" as Elisp filenames
Alhadis Sep 15, 2016
00efd6a
Add FORTRAN keyword "data" to .f and .for heuristics. (#3218)
larsbrinkhoff Sep 15, 2016
5bc8881
Swap grammar used for Vimscript highlighting
Alhadis Sep 15, 2016
5fd8d71
Remove license for old grammar
Alhadis Sep 15, 2016
6973803
Revise pattern for Emacs modeline detection
Alhadis Sep 17, 2016
63c8d22
Merge pull request #4 from github/master
Sep 19, 2016
82af10e
add support for MQL4 and MQL5
Sep 19, 2016
cc5f1c5
Add Codemirror modes
Sep 21, 2016
30298a9
Whitelist troublesome licenses
arfon Sep 21, 2016
4cf7feb
Merge pull request #3236 from github/license-whitelist
arfon Sep 22, 2016
35a06d6
Merge branch 'master' into add_codemirror_mode
arfon Sep 22, 2016
1d7ba18
M scope
arfon Sep 22, 2016
f30e927
Merge pull request #3197 from Alhadis/modelines
arfon Sep 22, 2016
991dcef
Merge pull request #3223 from Alhadis/vimscript
arfon Sep 22, 2016
de478d2
Merge pull request #3235 from github/add_codemirror_mode
arfon Sep 22, 2016
c8094d3
Merge branch 'master' into 3227-local
arfon Sep 22, 2016
d6d7d38
Fix w/ a test
Sep 22, 2016
6fcba83
Merge branch 'master' into 3227-local
arfon Sep 22, 2016
8e19aea
Removing stray Sublime-VimL grammar reference
arfon Sep 22, 2016
7a8bd62
Merge pull request #3237 from github/3227-local
arfon Sep 22, 2016
ecd4ae3
Bumping to v4.8.13
arfon Sep 22, 2016
0e5327a
Merge pull request #3238 from github/cut-release-v4.8.13
arfon Sep 22, 2016
a7a123a
Add heuristic for .inc files: the #declare keyword is unique to POV-Ray.
larsbrinkhoff Sep 14, 2016
f0659d3
Merge pull request #3213 from larsbrinkhoff/povray
arfon Sep 22, 2016
fc67fc5
Merge pull request #3219 from Alhadis/emacs-files
arfon Sep 22, 2016
b4035a3
Update grammars
arfon Sep 23, 2016
a1901fc
Bump version to v4.8.14
arfon Sep 23, 2016
2ea1ff2
Merge pull request #3240 from github/cut-release-v4.8.14
arfon Sep 23, 2016
6a54ee7
Set interpreters for Julia
JoshCheek Sep 23, 2016
88c74fa
Convert from mode names to mimetypes for better usage.
Sep 23, 2016
c525e3f
Ignore default external warnings
josh Sep 23, 2016
152b5ad
Fix shadowed path warning
josh Sep 23, 2016
39ea9be
Ignore ace mode warning while testing
josh Sep 23, 2016
6564078
Merge branch 'master' into change_modes_to_mimetypes
josh Sep 23, 2016
fdb9625
Consistent CodeMirror casing
josh Sep 23, 2016
daefff8
Fix JSX mode
josh Sep 23, 2016
0108ef4
Restore old mode
josh Sep 23, 2016
0406a5b
Fix typescript indent
josh Sep 23, 2016
855f1a1
Validate CodeMirror modes
josh Sep 23, 2016
d3f3c03
Add a sample showing the Julia interpreter is correctly analyzed
JoshCheek Sep 23, 2016
3abe081
Validate codemirror modes
josh Sep 23, 2016
67ed060
Assert CodeMirror modes and mime types are valid against source
josh Sep 23, 2016
07d4f21
Merge pull request #3243 from github/change_modes_to_mimetypes
josh Sep 23, 2016
e424e8e
Linguist 4.8.15
josh Sep 23, 2016
bed8add
Add smalltalk samples
Sep 24, 2016
41593b3
Update season package in npm to fix parsing error
pchaigno Sep 25, 2016
71032cd
Merge pull request #3249 from pchaigno/update-season-package
arfon Sep 26, 2016
f8ce42e
Recognize licenses in READMEs using Licensee
pchaigno Sep 26, 2016
524337d
Use Licensee hashes to uniquely identify licenses
pchaigno Sep 26, 2016
ebe8578
Rely solely on Licensee to recognize licenses
pchaigno Sep 26, 2016
05b536f
Added BuddyBuildSDK.framework to lib/linguist/vendor.yml
alexruperez Sep 28, 2016
7654032
Merge pull request #3254 from alexruperez/master
arfon Oct 1, 2016
e7e8a7d
Tests for .m heuristic rules
pchaigno Sep 24, 2016
cd9401c
Enable testing absence of heuristic result
pchaigno Sep 24, 2016
3ae89b4
Improve Mathematica's heuristic rule
pchaigno Sep 24, 2016
8216706
Tests to ensure the whitelists are up-to-date
pchaigno Sep 27, 2016
eeec481
Update submodules
pchaigno Sep 27, 2016
c863435
Add '</' to Markdown heuristic. (#3255)
larsbrinkhoff Oct 3, 2016
fe70965
Added entry for TI-83+/84 programs and apps
scottmangiapane Oct 4, 2016
a3628f8
Added example files for TI-83+/84 programs
scottmangiapane Oct 4, 2016
4e4d851
Alphabetized "TI PRGM"
scottmangiapane Oct 4, 2016
e32a4f1
Updated languages.yml
scottmangiapane Oct 4, 2016
6589bd9
Added tm_scope to TI PRGM
scottmangiapane Oct 4, 2016
676861f
Removed binary files from the TI PRGM sample
scottmangiapane Oct 4, 2016
5d85692
Updated TI PRGM languages.yml entry
scottmangiapane Oct 4, 2016
520e5a5
Alphabetized extensions for TI PRGM (again)
scottmangiapane Oct 4, 2016
7e63399
Delete colour property for ASN.1 language
Alhadis Oct 4, 2016
8d55fc1
Reordered extensions for TI PRGM
scottmangiapane Oct 4, 2016
e38cc75
Update ASN.1 grammar
Alhadis Oct 5, 2016
26310d9
TI PRGM -> TI Code
scottmangiapane Oct 5, 2016
20b8188
Add test to guard against unused colours
Alhadis Oct 5, 2016
d7c689f
Merge branch 'master' into grammar-scripts
Alhadis Oct 5, 2016
4a775dc
Add REXX interpreters
Alhadis Oct 5, 2016
12695fe
Add ".make" as a Makefile file extension
Alhadis Oct 5, 2016
a2db058
TI Code -> TI Program
scottmangiapane Oct 5, 2016
71dfed0
Restored .8xp.txt extension
scottmangiapane Oct 5, 2016
1bbb919
Reclassify Sublime configuration files as JSON
Alhadis Oct 6, 2016
6ac1ac9
Resolve conflicts from upstream changes
Alhadis Oct 6, 2016
9543a8c
Merge pull request #3259 from Alhadis/colour-removal
arfon Oct 6, 2016
e46781b
Merge upstream changes into topic branch
Alhadis Oct 6, 2016
5a5bf7d
Add new entry for Sublime Text config files
Alhadis Oct 6, 2016
d265b78
Copy Sublime configs from submodules
Alhadis Oct 7, 2016
ecaef91
Merge pull request #3266 from Alhadis/make
arfon Oct 9, 2016
c8d3767
Improve documentation on the language_id
pchaigno Oct 9, 2016
2ce2945
Merge pull request #3272 from pchaigno/doc-set-language-id
arfon Oct 10, 2016
608ed60
Merge branch 'master' of https://github.com/github/linguist
Oct 10, 2016
f6b6c4e
Merge branch 'master' into add-mql4-mql5-current
Oct 10, 2016
dd2e5ff
Merge pull request #3258 from scottmangiapane/master
arfon Oct 10, 2016
6b83e5f
Merge branch 'master' into sublime
Alhadis Oct 10, 2016
39e3688
Bump language ID for Sublime Text config files
Alhadis Oct 10, 2016
22c2cf4
Merge pull request #3268 from Alhadis/sublime
arfon Oct 10, 2016
eb0e75e
Add support for the Pic language
Alhadis Oct 11, 2016
a44ebe4
Bump language ID
Alhadis Oct 12, 2016
ba52e48
Merge pull request #3175 from Alhadis/cson
arfon Oct 12, 2016
e4cdbd2
Merge branch 'master' into pic
Alhadis Oct 12, 2016
8f31fbb
Bump language ID
Alhadis Oct 12, 2016
9878356
Add CodeMirror modes for GPG keys and IRC logs
Alhadis Oct 12, 2016
de9ff71
Test that grouped languages have no color.
larsbrinkhoff Oct 12, 2016
d43f111
Remove redundant group attribute for ColdFusion.
larsbrinkhoff Oct 12, 2016
8e9c224
Remove color attribute from all languages with a group attribute.
larsbrinkhoff Oct 12, 2016
dc54735
Merge branch 'master' into grammar-scripts
Alhadis Oct 17, 2016
ffd984b
Merge pull request #3277 from Alhadis/pic
arfon Oct 17, 2016
c6dc29a
Merge pull request #3242 from JoshCheek/julia-interpreters
arfon Oct 22, 2016
a5c08bb
Update grammar for ActionScript
pchaigno Oct 22, 2016
d6e0f74
Merge pull request #3279 from Alhadis/mirror-modes
arfon Oct 22, 2016
5a06240
Merge pull request #3289 from pchaigno/change-grammar-actionscript
arfon Oct 22, 2016
5fa02ad
Merge pull request #3182 from adius/patch-1
arfon Oct 22, 2016
e86d6e8
Merge pull request #3193 from Alhadis/grammar-scripts
arfon Oct 25, 2016
4e26f60
Makefile.boot misclassified as Clojure.
larsbrinkhoff Oct 25, 2016
2923d50
Merge pull request #3294 from larsbrinkhoff/boot
arfon Oct 25, 2016
6f0393f
Merge branch 'master' into 3233-local
arfon Oct 26, 2016
67ea350
Merge pull request #3295 from github/3233-local
arfon Oct 26, 2016
338cc16
Merge pull request #3264 from Alhadis/rexx-interpreters
arfon Oct 26, 2016
e520209
Grammar update
arfon Oct 26, 2016
d147778
Bumping to v4.8.16
arfon Oct 26, 2016
346aa99
Merge pull request #3296 from github/cut-release-v4.8.16
arfon Oct 26, 2016
359699c
Not going to be staff for much longer.
arfon Oct 26, 2016
4efc6f8
Merge branch 'master' into go-vendor
arfon Oct 26, 2016
a29f5b2
Adding Go-specific vendor paths
arfon Oct 27, 2016
3e37bd2
Merge pull request #2843 from github/go-vendor
arfon Oct 28, 2016
4e20928
Merge branch 'master' into grammar-list
Alhadis Oct 29, 2016
8cf575c
Update grammars list
Alhadis Oct 29, 2016
41c6aee
Small readme edits
arfon Oct 29, 2016
43fa563
Adding script/list-grammars to script/add-grammar
arfon Oct 29, 2016
8869912
Merge pull request #3307 from github/3192-temp
arfon Oct 29, 2016
416c5d1
Update README.md
arfon Oct 29, 2016
50013e8
Words
arfon Oct 29, 2016
ec56213
More words
arfon Oct 29, 2016
c736038
Merge pull request #3308 from github/help-for-highlighting
arfon Oct 29, 2016
0b94b9c
Update CONTRIBUTING.md
arfon Oct 30, 2016
4eefc1f
Merge pull request #3310 from github/welcoming-Alhadis
arfon Oct 30, 2016
9d419c4
Merge pull request #3245 from jecisc/smalltalk_examples
arfon Oct 30, 2016
e8d7eed
Support for Python console
pchaigno Nov 1, 2016
96a23ce
Merge pull request #3092 from pchaigno/python-console
arfon Nov 1, 2016
6a1423d
Add support for ABNF
sanssecours Oct 31, 2016
4172390
Merge pull request #3311 from sanssecours/abnf
arfon Nov 2, 2016
33899b9
Add support for EBNF
sanssecours Oct 31, 2016
85c9833
Delete GPL2.1-licensed Coq samples
Alhadis Nov 2, 2016
4f1e5c3
Add permissive-licensed Coq samples
Alhadis Nov 2, 2016
b2a486f
Merge pull request #3312 from sanssecours/ebnf
arfon Nov 2, 2016
53aa120
Merge pull request #3314 from github/coq-kiq
arfon Nov 2, 2016
d3e2ea3
Grammar updates
arfon Nov 2, 2016
aa27f18
Bumping version to v4.8.17
arfon Nov 2, 2016
3ca93a8
Merge pull request #3315 from github/cut-release-v4.8.17
arfon Nov 2, 2016
74931d1
Merge branch 'master' into bye-bye-github
arfon Nov 4, 2016
2a320cb
Adding new GitHub staff
arfon Nov 4, 2016
faaa447
Merge pull request #3297 from github/bye-bye-github
arfon Nov 4, 2016
009a4e6
add py3 extension to Python
danilaml Nov 12, 2016
00dc775
Update, according to comments
danilaml Nov 12, 2016
b958779
Merge pull request #3325 from danilaml/py3-ext
brandonblack Nov 14, 2016
78b2853
License of Ant grammar is correctly detected
pchaigno Nov 18, 2016
829eea0
Merge pull request #3337 from pchaigno/update-grammar-whitelist
brandonblack Nov 22, 2016
1d2ec4d
Fix error with filenames ending with a dot (#3349)
pchaigno Nov 29, 2016
d46a529
Add support for Thrift-generated PHP code. (#3329)
askreet Nov 29, 2016
0980e30
Generate language_id (#3284)
pchaigno Nov 29, 2016
5817237
Added Dangerfile for ruby (#3333)
saantiaguilera Nov 29, 2016
12f9295
Improve grammar scripts (#3350)
meganemura Nov 29, 2016
0e9109c
Add Nunjucks highlighting (#3341)
SimenB Nov 29, 2016
ecdae83
Add support for font-specific formats (#3142)
Crissov Dec 6, 2016
97ea27f
Add support for Monte.
mythmon Jan 24, 2015
721f5ee
Add `hello world` sample code
justinnoah Dec 6, 2016
01125f2
script/set-language-ids --update
justinnoah Dec 6, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/Gemfile.lock
.bundle/
.idea
benchmark/
lib/linguist/samples.json
/grammars
Expand Down
475 changes: 366 additions & 109 deletions .gitmodules

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
language: ruby
sudo: false
addons:
apt:
packages:
- libicu-dev
- libicu48
before_install: script/travis/before_install
script:
- bundle exec rake
- script/licensed verify
rvm:
- 1.9.3
- 2.0.0
- 2.1
- 2.2
Expand Down
117 changes: 98 additions & 19 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,120 @@
## Contributing
# Contributing

The majority of contributions won't need to touch any Ruby code at all. The [master language list][languages] is just a YAML configuration file.
Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great. This project adheres to the [Contributor Covenant Code of Conduct](http://contributor-covenant.org/). By participating, you are expected to uphold this code.

Almost all bug fixes or new language additions should come with some additional code samples. Just drop them under [`samples/`][samples] in the correct subdirectory and our test suite will automatically test them. In most cases you shouldn't need to add any new assertions.
The majority of contributions won't need to touch any Ruby code at all.

### My code is detected as the wrong language
## Adding an extension to a language

This can usually be solved either by adding a new filename or file name extension to the language's entry in [`languages.yml`][languages] or adding more [samples][samples] for your language to the repository to make Linguist's classifier smarter.
We try only to add new extensions once they have some usage on GitHub. In most cases we prefer that extensions be in use in hundreds of repositories before supporting them in Linguist.

### Syntax highlighting looks wrong
To add support for a new extension:

Assuming your code is being detected as the right language (see above), in most cases this is due to a bug in the language grammar rather than a bug in Linguist. [`grammars.yml`][grammars] lists all the grammars we use for syntax highlighting on github.com. Find the one corresponding to your code's programming language and submit a bug report upstream. If you can, try to reproduce the highlighting problem in the text editor that the grammar is designed for (TextMate, Sublime Text, or Atom) and include that information in your bug report.
0. Add your extension to the language entry in [`languages.yml`][languages], keeping the extensions in alphabetical order.
0. Add at least one sample for your extension to the [samples directory][samples] in the correct subdirectory.
0. Open a pull request, linking to a [GitHub search result](https://github.com/search?utf8=%E2%9C%93&q=extension%3Aboot+NOT+nothack&type=Code&ref=searchresults) showing in-the-wild usage.

You can also try to fix the bug yourself and submit a Pull Request. [This piece from TextMate's documentation](http://manual.macromates.com/en/language_grammars) offers a good introduction on how to work with TextMate-compatible grammars. You can test grammars using [Lightshow](https://lightshow.githubapp.com).
In addition, if this extension is already listed in [`languages.yml`][languages] then sometimes a few more steps will need to be taken:

Once the bug has been fixed upstream, please let us know and we'll pick it up for GitHub.
0. Make sure that example `.yourextension` files are present in the [samples directory][samples] for each language that uses `.yourextension`.
0. Test the performance of the Bayesian classifier with a relatively large number (1000s) of sample `.yourextension` files. (ping **@arfon** or **@bkeepers** to help with this) to ensure we're not misclassifying files.
0. If the Bayesian classifier does a bad job with the sample `.yourextension` files then a [heuristic](https://github.com/github/linguist/blob/master/lib/linguist/heuristics.rb) may need to be written to help.

### I want to add support for the `X` programming language

Great! You'll need to:
## Adding a language

0. Add an entry for your language to [`languages.yml`][languages].
0. Add a grammar for your language. Please only add grammars that have a license that permits redistribution.
0. Add your grammar as a submodule: `git submodule add https://github.com/JaneSmith/MyGrammar vendor/grammars/MyGrammar`.
0. Add your grammar to [`grammars.yml`][grammars] by running `script/convert-grammars --add vendor/grammars/MyGrammar`.
0. Add samples for your language to the [samples directory][samples].
We try only to add languages once they have some usage on GitHub. In most cases we prefer that each new file extension be in use in hundreds of repositories before supporting them in Linguist.

To add support for a new language:

0. Add an entry for your language to [`languages.yml`][languages]. Omit the `language_id` field for now.
0. Add a grammar for your language: `script/add-grammar https://github.com/JaneSmith/MyGrammar`. Please only add grammars that have [one of these licenses][licenses].
0. Add samples for your language to the [samples directory][samples] in the correct subdirectory.
0. Add a `language_id` for your language using `script/set-language-ids`. **You should only ever need to run `script/set-language-ids --update`. Anything other than this risks breaking GitHub search :cry:**
0. Open a pull request, linking to a [GitHub search result](https://github.com/search?utf8=%E2%9C%93&q=extension%3Aboot+NOT+nothack&type=Code&ref=searchresults) showing in-the-wild usage.

In addition, if your new language defines an extension that's already listed in [`languages.yml`][languages] (such as `.foo`) then sometimes a few more steps will need to be taken:

0. Make sure that example `.foo` files are present in the [samples directory][samples] for each language that uses `.foo`.
0. Test the performance of the Bayesian classifier with a relatively large number (1000s) of sample `.foo` files. (ping @arfon or @bkeepers to help with this) to ensure we're not misclassifying files.
0. Make sure that example `.foo` files are present in the [samples directory][samples] for each language that uses `.foo`.
0. Test the performance of the Bayesian classifier with a relatively large number (1000s) of sample `.foo` files. (ping **@arfon** or **@bkeepers** to help with this) to ensure we're not misclassifying files.
0. If the Bayesian classifier does a bad job with the sample `.foo` files then a [heuristic](https://github.com/github/linguist/blob/master/lib/linguist/heuristics.rb) may need to be written to help.

Remember, the goal here is to try and avoid false positives!

We try only to add languages once they have some usage on GitHub, so please note in-the-wild usage examples in your pull request. In most cases we prefer that languages already be in use in hundreds of repositories before supporting them in Linguist.

## Fixing a misclassified language

Most languages are detected by their file extension defined in [languages.yml][languages]. For disambiguating between files with common extensions, linguist applies some [heuristics](/lib/linguist/heuristics.rb) and a [statistical classifier](lib/linguist/classifier.rb). This process can help differentiate between, for example, `.h` files which could be either C, C++, or Obj-C.

Misclassifications can often be solved by either adding a new filename or extension for the language or adding more [samples][samples] to make the classifier smarter.


## Fixing syntax highlighting

Syntax highlighting in GitHub is performed using TextMate-compatible grammars. These are the same grammars that TextMate, Sublime Text and Atom use. Every language in [languages.yml][languages] is mapped to its corresponding TM `scope`. This scope will be used when picking up a grammar for highlighting.

Assuming your code is being detected as the right language, in most cases this is due to a bug in the language grammar rather than a bug in Linguist. [`grammars.yml`][grammars] lists all the grammars we use for syntax highlighting on github.com. Find the one corresponding to your code's programming language and submit a bug report upstream. If you can, try to reproduce the highlighting problem in the text editor that the grammar is designed for (TextMate, Sublime Text, or Atom) and include that information in your bug report.

You can also try to fix the bug yourself and submit a Pull Request. [TextMate's documentation](https://manual.macromates.com/en/language_grammars) offers a good introduction on how to work with TextMate-compatible grammars. You can test grammars using [Lightshow](https://github-lightshow.herokuapp.com).

Once the bug has been fixed upstream, we'll pick it up for GitHub in the next release of Linguist.

## Testing

For development you are going to want to checkout out the source. To get it, clone the repo and run [Bundler](http://gembundler.com/) to install its dependencies.

git clone https://github.com/github/linguist.git
cd linguist/
script/bootstrap

To run the tests:

bundle exec rake test

Sometimes getting the tests running can be too much work, especially if you don't have much Ruby experience. It's okay: be lazy and let our build bot [Travis](https://travis-ci.org/#!/github/linguist) run the tests for you. Just open a pull request and the bot will start cranking away.

Here's our current build status: [![Build Status](https://api.travis-ci.org/github/linguist.svg?branch=master)](https://travis-ci.org/github/linguist)

## Maintainers

Linguist is maintained with :heart: by:

- **@Alhadis**
- **@arfon**
- **@brandonblack** (GitHub staff)
- **@larsbrinkhoff**
- **@lildude** (GitHub staff)
- **@lizzhale** (GitHub staff)
- **@mikemcquaid** (GitHub staff)
- **@pchaigno**

As Linguist is a production dependency for GitHub we have a couple of workflow restrictions:

- Anyone with commit rights can merge Pull Requests provided that there is a :+1: from a GitHub member of staff
- Releases are performed by GitHub staff so we can ensure GitHub.com always stays up to date with the latest release of Linguist and there are no regressions in production.

### Releasing

If you are the current maintainer of this gem:

0. Create a branch for the release: `git checkout -b cut-release-vxx.xx.xx`
0. Make sure your local dependencies are up to date: `script/bootstrap`
0. If grammar submodules have not been updated recently, update them: `git submodule update --remote && git commit -a`
0. Ensure that samples are updated: `bundle exec rake samples`
0. Ensure that tests are green: `bundle exec rake test`
0. Bump gem version in `lib/linguist/version.rb`, [like this](https://github.com/github/linguist/commit/8d2ea90a5ba3b2fe6e1508b7155aa4632eea2985).
0. Make a PR to github/linguist, [like this](https://github.com/github/linguist/pull/1238).
0. Build a local gem: `bundle exec rake build_gem`
0. Test the gem:
0. Bump the Gemfile and Gemfile.lock versions for an app which relies on this gem
0. Install the new gem locally
0. Test behavior locally, branch deploy, whatever needs to happen
0. Merge github/linguist PR
0. Tag and push: `git tag vx.xx.xx; git push --tags`
0. Push to rubygems.org -- `gem push github-linguist-3.0.0.gem`

[grammars]: /grammars.yml
[languages]: /lib/linguist/languages.yml
[licenses]: https://github.com/github/linguist/blob/257425141d4e2a5232786bf0b13c901ada075f93/vendor/licenses/config.yml#L2-L11
[samples]: /samples
[new-issue]: https://github.com/github/linguist/issues/new
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
source 'https://rubygems.org'
gemspec :name => "github-linguist"
gemspec :name => "github-linguist-grammars"
gem 'byebug' if RUBY_VERSION >= '2.0'
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2011-2014 GitHub, Inc.
Copyright (c) 2011-2016 GitHub, Inc.

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
Loading