google / addlicense

A program which ensures source code files have copyright license headers by scanning directory patterns recursively
Apache License 2.0
724 stars 170 forks source link

Ignore files and directories from .gitignore #32

Open Serhii1011010 opened 4 years ago

Serhii1011010 commented 4 years ago

Both local and global one

willnorris commented 3 years ago

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.

matheusfm commented 1 year ago

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