lib/linguist/generated.rb in github-linguist-4.8.17 vs lib/linguist/generated.rb in github-linguist-4.8.18

- old
+ new

@@ -273,19 +273,17 @@ return false unless lines.count > 1 return lines[0].include?("Generated by the protocol buffer compiler. DO NOT EDIT!") end - APACHE_THRIFT_EXTENSIONS = ['.rb', '.py', '.go', '.js', '.m', '.java', '.h', '.cc', '.cpp'] + APACHE_THRIFT_EXTENSIONS = ['.rb', '.py', '.go', '.js', '.m', '.java', '.h', '.cc', '.cpp', '.php'] # Internal: Is the blob generated by Apache Thrift compiler? # # Returns true or false def generated_apache_thrift? return false unless APACHE_THRIFT_EXTENSIONS.include?(extname) - return false unless lines.count > 1 - - return lines[0].include?("Autogenerated by Thrift Compiler") || lines[1].include?("Autogenerated by Thrift Compiler") + return lines.first(6).any? { |l| l.include?("Autogenerated by Thrift Compiler") } end # Internal: Is the blob a C/C++ header generated by the Java JNI tool javah? # # Returns true of false.