skillfed

cmakelint

Static code checker for CMake files

cmakelint v1.4.3 83.0K downloads/30d#14,106 on PyPI107
Permissive license Apache 2.0 DORMANT released

What it is and what it does

cmakelint is a static code checker for CMake files that enforces style and quality rules. It parses CMakeLists.txt and related CMake scripts, then reports violations across multiple categories: syntax errors, whitespace issues (indentation, tabs, line endings, extra whitespace), readability problems (mixed case, logic clarity), package consistency, and filename conventions. The tool is configured via command-line filters or a .cmakelintrc configuration file, and supports inline directives within CMake files to override rules on a per-file basis.

It integrates into development workflows as a standalone command-line tool or as a pre-commit hook. With no runtime dependencies and a pure-Python wheel distribution, installation is straightforward. The package has been stable since its early releases and remains in production use, though active development has slowed.

Use it for:

  • Enforce consistent CMake style across a project before committing code.
  • Integrate CMake linting into CI/CD pipelines to catch style violations early.
  • Set up pre-commit hooks to automatically check CMakeLists.txt files on each commit.
  • Audit existing CMake codebases for whitespace and naming convention violations.
  • Configure project-specific CMake rules via .cmakelintrc to match team standards.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

cmakelint parses CMake files and reports style violations across syntax, whitespace, readability, and naming conventions.

Yes, if you maintain CMake projects and want automated style checking. The tool is lightweight, dependency-free, and permissively licensed. The dormant maintenance status is a minor concern for new features, but the stable codebase and lack of known vulnerabilities make it safe for ongoing use in established workflows.

Install

cmakelint on PyPI

pip

pip install cmakelint

uv

uv add cmakelint

poetry

poetry add cmakelint

Installing cmakelint

Before you install

Low install friction with no runtime dependencies. Maintenance is dormant—last release was in May 2024—but the repository remains active and the package is marked Production/Stable.

License in practice

Licensed under Apache 2.0 (permissive), allowing use in commercial and private projects with minimal restrictions.

Quickstart

pip install cmakelint

cmakelint CMakeLists.txt

# With filters:
cmakelint --filter=-whitespace/indent CMakeLists.txt

Verify before relying

  • Whether Python version constraints exist despite requires_python being unspecified.
  • Current status of pre-commit integration mentioned in the description.

Package facts

License Apache 2.0 (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance dormant — 824 days since the last release
Last repo commit
First released
Downloads 83,016/month — #14,106 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: cmakelint-1.4.3-py3-none-any.whl

Keywords: cmake, lint

Development Status :: 5 - Production/StableEnvironment :: ConsoleLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: OtherProgramming Language :: PythonTopic :: Software Development

Tags

cmake lintercmake style checkercmake code qualitycmake static analysiscmake lint toolcmake format checker
cmakelintingbuild-tools

More Software Development packages