cmakelint
Static code checker for CMake files
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 cmakelintuv
uv add cmakelintpoetry
poetry add cmakelintInstalling 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
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
cmakelangProvides command-line tools to format, lint,…
copyleft · top 5,000 on PyPI
EditorConfigParses and applies EditorConfig files to…
permissive · top 5,000 on PyPI
gersemigersemi is a command-line formatter for CMake…
copyleft · top 15,000 on PyPI
cmake-formatFormats, lints, and annotates CMake listfiles,…
copyleft · top 15,000 on PyPI
cpplintCpplint is a command-line static code checker…
permissive · top 15,000 on PyPI
tclinttclint is a CLI linter, formatter, and language…
permissive · top 15,000 on PyPI
yamllintyamllint checks YAML files for syntax errors,…
copyleft · top 1,000 on PyPI
sphinx-lintSphinx Lint checks reStructuredText and Python…
permissive · top 15,000 on PyPI
pep8Checks Python code against PEP 8 style…
permissive · top 5,000 on PyPI
dotenv-linterLints `.env` files for consistency violations…
permissive · top 15,000 on PyPI