Skip to content

refactor: clean up cycles.rs code quality#65

Merged
userFRM merged 1 commit intomainfrom
refactor/cycles-cleanup
Feb 27, 2026
Merged

refactor: clean up cycles.rs code quality#65
userFRM merged 1 commit intomainfrom
refactor/cycles-cleanup

Conversation

@userFRM
Copy link
Owner

@userFRM userFRM commented Feb 27, 2026

Summary

  • Replaced hand-rolled glob_match() with ignore::gitignore::Gitignore — same API used by rpg-encoder/src/evolution.rs for .rpgignore handling
  • Extracted ~130 lines of inline TOON formatting from detect_cycles tool handler into format_cycle_report() in toon.rs, matching the format_health_report() pattern
  • Replaced CycleConfig's project_root + ignore_rpgignore fields with excluded_paths: Option<Gitignore>, moving .rpgignore loading to the MCP layer

Closes #64

Test plan

  • cargo build --workspace passes
  • cargo build --workspace --no-default-features passes (ARM64 path)
  • cargo clippy --workspace --all-targets -- -D warnings clean
  • cargo fmt --all -- --check clean
  • cargo test --workspace — all tests pass
  • Behavioral parity: cycle detection, rpgignore filtering, TOON output format unchanged

🤖 Generated with Claude Code

… formatting, reuse ignore crate

1. Removed hand-rolled glob_match() in favor of the `ignore` crate's
   Gitignore matcher — same API used by rpg-encoder's evolution.rs for
   .rpgignore handling. Added `ignore` as a dependency to rpg-nav.

2. Extracted ~130 lines of inline TOON formatting from the detect_cycles
   tool handler in tools.rs into format_cycle_report() in toon.rs,
   matching the existing format_health_report() pattern.

3. Replaced CycleConfig's project_root + ignore_rpgignore fields with a
   single excluded_paths: Option<Gitignore>, moving .rpgignore loading
   responsibility to the MCP layer where it belongs.

Closes #62

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@userFRM userFRM merged commit 2001a60 into main Feb 27, 2026
3 checks passed
@userFRM userFRM deleted the refactor/cycles-cleanup branch February 27, 2026 13:20
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.

refactor: clean up cycles.rs code quality issues

1 participant