linters: add linter check for unused libraries
Metadata
Current evaluation
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.
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`?
-----
This PR adds a new linter warning when a library is packaged into a snap but not used.
The changes are split into 5 smaller commits.
These changes are inspired by some of the excellent work in https://github.com/snapcore/snapcraft/pull/3413
(CRAFT-1588)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | 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. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a five-commit change adding a linter warning for unused libraries packaged in snaps. Authored by maintainer mr-cal, this update addresses CRAFT-1588 and enhances build-time validation. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a pull request implementing a linter warning for unused libraries packaged into snaps. The feature was delivered across five commits and resolves CRAFT-1588. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #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. | |
| #4149 Add a linter for staged libraries included in the base snap | snapcraft | open | Feature request to add a linter that flags libraries in a snap that are already provided by the base snap, reducing snap size and security surface. Labeled Status: Triaged and Type: Enhancement by maintainer sergiusens. No implementation found in the codebase yet. | |
| #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%. | |
| #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. |