← Back to issue list

linters: add linting infrastructure

View original Github issue

Metadata

Project
snapcraft
Number
#3847
Type
pull request
State
merged
Author
cmatsuoka
Labels
Created
Updated
Closed

Current evaluation

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.

Suggested action:

No scores available.

Issue body

Create a basic framework for linting including the `lint` entry in snapcraft.yaml to disable specific linters. Linters run before packing a snap. A specific `lint` command to lint a snap package file will be added in a future PR. JSON-formatted output is implemented but will only be used with the `lint` command. Signed-off-by: Claudio Matsuoka <claudio.matsuoka@canonical.com> - [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/)? - [ ] Have you successfully run `make lint`? - [ ] Have you successfully run `pytest tests/unit`? ----- CRAFT-1098

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b 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.
qwen3.6-35b-a3b-mtp-q6 Merged adding linting infrastructure to snapcraft. Adds a lint entry in snapcraft.yaml to disable specific linters before packing. Rebased on main, merged with 92.04% diff coverage and 0.13% overall coverage increase.
qwen3.6-35b-a3b-mtp-q6 Merged into main, adding a basic linting infrastructure to snapcraft. Introduces a lint entry in snapcraft.yaml to disable specific linters, which now run before packing. Code coverage increased by 0.13% upon merge.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#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.
80%
#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.
79%
#4115 lint: lint snap files inside an instance snapcraft merged 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.
76%
#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.
73%
#4028 linters: add linter check for unused libraries snapcraft merged Merged following reviewer approval and successful CI checks. Adds a linter warning to flag unused libraries packaged into snaps. The update modifies 22 files with 449 additions and 40 deletions across five commits.
72%
#3872 linters: add missing library linter snapcraft merged Merged changes add a missing library linter to list ELF dependencies in the payload directory and fix filename filtering in the classic linter. Approved, passed CI, and increased coverage by 0.02%.
71%
#3931 linters: allow ignoring files per-linter snapcraft merged Merged. Restructures lint.ignore to support per-linter file exclusions for finer-grained control. Approved, passed CI with 100% diff coverage, and modified 9 files. Preserves ability to disable entire linters.
71%