runner.run_checks
runner.run_checks(
package_path,
checks=None,
skip=None,
config=None,
parallel=True,
)Run checks on a package.
This is the core function that orchestrates check discovery and execution. It loads configuration, discovers available checks via entry points, and runs them either in parallel or sequentially.
Parameters
package_path : str | Path-
Path to the package directory to check. Can be a string or Path object. Will be resolved to an absolute path.
checks : list[str] | None = None-
List of specific check names to run. If None, runs all checks that are enabled in the configuration. Available built-in checks: metadata, structure, tests, linting, typing, imports, license, docs.
skip : list[str] | None = None-
List of check names to skip, even if they would otherwise run.
config : dict[str, Any] | None = None-
Pre-loaded configuration dictionary. If None, configuration is loaded from the package’s pyproject.toml file.
parallel : bool = True-
Whether to run checks in parallel using threads. Defaults to True. Set to False for deterministic ordering or debugging.
Returns
Examples
Run all enabled checks:
>>> report = run_checks("/path/to/package")
>>> report.passed
TrueRun specific checks only:
>>> report = run_checks(".", checks=["metadata", "tests"])
>>> len(report.results)
2Run sequentially for debugging:
>>> report = run_checks(".", parallel=False)