Skip to content

refactor: split 4 files exceeding 800-line limit#118

Merged
forkwright merged 1 commit intomainfrom
refactor/file-splits
Mar 18, 2026
Merged

refactor: split 4 files exceeding 800-line limit#118
forkwright merged 1 commit intomainfrom
refactor/file-splits

Conversation

@forkwright
Copy link
Owner

Summary

  • harmonia-db play_history.rs (1575 lines) → play_history/{mod,tests}.rs; tests extracted as #[cfg(test)] mod tests; submodule
  • paroche opds/catalog.rs (1161 lines) → opds/catalog/{mod,tests}.rs; same pattern
  • harmonia-host tests/acquisition_integration.rs (1116 lines) → pipeline and startup-recovery tests extracted into tests/acquisition_integration/{pipeline_tests,recovery_tests}.rs via #[path] attributes
  • komide service.rs (817 lines) → service/{mod,tests}.rs; same pattern as the db/paroche splits

Test plan

  • cargo fmt --all -- --check passes
  • cargo clippy --workspace --all-targets -- -D warnings passes
  • cargo test --workspace passes (all tests pass, verified locally)
  • cargo test --workspace --doc passes
  • kanon lint . --rust reports zero RUST/file-too-long violations

Closes #1613

Observations

  • The task description mentions 45 files exceeding 800 lines; kanon lint found exactly 4 at the time of this work. The remaining 41 may be tracked under a different lint rule or were fixed separately.
  • acquisition_integration.rs required #[path = "..."] attributes because Rust 2024 module path resolution for integration test root files looks in the same directory, not a subdirectory named after the file. The #[path] attributes are explicit and correct.
  • A note in pipeline_retry_budget_exhaustion_marks_failed documents a known bug in SyntaxisService where ActiveEntry.retry_count resets to 0 on re-load; this was pre-existing and is preserved as-is.

Extract test modules from four files that violated the RUST/file-too-long
limit (800 lines):

- harmonia-db: play_history.rs (1575 lines) → play_history/{mod,tests}.rs
- paroche: opds/catalog.rs (1161 lines) → opds/catalog/{mod,tests}.rs
- harmonia-host: tests/acquisition_integration.rs (1116 lines) →
  extraction of pipeline_tests and recovery_tests into submodule files
- komide: service.rs (817 lines) → service/{mod,tests}.rs

All public APIs unchanged. Zero RUST/file-too-long violations remain.
All tests pass.

Closes #1613
@github-actions
Copy link
Contributor

⚠️ Large PR detected — 10 files, 5285 lines changed.

Consider splitting into smaller PRs for easier review. Not a blocker, just a signal.

@forkwright forkwright merged commit eb8f600 into main Mar 18, 2026
11 checks passed
@forkwright forkwright deleted the refactor/file-splits branch March 19, 2026 13:12
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