I added a build step to execute a Python script.
In this script pylint is called with the lint.Run(..args) to check the code.
The script works but in the end, the build fails with the only error message:
Build step 'Execute Python script' marked build as failure
Someone has an idea why this happens?
You can also simply put a
pylint || exit 0
in the shell cmdline. The Pylint plugin will fail the build anyway by checking the result of pyllint.
In Pylint 1.9.3, there is a --exit-zero
flag.
https://github.com/PyCQA/pylint/blob/1.9/ChangeLog#L47
Pylint has the unpleasant behavior to return a non-zero exit code even only if a small warning issue was found. Only when everything was fine, 0 is returned (see man page).
As usually a non-zero code denotes an error, Jenkins fails the build.
I see two ways to overcome this:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With