fix: DirectionWriter respects orderedComponents#254
Merged
Conversation
Split DirectionWriter::getDirectionLikeThings() into two emission paths: fixed-order (existing behavior, used when orderedComponents is empty) and ordered dispatch (uses the component order the reader recorded from parsed XML). Each per-kind emission block is extracted into a private helper method, called by both paths to avoid duplication. Fixes #206
Coverage reportCore-dev coverage
|
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 77.8% | 28487 / 36624 |
| Functions | 74.3% | 6349 / 8550 |
| Branches | 50.6% | 22632 / 44725 |
API coverage src/private/mx/{api,impl,utility}/
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 78.5% | 6003 / 7647 |
| Functions | 63.6% | 2022 / 3177 |
| Branches | 47.7% | 5082 / 10665 |
Core HTML report | API HTML report
Commit e73aa71ee444c48062e2a72bbe782e4a7e7b991a.
gen-quality
|
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.
Summary
DirectionWriter::getDirectionLikeThings()into two emission paths:fixed-order (existing behavior when
orderedComponentsis empty) and ordereddispatch (uses the component order the reader recorded from parsed XML).
DirectionWriter, called by both paths to avoid ~400 lines of duplication.orderedComponents, bounds-checks each index, andcalls the appropriate helper. Words are bundled on first encounter; chords are
skipped (emitted via
createHarmonyElements).DirectionData::orderedComponentsexplaining itsround-trip role and the "do not populate programmatically" contract.
Corpus impact
Discovery mode (94 PASS / 737 FAIL) shows no new files unlocked by this fix
alone. Files with interleaved direction-types (e.g.
ly31a_Directions.xml,ly31c_MetronomeMarks.xml) still fail due to other blockers:ly31a_Directions.xml: child count mismatch at.../note(unrelated todirection ordering)
ly31c_MetronomeMarks.xml: attribute count mismatch at.../direction-type/metronome(missing metronome attributes, not ordering)This fix is a prerequisite for those files to eventually pass — the ordering
divergence was one of multiple blockers, not the sole blocker. A synthetic
round-trip test that isolates the ordering behavior would strengthen coverage
here.
Fixes #206