checks.linting.LintingCheck
checks.linting.LintingCheck()Run linting tools on the package.
Executes a configurable linting tool to check code quality and style. Supports ruff (default), flake8, and pylint.
Attributes
name :-
The check identifier (“linting”).
description :-
Human-readable description of this check.
SUPPORTED_TOOLS :-
List of supported linting tools.
Examples
Run linting with default settings (ruff):
>>> from pathlib import Path
>>> check = LintingCheck()
>>> result = check.run(Path("."), {"enabled": True})
>>> result.name
'linting'Configure to use flake8:
>>> config = {"enabled": True, "tool": "flake8"}
>>> result = check.run(Path("."), config)Pass additional ruff arguments:
>>> config = {"enabled": True, "args": ["--select", "E,W"]}
>>> result = check.run(Path("."), config)Methods
| Name | Description |
|---|---|
| run | Run linting check on the package. |
run
checks.linting.LintingCheck.run(package_path, config)Run linting check on the package.
Executes the configured linting tool and collects any issues found. Issues are reported in the result details (limited to first 10).
Parameters
Returns
: CheckResult-
A CheckResult with:
: CheckResult-
- OK status if no linting issues found
: CheckResult-
- WARNING status if linting issues found
: CheckResult-
- ERROR status if linter fails or unsupported tool specified
: CheckResult-
- SKIPPED status if the linting tool is not installed