Repository navigation
Keep ruff out of the .claude worktrees - #38
Merged
Merged
Conversation
Running `uv run --frozen ruff check` from the repository root reported 181 errors, every one of them inside .claude/worktrees/. Claude Code keeps its git worktrees there, each a full copy of this repo at whatever commit it was cut from, and the ones predating the ruff adoption still hold the entire pre-format tree. Ruff was walking into all nine of them and reporting a checkout that is not this checkout. Nothing under .claude is gitignored -- it is merely untracked -- so ruff's usual .gitignore filtering never applied to it. This went unnoticed because neither place the linter had run so far can see that directory: the CI job runs against a fresh clone, which has no .claude/worktrees, and the adoption work itself was done from inside one of those worktrees, where the path does not exist either. Only a run from the main checkout's root reaches it. Excluding just .claude/worktrees rather than all of .claude keeps a future .claude/*.py of our own in scope. The setting is inert in CI, where the directory is absent. Verified from the main checkout root, where the failure actually reproduced: `ruff check` clean and 39 files already formatted, against 181 errors before. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Follow-up to #37. Running
uv run --frozen ruff checkfrom the repository root reports 181 errors — every one of them inside.claude/worktrees/, and none in the project itself.Cause
Claude Code keeps its git worktrees under
.claude/worktrees/, each a full copy of this repo at whatever commit it was cut from. Nine of them exist locally, and the ones predating #37 still contain the entire pre-format tree. Ruff was walking into all of them and reporting on a checkout that is not this checkout.Nothing under
.claudeis gitignored — it is merely untracked — so ruff's usual.gitignorefiltering never applied.Why #37 did not catch it
Neither place the linter had run can see that directory:
lintCI job runs against a fresh clone, which has no.claude/worktrees;Only a run from the main checkout's root reaches it — which is exactly how it was found.
Fix
Scoped to
worktreesrather than all of.claudeso a future.claude/*.pyof our own stays in scope. The setting is inert in CI, where the directory is absent.Verification
Run from the main checkout root, where the failure actually reproduced:
ruff checkruff format --checkOn the branch itself:
ruff checkclean, 38 files formatted, 366 passed / 36 skipped.🤖 Generated with Claude Code