addlicense icon indicating copy to clipboard operation
addlicense copied to clipboard

Recursive check pattern

Open jwillker opened this issue 3 years ago • 1 comments

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?

jwillker avatar Dec 15 '22 01:12 jwillker

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

hugosjoberg avatar Apr 18 '24 17:04 hugosjoberg