Skip to content

fix(ci/clean-worktrees): suppress DCT002 on shutil.rmtree onerror tuple - #2814

Merged
zackees merged 1 commit into
masterfrom
fix/clean-worktrees-dct002-suppress
Jun 5, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/clean-worktrees-dct002-suppress

Conversation

@zackees

@zackees zackees commented Jun 5, 2026 •

Copy link
Copy Markdown
Member

Tiny follow-up to PRs #2796 + #2807 (both just merged this loop iteration).

The PlatformIO/DCT002 linter from #2807 now runs against the codebase and flags `_rmtree_onerror(func, path, exc_info)` in #2796's `ci/clean-worktrees.py` because of its 3-tuple type annotation on `exc_info`. But that signature is Python's documented `shutil.rmtree(onerror=...)` callback contract — replacing it with a dataclass would break that interface.

Suppress with a `# noqa: DCT002` and document the why so a future reader doesn't try to "fix" it.

Unblocks the stop hook lint stage that started failing after #2807 landed.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Enhanced internal documentation clarity in development tooling.

The `_rmtree_onerror(func, path, exc_info)` callback uses the 3-tuple
signature that Python's `shutil.rmtree(onerror=...)` contract requires.
Replacing it with a dataclass would break that interface, so the new
DCT002 linter (from PR #2807, just merged) flags it as a false positive.
Suppress with a `# noqa: DCT002` and document why.

Unblocks the stop hook lint stage that started failing after PR #2807
landed.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@zackees
zackees merged commit 669c016 into master Jun 5, 2026
6 of 7 checks passed
@coderabbitai

coderabbitai Bot commented Jun 5, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b74bfce6-8d42-492c-b0d5-fde8c9e69285

📥 Commits

Reviewing files that changed from the base of the PR and between 8a8cd4a and 223846d.

📒 Files selected for processing (1)
  • ci/clean-worktrees.py

📝 Walkthrough

Walkthrough

Updated the _rmtree_onerror function docstring in ci/clean-worktrees.py to explicitly document the required shutil.rmtree(onerror=...) 3-tuple callback signature (exctype, value, traceback) and clarify why the DCT002 complexity warning is suppressed on the callback parameter.

Changes

Error handler callback documentation clarification

Layer / File(s) Summary
rmtree error handler callback contract documentation
ci/clean-worktrees.py
_rmtree_onerror docstring expanded to document the required (exctype, value, traceback) 3-tuple callback signature for shutil.rmtree(onerror=...) and explain the DCT002 complexity warning suppression rationale.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A rabbit hops through docs with care,
Three tuples in the callback air,
exc_info now explained so clear,
No warnings loud for coders near! 🐰✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/clean-worktrees-dct002-suppress

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jun 5, 2026
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 5, 2026
@zackees
zackees deleted the fix/clean-worktrees-dct002-suppress branch August 21, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant