mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 18:11:48 +04:00
formatting, pass tests
This commit is contained in:
parent
3a8b270dc0
commit
3ded202c2a
3 changed files with 7 additions and 2 deletions
|
|
@ -126,7 +126,11 @@ class Classifier:
|
||||||
return Classifier(filenames)
|
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', '')
|
skips = environ.get('SKIP', '')
|
||||||
environ_skips = {skip.strip() for skip in skips.split(',') if skip.strip()}
|
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}
|
context_skips = {h.id for h in hooks if args.all_files and not h.run_all}
|
||||||
|
|
|
||||||
|
|
@ -594,7 +594,7 @@ def test_compute_cols(hooks, expected):
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
def test_get_skips(environ, expected_output):
|
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
|
assert ret == expected_output
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1019,6 +1019,7 @@ def test_manifest_hooks(tempdir_factory, store):
|
||||||
types_or=[],
|
types_or=[],
|
||||||
verbose=False,
|
verbose=False,
|
||||||
fail_fast=False,
|
fail_fast=False,
|
||||||
|
run_all=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue