mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +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
|
||||
|
||||
Reference in New Issue
Block a user