Repository navigation
refactor: move the insert and paragraph-split methods into a RevisionManager mixin (ROADMAP.md #73) - #92
Conversation
|
Warning Review limit reachedNext included review available in 48 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #92 +/- ##
=====================================
Coverage 97.9% 98.0%
=====================================
Files 20 21 +1
Lines 5058 5067 +9
Branches 984 984
=====================================
+ Hits 4956 4969 +13
+ Misses 48 46 -2
+ Partials 54 52 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
What
insert_text_after,insert_text_beforeand the fifteen private insert and paragraph-split helpers move out ofmanager.pyintodocx_editor/track_changes/insert.pyas_InsertMixin;RevisionManagergains it as its sixth base. Behaviour is unchanged.Why
ROADMAP.md #73: one concern per module.
manager.pydrops from 1570 to 1144 lines and now holds only the location context, the listing/query methods and the resolution cluster.How
Method bodies are byte-identical (
scripts/check_pure_move.py --base main: 3/3 ok), including the@staticmethodon_plain_run_xmland the_apply_paragraph_splitsbody that ROADMAP.md #79 will fix separately.manager.pyloses only the ten imports the cluster used exclusively (RevisionError,TextMapMatch,_escape_xml,_reject_control_chars,get_rPr_xml,rebuild_run_fragments,render_plain_wt,_first_content_child,_set_xml_space_preserve,_RUN_TRACK_CHANGE_TAGS).base.pygains two verbatim stubs for the cross-cluster callees the mixin reaches throughself:_rewrite_insert_at(batch) and_split_foreign_ins_at(delete)._rejoin_paragraphstays inmanager.py: it is only called from the resolution path.Start with
insert.py(the moved block) and theRevisionManagerbases line inmanager.py.Testing
tests/test_track_changes_coverage.py(TestInsertNearMatchEmptyPositions) for the two_insert_near_matchguards nothing exercised before: a match with no positions and an edge<w:t>with no run.insert.pyreports 100% lines and branches on the insert-related test set (876 passed).ruff check,ruff format --check, andty check(the 7 pre-existing diagnostics) unchanged.