* 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:
sunderls
2017-01-24 03:58:53 +09:00
committed by Brandon Black
parent 625b06c30d
commit b36ea7ac9d
3 changed files with 22 additions and 1 deletions

View File

@@ -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