← Back to issue list

Add `charmcraft lint` to enforce Canonical recommendations

View original Github issue

Metadata

Project
charmcraft
Number
#2374
Type
issue
State
open
Author
taurus-forever
Labels
Created
Updated
Closed

Current evaluation

Feature request for a charmcraft lint command to enforce naming convention consistency (hyphens vs underscores) in actions/options. The NamingConventions linter already exists via charmcraft analyse (PR #1487), but a dedicated lint command and pre-linting during pack are not yet implemented. Maintainer acknowledged, blocked on #2315 which is now closed/abandoned.

Suggested action: keep open

Reason: The NamingConventions linter (added in PR #1487) already checks hyphen/underscore consistency in actions and config options via charmcraft analyse, partially addressing the core ask. However, the specific request for a charmcraft lint command and pre-linting during charmcraft pack remains unimplemented. Maintainer @lengau acknowledged the issue (2025-07-22) and cited #2315 as a blocker; that issue is now closed/abandoned, so the path forward needs re-evaluation but the feature gap is still real.

Impact: 35 Quick Win: 19.25 Staleness: 55 Complexity: 45 Confidence: 72 Support Request: 10

Issue body

### What needs to get done Hi, TL;DR: charm must follow same approach in naming actions/options/...: use `-` or `_` (c) Jon/codestyle. When developers adding the same feature to the different charms, they are following muscle memory and often missing this point. It cause issues like: https://warthogs.atlassian.net/browse/DPE-7741 (which is expensive and annoying to fix). Proposal add `charmcraft lint` to help charmers control it on CI/CD. E.g. it can check consistency of `_`/`-` and error blocking divergence. We can also warn this on `charmcraft pack`, but without error nobody notice it on CI. Tnx! ### Why it needs to get done To settle the high standards in charms quality avoiding divergences.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 35
Quick Win: 19.25
Staleness: 55
Complexity: 45
Confidence: 72
Support Request: 10
keep open Feature request for a charmcraft lint command to enforce naming convention consistency (hyphens vs underscores) in actions/options. The NamingConventions linter already exists via charmcraft analyse (PR #1487), but a dedicated lint command and pre-linting during pack are not yet implemented. Maintainer acknowledged, blocked on #2315 which is now closed/abandoned.
qwen/qwen3.6-35b-a3b
Staleness: 65
Complexity: 55
Confidence: 85
Support Request: 10
keep open Proposal to add a charmcraft lint command to enforce naming conventions and improve charm quality. Acknowledged by maintainers as a future goal, pending resolution of related linting infrastructure work.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 50
Confidence: 85
Support Request: 10
keep open Proposal to add a charmcraft lint command enforcing naming conventions. Maintainer acknowledged interest and linked implementation to blocking issue 2315.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 65
Confidence: 90
Support Request: 10
keep open Proposal to add a charmcraft lint command to enforce naming conventions and improve charm quality. Maintainers acknowledged the request and confirmed it is planned, pending resolution of related issue #2315.
qwen3.6-35b-a3b-mtp-q6
Staleness: 40
Complexity: 55
Confidence: 90
Support Request: 10
keep open Proposes adding charmcraft lint to enforce consistent hyphen/underscore naming for charm actions and options. Maintainers support the feature but note implementation is blocked pending related pre-linter development.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/charmcraft#1487 (confidence 85%)

    PR #1487 added the NamingConventions linter that checks hyphen vs underscore consistency in actions and config options, which is the core check requested in this issue.

  • Blocked By: canonical/charmcraft#2315 (confidence 75%)

    Maintainer stated pre-linters would come with resolution of #2315 (Use Craft Application's Linter Service), which is now closed/abandoned without code changes.

Related issues

No related issues found above the similarity threshold.