New Linter Service
Metadata
Current evaluation
Merged PR #907 (commit a76bcaa6), adding AbstractLinter, LinterService, Testcraft integration, and linter-author documentation; this completed the bounty and closed #782.
Resolution: closed resolved
Reason: PR #907 was merged as a76bcaa6 with the requested linter framework, Testcraft usage, and documentation. The closing maintainer comment confirms the bounty was completed in #907.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### What needs to get done
A design spec for the linter service that addresses the following:
- The service’s API
- Protocol for the linters themselves
- Do we want different types of linters? (e.g. do we want to distinguish linters that warn about issues with the inputs and linters that warn about issues with the resulting objects?)
Example use case for pre-linters and post-linters
- A Charmcraft pre linter may warn about out-of-date charmlibs before beginning pack, whilst a post linter may error because the resulting charm contains neither hooks nor a dispatch file.
#### Acceptance criteria
* A new abstract linter class
* A new linter service
* Usage of the linter service in testcraft
* Documentation for how to add a new linter
#### Implementation hints
Begin with the [AnalysisService from Charmcraft](https://github.com/canonical/charmcraft/blob/main/charmcraft/application/commands/analyse.py) and the [LinterIssue from Snapcraft](https://github.com/canonical/snapcraft/blob/a5682c276cea484efd21b86379f9a7bc9f30450d/snapcraft/linters/base.py#L51-L81). Use something roughly like the linter implementation in both (find commonalities), but make the `run` method a generator that yields zero or more issues.
### Why it needs to get done
Snapcraft and Charmcraft lint snaps and charms respectively at the end of the lifecycle.
These linters don’t share common code and don’t have a similar UX. Additionally, there isn’t a way to add linters to other *craft apps without significant code duplication.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #907 (commit a76bcaa6), adding AbstractLinter, LinterService, Testcraft integration, and linter-author documentation; this completed the bounty and closed #782. | |
| stealth/space-bunny-alpha | — | closed resolved | Linter service framework delivered by merged craft-application PR #907 (commit a76bcaa6), resolving the bounty after maintainer review. | |
| qwen/qwen3.6-35b-a3b | — | — | Bounty completed by HamdaanAliQuatil and merged in PR #907. The implementation delivers the new Linter Service with abstract linter classes, pre/post filter methods, and registration logic as specified. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged via PR #907. Implemented the abstract linter class and LinterService featuring pre/post filters and class-based registration per the approved design. The bounty was successfully awarded. | |
| qwen/qwen3.6-35b-a3b | — | — | Completed and merged in PR #907. Contributor HamdaanAliQuatil implemented the new Linter Service with pre/post filters, class-based registration, and ignore configuration per clinic feedback. A $750 bounty was awarded. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/craft-application#907
(confidence 100%)
Merged PR implementing the accepted linter-service design and closing #782.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #907 feat(linter): add linter service framework | craft-application | merged | Merged PR #907 as commit a76bcaa6, adding a shared Linter Service for consistent downstream registration and execution of linters and closing craft-application#782. | |
| #141 Add a basic linter service | craft-application | closed | Implemented the extensible linter framework in craft-application by merging PR #907 (commit a76bcaa6), providing shared linter registration and execution for downstream apps. | |
| #5542 Use Craft Application's Linter Service | snapcraft | closed | Closed by mr-cal (2026-01-21) as a bounty with no implementation. craft-application#907 (commit a76bcaa6) merged the shared Linter Service, and the migration work was moved to charmcraft#2546, still open. | |
| #4815 linter updates | snapcraft | merged | Merged PR #4815, updating linter configuration across 10 files (+26/−56), after two approvals and with no unresolved review comments. |