From 4d45f1378372288f26e13cac41194be1fd97f904 Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Thu, 11 Jul 2013 15:53:10 -0700 Subject: [PATCH] Hide .designer.cs files VS creates a bunch of files that, while important to version, are often also huge and boring. We should suppress them. --- lib/linguist/generated.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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.