lint: lint snap files inside an instance
Metadata
Current evaluation
Merged. Implements snapcraft lint execution inside a snap instance, covering unsquashing, metadata collection, installation, linting, and warning reporting. Approved, passed CI, achieved 100% diff coverage, and resolves CRAFT-1689.
Suggested action: —
No scores available.
Issue body
- [X] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [X] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [X] Have you successfully run `make lint`?
- [X] Have you successfully run `pytest tests/unit`?
-----
So far, `snapcraft lint` parses the command line, prepares an instance, and re-executes snapcraft inside the instance.
This PR adds the code that is executed inside the instance:
1. Unsquash the snap
2. Collect the metadata from snap.yaml and lint filters from snapcraft.yaml
3. Install the snap
4. Run the linter on `/snap/<snap-name>/current`
5. Report the linter warnings
(CRAFT-1689)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged. Implements snapcraft lint execution inside a snap instance, covering unsquashing, metadata collection, installation, linting, and warning reporting. Approved, passed CI, achieved 100% diff coverage, and resolves CRAFT-1689. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged into main. Adds instance-based linting to snapcraft by unsquashing, installing, and running the linter on the mounted snap path. Merged with 100% diff coverage and a 0.02% overall increase. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged into main. Adds snapcraft lint logic to execute inside an instance, covering snap unsquashing, metadata extraction, installation, and linter execution. Resolves CRAFT-1689 with 100% diff coverage. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #4101 lint: prepare instance for linting a snap file | snapcraft | merged | Merged into main. Updates snapcraft lint to prepare and re-execute inside a snap instance. Approved by a reviewer, passed CI, and increased coverage by 0.02%. Addresses CRAFT-1690. | |
| #4095 cli: add lint command | snapcraft | merged | Merged into main after approval and passing CI checks. Introduces a new snapcraft lint CLI command, adding 223 lines across 5 files with 96.25% test coverage. Resolves CRAFT-1688. | |
| #3847 linters: add linting infrastructure | snapcraft | merged | Merged. Adds basic linting infrastructure to snapcraft, including a lint entry in snapcraft.yaml to disable specific linters before packing. JSON output is implemented for future use. Approved, rebased, and passed coverage checks. | |
| #5850 style: fix pending lints from snapcraft itself | snapcraft | merged | Merged changes fixing pending snapcraft lint warnings for unused libraries and missing metadata fields. Approved by two reviewers, passed CI checks, and added 10 lines to one file. | |
| #4022 lint: ignore snapd-testing-tools, venv | snapcraft | merged | Merged linter configuration updates to ignore venv, snapd-testing-tools, and cache directories, resolving local development failures. Approved by reviewers, passed CI, and integrated into main. |