grammar: import from Snapcraft (CRAFT-818)
Metadata
Current evaluation
Merged import of grammar processing logic from Snapcraft. Refactored grammarProcessor and transformer signatures to remove Snapcraft coupling and enforce kwargs. Updated linting and type checking tooling. Approved and passed CI.
Suggested action: —
No scores available.
Issue body
Noticeable changes:
- updated to support latest pylint, mypy, pyright and black
- types for error parameters
- grammarProcessor no longer takes a grammar entry, it is now mandatory to pass
to .process and it is a mandatory parameter for it
- removed coupling with Snapcraft's ProjectOptions, and require arch and
target_arch for GrammarProcessor
- transformer method signature changed to require target_arch instead of
ProjectOptions
- most parameters for methods now require kwargs
Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged import of grammar processing logic from Snapcraft. Refactored grammarProcessor and transformer signatures to remove Snapcraft coupling and enforce kwargs. Updated linting and type checking tooling. Approved and passed CI. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged import of grammar module from Snapcraft (CRAFT-818). Updated pylint, mypy, pyright, and black support. Refactored grammarProcessor and transformer signatures to remove Snapcraft coupling, enforce mandatory parameters, and standardize kwargs usage. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #5462 docs: migrate 'Snapcraft advanced grammar' | snapcraft | merged | Merged documentation migration for the Snapcraft advanced grammar reference. Approved by two reviewers and passed CI checks before being squashed into the main branch. | |
| #3654 projects: add grammar validation | snapcraft | merged | Merged after review and CI approval. Adds pydantic validation for snapcraft.yaml grammar using craft-grammar models. A follow-up update was noted to align with a craft-grammar version change that switched grammar entries to lists. | |
| #330 fix: do not process non-grammar keywords | craft-application | merged | Merged a fix preventing the grammar processor from incorrectly handling non-grammar keywords, resolving snapcraft.yaml parsing errors. The change skips grammar processing for non-grammar fields, approved by reviewers and passing CI. | |
| #4716 test(grammar): new grammar support | snapcraft | closed | Closed and superseded after craft-application PR #296 merged and released. Related grammar tests were added via Snapcraft PR #4768. |