Skip to main content

cmakefmt banner

cmakefmt

CI
CI Pages Coverage CodSpeed

Package
Crates.io dependency status

Security & Quality
REUSE status OpenSSF Scorecard OpenSSF Best Practices

A fast, correct CMake formatter — cmake-format, reimagined in Rust.

cmakefmt demo

Contents

Why cmakefmt?

  • Drop-in replacement for cmake-format. A single native binary with the same workflows and no Python environment to manage.
  • 100× faster. Geometric-mean speedup over cmake-format across a corpus of 14 large open-source repositories (see Performance).
  • Workflow-first design. --check, --diff, --staged, --changed, semantic verification, JSON/SARIF/JUnit reports, an LSP server, and a GitHub Action are all first-class features rather than scripted afterthoughts.

Install

brew install cmakefmt/cmakefmt/cmakefmt   # macOS / Linux (Homebrew)
pip install cmakefmt                      # any platform with Python
cargo install cmakefmt-rust               # any platform
winget install cmakefmt.cmakefmt          # Windows

Conda, Docker, pre-built binaries, and full setup notes are documented at Installation.

Building the current source checkout or next release requires Rust 1.88 or newer. Prebuilt binaries and wheels do not require Rust.

Quick start

cmakefmt --in-place .   # format every CMake file in the project

The full CLI reference, configuration schema, editor integrations, and migration guide from cmake-format all live at cmakefmt.dev.

GitHub Action

The official cmakefmt-action wraps the binary for use in CI workflows:

- uses: actions/checkout@v6
- uses: cmakefmt/cmakefmt-action@v2

That snippet is the strict whole-repo check: it fails the job and emits inline PR annotations for any file that would change under formatting. The action also supports other modes and file-selection scopes:

- uses: cmakefmt/cmakefmt-action@v2
  with:
    mode: diff       # check, diff, fix, or setup
    scope: changed   # all, changed, or staged

For the complete list of inputs and recommended rollout patterns, see the cmakefmt-action README.

Documentation

The full documentation lives at cmakefmt.dev.

Page Description
Getting Started First format in under a minute
Installation Every install channel and setup notes
CLI Reference Every flag, subcommand, exit code
Config Reference Full config schema with examples
Migration from cmake-format Incremental rollout guide
Editor Integration VS Code, Neovim, Helix, Zed, Emacs
Comparison vs cmake-format and gersemi
Performance Benchmark methodology and numbers
Library API Embed cmakefmt in Rust code
Troubleshooting Common issues and debug workflow
Playground Try cmakefmt in your browser
Contributing / Changelog How to help; what changed

Status

cmakefmt is stable and actively maintained. The built-in command spec is audited against CMake 4.3.1. The release contract and per-channel support levels are documented at Release.

License

cmakefmt is dual-licensed under MIT or Apache-2.0, at your option.


This project is independent from other Rust crates of the same name — it is not affiliated with azais-corentin/cmakefmt or yamadapc/cmakefmt.

Metadata

Release files for cmakefmt 2.1.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 cmakefmt 2.1.0
File Size Uploaded Provenance Actions
cmakefmt-2.1.0.tar.gz 181.5 kB With provenance Details for cmakefmt-2.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for cmakefmt 2.1.0
File Actions
cmakefmt-2.1.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for cmakefmt-2.1.0-py3-none-win_amd64.whl
cmakefmt-2.1.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for cmakefmt-2.1.0-py3-none-manylinux_2_28_x86_64.whl
cmakefmt-2.1.0-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for cmakefmt-2.1.0-py3-none-manylinux_2_28_aarch64.whl
cmakefmt-2.1.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for cmakefmt-2.1.0-py3-none-macosx_11_0_arm64.whl
cmakefmt-2.1.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for cmakefmt-2.1.0-py3-none-macosx_10_12_x86_64.whl

Total release size: 12.9 MB

Release files / cmakefmt-2.1.0.tar.gz

Download URL cmakefmt-2.1.0.tar.gz
Size 181.5 kB
Tags Source
SHA-256 checksum
How to use checksums
493ec9c06b9560535099c3b653b1ec245f8b57d04c500a0b630e9440cd614aac
BLAKE2b-256 checksum
How to use checksums
4d3ce088c62016eedbd240001acf11fbedeeff75b6d65dc711ce4c44d89044ad
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 6, 2026.

Transparency log

Release files / cmakefmt-2.1.0-py3-none-win_amd64.whl

Download URL cmakefmt-2.1.0-py3-none-win_amd64.whl
Size 2.7 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
66f69270503858079faeb65eaede91bfea96886e44f589fb5ad4a9f3dd9a2ced
BLAKE2b-256 checksum
How to use checksums
a67fce368e35a2b7d2b2c89695429e72ba15be9498a1aa1ee2111390d5384566
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 6, 2026.

Transparency log

Release files / cmakefmt-2.1.0-py3-none-manylinux_2_28_x86_64.whl

Download URL cmakefmt-2.1.0-py3-none-manylinux_2_28_x86_64.whl
Size 2.6 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
ebe5f81d421866756bc2d71789b045303f6a293a3198dc11abdcdcb3b23c0756
BLAKE2b-256 checksum
How to use checksums
63f1aeb14f51dddfac013b8dd3c3de29bfb401b5dd5c34f32b4b5458a7580515
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 6, 2026.

Transparency log

Release files / cmakefmt-2.1.0-py3-none-manylinux_2_28_aarch64.whl

Download URL cmakefmt-2.1.0-py3-none-manylinux_2_28_aarch64.whl
Size 2.5 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
de98a0d355c4dc49cf887a4d6210d92d5d3fb1aa1b586a00294b00c4d6b71c38
BLAKE2b-256 checksum
How to use checksums
a6e55fbdea8d71a282b4d767ac34e76c0f2b14f9937732096741f485b13fd47a
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 6, 2026.

Transparency log

Release files / cmakefmt-2.1.0-py3-none-macosx_11_0_arm64.whl

Download URL cmakefmt-2.1.0-py3-none-macosx_11_0_arm64.whl
Size 2.4 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
505152ac26641ef9dc638829f278159d3e93b6fdb8fae3acf0f76b04cde2b2a7
BLAKE2b-256 checksum
How to use checksums
f9cf6200d01a368b267e1ad1bfcf79cb01c0588b5fc0c80538933919a105574f
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 6, 2026.

Transparency log

Release files / cmakefmt-2.1.0-py3-none-macosx_10_12_x86_64.whl

Download URL cmakefmt-2.1.0-py3-none-macosx_10_12_x86_64.whl
Size 2.5 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
1963806690cb6f8750a9c908689a55f62fad52c0c6415506a3fa7aaa7ae140ba
BLAKE2b-256 checksum
How to use checksums
cc2db47403fc966a28d14136d987efa5c70e5204e83df686a653cadfe643def2
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 6, 2026.

Transparency log

Security for cmakefmt 2.1.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

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for cmakefmt-2.1.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 Oct 6, 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