Skip to content

loqs.tools.migrate.report

Shared result/reporting types for migrate.

Classes

Functions

annotate_manual_review

annotate_manual_review(source: str, manual_review: Sequence[ManualReviewItem]) -> tuple[str, list[ManualReviewItem]]

Insert a short comment directly above each flagged line in source, wrapped to at most two lines and explicitly naming v1.2 as the API-transition point, so a later reader of the migrated file itself -- not just this tool's own stdout, which is easy to lose track of once a run is over -- can find what still needs a look.

item.line in manual_review must already be relative to source itself (see remap_manual_review() if it isn't). Returns the annotated source alongside a matching, re-located copy of manual_review: inserting comment lines necessarily pushes every flagged code line further down, so a caller that reports or further processes these items afterward needs their corrected positions, not the ones relative to the un-annotated source passed in.


format_manual_review_block

format_manual_review_block(label: str, items: Sequence[ManualReviewItem]) -> str

format_rewrite_block

format_rewrite_block(label: str, items: Sequence[RewriteItem]) -> str

remap_manual_review

remap_manual_review(old_source: str, new_source: str, manual_review: Sequence[ManualReviewItem]) -> list[ManualReviewItem]

remap_rewrites

remap_rewrites(old_source: str, new_source: str, rewrites: Sequence[RewriteItem]) -> list[RewriteItem]