mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-16 02:21:46 +04:00
pre_commit: expose fail-fast argument for run subcommand
This patch exposes the fail-fast feature as a command-line argument for the run subcommand, allowing to run pre-commit to stop at the first failed hook without the need of temporarily writing it to the configuration file when temporarily needed. Signed-off-by: Luís Ferreira <contact@lsferreira.net>
This commit is contained in:
parent
d021bbfabd
commit
61efc539a4
5 changed files with 23 additions and 2 deletions
|
|
@ -85,6 +85,10 @@ def _add_run_options(parser: argparse.ArgumentParser) -> None:
|
|||
'--all-files', '-a', action='store_true', default=False,
|
||||
help='Run on all the files in the repo.',
|
||||
)
|
||||
mutex_group.add_argument(
|
||||
'--fail-fast', action='store_true',
|
||||
help='Stop running hooks after the first failure',
|
||||
)
|
||||
mutex_group.add_argument(
|
||||
'--files', nargs='*', default=[],
|
||||
help='Specific filenames to run hooks on.',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue