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

Method check

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

Source from the content-addressed store, hash-verified

331
332class OptionalSensibleRegexAtTop(cfgv.OptionalNoDefault):
333 def check(self, dct: dict[str, Any]) -> None:
334 super().check(dct)
335
336 if '/*' in dct.get(self.key, ''):
337 logger.warning(
338 f'The top-level {self.key!r} field is a regex, not a glob -- '
339 f"matching '/*' probably isn't what you want here",
340 )
341 for fwd_slash_re in (r'[\\/]', r'[\/]', r'[/\\]'):
342 if fwd_slash_re in dct.get(self.key, ''):
343 logger.warning(
344 fr'pre-commit normalizes the slashes in the top-level '
345 fr'{self.key!r} field to forward slashes, so you '
346 fr'can use / instead of {fwd_slash_re}',
347 )
348
349
350def _entry(modname: str) -> str:

Callers

nothing calls this directly

Calls 2

checkMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected