scc includes the .ignore file as part of the project counting
Unexpected behaviour
In a directory where a .ignore file is present, scc includes it as part of the project stats.
My experience
- In a project with 54 source files and the .ignore one to exclude no project files.
- Using the command
scc --no-gen --no-cocomo -x i ./project - scc output is:
───────────────────────────────────────────────────────────────────────────────
Language Files Lines Blanks Comments Code Complexity
───────────────────────────────────────────────────────────────────────────────
C 54 8444 518 2483 5443 602
C Header 1 1 0 1 0 0
ignore 1 10 0 0 10 0
───────────────────────────────────────────────────────────────────────────────
Total 56 8455 518 2484 5453 602
───────────────────────────────────────────────────────────────────────────────
Expected behavior
Language Files Lines Blanks Comments Code Complexity
───────────────────────────────────────────────────────────────────────────────
C 54 8444 518 2483 5443 602
C Header 1 1 0 1 0 0
───────────────────────────────────────────────────────────────────────────────
Total 55 8445 518 2484 5443 602
───────────────────────────────────────────────────────────────────────────────
Desktop (please complete the following information):
- OS: Windows 10, Home Ed, single language
- Version 3.2.0
Its funny... I added this as a way to assist with counting them since it was not common at the time, along with gitignore and hgignore files...
Perhaps it would be best to exclude them by default allowing people to opt in... either that or respect a dot file in the home directory or some such to change the behavior.
Perhaps we can agree in a more specific name .scc_ignore and as you wrote, by default don't include it, except if in some organization the file be considered part of the deliverables that have to maintained or such, and so it would make sense in this case to opt in.
So I am going to implement support for a scc_ignore file soon, as some want specific behavior for counting itself. The reason for .ignore file support itself was due to wanting drop in compatibility with tools such as ripgrep and ag which support this file, and by extension visual studio code.
Done. This is now the default. If you want to count ignore files you must set the flag
--count-ignore set to allow .gitignore and .ignore files to be counted
so
scc --count-ignore
for ignore files to be counted.