mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Detect GFortran module files as generated
This commit is contained in:
@@ -69,7 +69,7 @@ module Linguist
|
||||
generated_protocol_buffer? ||
|
||||
generated_jni_header? ||
|
||||
vcr_cassette? ||
|
||||
generated_kicad_module?
|
||||
generated_module?
|
||||
end
|
||||
|
||||
# Internal: Is the blob an Xcode file?
|
||||
@@ -313,17 +313,22 @@ module Linguist
|
||||
return lines[0].include?("Generated by Cython")
|
||||
end
|
||||
|
||||
# Internal: Is it a KiCAD module file?
|
||||
# Internal: Is it a KiCAD or GFortran module file?
|
||||
#
|
||||
# KiCAD module files contain:
|
||||
# PCBNEW-LibModule-V1 yyyy-mm-dd h:mm:ss XM
|
||||
# on the first line.
|
||||
#
|
||||
# GFortran module files contain:
|
||||
# GFORTRAN module version 'x' created from
|
||||
# on the first line.
|
||||
#
|
||||
# Return true of false
|
||||
def generated_kicad_module?
|
||||
def generated_module?
|
||||
return false unless extname == '.mod'
|
||||
return false unless lines.count > 1
|
||||
return lines[0].include?("PCBNEW-LibModule-V")
|
||||
return lines[0].include?("PCBNEW-LibModule-V") ||
|
||||
lines[0].include?("GFORTRAN module version '")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user