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

Method check

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

Source from the content-addressed store, hash-verified

293
294class WarnMutableRev(cfgv.Conditional):
295 def check(self, dct: dict[str, Any]) -> None:
296 super().check(dct)
297
298 if self.key in dct:
299 rev = dct[self.key]
300
301 if '.' not in rev and not re.match(r'^[a-fA-F0-9]+$', rev):
302 logger.warning(
303 f'The {self.key!r} field of repo {dct["repo"]!r} '
304 f'appears to be a mutable reference '
305 f'(moving tag / branch). Mutable references are never '
306 f'updated after first install and are not supported. '
307 f'See https://pre-commit.com/#using-the-latest-version-for-a-repository ' # noqa: E501
308 f'for more details. '
309 f'Hint: `pre-commit autoupdate` often fixes this.',
310 )
311
312
313class OptionalSensibleRegexAtHook(cfgv.OptionalNoDefault):

Callers

nothing calls this directly

Calls 2

checkMethod · 0.45
matchMethod · 0.45

Tested by

no test coverage detected