Fix the rename that renamed itself
CI & Build / Build now, or wait for Android? (push) Successful in 2s
CI & Build / Python lint (push) Successful in 2s
CI & Build / TypeScript typecheck (push) Successful in 6s
CI & Build / Python tests (push) Successful in 9s
CI & Build / integration (push) Successful in 16s
CI & Build / Build & push image (push) Successful in 28s
CI & Build / Build now, or wait for Android? (push) Successful in 2s
CI & Build / Python lint (push) Successful in 2s
CI & Build / TypeScript typecheck (push) Successful in 6s
CI & Build / Python tests (push) Successful in 9s
CI & Build / integration (push) Successful in 16s
CI & Build / Build & push image (push) Successful in 28s
`sed s/_reconcile_tags/_lift_and_reconcile_tags/` ran over tags.py after the new function was already written with the new name, so the definition became `_lift_and_lift_and_reconcile_tags` while all 15 call sites were correct. Twelve test modules failed to import. The check that should have caught it is the reason it got through: the verification grep piped output through `sed 's/:.*_lift/: _lift/'`, which trims to the LAST `_lift` and therefore prints a doubled name identically to a correct one. A filter that can only make wrong output look right is worse than no filter. Same sed also clobbered the docstring's historical reference — it read "it used to be `_lift_and_reconcile_tags`", naming the function after itself. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -128,13 +128,13 @@ async def _find_or_create_label(db, owner_id, name: str):
|
|||||||
return label.id
|
return label.id
|
||||||
|
|
||||||
|
|
||||||
async def _lift_and_lift_and_reconcile_tags(db, note: Note) -> None:
|
async def _lift_and_reconcile_tags(db, note: Note) -> None:
|
||||||
"""Attach the note's tag labels, LIFT its standalone tags out of the body, and
|
"""Attach the note's tag labels, LIFT its standalone tags out of the body, and
|
||||||
re-derive display_title if the body moved.
|
re-derive display_title if the body moved.
|
||||||
|
|
||||||
NAMED FOR THE MUTATION. It used to be `_lift_and_reconcile_tags` and only touched rows;
|
NAMED FOR THE MUTATION. It used to be `_reconcile_tags` and only touched rows; it
|
||||||
it now rewrites `note.body`, and a caller that does not expect that will compute
|
now rewrites `note.body`, and a caller that does not expect that will compute a
|
||||||
a display_title from text this function is about to delete.
|
display_title from text this function is about to delete.
|
||||||
|
|
||||||
Which is why the lift and the re-derivation both live HERE rather than at the
|
Which is why the lift and the re-derivation both live HERE rather than at the
|
||||||
seven call sites that would each have to remember. Spreading a derived-value
|
seven call sites that would each have to remember. Spreading a derived-value
|
||||||
|
|||||||
Reference in New Issue
Block a user