cmake-format
Can format your listfiles so they don't look like crap
What it is and what it does
cmake-format is a suite of QA tools for CMake build files. It includes a formatter that rewrites CMakeLists.txt and other listfiles to conform to a configurable style (line width, indentation, spacing rules), a linter that checks for problems, an annotator that generates HTML documentation, and a utility to parse ctest output into JSON or XML. Configuration is flexible—you can use YAML, JSON, or Python format files, and the tool searches parent directories for a matching config file if none is specified.
The package depends only on cmakelang, a single runtime dependency. It is designed as a command-line tool and integrates with editors (VSCode, Sublime) and pre-commit hooks. However, the project has been abandoned since August 2020 with no active maintenance, meaning it will not receive bug fixes, security updates, or compatibility patches for newer CMake or Python versions.
Use it for:
- Enforce consistent formatting across CMake files in a project to improve readability and reduce style drift.
- Detect common mistakes and style violations in CMakeLists.txt files during code review or CI/CD pipelines.
- Generate structured reports from ctest runs for integration with dashboards or test result aggregation systems.
- Automatically format CMake code as part of a pre-commit hook or editor integration workflow.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Formats, lints, and annotates CMake listfiles, and converts ctest output to structured formats like JSON or XML.
No, not recommended for new projects. The package is abandoned (last release 2020-08-19) and will not receive maintenance, security updates, or compatibility fixes. While it has low install friction and no known vulnerabilities, the lack of active development means it may break with newer CMake or Python versions. Consider a maintained alternative or community fork if CMake formatting is critical to your workflow.
Install
cmake-format on PyPI
pip
pip install cmake-formatuv
uv add cmake-formatpoetry
poetry add cmake-formatInstalling cmake-format
Before you install
Low install friction with a single runtime dependency. However, the package is abandoned—last release was 2020-08-19, over 2186 days ago. No active maintenance or security updates should be expected.
License in practice
Licensed under GPLv3 (copyleft). Any derivative work or distribution must also be licensed under GPLv3 and include source code.
Quickstart
pip install cmakelang
cmake-format --in-place path/to/CMakeLists.txt
cmake-lint path/to/CMakeLists.txt
Verify before relying
- Whether the package works with modern CMake versions and current Python releases
- Whether the abandoned status means critical bugs remain unfixed
- Whether community forks or maintained alternatives have superseded this project
Package facts
| License | GPLv3 (copyleft) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — cmakelang |
| Maintenance | abandoned — 2,186 days since the last release |
| First released | |
| Downloads | 509,123/month — #6,272 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cmake_format-0.6.13-py3-none-any.whl
Keywords: cmake, format, formatter
Tags
More Quality Assurance packages
Coverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
ruffRuff is a Python linter and code formatter…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
blackBlack reformats Python source code to a…
permissive · top 1,000 on PyPI
pytest-xdistpytest-xdist distributes pytest tests across…
permissive · top 1,000 on PyPI
cfn-lintValidates AWS CloudFormation templates in YAML…
permissive · top 1,000 on PyPI
cmakelangProvides command-line tools to format, lint,…
copyleft · top 5,000 on PyPI
gersemigersemi is a command-line formatter for CMake…
copyleft · top 15,000 on PyPI
cmakelintcmakelint parses CMake files and reports style…
permissive · top 15,000 on PyPI
flake8-formatter-junit-xmlFormats flake8 linting output as JUnit XML,…
permissive · top 15,000 on PyPI
EditorConfigParses and applies EditorConfig files to…
permissive · top 5,000 on PyPI
cmakeDistributes CMake 4.4.2 as a Python package,…
permissive · top 5,000 on PyPI
pytest-cmakeIntegrates Pytest with CMake build systems,…
permissive · top 15,000 on PyPI
xmlformatterFormats and compresses XML documents by…
permissive · top 15,000 on PyPI
toml-sortCommand-line utility and Python library to sort…
permissive · top 15,000 on PyPI
mdformatMdformat is a CommonMark-compliant command-line…
permissive · top 5,000 on PyPI