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.89 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.

Wrapped target_sources(FILE_SET ...) calls keep TYPE, BASE_DIRS, and FILES on separate nested lines; calls that fit on one line stay inline.

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.3.2

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.3.2
File Size Uploaded Provenance Actions
cmakefmt-2.3.2.tar.gz 190.6 kB With provenance Details for cmakefmt-2.3.2.tar.gz

Built distributions (wheels)

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

Total release size: 15.7 MB

Release files / cmakefmt-2.3.2.tar.gz

Download URL cmakefmt-2.3.2.tar.gz
Size 190.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ec85225e2b1301c60617bd43b6f2a5d4369b5d81ca58f64995785d59726ed1cc
BLAKE2b-256 checksum
How to use checksums
6c36b656c48ab4c393125a282e4e447587e30a5e5fa4e530daecaedce181aa05
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 Oct 27, 2026.

Transparency log

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

Download URL cmakefmt-2.3.2-py3-none-win_amd64.whl
Size 3.3 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
c88190e69e77a38d00c58491b985392817e7494961976c8110eb2f3246a1030c
BLAKE2b-256 checksum
How to use checksums
f54669737cf059dbd49f58d10ccfb895bdab919388edb3720d432503e80fffbd
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 Oct 27, 2026.

Transparency log

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

Download URL cmakefmt-2.3.2-py3-none-manylinux_2_28_x86_64.whl
Size 3.2 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
3276320e413008e936145e25d8fad0ceb941bcf285b432f1a8486865d6861a2b
BLAKE2b-256 checksum
How to use checksums
a027e01a4ae2696d4710536f4e09528ae62d458ac70474445c8321f24df72020
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 Oct 27, 2026.

Transparency log

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

Download URL cmakefmt-2.3.2-py3-none-manylinux_2_28_aarch64.whl
Size 3.0 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
e7d8f07eb0874b3e40e17ebcdbb42b43c8380166528cc83b65fe9e90c69e4a94
BLAKE2b-256 checksum
How to use checksums
b00be36dbda000e0047e7b26be1585bab232858cda3e3954759fb16a1883687b
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 Oct 27, 2026.

Transparency log

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

Download URL cmakefmt-2.3.2-py3-none-macosx_11_0_arm64.whl
Size 2.9 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4dd69a2ad91e0b558b9885beb01ae91a8871daad7b506fb63bfe19c624c412b5
BLAKE2b-256 checksum
How to use checksums
d56f319e7b855ef1774d10e9c32d66914dc66a6d6887f6b4b2174f19248c8aa9
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 Oct 27, 2026.

Transparency log

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

Download URL cmakefmt-2.3.2-py3-none-macosx_10_12_x86_64.whl
Size 3.1 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
8eed4b554a832139f87660f315649e68b847cf4fcec45bd25f808360e6685c5a
BLAKE2b-256 checksum
How to use checksums
be7a1b6579c9b1cdfd690bcb74fead5d2f34a3ea0ecc5b5901d6cbf5d3ad77ab
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 Oct 27, 2026.

Transparency log

Security for cmakefmt 2.3.2

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.3.2.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 27, 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