pygount icon indicating copy to clipboard operation
pygount copied to clipboard

Respect .gitattributes language and vendored definitions

Open catgirliest opened this issue 1 year ago • 1 comments

In a .gitattributes file it is possible to map language names to filename extensions, e.g.

*.fs linguist-language=glsl
*.vs linguist-language=glsl

It is also possible to specify which directories are not to be counted by language analyzers, such as the one on this site.

**/vendor/** linguist-vendored
lib/json.h linguist-vendored

Pygount could respect these settings (and maybe some more attributes could be useful too, these two are the only ones I've used).

That's my suggestion.

catgirliest avatar Oct 02 '24 22:10 catgirliest

Supporting gitignores would be helpful too, especially with CMake.

catgirliest avatar Oct 03 '24 17:10 catgirliest

@875014 I am not sure I understand this suggestion. Do you mean:

If pygount detects a .gitattributes files with entries that set a linguist-language for certain file patterns, it should use this as language for the analysis instead of the language automatically assigned by Pygments.

Concerning gitignore. There is an existing (ancient) issue for that, which should cover your suggestion. If not, feel free to elaborate there. #20

roskakori avatar Dec 10 '24 23:12 roskakori

If pygount detects a .gitattributes files with entries that set a linguist-language for certain file patterns, it should use this as language for the analysis instead of the language automatically assigned by Pygments.

Yes, exactly like that.

catgirliest avatar Dec 18 '24 17:12 catgirliest