lib/linguist/generated.rb in github-linguist-4.5.4 vs lib/linguist/generated.rb in github-linguist-4.5.5
- old
+ new
@@ -51,10 +51,11 @@
#
# Return true or false
def generated?
xcode_file? ||
generated_net_designer_file? ||
+ generated_net_specflow_feature_file? ||
composer_lock? ||
node_modules? ||
godeps? ||
generated_by_zephir? ||
minified_files? ||
@@ -65,10 +66,11 @@
generated_postscript? ||
compiled_cython_file? ||
generated_protocol_buffer_go? ||
generated_protocol_buffer? ||
generated_jni_header? ||
+ generated_unity3d_meta? ||
vcr_cassette?
end
# Internal: Is the blob an Xcode file?
#
@@ -176,10 +178,21 @@
#
# Returns true or false
def generated_net_designer_file?
name.downcase =~ /\.designer\.cs$/
end
+
+ # Internal: Is this a codegen file for Specflow feature file?
+ #
+ # Visual Studio's SpecFlow extension generates *.feature.cs files
+ # from *.feature files, they are not meant to be consumed by humans.
+ # Let's hide them.
+ #
+ # Returns true or false
+ def generated_net_specflow_feature_file?
+ name.downcase =~ /\.feature\.cs$/
+ end
# Internal: Is the blob of JS a parser generated by PEG.js?
#
# PEG.js-generated parsers are not meant to be consumed by humans.
#
@@ -296,8 +309,21 @@
# Return true or false
def compiled_cython_file?
return false unless ['.c', '.cpp'].include? extname
return false unless lines.count > 1
return lines[0].include?("Generated by Cython")
+ end
+
+ # Internal: Is this a metadata file from Unity3D?
+ #
+ # Unity3D Meta files start with:
+ # fileFormatVersion: X
+ # guid: XXXXXXXXXXXXXXX
+ #
+ # Return true or false
+ def generated_unity3d_meta?
+ return false unless extname == '.meta'
+ return false unless lines.count > 1
+ return lines[0].include?("fileFormatVersion: ")
end
end
end