I have a pre-commit setup with several pretty standard repos (for a Python project anyways), and one heavily magical project-specific action.
Something like this:
repos:
- repo: https://github.com/timothycrosley/isort
...
- repo: https://github.com/psf/black
...
- repo: https://gitlab.com/pycqa/flake8
...
- repo: local
hooks:
- id: local_project_specific_magic
name: local-magic-script
entry: magic_script.sh
language: script
This all runs fine when all of the checks are successful.
What I need to achieve is to have the final local_project_specific_magic
hook not execute if any of the previous hooks fail. Is this doable?
I have tried to add fail_fast: true
and that seems to work, but it also prevents other hooks from running if any of them fail. For example, even if isort fixes some imports, I still want black to do its thing.