mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-18 11:31: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
|
|
@ -290,7 +290,7 @@ def _run_hooks(
|
|||
verbose=args.verbose, use_color=args.color,
|
||||
)
|
||||
retval |= current_retval
|
||||
if retval and config['fail_fast']:
|
||||
if retval and (config['fail_fast'] or args.fail_fast):
|
||||
break
|
||||
if retval and args.show_diff_on_failure and prior_diff:
|
||||
if args.all_files:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue