You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hook fail_fast says in the documentation that pre-commit will stop if this hook fails, which suggests it is referring only to the present hook. The actual behaviour appears to be that pre-commit will stop if this or any previous hook fails.
Example
Add a Python file containing including a blank line at the end:
defmy_function(b=):
a="a"
Use the config below and call pre-commit run -a.
Expected behaviour
All three hooks run. The first and third fail.
Observed behaviour
The first two hooks run. The first hook fails and the second hook passes.
Note
I had previously submitted this as a documentation issue (pre-commit/pre-commit.com#945), because I find the actual behaviour quite useful, as it means we can avoid running a slow hook (e.g. pytest) if any other hook has failed. However, @asottile said this is not the intended behaviour, so resubmitting here as a bug.
search you tried in the issue tracker
fail fast hook
describe your issue
Description
Hook
fail_fast
says in the documentation that pre-commit will stop if this hook fails, which suggests it is referring only to the present hook. The actual behaviour appears to be that pre-commit will stop if this or any previous hook fails.Example
Add a Python file containing including a blank line at the end:
Use the config below and call
pre-commit run -a
.Expected behaviour
All three hooks run. The first and third fail.
Observed behaviour
The first two hooks run. The first hook fails and the second hook passes.
Note
I had previously submitted this as a documentation issue (pre-commit/pre-commit.com#945), because I find the actual behaviour quite useful, as it means we can avoid running a slow hook (e.g. pytest) if any other hook has failed. However, @asottile said this is not the intended behaviour, so resubmitting here as a bug.
pre-commit --version
pre-commit 3.6.2
.pre-commit-config.yaml
~/.cache/pre-commit/pre-commit.log (if present)
Log from terminal, not file.
The text was updated successfully, but these errors were encountered: