diff --git a/lib/linguist/generated.rb b/lib/linguist/generated.rb index 826fdc93..624885f1 100644 --- a/lib/linguist/generated.rb +++ b/lib/linguist/generated.rb @@ -55,8 +55,9 @@ module Linguist minified_javascript? || compiled_coffeescript? || xcode_project_file? || - generated_net_docfile? || generated_parser? || + generated_net_docfile? || + generated_net_designer_file? || generated_protocol_buffer? end @@ -143,6 +144,16 @@ module Linguist lines[-2].include?("") end + # Internal: Is this a codegen file for a .NET project? + # + # Visual Studio often uses code generation to generate partial classes, and + # these files can be quite unwieldy. Let's hide them. + # + # Returns true or false + def generated_net_designer_file? + name.downcase =~ /\.designer\.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.