221 Commits

Author SHA1 Message Date
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
Ashe Connor
33be70eb28 Fix failing edges on leading commas in args (#3905) 2017-11-16 11:44:51 +11:00
James Dennes
3391dcce6a Make Language methods more resilient to non-String input (#3752)
* Add failing test for finding with non-String input

Show the failing behaviour of find_by_alias, find_by_name, and []
when non-String input is provided.

* Return nil rather than erroring on non-String input
2017-08-02 14:07:44 +02:00
Santiago M. Mola
085604948e Add support for XPM. (#3706)
* .xpm and .pm extensions associated with XPM.

* .pm is disambiguated by searching the /* XPM */ string.
  This is how `file` performs detection and should work with
  every XPM3 file (most XPM generated by software later than 1991).

Added XPM samples:

* stick-unfocus.xpm: extracted from Fluxbox (MIT License)
  0c13ddc0c8/data/styles/Emerge/pixmaps/stick-unfocus.xpm

* cc-public_domain_mark_white.pm: public domain image from
  https://commons.wikimedia.org/wiki/File:Cc-public_domain_mark_white.svg
  converted to XPM with ImageMagick (convert input.svg output.xpm).
2017-07-22 14:19:22 +01:00
Yuki Izumi
5d09fb67dd Allow for split(",") returning nil (#3424) 2017-01-10 11:44:24 +11: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
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
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
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
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
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
Todd Berman
88c74fa9c2 Convert from mode names to mimetypes for better usage. 2016-09-23 13:40:19 -07:00
Todd Berman
d6d7d38eb8 Fix w/ a test 2016-09-21 20:52:49 -07:00
Arfon Smith
e1216ea4ee Merge branch 'language-id' of github.com:github/linguist into language-id 2016-09-13 11:14:19 -07:00
Arfon Smith
a3227c2c27 Adding basic find_by_id functionality to Language 2016-09-13 11:09:05 -07:00
Paul Chaignon
65201b322a Test the uniqueness of language ids 2016-09-13 13:10:07 +02:00
Arfon Smith
1f43664a51 Adding some tests for some known language_ids 2016-09-12 22:10:59 -07:00
Arfon Smith
7cda13afcb A Language should know about it's language_id 2016-09-12 22:02:49 -07:00
Dan Buch
d7b2826113 Add SuperCollider grammar
plus a few minor language support updates including:

- recognize `sclang` and `scsynth` interpreters
- set `tm_scope: source.supercollider`
- reorder extensions so that `.sc` is primary
2015-11-08 06:28:14 -05:00
Arfon Smith
997c0fca10 Catching one more edge case 2015-08-11 06:48:54 +01:00
Arfon Smith
851c93a1f7 Don't blow up if empty string/nil passed to alias methods 2015-08-10 22:07:28 +01:00
Kevin Butler
3180c5d554 Allow delimiting by comma in the language name 2015-06-10 15:37:31 +01:00
Arfon Smith
4af679c27f Merge pull request #2324 from pchaigno/batch-group
Remove Batch from Shell group
2015-04-10 14:29:10 -05:00
Paul Chaignon
3a07410569 Remove test for group of Batch 2015-04-10 20:59:10 +02:00
Arfon Smith
ac4594e3b1 Merge pull request #2298 from github/add-proximity-test
Add proximity test for colors
2015-04-06 13:15:32 -05:00
Arfon Smith
2861a8f19c Fixing up colours to match languages.yml 2015-04-06 12:41:49 -05:00
Alex Efros
bbea29be55 add Limbo to test_languages 2015-04-05 03:03:45 +03:00
Lars Brinkhoff
2b25bb6d1c Add MUF language - Multi-user Forth. 2015-02-25 19:29:57 +01:00
Garen Torikian
6b26386a81 Improve "no type found" error message 2015-02-22 20:21:02 -08:00
Garen Torikian
fecf0cc137 There is no "other" 2015-02-22 10:32:01 -08:00
Garen Torikian
8420e4b044 Test that languages have a type 2015-02-22 10:23:48 -08:00
Adam Roben
65296e86a3 Switch to Minitest::Test instead of Test::Unit::TestCase
This gives us a consistent test framework across all Ruby versions which
should help avoid errors that are only found when CI runs the tests on
different Rubies. (And this fixes an immediate bug where there's no
`skip` method in the version of test-unit we're currently using only on
Ruby 2.2.)
2014-12-31 15:26:26 -05:00
Adam Roben
cb5f2685cd Test that all popular languages exist
popular.yml listed "Bash" but should have been listing "Shell" instead.
There is no "Bash" language. Now CI will fail if this happens again.
2014-12-11 11:47:52 -05:00
Garen Torikian
348dab4b9f Update test to account for using text 2014-12-06 11:59:31 +02:00
Garen Torikian
bb12b86445 Set missing ace_mode values to text
This makes it much easier to deal with when iterating over all the
languages, since `text` is a valid, non-highlighting lexer.
2014-12-05 16:56:55 +02:00
Garen Torikian
ab61b06c34 Reject Ace modes that are lacking a mode 2014-12-05 16:25:14 +02:00
Garen Torikian
768ec76ff0 Merge master 2014-12-01 15:52:37 +02:00
Garen Torikian
66eabd8bdc Prefer Yajl.load 2014-11-28 12:34:02 -08:00
Garen Torikian
1d4149168d Add Rake task to fetch ace_modes, and skip test if there's no internet 2014-11-28 11:48:26 -08:00
Garen Torikian
26ab33754f Merge master 2014-11-28 11:04:53 -08:00
Brandon Keepers
9020d7c044 Deprecate find_by_shebang
This class doesn’t need to know about shebangs.
2014-11-27 13:18:51 -05:00
Brandon Keepers
3edf5fd770 Remove test for removed extension
This existed when the test was written, but was removed in https://github.com/github/linguist/pull/1734 and the test got lost in a merge somewhere.
2014-11-26 15:59:16 -05:00