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

Method check

pre_commit/clientlib.py:314–329  ·  view source on GitHub ↗
(self, dct: dict[str, Any])

Source from the content-addressed store, hash-verified

312
313class OptionalSensibleRegexAtHook(cfgv.OptionalNoDefault):
314 def check(self, dct: dict[str, Any]) -> None:
315 super().check(dct)
316
317 if '/*' in dct.get(self.key, ''):
318 logger.warning(
319 f'The {self.key!r} field in hook {dct.get("id")!r} is a '
320 f"regex, not a glob -- matching '/*' probably isn't what you "
321 f'want here',
322 )
323 for fwd_slash_re in (r'[\\/]', r'[\/]', r'[/\\]'):
324 if fwd_slash_re in dct.get(self.key, ''):
325 logger.warning(
326 fr'pre-commit normalizes slashes in the {self.key!r} '
327 fr'field in hook {dct.get("id")!r} to forward slashes, '
328 fr'so you can use / instead of {fwd_slash_re}',
329 )
330
331
332class OptionalSensibleRegexAtTop(cfgv.OptionalNoDefault):

Callers

nothing calls this directly

Calls 2

checkMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected