discovery.discover_checks
discovery.discover_checks()Discover all registered checks via entry points.
Scans the pycmdcheck.checks entry point group and loads all registered check classes. Built-in checks are registered in the package’s pyproject.toml, and third-party packages can register additional checks.
A plugin that fails to load, for any reason, is skipped with a logged warning, and discovery continues with the other checks. The names of the built-in checks, deprecated ones included, are reserved: a plugin that registers one of them is skipped with a warning, so a plugin cannot replace a built-in check.
Returns
Examples
Discover all available checks (returns a name -> class mapping):
>>> checks = discover_checks()
>>> isinstance(checks, dict)
TrueGet a specific check class (requires the package to be installed so its entry points are registered):
>>> MetadataCheck = discover_checks()["metadata"]
>>> MetadataCheck().name
'metadata'