diff --git a/plugins/toolchain/.claude-plugin/plugin.json b/plugins/toolchain/.claude-plugin/plugin.json index ec49d5f1a6..9313543ec6 100644 --- a/plugins/toolchain/.claude-plugin/plugin.json +++ b/plugins/toolchain/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json", "name": "toolchain", - "version": "0.6.0", + "version": "0.7.0", "description": "Repo-agnostic polyglot verification toolchain: build + test + lint for changed files across .NET, Python, TypeScript, Bash, PowerShell, Markdown, YAML, and cross-cutting surfaces (`/toolchain:check`, `/toolchain:lint`), plus a re-runnable `/toolchain:setup` with check (report the configured ecosystems and their command surface) and apply (interview, infer, and write the tracked per-ecosystem command config those skills resolve first).", "author": { "name": "Melodic Software", diff --git a/plugins/toolchain/CHANGELOG.md b/plugins/toolchain/CHANGELOG.md index 34e2da30ab..7a93733147 100644 --- a/plugins/toolchain/CHANGELOG.md +++ b/plugins/toolchain/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to the `toolchain` plugin are documented here. Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); this plugin uses semantic versioning. +## [0.7.0] + +### Added + +- **`pyright` added to the bundled Python ecosystem default's `check-cmd`.** Local `/toolchain:check` + now runs `uv run pyright` alongside the existing ruff lint/format check, closing the gap where CI + gated pyright but the local batch was ruff-only. Rung-4 fallback only — a consumer's own + `.claude/ecosystems/python.yaml` overrides `check-cmd` key-by-key and is unaffected. `fix-cmd` is + unchanged (pyright has no fix mode). `context/python.md` documents the default standard-mode gotcha + for untyped projects. + ## [0.6.0] ### Added diff --git a/plugins/toolchain/reference/ecosystems/python.yaml b/plugins/toolchain/reference/ecosystems/python.yaml index ec98392558..f3a9ddad4f 100644 --- a/plugins/toolchain/reference/ecosystems/python.yaml +++ b/plugins/toolchain/reference/ecosystems/python.yaml @@ -5,7 +5,7 @@ globs: ["*.py", "pyproject.toml", "uv.lock"] project-discovery: ["pyproject.toml"] build-cmd: null # no separate build step; lint/test cover verification test-cmd: "uv run pytest -x -q" # plain pytest when the project doesn't use uv -check-cmd: "uv run ruff check . --no-fix && uv run ruff format . --check" -fix-cmd: "uv run ruff check . --fix && uv run ruff format ." -opt-in: "ruff config (ruff.toml, .ruff.toml, or pyproject.toml [tool.ruff])" -install-hint: "pip install ruff uv | brew install uv ruff | winget install astral-sh.uv" +check-cmd: "uv run ruff check . --no-fix && uv run ruff format . --check && uv run pyright" +fix-cmd: "uv run ruff check . --fix && uv run ruff format ." # pyright has no fix mode +opt-in: "ruff config (ruff.toml, .ruff.toml, or pyproject.toml [tool.ruff]); pyright runs in its default standard mode absent a pyrightconfig.json or pyproject.toml [tool.pyright]" +install-hint: "pip install ruff pyright uv | brew install uv ruff pyright | winget install astral-sh.uv" diff --git a/plugins/toolchain/skills/check/context/python.md b/plugins/toolchain/skills/check/context/python.md index e0c9129212..4109f604d1 100644 --- a/plugins/toolchain/skills/check/context/python.md +++ b/plugins/toolchain/skills/check/context/python.md @@ -26,7 +26,9 @@ cd "$PROJECT_DIR" && uv run ruff format . cd "$PROJECT_DIR" && uv run pytest tests/ -x -q ``` -## Type check (when configured) +## Type check + +Part of `check-cmd` (no fix mode — `fix-cmd` only runs the two ruff commands): ```bash cd "$PROJECT_DIR" && uv run pyright @@ -36,6 +38,7 @@ cd "$PROJECT_DIR" && uv run pyright - **Use `uv run` prefix in uv-managed projects** (a `uv.lock` is the signal) — it ensures the managed virtualenv is used. In pip/poetry projects, use that project's documented invocation instead - **E501 (line-too-long) is not auto-fixable** — the formatter handles code wrapping, but docstrings/comments/string literals exceeding the configured `line-length` must be shortened manually +- **pyright runs in its default standard mode absent a `pyrightconfig.json` or `pyproject.toml [tool.pyright]`** — on an untyped or partially-typed project this can surface genuine type errors; set `typeCheckingMode` (e.g. `basic` or `off`) or add project config to tune the strictness rather than suppressing findings ad hoc - **Run from project directory** — each `pyproject.toml` defines an independent project root. Always `cd` to the directory containing `pyproject.toml` before running commands - **`encoding='utf-8'`** — always specify on Windows `open()` calls