← ClaudeAtlas

dhpk-python-static-checkslisted

Static-check strategy for Python — ruff rule selection (lint vs format), pyright-strict vs mypy trade-offs, progressive typing adoption, per-file/per-line suppression discipline, and how the dhpk python module's post-edit + pre-commit hooks invoke them. Use when configuring ruff/pyright/mypy or triaging their output. Not for runtime debugging or test design; use dhpk-python-pro or dhpk-pytest-async. Output: a tool configuration or triage plan with commands and pass/fail gates.
hmj1026/dhpk · ★ 2 · Code & Development · score 71
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. -