3539 Commits

Author SHA1 Message Date
Theodore Dubois
14a7cb2d1b Add calculuswhiz/Assembly-Syntax-Definition grammar and use it for Unix Assembly (#4096) 2018-04-18 15:29:33 +02:00
Paul Chaignon
54ae7e7b4d Strategies take result from previous strategy into account (#4099)
Each strategy takes as candidates the language outputted by the
previous strategy if any. This was already the case for the
Classifier and Heuristic strategies as these couldn't generate new
candidate languages (as opposed to the Modeline, Filename, Shebang,
and Extension strategies).

In practice, this signifies that if, for example, the Shebang
strategy finds two possible languages for a given file (as is
currently possible with the perl interpreter), the next strategy, the
Extension strategy, will use this information and further reduce the
set of possible language.
Currently, without this commit, the Extension strategy would discard
the results from the previous strategy and start anew, possibly
returning a different language from those returned by the Shebang
strategy.
2018-04-17 10:02:57 +02:00
Brayden Banks
5363e045bb Teach Generated about Cargo lock files (#4100) 2018-04-15 12:04:19 +02:00
Juan Julián Merelo Guervós
a9ff59aef5 Additions to the Perl family of languages (#4066)
* Mainly fixing problems with Perl heuristics

And also adding a little bit of text to the README file to help with local use and test.

* Adds new sample

* Adds a couple of samples more, not represented before

* Moves installation intructions to CONTRIBUTING.md

Refs #2309 and also changes github.com to an uniform capitalization.

* Correcting error. Great job, CI

* Moving another file

* Adds samples and new checks for perl/perl6

* Stupid mistake

* Changing regex for perl5 vs perl6

Initial suggestion by @pchaigno, slightly changed to eliminate false positives such as "classes" or "modules" at the beginning of a line in the =pod

BTW, it would be interesting to just eliminate these areas for language detection.

* Eliminates Rexfile from Perl6

And adds .pod6

* Followup to #2709

I just found I had this sitting here, so I might as well follow
instructions to fix it.

* Adds example for pod6

* Eliminates .pod because it's its own language

* Removes bad directory

* Reverting changes that were already there

* Restored CONTRIBUTING.md from head

I see installation of cmake is advised in README.md

* Eliminates `.pod6`

To leave way for #3366 or succeeding PRs.

* Removed by request, since we're no longer adding this extension

* Sorting by alphabetical order filenames

* Moved from sample to test fixtures
2018-04-11 17:32:26 +02:00
John Gardner
7b9ec3d1b3 Add support for sed as a programming language (#4093) 2018-04-11 16:09:54 +02:00
Cyrille Le Clerc
51d3711faf Detect Maven wrapper "mvnw" (#4042)
* Detect Maven wrapper "mvnw"

* Fix build, filenames must be sorted in the "filenames" section of languages.yml, filenames cannot be grouped by topic

* Remove `mvnw` file from languages/Shell/filenames according to @Alhadis recommendation as we are sure that `mvnw` always starts with the shebang `#!/bin/sh`.

* Remove space chars added by mistake
2018-04-08 16:04:34 +01:00
Jens Fischer
14fcd75773 Add HXML support (#4092)
* Add HXML support

* Fix test failures
2018-04-08 11:23:00 +01:00
Jens Fischer
34c623eaba Replace haxe-sublime-bundle with haxe-TmLanguage (#4079)
* Replace haxe-sublime-bundle with haxe-TmLanguage

* Add missing changes

* Typo fix
2018-04-06 17:25:59 +01:00
John Gardner
324bc83914 Register "cperl" as an alias of Perl 5 (#4067)
* Register `cperl` as an alias of Perl 5

Emacs ships with an enhanced major-mode for editing Perl with embedded C
sections (called `cperl-mode`). This commit enables Linguist to identify
Perl files containing cperl modelines.

* Add `cperl` to list of Perl 5 interpreters
2018-04-07 01:43:51 +10:00
kasper3
ecc62784ca Add pwsh PowerShell interpreter (#4073)
* Register pwsh as interpreter for PowerShell

* Add pwsh sample

* Remove pwsh from Shell section
2018-04-06 15:25:09 +01:00
Paul Chaignon
0bf4b8a482 Remove samples/LANG/filenames as a source of truth (#4078)
All filenames must now be explicitly listed in languages.yml. A test
makes sure they are.
2018-04-02 11:09:06 +02:00
Nish Tahir
ba1cf12776 Replace Kotlin language grammar (#4065) 2018-03-28 16:57:17 +01:00
Joseph Stachelek
03f394626d Exclude R package doc directory (#4068)
* Exclude R package doc directory

* Match starting slash of R doc directory
2018-03-28 16:49:13 +01:00
Ben Wiley
cf385d9e77 Support for PICO-8 as Lua variant (#4072)
* Support for PICO-8 as Lua variant

Treats [PICO-8 fantasy console](https://www.lexaloffle.com/pico-8.php) files (.p8) as Lua.

A search for `pico8 extension:p8` on GitHub shows [hundreds of repositories](https://github.com/search?utf8=%E2%9C%93&q=pico8+extension%3Ap8&type=Repositories&ref=advsearch&l=&l=) using this extension. Pico-8 stores information describing the code, graphics and sound for a game in a single .p8 text file. Due to the nature of Pico-8, this information is relatively terse and the main feature of the file is Lua code. Therefore it makes sense to give .p8 files Lua syntax highlighting.

* Create treegen.p8

https://github.com/lvictorino/pico8/blob/master/treegen.p8
2018-03-28 16:47:55 +01:00
Steve Pike
dd3b1eec91 enable syntax highlighting for .jinja2 ext (#4051)
* enable syntax highlighting for .jinja2 ext

This is a commonly used jinja (2!) extension

* add sample jinja2 file

* move jinja to django samples dir

* added a link to the jinja docs in the sample file

* change sample jinja2 file to a one that exists on GH
2018-03-06 13:53:24 +00:00
John Gardner
2b65318a61 Register 12 new JSON filenames/extensions (#4053)
Added:
* .avsc
* .gltf
* .htmlhintrc
* .jscsrc
* .jslintrc
* .jsonl
* .tern-config
* .tern-project
* .tfstate
* .tfstate.backup
* .webapp
* .webmanifest
2018-03-02 20:33:47 +11:00
bruno cuconato
1bbcfa5683 add CoNLL-U format (#4029)
* * add CoNLL-U format
- add to languages.yml
- add textmate grammar
  - add to vendor/README
  - add to grammars.yml
- add samples

* rm other extensions as I couldn't find properly licensed examples of them in the wild

* substitutesamples for something with appropriate license

* update grammar submodule so it finds the LICENSE

* add license to grammar

* * conllu
- readd other extensions
- abridge samples and a new one
- update grammar submodule: correct extension of grammar file

* rm .conllx extension
2018-02-21 15:27:32 +00:00
Jason Malinowski
c2d3170064 Support VB.NET *.Generated.vb along with *.Generated.cs files (#4027) 2018-02-21 11:56:55 +00:00
Paul Chaignon
3769216c7a Associate .x extension to Linker Script language (#4040) 2018-02-19 10:50:05 +01:00
Nathaniel J. Smith
2abf488e65 Treat "python3" as an alias for "python" (#4026)
Pygments has separate highlighters for "python" (meaning python 2) and "python3" (meaning python 3). As a result, there are lots of files out there (especially ReSTructured text) that contain code blocks whose language is explicitly given as "python3" or "py3". Currently these are unrecognized by linguist. Instead, we should use our python highlighter for them (which works for both python 2 and python 3).

References:
  http://pygments.org/docs/lexers/#pygments.lexers.python.Python3Lexer
  https://github.com/github/markup/issues/1019
  https://github.com/python-trio/async_generator/pull/12
2018-02-08 09:52:21 +00:00
Tobias V. Langhoff
812797b51d Add "asm" as alias for assembly (#4019) 2018-01-31 11:56:47 +00:00
Colin Seymour
a18ad1d489 Release v6.0.1 (#4016)
* Update grammar submodule refs

* Bump version to v.6.0.1
2018-01-30 15:17:58 +00:00
Colin Seymour
15e2b74dec Release v6.0.0 (#4002)
* Update all submodules

* Ensure always using lastest docker image

* Allow passing in GEM_VERSION from env

This is useful to building test gems in a cache friendly way using:
`GEM_VERSION=$(git describe --tags 2>/dev/null | sed 's/-/./g' | sed
's/v//') bundle exec rake build_gem`

* Update submodules one last time

* Set version 6.0.0
2018-01-26 13:12:12 +00:00
Dylan Simon
60f748d47b Add .x as XDR/RPCGEN (#3472)
* Add .x as XDR/RPCGEN

XDR/RPC language as documented in RFC5531, RFC4506.
Samples are from glibc and RFCs.

* Add Logos samples

https://github.com/JonasGessner/NoCarrier/blob/master/NoCarrier.x - MIT
cf31f4e466/llvm-gcc-R3/gcc/testsuite/objc/execute/string1.x - GPL2
f6415578fa/perapp-plugin/Tweak.x - GPL3
d1b3e83888/NCHax.x - Apache

* Add disambiguate heuristics for .x

* Add RPC to vendor/README.md
2018-01-25 09:15:09 +00:00
Seppe Stas
8da6ddf9d9 Override languages being included by language statistics (#3807)
* Add detectable key to languages

This key allows to override the language being included in the
language stats of a repository.

* Make detectable override-able using .gitattributes

* Mention `linguist-detectable` in README

* Remove detectable key from languages

Reverts changes in 0f7c0df5.

* Update commit hash to the one that was merged

PR #3806 changed the commit hash. The original commit was not
actually merged into the test/attributes branch.

* Fix check to ensure detectable is defined

* Add include in language stats tests when detectable set

* Ignore detectable when vendored, documentation or overridden

* Add documentation on detectable override in README

* Improve documentation on detectable override in README
2018-01-23 12:17:48 +00:00
Brandon Elam Barker
512f077da8 adding the .kojo extension for Scala (#3960) 2018-01-13 09:38:34 +00:00
Josh Padnick
3260b06241 Format .tfvars file as HashiCorp Config Language. (#3885)
* Format .tfvars file as HashiCorp Config Language.

* Add sample terraform.tfvars file to demonstrate HCL rendering.
2018-01-12 17:27:41 +00:00
BRAMILLE Sébastien
ef3b0b6af3 Add solidity language (#3973)
* add solidity language

* add solidity color

* move samples to test fixtures

they're not used by the bayesian classifier

* Update languages.yml

* Rename RefundVault.sol to RefundVault.solidity

* Rename pygments-example.sol to pygments-example.solidity

* Change color from #383838 to #AA6746

`Color #383838 is too close to ["3F3F3F", "383838"]`

* Fix test

* Remove test/fixtures and add samples

* Remove extension

* Remove sample file
2018-01-12 17:26:51 +00:00
Colin Seymour
434023460e Revert "Check generated Jest snap file" (#3984)
* Revert "Remove Arduino as a language (#3933)"

This reverts commit 8e628ecc36.

* Revert "Check generated Jest snap file (#3874)"

This reverts commit ca714340e8.
2018-01-12 11:49:02 +00:00
oldmud0
8e628ecc36 Remove Arduino as a language (#3933)
* Remove Arduino as a language

* Move Arduino samples to C++

* Move .ino entry to its correct place
2018-01-11 10:48:19 +00:00
Yuya Takeyama
ca714340e8 Check generated Jest snap file (#3874)
* Check generated Jest snap file

* Check file name rule first

ref: https://github.com/github/linguist/pull/3874/files#r146168309

* Check extension first

It must be cheaper
ref: https://github.com/github/linguist/pull/3874/files#r146168426
2018-01-11 09:25:13 +00:00
Egor Zhdan
db1d4f7893 Add Materialize.css to the vendor list (#3943) 2018-01-11 09:48:49 +01:00
Paolo Di Tommaso
bee7e55618 Add Nextflow language support (#3870)
* Added nextflow language
* Added main.nf to list of filenames
* Fixed duplicate groovy scope
* Removed hello-world example
* Update grammar submodule
* Removed main.nf from filenames
* Added nextflow.config example
2018-01-09 12:47:59 +01:00
Ashe Connor
5fbe9c0902 Allow classifier to run on symlinks as usual (#3948)
* Fixups for symlink detection, incl. test

* assert the heuristics return none for symlink
2018-01-08 09:01:16 +11:00
Paul Chaignon
a840668599 perl6 alias for Perl 6 (#3977)
Many repository rely on `perl6` as a Markdown key for code snippet
highlighting. The new Perl 6 name breaks this behavior as it requires
`perl-6` as the Markdown key.
2018-01-07 21:32:55 +01:00
Ashe Connor
d4c2d83af9 Do not traverse symlinks in heuristics (#3946) 2017-12-12 21:53:36 +11:00
Paul Chaignon
e4b9430024 Vendor CSS files in font-awesome directory (#3932) 2017-12-02 15:24:05 +01:00
Paul Chaignon
a76805e40d Improve Prolog .pro heuristic to avoid false positives (#3931)
The `[a:-b]` syntax for index selection in arrays is valid in IDL and
matches the heuristic for Prolog. Update the Prolog heuristic to
exclude `[`.
2017-12-02 15:08:19 +01:00
NachoSoto
4f46155c05 Add Carthage/Build to generated list so it doesn't show in PR diffs (#3920)
Equivalent to #3865, but for Carthage.
2017-11-29 14:26:23 +00:00
NachoSoto
38901d51d2 Changed Carthage vendor regex to allow folder in any subdirectory (#3921)
In monorepro projects, it's not uncommon for `Carthage` to not be in the root directory.
2017-11-29 14:25:04 +00:00
Shai Mishali
ded0dc74e0 Add Cocoapods to generated list so it doesn't show in PR diffs (#3865)
* Add Cocoapods to generated list so it doesn't show in PR diffs

* Removed Cocoapods from vendor.yml

* Enhance regex to match only Cocoapod's Pods folder

* Adds additional test cases for generated Pods folder
2017-11-28 11:04:18 +00:00
Colin Seymour
c5d1bb5370 Unvendor tools/ (#3919)
* Unvendor tools/

* Remove test
2017-11-28 10:52:02 +00:00
Andrey Sitnik
c8ca48856b Add PostCSS syntaxes support (#3916) 2017-11-26 16:21:10 +11:00
John Gardner
7be6fb0138 Test Perl before Turing when running heuristics (#3880)
* Test Perl before Turing when running heuristics

* Revise order of Perl 5 and 6 in `.t` heuristic

See: https://github.com/github/linguist/pull/3880#issuecomment-340319500

* Combine patterns for disambiguating Perl
2017-11-17 21:25:56 +11:00
wesdawg
8c516655bc Add YARA language (#3877)
* Add YARA language grammars

* Add YARA to languages.yml

* Add YARA samples

* Add YARA to README
2017-11-16 12:16:33 +11:00
Michael R. Crusoe
9dceffce2f Add the Common Workflow Language standard (#3902)
* Add the language for the Common Workflow Language standards

* add CWL grammer

* add MIT licensed CWL sample

* script/set-language-ids --update for CWL
2017-11-16 12:15:55 +11:00
Ashe Connor
33be70eb28 Fix failing edges on leading commas in args (#3905) 2017-11-16 11:44:51 +11:00
Jingwen
9c4dc3047c Add BUILD.bazel to Python filenames (#3907)
BUILD.bazel and BUILD are used by Bazel, and both are valid filenames. BUILD.bazel is used in favor of BUILD if it exists.

https://stackoverflow.com/a/43205770/521209
2017-11-15 10:04:36 +00:00
Pratik Karki
d8e5f3c965 Add color for LFE language. (#3895)
* 'Add color to LFE'

* Test passing color for LFE

* Let LFE be independent rather than grouping to Erlang
2017-11-14 07:35:12 +00:00
Ashe Connor
71bf640a47 Release v5.3.3 (#3903)
* Add self to maintainers

* bump to v5.3.3
2017-11-13 18:17:38 +11:00