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

@ -57,6 +57,7 @@ xfailif_windows = pytest.mark.xfail(os.name == 'nt', reason='windows')
def run_opts(
all_files=False,
fail_fast=False,
files=(),
color=False,
verbose=False,
@ -78,6 +79,7 @@ def run_opts(
assert not (all_files and files)
return auto_namedtuple(
all_files=all_files,
fail_fast=fail_fast,
files=files,
color=color,
verbose=verbose,