Skip to content

fix(impl): stop dropping words color#253

Merged
webern merged 2 commits into
mainfrom
fix-words-color
Jun 28, 2026
Merged

fix(impl): stop dropping words color#253
webern merged 2 commits into
mainfrom
fix-words-color

Conversation

@webern

@webern webern commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Closes #207.

parseWords calls getColor() but never sets isColorSpecified, so DirectionWriter silently
drops the color on write. Mirror the pattern already used by parseRehearsal, parseSegno, and
parseCoda: check wordEl.color().has_value() and gate both the flag and the getColor call.

@github-actions

Copy link
Copy Markdown

gen-quality gen/

gen-quality: 84.5 / 100   (floor 84.5, +0.0)

  structure     86.5  x0.50   [fn 90.5 / file 82.6]
  cyclomatic    88.4  x0.25
  cognitive     76.6  x0.25

  409 functions across 31 files, 7702 lines (largest file 1044)
  max cc 56  max cognitive 44  max fn loc 152

Worst offenders (top 5 per axis; full lists in score.json):
  cyclomatic gen/xsd/analyze.py:311     report                             56
  cyclomatic gen/plates/build.py:956    _validate_config_against_ir        35
  cyclomatic gen/press/context.py:145   plate_context                      34
  cyclomatic gen/__main__.py:46         _ir                                23
  cyclomatic gen/tests/test_ir.py:102   _check_references                  20
  cognitive  gen/xsd/analyze.py:311     report                             44
  cognitive  gen/ir/resolve.py:119      flat_elements                      40
  cognitive  gen/tests/test_ir.py:102   _check_references                  38
  cognitive  gen/press/context.py:145   plate_context                      37
  cognitive  gen/xsd/analyze.py:207     _sccs                              37
  size       gen/xsd/analyze.py:311     report                             152
  size       gen/press/context.py:145   plate_context                      96
  size       gen/plates/build.py:533    _value_plate                       89
  size       gen/plates/build.py:956    _validate_config_against_ir        89
  size       gen/ir/resolve.py:119      flat_elements                      78

Commit c9b2d40f6d549d02a3886bb54b0b0f52123bf3c1.

@webern webern force-pushed the docker-volume-isolation branch from 9bf425e to 49436ef Compare June 28, 2026 16:04
@webern webern force-pushed the fix-words-color branch from 877e752 to 6f197db Compare June 28, 2026 16:04
@github-actions

Copy link
Copy Markdown

Coverage report

Core-dev coverage src/private/mx/core/

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% 5915 / 7537
Functions 63.5% 2006 / 3159
Branches 47.8% 5000 / 10457

Core HTML report | API HTML report

Commit f7b1d42049ed8196469955cfc51b5da4ecbee7b3.

@github-actions

Copy link
Copy Markdown

gen-quality gen/

gen-quality: 84.5 / 100   (floor 84.5, +0.0)

  structure     86.5  x0.50   [fn 90.5 / file 82.6]
  cyclomatic    88.4  x0.25
  cognitive     76.6  x0.25

  409 functions across 31 files, 7702 lines (largest file 1044)
  max cc 56  max cognitive 44  max fn loc 152

Worst offenders (top 5 per axis; full lists in score.json):
  cyclomatic gen/xsd/analyze.py:311     report                             56
  cyclomatic gen/plates/build.py:956    _validate_config_against_ir        35
  cyclomatic gen/press/context.py:145   plate_context                      34
  cyclomatic gen/__main__.py:46         _ir                                23
  cyclomatic gen/tests/test_ir.py:102   _check_references                  20
  cognitive  gen/xsd/analyze.py:311     report                             44
  cognitive  gen/ir/resolve.py:119      flat_elements                      40
  cognitive  gen/tests/test_ir.py:102   _check_references                  38
  cognitive  gen/press/context.py:145   plate_context                      37
  cognitive  gen/xsd/analyze.py:207     _sccs                              37
  size       gen/xsd/analyze.py:311     report                             152
  size       gen/press/context.py:145   plate_context                      96
  size       gen/plates/build.py:533    _value_plate                       89
  size       gen/plates/build.py:956    _validate_config_against_ir        89
  size       gen/ir/resolve.py:119      flat_elements                      78

Commit f7b1d42049ed8196469955cfc51b5da4ecbee7b3.

@webern webern changed the title fix: parseWords never sets isColorSpecified fix(impl): parseWords never sets isColorSpecified Jun 28, 2026
@webern webern changed the title fix(impl): parseWords never sets isColorSpecified fix(impl): stop dropping words color Jun 28, 2026
Base automatically changed from docker-volume-isolation to main June 28, 2026 17:19
@webern webern merged commit 1eeb480 into main Jun 28, 2026
7 checks passed
@webern webern deleted the fix-words-color branch June 28, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

impl: parseWords never sets WordsData.isColorSpecified — words color does not round-trip

1 participant