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

support ignoring file or directories #84

Closed willnorris closed 3 years ago

willnorris commented 3 years ago

use the doublestar library to support pattern matching of files or directories to ignore. This replaces (and deprecates) the previous -skip flag which only supported file extensions.

(previous discussion in https://github.com/google/addlicense/pull/70#issuecomment-888695051)

The doublestar library requires go1.16, so I'm leaving this is draft mode until go1.17 is released (which should be any day now).

/cc @Shikugawa @laurentsimon @Shabirmean @lukehinds @cpanato - you've all been involved in similar implementations in #70, #73, and #75, so I'm curious if this implementation meets your use cases.

codecov-commenter commented 3 years ago

Codecov Report

Merging #84 (b8695ac) into master (b431030) will increase coverage by 0.57%. The diff coverage is 47.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #84      +/-   ##
==========================================
+ Coverage   46.98%   47.56%   +0.57%     
==========================================
  Files           2        2              
  Lines         232      246      +14     
==========================================
+ Hits          109      117       +8     
- Misses        116      122       +6     
  Partials        7        7              
Impacted Files Coverage Δ
main.go 40.19% <47.61%> (+1.24%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b431030...b8695ac. Read the comment docs.

naveensrinivasan commented 3 years ago

What else is pending in the PR? This will be helpful to lots of other projects. Thanks

willnorris commented 3 years ago

I originally proposed we wait until the go1.17 release, so then we would be supporting the two latest releases of Go (since doublestar bumps our minimum version to go1.16). go1.17 should be releasing soon? RC2 was just released this past week.

We could choose to go ahead and merge and only support go1.16, and then try to support the latest two versions going forward once go1.17 drops. @mco-gh, what do you think?

mco-gh commented 3 years ago

Either is fine with me, depends on how soon you want to merge.

On Fri, 6 Aug 2021 at 16:43, Will Norris @.***> wrote:

I originally proposed we wait until the go1.17 release, so then we would be supporting the two latest releases of Go (since doublestar bumps our minimum version to go1.16). go1.17 should be releasing soon? RC2 was just released this past week https://groups.google.com/g/golang-dev/c/4EyTZSGqa0w.

We could choose to go ahead and merge and only support go1.16, and then try to support the latest two versions going forward once go1.17 drops. @mco-gh https://github.com/mco-gh, what do you think?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google/addlicense/pull/84#issuecomment-894347014, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFAXF2Z5ZDMZ7GAQTY57I3T3P7I7ANCNFSM5BGZ6UYQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

-- Marc Cohen Web: mco.dev Email: @.*** Working with me: mco.dev/working-with-marc Feedback: How am I doing? Provide anonymous feedback! https://www.increment.me/feedback/049628fd-7339-406d-9203-17d3ec8976bd/submit

Q: Why is this email three sentences or less? A: three.sentenc.es

naveensrinivasan commented 3 years ago

I originally proposed we wait until the go1.17 release, so then we would be supporting the two latest releases of Go (since doublestar bumps our minimum version to go1.16). go1.17 should be releasing soon? RC2 was just released this past week.

We could choose to go ahead and merge and only support go1.16, and then try to support the latest two versions going forward once go1.17 drops. @mco-gh, what do you think?

Would appreciate it if we could merge this. Thanks

willnorris commented 3 years ago

okay, I've gone ahead and marked this ready for review @mco-gh. Since go1.16 has been out for 6 months, I suspect this is fine.

naveensrinivasan commented 3 years ago

Thank you!

laurentsimon commented 3 years ago

Awesome! Thanks for such a quick turnaround!