Skip to content

feat(python): add strict ruff + pyright overlay - #17

Merged
kyle-sexton merged 1 commit into
mainfrom
feat/python-overlay
Jun 23, 2026
Merged

feat(python): add strict ruff + pyright overlay#17
kyle-sexton merged 1 commit into
mainfrom
feat/python-overlay

Conversation

@kyle-sexton

Copy link
Copy Markdown
Contributor

What

Adds the Python language overlay (modules/python/) — Phase 3 of docs/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 curated select (adds S, ASYNC, DTZ, ARG, RET, TID, PIE, PERF, LOG, G, PLE); bans relative imports; drops fix=true (no silent CI mutation) and the target-version pin (inherits requires-python); drops the self-contradictory datetime.now ban (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; strict plus escalation of rules strict leaves at none; reportUnusedImport/reportUnusedVariablenone so Ruff is the sole owner of unused-symbol findings. All project-scope keys stripped and documented for consumers.
  • Fixtures + 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 pinned uvx.
  • ci.yml — new python lane (uv, pinned ruff 0.15.14 / pyright 1.1.409) wired into the ci-status gateway.
  • docs/migration-plan.md — corrects the migration source branch (chore/reset-to-templatemain); marks Python done.

Notes

No ci-workflows Python composite action exists yet, so the lane installs pinned engines inline via uv (mirroring the other inline-installed tool lanes). The composite action is the remaining execution work for that repo.

🤖 Generated with Claude Code

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>
@kyle-sexton
kyle-sexton merged commit 7d2331a into main Jun 23, 2026
15 checks passed
@kyle-sexton
kyle-sexton deleted the feat/python-overlay branch June 23, 2026 04:07

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread modules/python/README.md
Comment on lines +34 to +36
`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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

kyle-sexton added a commit that referenced this pull request Jun 24, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant