Skip to content

Conversation

@sanity
Copy link
Collaborator

@sanity sanity commented Oct 28, 2025

Summary

Splits the 2214-line priority_select.rs into a cleaner, more maintainable structure:

  • priority_select.rs (313 lines) - implementation only
  • priority_select/tests.rs (1900 lines) - comprehensive test module

Why

Large files are a code smell. While not as extreme as Bob Martin's approach, 2200+ line files become difficult to navigate and maintain. This refactoring:

  • Improves navigation: Separate test file makes it easier to find production code
  • Modern Rust style: Uses module_name.rs + module_name/ pattern instead of mod.rs
  • Template for future work: Demonstrates approach for splitting other large files
  • Zero risk: Pure refactoring with no logic changes - all 13 tests pass

What Changed

  • Split priority_select.rspriority_select.rs + priority_select/tests.rs
  • Preserved all functionality and test coverage
  • Maintained existing module visibility (pub(super), etc.)

Test Plan

  • Build succeeds: cargo build --lib
  • All 13 tests pass: cargo test --lib priority_select
  • Formatting passes: cargo fmt --check
  • Clippy passes: cargo clippy
  • Pre-commit hooks pass

🤖 Generated with Claude Code

Splits the 2214-line priority_select.rs into a cleaner structure:
- priority_select.rs (313 lines) - implementation
- priority_select/tests.rs (1900 lines) - test module

Uses modern Rust module style (named file + directory) rather than
mod.rs pattern. This improves code organization and makes large test
suites easier to navigate without affecting functionality.

All 13 tests pass. No logic changes - pure refactoring.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@sanity sanity enabled auto-merge October 28, 2025 02:12
@sanity sanity added the C-tech-debt Category: Tech debt label Oct 28, 2025
@sanity sanity added this pull request to the merge queue Oct 28, 2025
Merged via the queue into main with commit e258dfa Oct 28, 2025
10 checks passed
@sanity sanity deleted the refactor/split-priority-select branch October 28, 2025 02:28
@sanity
Copy link
Collaborator Author

sanity commented Oct 28, 2025

Part of systematic file bloat reduction tracked in #2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-tech-debt Category: Tech debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants