Commit Graph

908 Commits

Author SHA1 Message Date
Colin Seymour
01de40faaa Return early in Classifier.classify if no languages supplied (#3471)
* Return early if no languages supplied

There's no need to tokenise the data when attempting to classify without a limited language scope as no action will be performed when it comes to scoring anyway.

* Add test for empty languages array
2017-02-13 18:22:54 +00:00
sunderls
b36ea7ac9d Add yarn (#3432)
* add yarn.lock

* fix comment

* remove yarn test

* add test

* fix test

* try fix again

* try 3rd time

* check filename and firstline for yarn lockfile
2017-01-23 10:58:53 -08:00
John Gardner
93ec1922cb Swap grammar used for CSS highlighting (#3426)
* Swap grammar used for CSS highlighting

* Whitelist license of Atom's CSS grammar

* Explicitly declare grammar as MIT-licensed

Source: https://github.com/atom/language-css/blob/5d4af/package.json#L14
2017-01-11 16:16:25 +11:00
Yuki Izumi
5d09fb67dd Allow for split(",") returning nil (#3424) 2017-01-10 11:44:24 +11:00
Brandon Black
a604de9846 replacing atom grammar due to ST2 compatibility change 2017-01-03 16:46:02 -08:00
Brandon Black
3e224e0039 updating grammars 2017-01-03 16:33:46 -08:00
Zach Brock
f98ab593fb Detect Javascript files generated by Protocol Buffers. 2017-01-03 16:07:26 -08:00
Nate Whetsell
48e4394d87 Add Jison-generated JavaScript to generated files (#3393)
* Fix typos

* Add Jison-generated JavaScript to generated files
2017-01-03 14:08:29 -08:00
yutannihilation
1c4baf6dc2 ignore roxygen2-generated files (#3373) 2017-01-03 13:31:04 -08:00
Arfon Smith
d8b91bd5c4 The grand language renaming bonanza (#3278)
* Removing FORTRAN samples because OS X case-insensitive filesystems :-\

* Adding Fotran samples back

* FORTRAN -> Fortran

* Groff -> Roff

* GAS -> Unix Assembly

* Cucumber -> Gherkin

* Nimrod -> Nim

* Ragel in Ruby Host -> Ragel

* Jade -> Pug

* VimL -> Vim script
2016-12-13 13:39:27 -08:00
Paul Chaignon
9b941a34f0 Use filenames as a definitive answer (#2006)
* Separate find_by_extension and find_by_filename
find_by_extension now takes a path as argument and not only the file extension.
Currently only find_by_extension is used as a strategy.

* Add find_by_filename as first strategy
2016-12-12 12:34:33 -08:00
Paul Chaignon
9d8392dab8 Remove deprecated code (#3359)
* Remove deprecated find_by_shebang

* Remove deprecated ace_modes function

* Remove deprecated primary_extension function

Gists don't have a language dropdown anymore

* Remove deprecated Linguist::Language.detect function

* Remove deprecated search_term field
2016-12-12 12:24:19 -08:00
Brandon Black
2c78dd2c66 Bumping to v4.8.18 (#3370)
* make tests great again 

* version bump

* removing empty line in gemspec
2016-12-07 11:39:49 -08:00
Paul Chaignon
c486f56204 Mark .indent.pro files as vendored (#3361) 2016-12-06 21:59:28 -08:00
Paul Chaignon
79f20e8057 Heuristic rule for TeX .cls files (#3360) 2016-12-06 21:50:33 -08:00
Paul Chaignon
0980e304b1 Generate language_id (#3284)
* Generate language_id from language names

The language_id is generated from the SHA256 hash of the language's name

* Test the validity of language ids

All languages should have a positive 32bit integer as an id

* Update languages.yml header in set-language-ids
2016-11-29 07:50:44 -08:00
Kyle Smith
d46a529b6a Add support for Thrift-generated PHP code. (#3329) 2016-11-29 07:49:41 -08:00
Paul Chaignon
1d2ec4dbc3 Fix error with filenames ending with a dot (#3349)
The second negative argument to split instructs it to
preserve null fields in the returned array
2016-11-29 07:42:50 -08:00
Paul Chaignon
78b2853d70 License of Ant grammar is correctly detected
The last version of Licensee can recognize
underlined license headers in READMEs
2016-11-18 23:47:55 +01:00
Arfon Smith
a29f5b2d46 Adding Go-specific vendor paths 2016-10-27 13:59:09 -04:00
Arfon Smith
4efc6f8c95 Merge branch 'master' into go-vendor 2016-10-26 18:34:02 -04:00
Arfon Smith
e520209e49 Grammar update 2016-10-25 20:25:07 -04:00
Paul Chaignon
a5c08bb203 Update grammar for ActionScript 2016-10-22 21:35:28 +02:00
Lars Brinkhoff
de9ff713a4 Test that grouped languages have no color. 2016-10-13 06:54:21 +02:00
Alhadis
20b8188384 Add test to guard against unused colours 2016-10-05 16:17:00 +11:00
Lars Brinkhoff
c863435c84 Add '</' to Markdown heuristic. (#3255) 2016-10-03 19:22:34 +02:00
Paul Chaignon
eeec48198a Update submodules 2016-10-02 11:16:25 +02:00
Paul Chaignon
82167063da Tests to ensure the whitelists are up-to-date 2016-10-02 11:16:25 +02:00
Paul Chaignon
3ae89b48ba Improve Mathematica's heuristic rule
Use closing of Mathematica comment instead of opening
Unit test to check that test file is not detected as Mathematica anymore
2016-10-01 08:46:31 +02:00
Paul Chaignon
cd9401c424 Enable testing absence of heuristic result 2016-10-01 08:46:31 +02:00
Paul Chaignon
e7e8a7d835 Tests for .m heuristic rules 2016-10-01 08:46:31 +02:00
Paul Chaignon
ebe85788ab Rely solely on Licensee to recognize licenses
Remove our own license classification code
Add hashes for any project which does not have a standard license body
Add projects for which a license was not found to the whitelist

Requires Licensee v8.6.0 to correctly recognize TextMate bundles' .mdown README
2016-09-27 10:44:25 +02:00
Paul Chaignon
524337d07b Use Licensee hashes to uniquely identify licenses
Since v6.1.0, Licensee exposes the hash of the license
We can use it to uniquely identify unrecognized licenses,
Thus, tests will fail if the content of an unrecognized license changes

Projects for which no license was found are kept in the whitelist
2016-09-27 10:44:25 +02:00
Paul Chaignon
f8ce42e169 Recognize licenses in READMEs using Licensee
Since v7.0.0 Licensee can detect license text in READMEs
Using this, we might be able to rely solely on Licensee in the future
2016-09-27 10:44:25 +02:00
Joshua Peek
67ed060d37 Assert CodeMirror modes and mime types are valid against source 2016-09-23 16:33:12 -07:00
Joshua Peek
3abe081560 Validate codemirror modes 2016-09-23 16:30:38 -07:00
Joshua Peek
855f1a1f86 Validate CodeMirror modes 2016-09-23 14:47:49 -07:00
Joshua Peek
0108ef4386 Restore old mode 2016-09-23 14:35:02 -07:00
Joshua Peek
fdb962518f Consistent CodeMirror casing 2016-09-23 13:54:55 -07:00
Joshua Peek
6564078061 Merge branch 'master' into change_modes_to_mimetypes 2016-09-23 13:54:20 -07:00
Joshua Peek
39ea9be5f8 Ignore ace mode warning while testing 2016-09-23 13:53:38 -07:00
Joshua Peek
152b5ade5e Fix shadowed path warning 2016-09-23 13:50:01 -07:00
Joshua Peek
c525e3fbef Ignore default external warnings 2016-09-23 13:49:30 -07:00
Todd Berman
88c74fa9c2 Convert from mode names to mimetypes for better usage. 2016-09-23 13:40:19 -07:00
Lars Brinkhoff
a7a123a8db Add heuristic for .inc files: the #declare keyword is unique to POV-Ray.
Also added #local, #macro, and #while.
2016-09-22 07:02:44 +02:00
Arfon Smith
6fcba83f3e Merge branch 'master' into 3227-local 2016-09-21 20:55:07 -07:00
Todd Berman
d6d7d38eb8 Fix w/ a test 2016-09-21 20:52:49 -07:00
Arfon Smith
c8094d3775 Merge branch 'master' into 3227-local 2016-09-21 20:26:51 -07:00
Arfon Smith
f30e9270f1 Merge pull request #3197 from Alhadis/modelines
Revise patterns for Vim modeline detection
2016-09-21 20:13:28 -07:00
Arfon Smith
30298a9ef8 Whitelist troublesome licenses 2016-09-21 09:27:35 -07:00