← Back to issue list

fix: align GrammarProcessor.__init__ with BaseProcessor

View original Github issue

Metadata

Project
craft-grammar
Number
#217
Type
pull request
State
merged
Author
lengau
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #217 to fix GrammarProcessor.__init__ parameter ordering, aligning it with BaseProcessor to resolve ty type-check failures without changing the public API.

Resolution: closed resolved

Reason: The PR was merged, correcting the parameter order in GrammarProcessor.__init__ to match BaseProcessor and resolving the ty type-check failure.

Evaluated by: mr-cal-bot

No scores available.

Issue body

## Summary `GrammarProcessor.__init__` declared the keyword-only `checker` parameter before the positional parameters (`arch`, `target_arch`, `platforms`) that `BaseProcessor.__init__` accepts positionally. That makes the override incompatible with the base class signature (Liskov Substitution Principle) and fails the `ty` type check run by `make lint`: ``` error[invalid-method-override]: Invalid override of method `__init__` --> craft_grammar/_processor.py:61:9 info: parameter `checker` is keyword-only but must also accept positional arguments ``` This fix moves `checker` after the shared positional parameters so the override matches `BaseProcessor.__init__`. The public keyword-only calling convention is unchanged, so there is no behavioural or API break. Pre-existing failure on `main`, unrelated to the Starbase sync; split out so the Starbase merge diff stays reviewable. ## Test plan - [x] `uv run pytest tests/unit` passes - [x] `uv tool run ty check --python .venv craft_grammar tests` passes - [x] pre-commit hooks (ruff check, ruff format) pass

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b — closed resolved Merged PR #217 to fix GrammarProcessor.__init__ parameter ordering, aligning it with BaseProcessor to resolve ty type-check failures without changing the public API.
~deepseek/deepseek-pro-latest
Impact: 35
Quick Win: 26
Complexity: 10
Confidence: 85
Actionability: 82
needs review Reorders GrammarProcessor.__init__ so keyword-only checker follows positional arch/target_arch/platforms, matching BaseProcessor and fixing a ty invalid-method-override lint error. Approved, tests green; OSV-scanner failing (pre-existing on main).
~deepseek/deepseek-pro-latest
Impact: 35
Quick Win: 25
Complexity: 10
Confidence: 88
Actionability: 78
needs review Moves the keyword-only checker param after arch/target_arch/platforms in GrammarProcessor.__init__ to match BaseProcessor's signature, fixing a ty invalid-method-override lint failure. 2-line diff; CI green except OSV-scanner.
~deepseek/deepseek-pro-latest
Impact: 32
Quick Win: 23
Complexity: 5
Confidence: 85
Actionability: 75
needs review Moves GrammarProcessor.__init__'s keyword-only checker parameter after arch/target_arch/platforms to match BaseProcessor's signature, fixing a ty invalid-method-override lint failure. +2/-2 lines; tests and lint pass, OSV-scanner CI failing.
~deepseek/deepseek-pro-latest
Impact: 35
Quick Win: 25
Complexity: 5
Confidence: 80
Actionability: 75
needs review Moves keyword-only `checker` param after positional `arch`/`target_arch`/`platforms` in GrammarProcessor.__init__ to match BaseProcessor and fix ty invalid-method-override; no API change.
~deepseek/deepseek-pro-latest
Impact: 25
Quick Win: 19
Complexity: 5
Confidence: 85
Actionability: 80
needs review Fixes GrammarProcessor.__init__ signature to match BaseProcessor by moving checker after positional arch/target_arch/platforms; no runtime behavior change; awaiting review.

Update history

Date Change
merged
updated
updated
updated
updated
created

Related issues

No related issues found above the similarity threshold.