lib/linguist/generated.rb in github-linguist-7.27.0 vs lib/linguist/generated.rb in github-linguist-7.28.0
- old
+ new
@@ -299,11 +299,11 @@
def generated_postscript?
return false unless ['.ps', '.eps', '.pfa'].include? extname
# Type 1 and Type 42 fonts converted to PostScript are stored as hex-encoded byte streams; these
# streams are always preceded the `eexec` operator (if Type 1), or the `/sfnts` key (if Type 42).
- return true if data =~ /(\n|\r\n|\r)\s*(?:currentfile eexec\s+|\/sfnts\s+\[\1<)\h{8,}\1/
+ return true if data =~ /^\s*(?:currentfile eexec\s+|\/sfnts\s+\[\s<)/
# We analyze the "%%Creator:" comment, which contains the author/generator
# of the file. If there is one, it should be in one of the first few lines.
creator = lines[0..9].find {|line| line =~ /^%%Creator: /}
return false if creator.nil?
@@ -691,12 +691,12 @@
#
# Return true or false
def generated_gimp?
return false unless ['.c', '.h'].include? extname
return false unless lines.count > 0
- return lines[0].match(/\/\* GIMP [a-zA-Z0-9\- ]+ C\-Source image dump \(.+?\.c\) \*\//) ||
- lines[0].match(/\/\* GIMP header image file format \([a-zA-Z0-9\- ]+\)\: .+?\.h \*\//)
+ return lines[0].match(/^\/\* GIMP [a-zA-Z0-9\- ]+ C\-Source image dump \(.+?\.c\) \*\//) ||
+ lines[0].match(/^\/\* GIMP header image file format \([a-zA-Z0-9\- ]+\)\: .+?\.h \*\//)
end
# Internal: Is this a generated Microsoft Visual Studio 6.0 build file?
#
# Return true or false
@@ -793,10 +793,10 @@
def generated_sorbet_rbi?
return false unless extname.downcase == '.rbi'
return false unless lines.count >= 5
lines[0].match?(/^# typed:/) &&
lines[2].include?("DO NOT EDIT MANUALLY") &&
- lines[4].match?(/^# Please.*run.*`.*tapioca/)
+ lines[4].match?(/^# Please (run|instead update this file by running) `bin\/tapioca/)
end
# Internal: Is this an HTML coverage report?
#
# Tools like coverage.py generate HTML reports under an `htmlcov` directory.