diff --git a/pre_commit/commands/run.py b/pre_commit/commands/run.py index 6a22ab93..60e0f11e 100644 --- a/pre_commit/commands/run.py +++ b/pre_commit/commands/run.py @@ -126,7 +126,11 @@ class Classifier: return Classifier(filenames) -def _get_skips(environ: MutableMapping[str, str], args: argparse.Namespace, hooks: list[Hook]) -> set[str]: +def _get_skips( + environ: MutableMapping[str, str], + args: argparse.Namespace, + hooks: list[Hook], +) -> set[str]: skips = environ.get('SKIP', '') environ_skips = {skip.strip() for skip in skips.split(',') if skip.strip()} context_skips = {h.id for h in hooks if args.all_files and not h.run_all} diff --git a/tests/commands/run_test.py b/tests/commands/run_test.py index 03d741e0..fa87dd3f 100644 --- a/tests/commands/run_test.py +++ b/tests/commands/run_test.py @@ -594,7 +594,7 @@ def test_compute_cols(hooks, expected): ), ) def test_get_skips(environ, expected_output): - ret = _get_skips(environ) + ret = _get_skips(environ, args=mock.MagicMock(), hooks=mock.MagicMock()) assert ret == expected_output diff --git a/tests/repository_test.py b/tests/repository_test.py index 252c126c..513270c3 100644 --- a/tests/repository_test.py +++ b/tests/repository_test.py @@ -1019,6 +1019,7 @@ def test_manifest_hooks(tempdir_factory, store): types_or=[], verbose=False, fail_fast=False, + run_all=True, )