verify: update notes at their original path#5
Open
mconsalvo95-tech wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1.
This keeps
verify --updatefrom creating a second note file when the note's current filename does not match the canonical{id}-{topic}.mdname.The update path already knows which file was checked through
NoteStatus.path, but the healed note was being written throughwrite_note(), which derives the output filename from the note frontmatter. This now writes the updated frontmatter/body back to the same note file that was checked.I also added a regression test that renames a note file, drifts its reference, runs
verify --update, and asserts that only the renamed file remains and a follow-upverify --checkis clean.Checks:
uv run --extra dev pytest tests\test_cli_v09_update.py::TestUpdateWritesOriginalNotePath::test_update_keeps_mismatched_note_filename -quv run --extra dev pytest tests\test_cli_v09_update.py -quv run --extra dev ruff checkuv run --extra dev ruff format --checkuv run --extra dev pytest -q(local Windows: 322 passed, 1 pre-existing executable-bit assertion failure intests/test_githook.py::TestInstallGitHook::test_fresh_install)uv run --extra dev fieldnotes verify --check(local Windows checkout reports pre-existing stale fieldnotes; same result before this change)