Skip to content

refactor(core): normalize WalkBuilder paths at source to eliminate ./ prefix#9

Merged
StudentWeis merged 1 commit into
mainfrom
refactor/8-normalize-walkbuilder-paths
Apr 25, 2026
Merged

refactor(core): normalize WalkBuilder paths at source to eliminate ./ prefix#9
StudentWeis merged 1 commit into
mainfrom
refactor/8-normalize-walkbuilder-paths

Conversation

@StudentWeis
Copy link
Copy Markdown
Owner

Summary

Normalize WalkBuilder output paths at the source (collect_markdown_files) by stripping the ./ prefix, then remove the canonical_plan_key / find_matching_plan_key workaround from mv.rs that was only necessary because of this inconsistency.

Linked Issue

Closes #8

Changes

  • src/core/util.rs: collect_markdown_files now strips the leading ./ that WalkBuilder produces when root is ".", so every returned path matches the shape a user would type on the command line.
  • src/core/mv.rs: removed canonical_plan_key, find_matching_plan_key, and the resolve_path import. All ReplacementPlan key operations (remove, contains_key, inequality checks) revert to plain HashMap lookups.
  • tests/lib_find_tests.rs: new test test_find_references_paths_have_no_dot_slash_prefix locks in the invariant. The two fix(mv): mv fails when source has a self-reference and path shape differs from WalkBuilder output #6 regression tests (test_mv_relative_source_with_self_reference_succeeds, test_mv_relative_source_rewrites_external_reference) continue to pass, confirming the source-level fix is sufficient.

Testing

… prefix

collect_markdown_files now strips the leading './' that WalkBuilder produces
when root is '.', so every returned path matches the shape a user would type
on the command line.

With this normalisation in place the transient canonical_plan_key /
find_matching_plan_key workaround from #7 is redundant — all ReplacementPlan
key operations revert to plain HashMap lookups, honouring KISS.

The two regression tests from #6 continue to pass, confirming the source-level
fix is sufficient. A new test locks in the 'no ./ prefix' invariant.

Refs #8
@StudentWeis StudentWeis merged commit d6e0c7d into main Apr 25, 2026
8 checks passed
@StudentWeis StudentWeis deleted the refactor/8-normalize-walkbuilder-paths branch April 25, 2026 12:02
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(core): normalize WalkBuilder paths at the source to eliminate ./ prefix inconsistency

1 participant