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. Errors cause charmlint to exit with code 1. With --strict, warnings cause charmlint to exit with code 2.

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.3.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.3.0
File Size Uploaded
charmlint-0.3.0.tar.gz 268.1 kB Details

Built distribution (wheel)

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

Total release size: 371.2 kB

Release files / charmlint-0.3.0.tar.gz

Download URL charmlint-0.3.0.tar.gz
Size 268.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0300c1aff132b4b45d576f79452987ea9d01087c00ca9cc424ca398dd0724ba3
BLAKE2b-256 checksum
How to use checksums
1733655fc4b6ba0bcf67f0bec73651486c75a013162bed1ad369f60ae7fb6e21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 12, 2026.

Transparency log

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

Download URL charmlint-0.3.0-py3-none-any.whl
Size 103.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dee01cce0cb2e640ac76f4221a08effae902e4c92c19655f6ea71a27c73710c7
BLAKE2b-256 checksum
How to use checksums
90c6770ef51312f60daf735417649fa2f0a6ea88e5151b2740d8b1726a602bdf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.1

2 release files

0.1.1

2 release files

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