← Back to issue list

grammar: import from Snapcraft (CRAFT-818)

View original Github issue

Metadata

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

Current evaluation

Merged PR #3 (69a12dc) imported the grammar from Snapcraft, updated lint/type tooling, and decoupled GrammarProcessor from ProjectOptions.

Resolution: closed resolved

Reason: PR #3 was merged into main as 69a12dc, with implementation commit 31f60d0. It delivered the CRAFT-818 grammar import and related API updates; Snapcraft later adopted it in #3642 (943d130c2).

Evaluated by: mr-cal-bot

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
stealth/space-bunny-alpha — closed resolved Merged PR #3 (69a12dc) imported the grammar from Snapcraft, updated lint/type tooling, and decoupled GrammarProcessor from ProjectOptions.
stealth/space-bunny-alpha — closed resolved Merged CRAFT-818 to import the grammar from Snapcraft, update lint/type tooling, add error parameter types, and decouple GrammarProcessor from ProjectOptions.
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.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/snapcraft#3642 (confidence 95%)

    Snapcraft later adopted the extracted craft-grammar implementation in merge 943d130c2.

Related issues

Issue Project State Summary Similarity
#1684 Vendor grammar logic into snapcraft snapcraft closed Advanced grammar was extracted to craft-grammar and adopted by Snapcraft in #3642 (merge 943d130c2), superseding the planned in-tree refactor.
81%
#3642 grammar: migrate to external package (CRAFT-819) snapcraft merged Merged: grammar plugin moved out of the snapcraft tree into the external craft-grammar package (CRAFT-819), deleting ~2,439 lines. Merge commit 943d130c2.
74%
#5462 docs: migrate 'Snapcraft advanced grammar' snapcraft merged Merged the advanced grammar documentation migration in commit b7a56461b; follow-up #5468 restored the Read the Docs build in 0157e5b15.
73%
#4716 test(grammar): new grammar support snapcraft closed PR #4716 (unit tests for new grammar support) was approved but closed unmerged; maintainer @mr-cal closed it because craft-application#296 was merged/released and equivalent Snapcraft tests landed in merged #4768 (c76e626).
73%
#1500 grammar: move into project_loader snapcraft merged Merged as ed332f0d4, moving the stage-package grammar package from snapcraft/internal/pluginhandler into project_loader — a pure relocation, part of the #1492 effort to make grammar reusable across snapcraft.yaml.
72%
#3654 projects: add grammar validation snapcraft merged Merged #3654 via commit 17fcb85f8, validating snapcraft.yaml with craft-grammar Pydantic models before processing grammar-aware properties.
70%