mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
Merge remote-tracking branch 'origin/master' into rewrite-readme
* origin/master: (104 commits) Added shebang sample for Pike. Added interpreter "pike" for Pike. Add support for FXML files. Add support for Turtle and SPARQL Fixed issues for web ontology to pass tests Added Web Ontology Language Support Simplify blob tests Use the original FileBlob path for filesystem access Sample sagews file, as requested Update languages.yml with *.sagews New grammar for Racket Remove grammar for Racket Modifying BlobHelper and FileBlob to use path Sample file for .cmake.in Restore the .cmake.in extension. More CMake samples. Updating file regex to support unlicense.txt Updating ref to include license Remove pry Start using path with LazyBlob ... Conflicts: CONTRIBUTING.md README.md
This commit is contained in:
@@ -13,10 +13,18 @@ To add support for a new 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/download-grammars --add 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] 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.
|
||||
|
||||
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. 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!
|
||||
|
||||
## 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` is mapped to its corresponding TM `scope`. This scope will be used when picking up a grammar for highlighting.
|
||||
@@ -49,6 +57,7 @@ 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).
|
||||
|
||||
Reference in New Issue
Block a user