dhpk-python-static-checkslisted
Install: claude install-skill hmj1026/dhpk
# Python Static Checks
How to configure and reason about the Python tooling the `python` dhpk module
drives. The module never bundles config — it runs the project's own
`pyproject.toml` via the configured runner (`uv run` by default).
## ruff — lint + format in one tool
- **Two commands, one tool:** `ruff check` (lint) and `ruff format` (Black-compatible
formatter). The hooks run both; CI should too.
- **Rule selection** lives in `[tool.ruff.lint] select = [...]`. A solid baseline
(ccas uses it): `E` (pycodestyle), `F` (pyflakes), `I` (isort/import order),
`N` (pep8-naming), `W` (warnings), `UP` (pyupgrade — modern-syntax nudges).
Add `B` (bugbear), `S` (bandit security), `ASYNC` as the codebase matures.
- **Per-line suppression:** `# noqa: E501` (specific code, never bare `# noqa`).
**Per-file:** `[tool.ruff.lint.per-file-ignores]` (e.g. allow unused imports in
`__init__.py`, asserts in `tests/`).
- Keep `line-length` and `target-version` in `pyproject.toml` so editor, hook, and
CI agree. `ruff check --fix` and `ruff format` auto-resolve most findings.
## Type checking — pyright vs mypy
- The module's `python_typechecker` knob selects `pyright` (default), `mypy`, or
`none`. Pick one and gate on it; running both doubles noise.
- **pyright:** fast, excellent inference, `strict` mode is aggressive. Configure in
`pyproject.toml` `[tool.pyright]` (or `pyrightconfig.json`): set `pythonVersion`,
`venvPath`/`venv`, and `typeCheckingMode`. ccas runs strict.
-