-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude linguist-vendored and linguist-generated in .gitattributes when using --no-autogen #722
Comments
Can you recommend a repo to clone that has such entries? |
I've got a couple at brianary/webcoder or brianary/scripts, but there are a lot of others. |
It looks like |
added Text::Glob by Richard Clamp to handle glob -> regex
Take a shot at the update I just pushed, only test on Linux so far. |
I pulled down the repo and ran `./cloc`...
I added this .gitattributes file:
Then I ran `./cloc` again, which seemed to add one ignored file, but didn't exclude any lines of Perl code...
|
The failure was caused by the spurious However... I took a closer look at the |
ea192f1 is my next attempt at this, please give it a try |
this is a partial implementation, still need --match-f, --match-d
Unfortunately, I still don't see a difference when adding that .gitattributes. |
Are you using github.com/AlDanial/cloc v 1.97 T=2.33 s (335.9 files/s, 169801.5 lines/s) ---------------------------------------------------------------------------------------- Language files blank comment code ---------------------------------------------------------------------------------------- Perl 36 23797 49078 265666 Text 47 2330 0 17361 YAML 370 12 372 9075 Markdown 4 305 40 2862 However with github.com/AlDanial/cloc v 1.97 T=1.74 s (446.6 files/s, 208591.7 lines/s) ---------------------------------------------------------------------------------------- Language files blank comment code ---------------------------------------------------------------------------------------- Perl 34 21624 44084 241342 Text 47 2330 0 17361 YAML 370 12 372 9075 Markdown 4 305 40 2862 |
I did have the wrong options, but retrying on Windows with the right ones, both still start with:
Something seems way off for us to be getting such different results in either case. |
Couple of things: I had a bunch of extra files in my dir that inflated my count. Also the glitch had to do with file path separators, I wasn't treating \ and / consistently in this code branch. The latest push should fix it. Here are my results on Windows, using extra filters to just narrow it down to the 8 or 10 Perl files: C:>perl cloc --git --no-autogen --by-file --include-lang=Perl . 834 text files. 721 unique files. 839 files ignored. github.com/AlDanial/cloc v 1.97 T=2.00 s (5.0 files/s, 26986.6 lines/s) ----------------------------------------------------------------------------------- File blank comment code ----------------------------------------------------------------------------------- .\cloc-1.96.pl 1485 3656 12103 .\cloc-1.92.pl 1481 3628 11998 .\cloc.ok 1484 3635 11950 .\Unix\t\00_C.t 3 3 1282 .\Unix\t\01_opts.t 86 28 697 .\Unix\t\02_git.t 15 1 134 .\tests\inputs\issues\380\wrapper.pl 44 72 71 .\sqlite_formatter 5 15 42 .\tests\inputs\issues\420\mixed_case_ext.Pl 5 1 14 .\tests\inputs\diff\B\extra_file.pl 0 0 2 ----------------------------------------------------------------------------------- SUM: 4608 11039 38293 ----------------------------------------------------------------------------------- If I don't include C:>perl cloc --git --by-file --include-lang=Perl . 834 text files. 721 unique files. 837 files ignored. github.com/AlDanial/cloc v 1.97 T=2.02 s (5.9 files/s, 42343.3 lines/s) ----------------------------------------------------------------------------------- File blank comment code ----------------------------------------------------------------------------------- .\cloc 1488 3666 12290 .\cloc-1.96.pl 1485 3656 12103 .\Unix\cloc 685 1328 12041 .\cloc-1.92.pl 1481 3628 11998 .\cloc.ok 1484 3635 11950 .\Unix\t\00_C.t 3 3 1282 .\Unix\t\01_opts.t 86 28 697 .\Unix\t\02_git.t 15 1 134 .\tests\inputs\issues\380\wrapper.pl 44 72 71 .\sqlite_formatter 5 15 42 .\tests\inputs\issues\420\mixed_case_ext.Pl 5 1 14 .\tests\inputs\diff\B\extra_file.pl 0 0 2 ----------------------------------------------------------------------------------- SUM: 6781 16033 62624 ----------------------------------------------------------------------------------- Your file lists may be smaller but if you do the two runs one should produce two fewer files than the other. |
I think that has done it! :) |
Glad to hear it, thanks for your patience with testing. |
GitHub supports specifying vendor-created code and generated code in a repository using Lingust extensions in the .gitattributes file, which it uses to optimally fold files in diff views. It would be nice if these were excluded with the
--no-autogen
option, since this is already being maintained in repos.Example
The text was updated successfully, but these errors were encountered: