MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / _validate_config

Function _validate_config

pre_commit/commands/hook_impl.py:49–67  ·  view source on GitHub ↗
(
        retv: int,
        config: str,
        skip_on_missing_config: bool,
)

Source from the content-addressed store, hash-verified

47
48
49def _validate_config(
50 retv: int,
51 config: str,
52 skip_on_missing_config: bool,
53) -> None:
54 if not os.path.isfile(config):
55 if skip_on_missing_config or os.getenv('PRE_COMMIT_ALLOW_NO_CONFIG'):
56 print(f'`{config}` config file not found. Skipping `pre-commit`.')
57 raise SystemExit(retv)
58 else:
59 print(
60 f'No {config} file was found\n'
61 f'- To temporarily silence this, run '
62 f'`PRE_COMMIT_ALLOW_NO_CONFIG=1 git ...`\n'
63 f'- To permanently silence this, install pre-commit with the '
64 f'--allow-missing-config option\n'
65 f'- To uninstall pre-commit run `pre-commit uninstall`',
66 )
67 raise SystemExit(1)
68
69
70def _ns(

Callers 1

hook_implFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected