← Back to issue list

lint: lint snap files inside an instance

View original Github issue

Metadata

Project
snapcraft
Number
#4115
Type
pull request
State
merged
Author
mr-cal
Labels
—
Created
Updated
Closed

Current evaluation

Merged as ddd328f07, #4115 adds in-instance snap linting that unsquashes and installs the snap, reads metadata and filters, runs the linter, and reports warnings (CRAFT-1689).

Resolution: closed resolved

Reason: PR #4115 was approved and merged, resolving CRAFT-1689 by implementing the complete in-instance linting flow in commit ddd328f07.

Evaluated by: mr-cal-bot

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
stealth/space-bunny-alpha — closed resolved Merged as ddd328f07, #4115 adds in-instance snap linting that unsquashes and installs the snap, reads metadata and filters, runs the linter, and reports warnings (CRAFT-1689).
stealth/space-bunny-alpha — closed resolved Merged #4115 added in-instance snap linting: unsquash, collect metadata, install, lint the snap and report warnings, resolving CRAFT-1689.
stealth/space-bunny-alpha — closed resolved Merged PR #4115 added in-instance snap linting: unsquashing, metadata/filter collection, installation, lint execution, and warning reporting for CRAFT-1689.
stealth/space-bunny-alpha — closed resolved Merged PR #4115 (2a4729d), adding in-instance snap linting: unsquash, collect metadata and filters, install, lint, and report warnings.
stealth/space-bunny-alpha — closed resolved Merged PR #4115 (2a4729d), adding in-instance snapfile linting: unsquash, collect metadata and filters, install the snap, run the linter, and report warnings.
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.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/snapcraft#4101 (confidence 99%)

    Merged prerequisite that prepared the lint instance and re-executed Snapcraft inside it.

  • Related To: canonical/snapcraft#4095 (confidence 96%)

    Introduced the snapcraft lint CLI command completed by #4115.

Related issues

Issue Project State Summary Similarity
#4101 lint: prepare instance for linting a snap file snapcraft merged Merged #4101 as caa2f2e9d, making snapcraft lint prepare an instance and re-execute lint inside it for CRAFT-1690.
81%
#6448 fix(lint): lint snaps in a build environment matching their base snapcraft closed Proposed base-aware lint environments for newer snaps, but PR #6448 was closed unmerged after two days without review; issue #6332 remains open.
74%
#3847 linters: add linting infrastructure snapcraft merged Merged into main as 9f70a0422, adding the linting framework, snapcraft.yaml lint configuration, pre-pack lint execution, and JSON-formatted issue output.
71%