feat(python): add strict ruff + pyright overlay - #17
Conversation
Re-derive (not port) the Python tooling configs from medley against the official Ruff and Pyright docs, leaning strict (warnings-as-errors) and consistent across the two tools. - ruff.toml: strict curated select (adds S, ASYNC, DTZ, ARG, RET, TID, PIE, PERF, LOG, G, PLE); ban relative imports; drop fix=true (no silent CI mutation) and the target-version pin (inherit requires-python); drop the datetime.now banned-api entry (DTZ owns datetime-awareness and permits the correct tz-aware form). - pyrightconfig.json: ruleset-only base; strict plus escalations of rules strict leaves at none; reportUnusedImport/Variable -> none so Ruff is the sole owner of unused-symbol findings. Project-scope keys stripped and documented for consumers. - fixtures + python.test.sh: good passes both engines clean; bad flags the config-specific codes, proving the rulesets load. - ci.yml: python lane (uv, pinned ruff/pyright) wired into ci-status. - migration-plan: correct the source branch to main; mark Python done. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 459be00db9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| `target-version` (Ruff) and `pythonVersion` (Pyright) are intentionally omitted: | ||
| each consuming repo's `requires-python` / active interpreter drives them, so the | ||
| base is correct for any Python floor. |
There was a problem hiding this comment.
Require Pyright's Python version to be set
For projects whose supported floor is below the Pyright default or runner interpreter, this guidance leaves Pyright analyzing against the wrong Python version: Pyright does not read [project].requires-python from pyproject.toml, so a repo declaring >=3.10 can still pass 3.12-only syntax unless pythonVersion or --pythonversion is supplied. Since this module tells adopters to omit pythonVersion, the shared standard will silently miss version-incompatible code in those consumers.
Useful? React with 👍 / 👎.
…tch-item (#36) claude-code-plugins onboarded to the CI platform (consumer PR #4; org ci-gate armed via github-iac PR #17). Update the rollout adoption table, per-repo note, and sequence (next: medley), and tick the Phase 6 checkbox in plan.md. Also reconcile architecture D6: the visibility watch-item is resolved by making ci-workflows public (a public consumer can only `uses:` public repos), so the "keep everything private" implication no longer holds for public providers. The constraints for any provider kept private are retained. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
What
Adds the Python language overlay (
modules/python/) — Phase 3 ofdocs/migration-plan.md. Configs are re-derived against official Ruff and Pyright docs, not ported verbatim from medley: leaning strict (warnings-as-errors) and consistent across the two tools.Highlights
ruff.toml— strict curatedselect(addsS, ASYNC, DTZ, ARG, RET, TID, PIE, PERF, LOG, G, PLE); bans relative imports; dropsfix=true(no silent CI mutation) and thetarget-versionpin (inheritsrequires-python); drops the self-contradictorydatetime.nowban (DTZ owns datetime-awareness and permits the correct tz-aware form). Opt-in groups (TC/FBT/INP/D) documented, not forced.pyrightconfig.json— ruleset-only base;strictplus escalation of rules strict leaves atnone;reportUnusedImport/reportUnusedVariable→noneso Ruff is the sole owner of unused-symbol findings. All project-scope keys stripped and documented for consumers.python.test.sh— good passes both engines clean; bad flags the config-specific codes (TID251/DTZ005,reportMissingParameterType/reportAssignmentType), proving the rulesets actually load. Verified empirically via pinneduvx.ci.yml— newpythonlane (uv, pinnedruff 0.15.14/pyright 1.1.409) wired into theci-statusgateway.docs/migration-plan.md— corrects the migration source branch (chore/reset-to-template→main); marks Python done.Notes
No
ci-workflowsPython composite action exists yet, so the lane installs pinned engines inline viauv(mirroring the other inline-installed tool lanes). The composite action is the remaining execution work for that repo.🤖 Generated with Claude Code