Skip to content

MPT-22214 exclude .claude so local make check passes with worktrees#348

Merged
jentyk merged 2 commits into
mainfrom
claude/optimistic-hopper-799372
Jun 16, 2026
Merged

MPT-22214 exclude .claude so local make check passes with worktrees#348
jentyk merged 2 commits into
mainfrom
claude/optimistic-hopper-799372

Conversation

@jentyk

@jentyk jentyk commented Jun 15, 2026

Copy link
Copy Markdown
Member

Jira: MPT-22214

What

Add .claude to the [tool.flake8] extend-exclude list in pyproject.toml (one line, alongside the existing .venv entry).

Why

make check (which runs flake8 . 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 any per-file-ignores pattern, so the lint fails.

Root cause: .claude is gitignored, so ruff (exclude_gitignore = true) and mypy skip it, but flake8 has no gitignore awareness and .claude was not in extend-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/:

  • Before (.claude not excluded): flake8 flags the dummy file and exits 1 — bug reproduced.
  • After (this change): flake8 no longer flags it.
  • Full make check passes end to end: ruff format --check, ruff check, flake8, mypy, and uv lock --check all green with a nested worktree present.

Change is minimal and scoped to the flake8 config.

🤖 Generated with Claude Code

Closes MPT-22214

Release Notes

  • Added .claude to Flake8’s [tool.flake8].extend-exclude in pyproject.toml so flake8 ignores nested Claude Code worktree checkouts under .claude/worktrees/
  • Fixes local make check failures caused by flake8 linting code within those worktree directories (CI remains unaffected on clean checkouts)

@jentyk jentyk requested a review from a team as a code owner June 15, 2026 09:10
@jentyk jentyk requested review from albertsola and svazquezco June 15, 2026 09:10
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds .claude to the extend-exclude list in the [tool.flake8] configuration section of pyproject.toml, preventing Flake8 from linting that directory.

Changes

Flake8 Configuration Update

Layer / File(s) Summary
Add .claude to Flake8 extend-exclude
pyproject.toml
.claude is appended to the extend-exclude list under [tool.flake8].

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~1 minute


🔕 Pre-merge checks override applied

The pre-merge checks have been overridden successfully. You can now proceed with the merge.

Overridden by @jentyk via checkbox on 2026-06-15T09:23:50.980Z.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Pr And Commit Formatting ❌ Error [IGNORED] PR title does not follow required format. Title has structure <type>(<scope>): <description> (JIRA-ID) but should be <JIRA-ID> <short summary> with JIRA ID at the start, not end. Change PR title from chore(flake8): exclude .claude so local make check passes with worktrees (MPT-22214) to MPT-22214 exclude .claude so local make check passes with worktrees.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Documentation Up To Date ✅ Passed Configuration-only change with no documented behavior impact; the .claude directory and worktree workflow are not mentioned in any documentation, so no docs update is required.

Comment @coderabbitai help to get the list of available commands and usage tips.

…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>
@jentyk jentyk force-pushed the claude/optimistic-hopper-799372 branch from 766bcc8 to 579e78d Compare June 15, 2026 09:19
@jentyk jentyk changed the title chore(flake8): exclude .claude so local make check passes with worktrees chore(flake8): exclude .claude so local make check passes with worktrees (MPT-22214) Jun 15, 2026
@jentyk jentyk changed the title chore(flake8): exclude .claude so local make check passes with worktrees (MPT-22214) MPT-22214 exclude .claude so local make check passes with worktrees Jun 15, 2026
@sonarqubecloud

Copy link
Copy Markdown

@jentyk

jentyk commented Jun 16, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai approve

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
✅ Action performed

Comments resolved and changes approved.

@jentyk jentyk merged commit 9d963df into main Jun 16, 2026
4 checks passed
@jentyk jentyk deleted the claude/optimistic-hopper-799372 branch June 16, 2026 12:16
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.

2 participants