google / addlicense

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

Recursive check pattern #136

Open jwillker opened 1 year ago

jwillker commented 1 year ago

I have many directories with go code. For the addlicence works, I have to do this:

docker run --rm -it -v ${PWD}:/src ghcr.io/google/addlicense \
       -check \
       -ignore "**/*.swagger.go" \
       -ignore "**/**/*.swagger.go" \
       */*/*.go
       **/**/**/**/**/**/*.go \
       **/**/**/**/**/*.go \
       **/**/**/**/*.go \
       **/**/**/*.go \
       **/**/*.go \
       **/*.go \
       *.go

Is there a better way only to check Golang code in any path? And ignore some file patterns in any path?

hugosjoberg commented 6 months ago

This also works:

find path/ -type f -name '*.go' -print0 | xargs -0 -n1  docker run --rm -it -v ${PWD}:/src ghcr.io/google/addlicense -check