google / addlicense

A program which ensures source code files have copyright license headers by scanning directory patterns recursively

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ignore files and directories from .gitignore

Serhii1011010 opened this issue · comments

Both local and global one

I think that's a great idea. I do love how ripgrep and a bunch of other more modern tools support this natively.

Now that we're using https://github.com/bmatcuk/doublestar to power the -ignore flag, I think my ideal implementation would be for doublestar itself (or another library) to provide an API that parses a .gitignore file and returns doublestar-compatible pattern strings. Then we could just append them to any additional patterns provided with the -ignore flag. Bonus points if a single functional call would find all .gitignore files recursively, as well as parse the appropriate global file. I'll try looking around for anything that can do this, but would also love any pointers to libraries folks might know about.

It may be a good idea to have a dedicated file for addlicense, just like there is for .dockerignore, .helmignore, etc.