plone / plone.recipe.codeanalysis

provides static code analysis for Buildout-based Python projects, including flake8, JSHint, CSS Lint, and other code checks
https://pypi.org/project/plone.recipe.codeanalysis/
11 stars 8 forks source link

Set return-status-codes default to True #211

Open tisto opened 6 years ago

tisto commented 6 years ago

The main reason why return-status-codes is set to false by default was Jenkins. Traditional Jenkins jobs fail if a process exits with 1. With the new declarative pipeline syntax this is not true any longer. Jenkins requires the process to fail with exit code 1 just like Travis and other CI systems.

Therefore I think we can simplify the configuration by setting return-status-codes to True (by default). This would be a breaking change and require a major version step though. Opinions?

gforcada commented 6 years ago

As long as it is on a major version bump, I'm fine 👍

tisto commented 6 years ago

Ok, I forgot one nifty detail. Returning the status code breaks the code-analysis call. When "bin/code-analysis" fails within the pre-commit hook, the dev can not commit anything. This is incredibly annoying. So if we want to simplify this, we need our pre-commit hook to work around the exit status of "bin/code-analysis".

tisto commented 6 years ago

Ok, I just checked. This should work if we change the pre-commit hook to:

#!/usr/bin/env bash
bin/code-analysis || true

I guess this is safe because nobody needs an exit status from a pre-commit hook anyways. This is just something on the dev machines.