Skip to content

chore(cleanup): Phase 6 — dead code removal & cleanup#5

Merged
jyshnkr merged 1 commit intomainfrom
release
Mar 1, 2026
Merged

chore(cleanup): Phase 6 — dead code removal & cleanup#5
jyshnkr merged 1 commit intomainfrom
release

Conversation

@jyshnkr
Copy link
Copy Markdown
Owner

@jyshnkr jyshnkr commented Mar 1, 2026

  • filters: remove GLOBAL_SYNC_EXCLUDES (an include-list + single '- *' catch-all is sufficient and safer); add docstring explaining why to build_global_filter_args
  • filters: remove build_project_rsync_items (never called; callers use PROJECT_SYNC_ITEMS)
  • tests/test_filters: remove assertions against deleted constant and function; replace with test_project_sync_items_contains_expected
  • pyproject.toml: requires-python ">=3.10" → ">=3.9"; all modules use from __future__ import annotations making X|Y union syntax safe on 3.9

Summary by CodeRabbit

  • New Features

    • Expanded Python compatibility to support Python 3.9 and above (previously required 3.10+).
  • Refactor

    • Simplified internal filtering strategy by removing redundant exclusion mechanisms and consolidating filter logic.

- filters: remove GLOBAL_SYNC_EXCLUDES (an include-list + single '- *' catch-all
  is sufficient and safer); add docstring explaining why to build_global_filter_args
- filters: remove build_project_rsync_items (never called; callers use PROJECT_SYNC_ITEMS)
- tests/test_filters: remove assertions against deleted constant and function;
  replace with test_project_sync_items_contains_expected
- pyproject.toml: requires-python ">=3.10" → ">=3.9"; all modules use
  `from __future__ import annotations` making X|Y union syntax safe on 3.9

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Remove dead code and simplify filter logic

✨ Enhancement 🧪 Tests

Grey Divider

Walkthroughs

Description
• Remove unused GLOBAL_SYNC_EXCLUDES constant; simpler include-list approach
• Delete unused build_project_rsync_items function never called by code
• Enhance build_global_filter_args docstring explaining filter strategy
• Update test suite to match removed code and add PROJECT_SYNC_ITEMS validation
• Lower Python requirement from 3.10 to 3.9 using __future__ annotations
Diagram
flowchart LR
  A["GLOBAL_SYNC_EXCLUDES<br/>removed"] --> B["Simpler filter<br/>strategy"]
  C["build_project_rsync_items<br/>deleted"] --> B
  B --> D["Enhanced docstring<br/>in build_global_filter_args"]
  E["Test suite<br/>updated"] --> F["Removed assertions<br/>for deleted code"]
  E --> G["Added PROJECT_SYNC_ITEMS<br/>validation test"]
  H["Python 3.10 → 3.9<br/>requirement"] --> I["__future__ annotations<br/>enable compatibility"]
Loading

Grey Divider

File Changes

1. src/claudesync/filters.py ✨ Enhancement +8/-29

Remove dead code and improve filter documentation

• Removed GLOBAL_SYNC_EXCLUDES constant (34 lines) as it's redundant with include-list approach
• Deleted build_project_rsync_items function (never called; callers use PROJECT_SYNC_ITEMS directly)
• Enhanced build_global_filter_args docstring explaining why only includes list is needed
• Updated filter comment from "Exclude everything else" to clarify catch-all behavior

src/claudesync/filters.py


2. tests/test_filters.py 🧪 Tests +4/-21

Update tests for removed code and functions

• Removed imports for deleted build_project_rsync_items and GLOBAL_SYNC_EXCLUDES
• Deleted test_project_rsync_items test function (tests deleted function)
• Deleted test_global_sync_excludes_debug and test_global_sync_excludes_cache tests
• Deleted test_global_sync_excludes_plugins_cache test
• Added test_project_sync_items_contains_expected to validate PROJECT_SYNC_ITEMS contents

tests/test_filters.py


3. pyproject.toml ⚙️ Configuration changes +1/-1

Lower minimum Python version to 3.9

• Lowered requires-python from ">=3.10" to ">=3.9"
• All modules use from __future__ import annotations making X|Y union syntax safe on Python 3.9

pyproject.toml


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review bot commented Mar 1, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b662ec3 and 5dd5f88.

📒 Files selected for processing (3)
  • pyproject.toml
  • src/claudesync/filters.py
  • tests/test_filters.py

📝 Walkthrough

Walkthrough

This PR lowers the minimum Python version requirement to 3.9, removes the unused GLOBAL_SYNC_EXCLUDES constant and build_project_rsync_items() function from the filters module, and simplifies the exclusion strategy in build_global_filter_args() to rely solely on GLOBAL_SYNC_INCLUDES with a catch-all filter rule.

Changes

Cohort / File(s) Summary
Configuration
pyproject.toml
Lowered minimum supported Python version from 3.10 to 3.9 in the requires-python field.
Filters Module
src/claudesync/filters.py
Removed GLOBAL_SYNC_EXCLUDES constant and build_project_rsync_items() function; updated build_global_filter_args() docstring to reflect new exclusion strategy using GLOBAL_SYNC_INCLUDES with a catch-all "- *" rule.
Tests
tests/test_filters.py
Removed imports and tests for build_project_rsync_items and GLOBAL_SYNC_EXCLUDES; replaced test_project_rsync_items with test_project_sync_items_contains_expected to validate ".claude/settings.json" presence in PROJECT_SYNC_ITEMS.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

🐰 Exclusions simplified, the old ways gone,
GLOBAL_SYNC_EXCLUDES hopped along—
Now a catch-all wildcard takes the stage,
Python nine or higher writes the page!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title broadly references 'dead code removal & cleanup' which aligns with the PR's main objectives of removing GLOBAL_SYNC_EXCLUDES, build_project_rsync_items function, and associated tests, though it doesn't specify the Python version lowering change.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch release

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

@jyshnkr jyshnkr merged commit 7dbb739 into main Mar 1, 2026
3 checks passed
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.

1 participant