Skip to content

fix: remove 15 orphaned compatibility bridge files#23

Merged
stuckvgn merged 5 commits intomainfrom
fix/remove-orphaned-files
Apr 13, 2026
Merged

fix: remove 15 orphaned compatibility bridge files#23
stuckvgn merged 5 commits intomainfrom
fix/remove-orphaned-files

Conversation

@stuckvgn
Copy link
Copy Markdown

@stuckvgn stuckvgn commented Apr 12, 2026

Summary

  • Removes 15 underscore-prefixed compatibility shim files from desloppify/languages/_framework/treesitter/
  • All 15 are re-export bridges to canonical grouped-namespace locations (e.g., analysis.extractors, imports.graph, specs.compiled)
  • The package __init__.py docstring explicitly describes these as "compatibility shims only" and directs new code to the grouped namespaces
  • Static analysis (grep across entire codebase) confirms zero direct importers for any of the 15 files
  • Verified: desloppify.languages._framework.treesitter still imports cleanly after deletion

Deleted files and their canonical replacements

Deleted Canonical location
_compat_bridge.py (infrastructure for the shims — deleted last)
_complexity_function_metrics.py analysis.complexity_function_metrics
_complexity_nesting.py analysis.complexity_nesting
_extractors.py analysis.extractors
_import_cache.py imports.resolver_cache
_import_graph.py imports.graph
_import_resolvers_backend.py imports.resolvers_backend
_import_resolvers_functional.py imports.resolvers_functional
_import_resolvers_scripts.py imports.resolvers_scripts
_normalize.py imports.normalize
_smells.py analysis.smells
_specs_compiled.py specs.compiled
_specs_functional.py specs.functional
_specs_scripting.py specs.scripting
_unused_imports.py analysis.unused_imports

Test plan

  • Run python3.11 -m desloppify scan --skip-slow --profile ci post-merge
  • Confirm file health dimension improves and orphaned issue count decreases by 15
  • Confirm objective score stays ≥98

Summary by CodeRabbit

  • Refactor
    • Removed internal compatibility bridge modules and consolidated the codebase structure. This simplification improves code maintainability without affecting user-facing functionality.

All 15 deleted files are underscore-prefixed compatibility shims in
desloppify/languages/_framework/treesitter/ that re-exported symbols
from their canonical grouped-namespace locations via a _compat_bridge
helper. The package __init__.py docstring explicitly flags these as
\"compatibility shims only\" and instructs new code to import from the
grouped namespaces.

Static analysis confirms zero direct importers for any of the 15 files.
Deleted:
  _compat_bridge.py (infrastructure for the shims)
  _complexity_function_metrics.py → analysis.complexity_function_metrics
  _complexity_nesting.py → analysis.complexity_nesting
  _extractors.py → analysis.extractors
  _import_cache.py → imports.resolver_cache
  _import_graph.py → imports.graph
  _import_resolvers_backend.py → imports.resolvers_backend
  _import_resolvers_functional.py → imports.resolvers_functional
  _import_resolvers_scripts.py → imports.resolvers_scripts
  _normalize.py → imports.normalize
  _smells.py → analysis.smells
  _specs_compiled.py → specs.compiled
  _specs_functional.py → specs.functional
  _specs_scripting.py → specs.scripting
  _unused_imports.py → analysis.unused_imports
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 12, 2026

Warning

Rate limit exceeded

@stuckvgn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 24 minutes and 31 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 24 minutes and 31 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b7947ba5-a3c2-4755-a3c8-1f1f50520951

📥 Commits

Reviewing files that changed from the base of the PR and between 5064479 and 2b8a348.

📒 Files selected for processing (2)
  • desloppify/languages/_framework/treesitter/__init__.py
  • desloppify/languages/_framework/treesitter/_specs.py
📝 Walkthrough

Walkthrough

Deleted a centralized compatibility bridge utility (load_compat_exports) and 14 modules that relied on it to dynamically re-export canonical implementations. These compatibility shims duplicated a single forwarding pattern across the tree-sitter subsystem.

Changes

Cohort / File(s) Summary
Core Bridge Utility
desloppify/languages/_framework/treesitter/_compat_bridge.py
Removed the load_compat_exports helper function that dynamically imported modules, enumerated non-__ attributes, and populated caller namespaces with re-exported symbols.
Analysis Modules
desloppify/languages/_framework/treesitter/_complexity_function_metrics.py, _complexity_nesting.py, _extractors.py, _smells.py, _unused_imports.py
Removed compatibility shims that re-exported canonical implementations from analysis.* submodules via load_compat_exports.
Import Modules
desloppify/languages/_framework/treesitter/_import_cache.py, _import_graph.py, _import_resolvers_backend.py, _import_resolvers_functional.py, _import_resolvers_scripts.py, _normalize.py
Removed compatibility shims that re-exported canonical implementations from imports.* submodules via load_compat_exports.
Specs Modules
desloppify/languages/_framework/treesitter/_specs_compiled.py, _specs_functional.py, _specs_scripting.py
Removed compatibility shims that re-exported canonical implementations from specs.* submodules via load_compat_exports.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly summarizes the main change: removal of 15 orphaned compatibility bridge files. It matches the PR's primary objective and changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
No Hardcoded Secrets Or Credentials ✅ Passed All 15 deleted compatibility bridge files contain only re-export shims with no hardcoded secrets, API keys, tokens, passwords, or credentials.
No Speciesist Idioms ✅ Passed PR removes 15 deprecated shim files with no speciesist idioms in summary, objectives, or deletions.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/remove-orphaned-files
  • 🛠️ fix NAV violations: Commit on current branch
  • 🛠️ fix NAV violations: Create PR

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.

@stuckvgn
Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 12, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 12, 2026
@stuckvgn
Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 12, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Two import blocks were unsorted. Fix with ruff --fix to satisfy I001.
@stuckvgn
Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 12, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@stuckvgn stuckvgn merged commit 17a7214 into main Apr 13, 2026
13 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