Add support for linguist- marks in .gitattributes (adresses #386)#1292
Add support for linguist- marks in .gitattributes (adresses #386)#1292JJWRoeloffs wants to merge 2 commits intoXAMPPRocky:masterfrom
linguist- marks in .gitattributes (adresses #386)#1292Conversation
And fix the problem in my code that I found that way, `linguist-ignore` is a variable that should be true when we _do_ want to use the ignore from the linguist marks in the .gitattributes file
|
Thank you for your PR!
I would expect it to behave the same as ignore. |
|
Stumbled on this while browsing, my 2 cents:
I don't think you want to group these 3 attributes together. Especially This PR as it is is putting the cart before the horse IMO, because Also, there's the |
I noticed tokei does not support the
linguist-vendorred,linguist-documenttaion, andlinguist-generatedmarks you can put in your.gitattributeswhile working on a project of mine, and then found that the issue for this was listed as open and help-wanted (#386), (even a few years later). With this pull request, I attempted to implement this linguist support in the way outlined in the original issue.I haven't programmed in Rust in a while, so I am a bit... rusty (pun absolutely intended.) I hope I did everything properly! ^.^
In this pull request I am:
gix-attributesdependency for.gitattributesparsing, as specified in the original issue.linguist-vendorred,linguist-documenttaion, andlinguist-generatedin.gitattributesto-ignore using overrides.--no-ignore-linguistand its documentation, which disables the functionality I added.EDIT: Coming back a day later, I realize there are some complications that I missed: If you pass multiple directories to tokei, the expected behavior is that each of these directories has its own ignore files that apply locally to the files in those directories, which is indeed how the
.gitignoreis implemented in the ignore crate. However, with how I implemented gitattributes, any found rule in a gitattribute file applies globally to the entire run, even to separately passed directories. I am expecting there to be a decent fix for this, but I'll wait for your comment before putting more time into this PR.(It also appears I flipped the
ignore parentflag.)