Open jacobweinstock opened 2 years ago
I'm able to reproduce this. Reading the find
docs on my linux box it states that using the +
form does not swallow the exit code. Can you modify lint-install.go and give that a try?
hmmm....i must be reading something different. https://man7.org/linux/man-pages/man1/find.1.html:
"-execdir command {} + always returns true, while -execdir command {} ; returns true only if command returns 0."
Also, I can't get the command to work when i use {}
and/or +
.
Also, it seems the way the find command is used is just to execute the golangci-lint
in a specific directory and not to actually find files. So using {}
wouldn't make sense.
Hmm I was going off of a couple sentences before that line:
If any invocation with the `+' form returns a non-zero value as exit status, then find returns a non-zero exit status.
And verified using the following experiment:
14:28 ~/go/src/github.com/tinkerbell/lint-install $ find . -name go.mod -execdir sh -c 'exit 1' '{}' '+'
14:28 ~/go/src/github.com/tinkerbell/lint-install $ echo $?
1
find is used to find the go.mod files (there may be many in a repo, in subdirs for e.g.) and then runs golangci-lint run from within that dir https://github.com/mistifyio/go-zfs/ is an example repo.
This repo uses the
find
command to executegolangci-lint
in the top level directory. As a side affect of this I believe this swallows the exit code from the actualgolangci-lint
command. This makes it impossible to uselint-install
in CI where a non-zero exit code should fail a build.Same
golanglint-ci
command run on its own:Expected Behaviour
Current Behaviour
Possible Solution
Steps to Reproduce (for bugs)
1. 2. 3. 4.
Context
Your Environment
Operating System and version (e.g. Linux, Windows, MacOS):
How are you running Tinkerbell? Using Vagrant & VirtualBox, Vagrant & Libvirt, on Packet using Terraform, or give details:
Link to your project or a code example to reproduce issue: