feat: add mypy command with grouped error output#109
feat: add mypy command with grouped error output#109pszymkowiak merged 3 commits intortk-ai:masterfrom
Conversation
|
Rust code ok, 4 items to address:
|
|
Thanks for the mypy support — this fits well in the Python tooling story alongside ruff/pytest/pip. The PR has a merge conflict with master — could you rebase? A lot has changed since Feb 13 (Python/Go support landed in 0.18.0). Once rebased, I'll do a proper review. The approach (grouped errors by file, top error codes summary) looks solid from the description. |
Add rtk mypy module that parses mypy type checker output, groups errors by file and error code, and produces compact summaries. Includes discovery registry pattern, hook rewrites, and 11 new tests (324 total). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove process docs (spec, plan, tasks, research, checklists) from specs/001-mypy-cmd/ and strip "Active Technologies" / "Recent Changes" sections from CLAUDE.md per PR rtk-ai#109 review feedback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Make lint_cmd.rs delegate to mypy_cmd::filter_mypy_output() instead of maintaining a separate, less capable implementation. The mypy_cmd version handles column numbers, note continuations, file-less errors, and shows full error details. Removes 145 lines of duplicate code + 2 redundant tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Addressed all 4 review items:
All 387 tests pass, including 11 mypy-specific tests. Zero new clippy warnings. |
|
@FlorianBruniaux All 4 review items have been addressed (see previous comment for details). Could you remove the |
|
Clean implementation. lazy_static! for regex, exit code preserved, python3 -m mypy fallback, no production unwrap(). Minor: which_command() duplicates an existing helper in utils.rs. Could use crate::utils::tool_exists() instead, but not a blocker. LGTM. |
Bug fixes (4): - fix(registry): move "fi"/"done" to IGNORED_EXACT to prevent shadowing find commands (rtk-ai#246) - fix(hook): filter docker compose rewrites to supported subcommands only (ps/logs/build), avoid hard failures on up/down/exec (rtk-ai#245) - fix(git): add is_blob_show_arg() to prevent duplicate output on git show rev:path style args (rtk-ai#248) - fix(go): surface build failures (build-output/build-fail/FailedBuild) in go test -json summary (rtk-ai#274) Features (2): - feat(mypy): add rtk mypy command with grouped error output, 80% token reduction; delegate from lint_cmd.rs; add hook rewrites and registry entries (rtk-ai#109) - feat(gain): add --project/-p flag to scope rtk gain stats to the current working directory; add shorten_path() display helper (rtk-ai#128) Tests: 501 passed (10 new tests added)
Summary
rtk mypycommand that parses mypy type checker output, groups errors by file (sorted by error count), shows top error codes summary, and preserves note continuation lines (~80% token reduction)mypyandpython -m mypyTest plan
mypy_cmdunit tests pass (grouped output, column numbers, top codes, single code, every error shown, note continuation, fileless errors, no errors, no file limit)test_classify_mypy,test_classify_python_m_mypy)test_patterns_rules_length_matchpasses (PATTERNS/RULES aligned at 22)cargo fmt --all --check && cargo clippy --all-targets && cargo test🤖 Generated with Claude Code