Commit Graph

935 Commits

Author SHA1 Message Date
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
Ashe Connor
33be70eb28 Fix failing edges on leading commas in args (#3905) 2017-11-16 11:44:51 +11:00
Alex Arslan
0f4955e5d5 Update Julia definitions to use Atom instead of TextMate (#3871) 2017-11-09 19:39:37 +11:00
Cesar Tessarin
21babbceb1 Fix Perl 5 and 6 disambiguation bug (#3860)
* Add test to demonstrate Perl syntax detection bug

A Perl 5 .pm file containing the word `module` or `class`, even with
an explicit `use 5.*` statement, is recognized as Perl 6 code.

* Improve Perl 5 and Perl 6 disambiguation

The heuristics for Perl 5 and 6 `.pm` files disambiguation was done
searching for keywords which can appear in both languages (`class` and
`module`) in addition to the `use` statement check.

Due to Perl 6 being tested first, code containing those words would
always be interpreted as Perl 6.

Test order was thus reversed, testing for Perl 5 first. Since Perl 6
code would never contain a `use 5.*` statement, this does no harm to
Perl 6 detection while fixing the problem to Perl 5.

Fixes: #3637
2017-10-23 10:16:56 +01:00
Ashe Connor
93cd47822f Only recognise Pod for .pod files (#3863)
We uncomplicate matters by removing ".pod" from the Perl definition
entirely.
2017-10-17 19:05:20 +11:00
Codecat
44048c9ba8 Add Angelscript language (#3844)
* Add AngelScript scriping language

* Add AngelScript sample

* Initial implementation of Angelscript

* Update Angelscript tm_scope and ace_mode

* Move Angelscript after ANTLR

* Updated grammar list

* Alphabetical sorting for Angelscript

* Angelscript grammar license is unlicense

* Add ActionScript samples

* Added a heuristic for .as files

* Whitelist sublime-angelscript license hash

* Added heuristic test for Angelscript and Actionscript

* Remove .acs from Angelscript file extensions
2017-10-14 17:34:12 +01:00
John Gardner
63ff51e2ed Add test to keep grammar-list synced with submodules (#3793)
* Add test to check if grammar list is outdated

* Update grammar list

* Fix duplicate punctuation in error messages
2017-08-24 21:13:30 +10: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
John Gardner
25de4e0ae2 Add Printer Font ASCII to recognised PostScript extensions (#3734)
* Register Adobe Type 1 fonts as PostScript files

* Add logic for recognising generated PFA files

* Extend list of PostScript generators
2017-08-02 21:58:40 +10:00
Jared Harper
4dcf223c8e Support for C++ files generated by protobuf/grpc (#3640)
* Support for C++ files generated by protobuf/grpc

This changeset includes a sample generated file.

[grpc](http://grpc.io) is a high performance, open-source universal
RPC framework.

* Account for older gRPC protobuf plugin message
2017-07-22 14:20:55 +01:00
Santiago M. Mola
329f80d245 fix classifier tests (#3709)
test_classify_ambiguous_languages was not running any test, since
it was looking only for languages that are ambiguous on
filename for known filenames (rather than ambiguous for filename
or extension).

Note that test time and assertions.
Before:
  Finished in 0.149294s, 40.1892 runs/s, 46.8874 assertions/s.
After:
  Finished in 3.043109s, 1.9717 runs/s, 224.7702 assertions/s.
2017-07-22 14:20:15 +01: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
Colin Seymour
e60384b018 Release v5.1.0 (#3725)
* sublime-spintools now has a license so no need for whitelist

* Bump version: 5.0.12

* Use the more apt release of v5.1.0
2017-07-22 14:16:16 +01:00
Santiago M. Mola
470a82d9f5 shell: add more interpreters (#3708)
* ash: only interpreter, extension is more commonly used for
  Kingdom of Loathing scripting, e.g. github.com/twistedmage/assorted-kol-scripts

* dash: only interpreter, extension is more commonly used for
  dashboarding-related stuff

* ksh: extension was already present

* mksh

* pdksh
2017-07-20 10:33:28 +01:00
John Gardner
128abe3533 Fix spelling of Perl 6 (#3672)
Resolves #3671.
2017-06-20 19:39:39 +10:00
Colin Seymour
ca6121e3ea Update MD5 digest for testing under Ruby 2.4 (#3643)
* Update md5 sums for Ruby 2.4

Ruby 2.4 deprecated Fixnum & Bignum into Integer. This means the MD5 digests for the integers in our tests have a class of Integer instead of Fixnum which means we need to update the digests specifically for 2.4.

* Use Gem::Version for safer version comparison
2017-05-26 08:16:12 +01:00
Simen Bekkhus
fba4babdcd Don't show npm lockfiles by default (#3611) 2017-05-10 15:55:16 +01:00
Santiago M. Mola
c0e242358a Fix heuristics after rename (#3556)
* fix Roff detection in heuristics

This affects extensions .l, .ms, .n and .rno.

Groff was renamed to Roff in 673aeb32b9851cc58429c4b598c876292aaf70c7,
but heuristic was not updated.

* replace FORTRAN with Fortran

It was already renamed in most places since 4fd8fce08574809aa58e9771e2a9da5d135127be
heuristics.rb was missing though.

* fix caseness of GCC Machine Description
2017-04-26 15:31:36 -07:00
Christoph Pojer
461c27c066 Revert "Added Jest snapshot test files as generated src (#3572)" (#3579)
This reverts commit f38d6bd124.
2017-04-22 14:20:54 +02:00
Hank Brekke
f38d6bd124 Added Jest snapshot test files as generated src (#3572) 2017-04-20 08:58:39 +01:00
Santiago M. Mola
e80b92e407 Fix heuristic for Unix Assembly with .ms extension (#3550) 2017-04-06 22:01:42 +10:00
Paul Chaignon
c59c88f16e Update grammar whitelist (#3510)
* Remove a few hashes for grammars with BSD licenses

There was an error in Licensee v8.8.2, which caused it to not
recognize some BSD licenses. v8.8.3 fixes it.

* Update submodules

Remove 2 grammars from the whitelist because their licenses were
added to a LICENSE file which a proper format (one that Licensee
detects).

MagicPython now supports all scopes that were previously supported
by language-python.
2017-03-13 17:19:06 -07:00
Paul Chaignon
9468ad4947 Fix grammar hashes (#3504)
* Update Licensee hashes for grammar licenses

Licensee v8.8 changed the way licenses are normalized, thus changing hashes for
some grammars

* Update Licensee

Prevent automatic updates to major releases
2017-03-09 23:57:35 -08:00
Eloy Durán
f1be771611 Disambiguate TypeScript with tsx extension. (#3464)
Using the technique as discussed in #2761.
2017-02-20 10:17:18 +00:00
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