MPT-22214 exclude .claude so local make check passes with worktrees#348
Merged
Conversation
📝 WalkthroughWalkthroughAdds ChangesFlake8 Configuration Update
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~1 minute 🔕 Pre-merge checks override appliedThe pre-merge checks have been overridden successfully. You can now proceed with the merge. Overridden by ❌ Failed checks (1 error)
✅ Passed checks (3 passed)
Comment |
…ees (MPT-22214) flake8 has no gitignore awareness (unlike ruff's exclude_gitignore and mypy's tests exclude), so it descends into the nested full-repo checkouts under .claude/worktrees/<name>/ created by the Claude Code worktree workflow and reports WPS violations on paths that match no per-file-ignores pattern. This breaks `make check` locally. CI is unaffected because it runs on a clean checkout without nested worktrees. Add .claude to the [tool.flake8] extend-exclude list, alongside the existing .venv entry. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
766bcc8 to
579e78d
Compare
albertsola
approved these changes
Jun 16, 2026
|
Member
Author
|
@coderabbitai approve |
✅ Action performedComments resolved and changes approved. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Jira: MPT-22214
What
Add
.claudeto the[tool.flake8] extend-excludelist inpyproject.toml(one line, alongside the existing.venventry).Why
make check(which runsflake8 .in Docker) fails locally whenever git worktrees exist under.claude/worktrees/— the directory the Claude Code worktree workflow uses. flake8 scans those nested full-repo checkouts and reports WPS violations (e.g. WPS432 magic numbers, WPS235 too many imports) on paths like.claude/worktrees/<name>/tests/.... Those paths don't match anyper-file-ignorespattern, so the lint fails.Root cause:
.claudeis gitignored, so ruff (exclude_gitignore = true) and mypy skip it, but flake8 has no gitignore awareness and.claudewas not inextend-exclude. CI is unaffected because it runs on a clean checkout without nested worktrees — this only impacts local development for anyone using the worktree workflow.Verification
flake8 runs inside Docker via
make check. With a dummy WPS-violating file placed under.claude/worktrees/_dummy_verify/tests/:.claudenot excluded): flake8 flags the dummy file and exits 1 — bug reproduced.make checkpasses end to end:ruff format --check,ruff check,flake8,mypy, anduv lock --checkall green with a nested worktree present.Change is minimal and scoped to the flake8 config.
🤖 Generated with Claude Code
Closes MPT-22214
Release Notes
.claudeto Flake8’s[tool.flake8].extend-excludeinpyproject.tomlso flake8 ignores nested Claude Code worktree checkouts under.claude/worktrees/make checkfailures caused by flake8 linting code within those worktree directories (CI remains unaffected on clean checkouts)