lib/linguist/generated.rb in github-linguist-6.2.0 vs lib/linguist/generated.rb in github-linguist-6.3.0
- old
+ new
@@ -86,10 +86,11 @@
generated_grammarkit? ||
generated_roxygen2? ||
generated_jison? ||
generated_yarn_lock? ||
generated_grpc_cpp? ||
+ generated_dart? ||
generated_perl_ppport_header?
end
# Internal: Is the blob an Xcode file?
#
@@ -291,11 +292,11 @@
return false unless lines.count > 1
return lines[0].include?("Code generated by")
end
- PROTOBUF_EXTENSIONS = ['.py', '.java', '.h', '.cc', '.cpp']
+ PROTOBUF_EXTENSIONS = ['.py', '.java', '.h', '.cc', '.cpp', '.rb']
# Internal: Is the blob a C++, Java or Python source file generated by the
# Protocol Buffer compiler?
#
# Returns true of false.
@@ -540,9 +541,26 @@
# Return true or false
def generated_grpc_cpp?
return false unless %w{.cpp .hpp .h .cc}.include? extname
return false unless lines.count > 1
return lines[0].start_with?("// Generated by the gRPC")
+ end
+
+ # Internal: Is this a generated Dart file?
+ #
+ # A dart-lang/appengine generated file contains:
+ # // Generated code. Do not modify.
+ # on the first line.
+ #
+ # An owl generated file contains:
+ # // GENERATED CODE - DO NOT MODIFY
+ # on the first line.
+ #
+ # Return true or false
+ def generated_dart?
+ return false unless extname == '.dart'
+ return false unless lines.count > 1
+ return lines.first.downcase =~ /generated code\W{2,3}do not modify/
end
# Internal: Is the file a generated Perl/Pollution/Portability header file?
#
# Returns true or false.