mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
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
This commit is contained in:
@@ -80,7 +80,8 @@ module Linguist
|
||||
generated_jflex? ||
|
||||
generated_grammarkit? ||
|
||||
generated_roxygen2? ||
|
||||
generated_jison?
|
||||
generated_jison? ||
|
||||
generated_yarn_lock?
|
||||
end
|
||||
|
||||
# Internal: Is the blob an Xcode file?
|
||||
@@ -479,5 +480,13 @@ module Linguist
|
||||
return lines[0].start_with?("/* parser generated by jison ") ||
|
||||
lines[0].start_with?("/* generated by jison-lex ")
|
||||
end
|
||||
|
||||
# Internal: Is the blob a generated yarn lockfile?
|
||||
#
|
||||
# Returns true or false.
|
||||
def generated_yarn_lock?
|
||||
return false unless name.match(/yarn\.lock/)
|
||||
return lines[0].include?("# THIS IS AN AUTOGENERATED FILE")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
9
test/fixtures/Data/yarn.lock
vendored
Normal file
9
test/fixtures/Data/yarn.lock
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
abab@^1.0.0:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d"
|
||||
|
||||
abbrev@1, abbrev@1.0.x:
|
||||
version "1.0.9"
|
||||
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135"
|
||||
@@ -79,6 +79,9 @@ class TestGenerated < Minitest::Test
|
||||
generated_fixture_loading_data("Data/sourcemap.v3.map")
|
||||
generated_fixture_loading_data("Data/sourcemap.v1.map")
|
||||
|
||||
# Yarn locfile
|
||||
generated_fixture_loading_data("Data/yarn.lock")
|
||||
|
||||
# Specflow
|
||||
generated_fixture_without_loading_data("Features/BindingCulture.feature.cs")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user