Skip to content

feat: add mypy command with grouped error output#109

Open
Rmohid wants to merge 3 commits intortk-ai:masterfrom
Rmohid:001-mypy-cmd
Open

feat: add mypy command with grouped error output#109
Rmohid wants to merge 3 commits intortk-ai:masterfrom
Rmohid:001-mypy-cmd

Conversation

@Rmohid
Copy link

@Rmohid Rmohid commented Feb 13, 2026

Summary

  • Add rtk mypy command 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)
  • Add discovery registry pattern and hook rewrites for mypy and python -m mypy
  • 11 new tests (324 total), all passing

Test plan

  • All 9 mypy_cmd unit tests pass (grouped output, column numbers, top codes, single code, every error shown, note continuation, fileless errors, no errors, no file limit)
  • Both registry tests pass (test_classify_mypy, test_classify_python_m_mypy)
  • test_patterns_rules_length_match passes (PATTERNS/RULES aligned at 22)
  • Full pre-commit gate: cargo fmt --all --check && cargo clippy --all-targets && cargo test

🤖 Generated with Claude Code

@pszymkowiak
Copy link
Collaborator

Rust code ok, 4 items to address:

  1. Remove specs/ — 533 lines of process docs (spec, plan, tasks, research, checklists). Should not be in the repo.
  2. Clean CLAUDE.md — remove the "Active Technologies" and "Recent Changes" sections added at the bottom. Keep only the module table entry.
  3. Duplicate rtk lint mypy — already merged in feat(python): add lint dispatcher + universal format command #100. Either remove the duplicate parser in lint_cmd.rs or have it delegate to mypy_cmd.
  4. Rebase needed — mergeStateStatus: UNSTABLE.

@FlorianBruniaux
Copy link
Collaborator

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.

Robert Mohid and others added 3 commits February 17, 2026 21:08
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>
@Rmohid
Copy link
Author

Rmohid commented Feb 18, 2026

Addressed all 4 review items:

  1. Removed specs/ -- deleted all 5 process doc files (spec, plan, tasks, research, checklists)
  2. Cleaned CLAUDE.md -- removed "Active Technologies" and "Recent Changes" sections; kept only the mypy module table entry
  3. Deduplicated mypy handler -- made mypy_cmd::filter_mypy_output() public and lint_cmd.rs now delegates to it (removed 145 lines of duplicate code + 2 redundant tests). The mypy_cmd version is more capable: handles column numbers, note continuations, file-less errors, and shows full error details
  4. Rebased on master (c29644b, v0.21.1)

All 387 tests pass, including 11 mypy-specific tests. Zero new clippy warnings.

@Rmohid Rmohid closed this Feb 20, 2026
@Rmohid Rmohid reopened this Feb 20, 2026
@Rmohid
Copy link
Author

Rmohid commented Feb 20, 2026

@FlorianBruniaux All 4 review items have been addressed (see previous comment for details). Could you remove the awaiting-changes label and merge when ready? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments