mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Check generated Jest snap file (#3874)
* Check generated Jest snap file * Check file name rule first ref: https://github.com/github/linguist/pull/3874/files#r146168309 * Check extension first It must be cheaper ref: https://github.com/github/linguist/pull/3874/files#r146168426
This commit is contained in:
committed by
Colin Seymour
parent
a4e6fc78c8
commit
ca714340e8
@@ -62,6 +62,7 @@ module Linguist
|
||||
npm_shrinkwrap_or_package_lock? ||
|
||||
godeps? ||
|
||||
generated_by_zephir? ||
|
||||
generated_jest_snap? ||
|
||||
minified_files? ||
|
||||
has_source_map? ||
|
||||
source_map? ||
|
||||
@@ -525,5 +526,12 @@ module Linguist
|
||||
return false unless lines.count > 1
|
||||
return lines[0].start_with?("// Generated by the gRPC")
|
||||
end
|
||||
|
||||
# Internal: Is this a snap file of Jest?
|
||||
#
|
||||
# Return true or false
|
||||
def generated_jest_snap?
|
||||
name.end_with?(".snap") && name.include?("__snapshots__")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user