Skip to main content

A fast, correct CMake formatter

Project description

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.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cmakefmt-1.4.0.tar.gz (156.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

cmakefmt-1.4.0-py3-none-win_amd64.whl (2.8 MB view details)

Uploaded Python 3Windows x86-64

cmakefmt-1.4.0-py3-none-manylinux_2_39_x86_64.whl (2.7 MB view details)

Uploaded Python 3manylinux: glibc 2.39+ x86-64

cmakefmt-1.4.0-py3-none-manylinux_2_39_aarch64.whl (2.5 MB view details)

Uploaded Python 3manylinux: glibc 2.39+ ARM64

cmakefmt-1.4.0-py3-none-macosx_11_0_arm64.whl (2.4 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

cmakefmt-1.4.0-py3-none-macosx_10_12_x86_64.whl (2.5 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file cmakefmt-1.4.0.tar.gz.

File metadata

  • Download URL: cmakefmt-1.4.0.tar.gz
  • Upload date:
  • Size: 156.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cmakefmt-1.4.0.tar.gz
Algorithm Hash digest
SHA256 c003e98275466d468e48d16d54e7f69c196f415c9524722915747a7691476eae
MD5 49de9116f39cd6b542d70874e62cf560
BLAKE2b-256 ff8b5dcb5ef3cbabfd4bb1f0dae6d8eb9871ed17ad4926ad7ba45a624f16ce07

See more details on using hashes here.

Provenance

The following attestation bundles were made for cmakefmt-1.4.0.tar.gz:

Publisher: release.yml on cmakefmt/cmakefmt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cmakefmt-1.4.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: cmakefmt-1.4.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cmakefmt-1.4.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 0dd31b9be99093a515c207b5e05d8a799a938e0f1781a0eb4777295f058086a6
MD5 225c41264ef2a58b70b39b612a51fa5d
BLAKE2b-256 cfcb56e5b15dfc40198bb562947dddeb441321795785e258a69b9b75ee01e732

See more details on using hashes here.

Provenance

The following attestation bundles were made for cmakefmt-1.4.0-py3-none-win_amd64.whl:

Publisher: release.yml on cmakefmt/cmakefmt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cmakefmt-1.4.0-py3-none-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for cmakefmt-1.4.0-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 cfd8a82f0e6bac0ad0b81291103a3bc7be29c9f81cac965b8b637788e66211ab
MD5 7498a67f50e292d8f59586ecf1655f4a
BLAKE2b-256 8b150086df0d62d92c5af13c3041a1074ce7032a0b9b11a62ee823036b761470

See more details on using hashes here.

Provenance

The following attestation bundles were made for cmakefmt-1.4.0-py3-none-manylinux_2_39_x86_64.whl:

Publisher: release.yml on cmakefmt/cmakefmt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cmakefmt-1.4.0-py3-none-manylinux_2_39_aarch64.whl.

File metadata

File hashes

Hashes for cmakefmt-1.4.0-py3-none-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 0bf7cea2037c136fac90c0a3eb8cfb07b901d0db3f739306c4c6d8cd7603ee02
MD5 472626b515b7d85cf74f838f039b2386
BLAKE2b-256 9636dd7daaa8f9561374546524e5c3f2d9cb8babea4dcf31ea46109208085cd8

See more details on using hashes here.

Provenance

The following attestation bundles were made for cmakefmt-1.4.0-py3-none-manylinux_2_39_aarch64.whl:

Publisher: release.yml on cmakefmt/cmakefmt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cmakefmt-1.4.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cmakefmt-1.4.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c7072d8f5a80a56095cb2dc618a66ba8ff9894bfe73a35d948935b8905c2ac71
MD5 69b3defbeb67595e77a8f0408fa41566
BLAKE2b-256 7b4a59d3778568245b2c0f875c7a24347bc5adc873ad97c0e041c6051dfcde73

See more details on using hashes here.

Provenance

The following attestation bundles were made for cmakefmt-1.4.0-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on cmakefmt/cmakefmt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cmakefmt-1.4.0-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for cmakefmt-1.4.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 047693676cf17eeb0cd4a94055b85a819ffddf13c237aa242e4536438418721b
MD5 e65dbe6ff27d180ae271d95f2f6311dc
BLAKE2b-256 b3d1e2d10b64709e4cd302c13a2e6c157cf7c7be48e557a142c6bf618410c5cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for cmakefmt-1.4.0-py3-none-macosx_10_12_x86_64.whl:

Publisher: release.yml on cmakefmt/cmakefmt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page