src/svg_parser/fill_resolver.py is dead code — duplicate resolver never wired into the pipeline #121

Closed
opened 2026-08-11 09:35:07 +00:00 by Mark · 0 comments
Owner

What is wrong

src/svg_parser/fill_resolver.py (598 lines) is a second gradient/pattern resolver that is never imported by any src/ module. The live pipeline wires src/svg_parser/gradient_pattern_resolver.py (GradientPatternResolver) into parser.parse_svg (parser.py:71-72). fill_resolver was restored from a stash in d42e46e ("fix: restore fill_resolver module to fix pytest collection (#115)") but only the tests import it (DEFAULT_LINEAR_BANDS, resolve_paint_references, resolve_svg_string).

Where

  • src/svg_parser/fill_resolver.py — dead module
  • src/svg_parser/gradient_pattern_resolver.py — the live resolver
  • tests/test_gradient_pattern_fill.py — imports both, asserting the live parser contract but also exercising the dead module directly

What the fix is

Decide which resolver is canonical. gradient_pattern_resolver is wired and covered; fill_resolver duplicates UnsupportedSVGFeatureError (vs the pipeline-wide UnsupportedFillError), DEFAULT_LINEAR_BANDS, and resolve_svg_string. Either delete fill_resolver and update the 2-3 tests that call it directly, or migrate the pipeline to it and delete gradient_pattern_resolver. Keep one exception type — having both UnsupportedFillError (pipeline_api) and UnsupportedSVGFeatureError (fill_resolver) for the same condition is a maintenance hazard.

Verification

After removal, python -m pytest -q stays green (currently 336 passing).

## What is wrong `src/svg_parser/fill_resolver.py` (598 lines) is a second gradient/pattern resolver that is never imported by any `src/` module. The live pipeline wires `src/svg_parser/gradient_pattern_resolver.py` (GradientPatternResolver) into `parser.parse_svg` (parser.py:71-72). `fill_resolver` was restored from a stash in d42e46e ("fix: restore fill_resolver module to fix pytest collection (#115)") but only the tests import it (`DEFAULT_LINEAR_BANDS`, `resolve_paint_references`, `resolve_svg_string`). ## Where - `src/svg_parser/fill_resolver.py` — dead module - `src/svg_parser/gradient_pattern_resolver.py` — the live resolver - `tests/test_gradient_pattern_fill.py` — imports both, asserting the live parser contract but also exercising the dead module directly ## What the fix is Decide which resolver is canonical. `gradient_pattern_resolver` is wired and covered; `fill_resolver` duplicates `UnsupportedSVGFeatureError` (vs the pipeline-wide `UnsupportedFillError`), `DEFAULT_LINEAR_BANDS`, and `resolve_svg_string`. Either delete `fill_resolver` and update the 2-3 tests that call it directly, or migrate the pipeline to it and delete `gradient_pattern_resolver`. Keep one exception type — having both `UnsupportedFillError` (pipeline_api) and `UnsupportedSVGFeatureError` (fill_resolver) for the same condition is a maintenance hazard. ## Verification After removal, `python -m pytest -q` stays green (currently 336 passing).
Mark closed this issue 2026-08-13 00:13:14 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/easystitch#121
No description provided.