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:
Luís Ferreira 2021-10-03 00:34:39 +01:00
parent d021bbfabd
commit 61efc539a4
No known key found for this signature in database
GPG key ID: 730750D54B7A9F66
5 changed files with 23 additions and 2 deletions

View file

@ -69,6 +69,7 @@ def _ns(
color: bool,
*,
all_files: bool = False,
fail_fast: bool = False,
remote_branch: Optional[str] = None,
local_branch: Optional[str] = None,
from_ref: Optional[str] = None,
@ -91,6 +92,7 @@ def _ns(
remote_url=remote_url,
commit_msg_filename=commit_msg_filename,
all_files=all_files,
fail_fast=fail_fast,
checkout_type=checkout_type,
is_squash_merge=is_squash_merge,
rewrite_command=rewrite_command,