checks.base.Check
checks.base.Check()Protocol defining the interface for all checks.
This protocol defines what a check must implement to be usable by pycmdcheck. Checks can be implemented by either:
- Inheriting from BaseCheck (recommended for most cases)
- Implementing this Protocol directly (for structural subtyping)
Attributes
Examples
Implement a check using the protocol directly:
>>> class MyCheck:
... name = "my_check"
... description = "My custom check"
...
... def run(self, package_path, config):
... return CheckResult(
... name=self.name,
... status=CheckStatus.OK,
... message="Check passed",
... )
>>> isinstance(MyCheck(), Check)
TrueMethods
| Name | Description |
|---|---|
| run | Execute the check and return result. |
run
checks.base.Check.run(package_path, config)Execute the check and return result.
Parameters
Returns
: CheckResult-
A CheckResult containing the status, message, and optional details.