skillfed

cmake-format

Can format your listfiles so they don't look like crap

cmake-format v0.6.13 509.1K downloads/30d#6,272 on PyPI
Copyleft license GPLv3 Abandoned released

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-format

uv

uv add cmake-format

poetry

poetry add cmake-format

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: GNU General Public License v3 (GPLv3)

Tags

cmake formattercmake lintercmake code qualitycmake style checkerctest output parsercmake build file formatter
cmakecode-formatterabandoned

More Quality Assurance packages