Skip to main content

charmlint

CI PyPI

A linter for Juju charms.

charmlint checks charm source code against Canonical's charm best practices: observability, security, testing, metadata, configuration, and more. It's for charm authors and reviewers who want best-practice gaps caught before review rather than during it, locally or in CI. It isn't tied to any AI assistant or model: it works the same whether you run it yourself or from Claude Code, Copilot, Codex, or any other coding agent.

Usage

charmlint requires Python 3.12 or later. Run it from PyPI with uvx, no install needed:

uvx charmlint /path/to/charm

Or add it to a charm's dev dependencies and run it with uv run:

uv add --dev charmlint
uv run charmlint

charmlint doesn't follow SemVer: a minor release can add or tighten rules, so an upgrade may turn a clean run into a failing one. If you set version bounds, see docs/versioning.md for how to pin.

Common options:

uvx charmlint --format json .
uvx charmlint --select SECURITY,METADATA-001 .
uvx charmlint --ignore no-readme --strict .

charmlint --help lists the rest. charmlint exits 1 when it finds errors, or warnings too with --strict. Exit code 2 means charmlint could not run (for example, a bad path or configuration). To report errors only, hiding warnings and info, use --min-severity error.

Configuration

Configure under [tool.charmlint] in pyproject.toml:

[tool.charmlint]
select = ["SECURITY", "METADATA"]
ignore = ["METADATA-002"]

You can also use a standalone charmlint.toml or .charmlint.toml file, with the same keys at the top level (no [tool.charmlint] header).

Individual findings can be suppressed inline with # charmlint: ignore[SECURITY-001]. See docs/configuration.md for all settings and suppression directives.

Documentation

Community and support

Questions and discussion are welcome on Matrix and Discourse. If you find a bug or have a feature request, please open a GitHub issue. Everyone taking part is expected to follow the Code of Conduct.

Contributing

Improvements to the rules, the code, and the documentation are all welcome. CONTRIBUTING.md covers development setup, tests, and pull requests. Contributors need to sign the Canonical contributor licence agreement.

Metadata

Release files for charmlint 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for charmlint 0.5.0
File Size Uploaded Provenance Actions
charmlint-0.5.0.tar.gz 389.2 kB With provenance Details for charmlint-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for charmlint 0.5.0
File Interpreter ABI Platform Actions
charmlint-0.5.0-py3-none-any.whl Python 3 none any Details for charmlint-0.5.0-py3-none-any.whl

Total release size: 504.7 kB

Release files / charmlint-0.5.0.tar.gz

Download URL charmlint-0.5.0.tar.gz
Size 389.2 kB
Tags Source
SHA-256 checksum
How to use checksums
98d7e489d43ca42ca61e2bb19096b122291d1c6778b95ef9ee5b6f30dc6faaff
BLAKE2b-256 checksum
How to use checksums
b0098b7323a63e4477137c5f2fa44ac5208188e65fb20042530db3dcfcaffb7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Release files / charmlint-0.5.0-py3-none-any.whl

Download URL charmlint-0.5.0-py3-none-any.whl
Size 115.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf2f721238fc6f48e179b246b1a603959aad698ab7d1952538d8b2588c71c28a
BLAKE2b-256 checksum
How to use checksums
0bcc2ea15cdf11b75047dd27c5591f597accdc208755cd5f163539a6d16b7c85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Security for charmlint 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for charmlint-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page