Skip to main content

CMakeLint

PyPI - Python Version pypi PyPI - Downloads LICENSE uv ruff Gitmoji

cmakelint parses CMake files and reports style issues.

cmakelint requires Python.

Installation

To install cmakelint from PyPI, run:

pip install cmake-lint-paddle

Usage

cmakelint --help
usage: cmakelint [-h] [-v] [--filter -X,+Y] [--config CONFIG] [--spaces SPACES] [--linelength LINELENGTH] [--quiet] [files ...]

cmakelint

positional arguments:
  files                 files to lint

options:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  --filter -X,+Y        Specify a comma separated list of filters to apply
  --config CONFIG       Use the given file for configuration. By default the file $PWD/.cmakelintrc, ~/.config/cmakelintrc,
                        $XDG_CONFIG_DIR/cmakelintrc or ~/.cmakelintrc is used if it exists. Use the value "None" to use no configuration file
                        (./None for a file called literally None) Only the option "filter=" is currently supported in this file.
  --spaces SPACES       Indentation should be a multiple of N spaces
  --linelength LINELENGTH
                        This is the allowed line length for the project. The default value is 80 characters.
  --quiet               makes output quiet unless errors occurs Mainly used by automation tools when parsing huge amount of files. In those
                        cases actual error might get lost in the pile of other stats prints. This argument is also handy for build system
                        integration, so it's possible to add automated lint target to a project and invoke it via build system and have no
                        pollution of terminals or IDE.

Run the --filter= option with no filter to see available options. Currently these are:

convention/filename
linelength
package/consistency
readability/logic
readability/mixedcase
readability/wonkycase
syntax
whitespace/eol
whitespace/extra
whitespace/indent
whitespace/mismatch
whitespace/newline
whitespace/tabs

An example .cmakelintrc file would be as follows:

filter=-whitespace/indent

With this file in your home directory, running these commands would have the same effect:

cmakelint.py CMakeLists.txt
cmakelint.py --filter=-whitespace/indent CMakeLists.txt

Filters can optionally be directly enabled/disabled from within a CMake file, overriding the configuration from file or CLI argument:

# lint_cmake: <+ or -><filter name>
# e.g.:
# lint_cmake: -readability/wonkycase
# add multiple filters as list:
# lint_cmake: <+/-><filter1>, <+/-><filter2>

cmakelint can also be run with pre-commit. Add the following configuration block to your .pre-commit-config.yaml:

- repo: https://github.com/PFCCLab/cmake-lint-paddle
  rev: v1.5.2
  hooks:
     - id: cmakelint

Output status codes

The program should exit with the following status codes:

  • 0 if everything went fine
  • 1 if an error message was issued
  • 32 on usage error

Release files for cmake-lint-paddle 1.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cmake-lint-paddle 1.5.2
File Size Uploaded
cmake_lint_paddle-1.5.2.tar.gz 13.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cmake-lint-paddle 1.5.2
File Interpreter ABI Platform
cmake_lint_paddle-1.5.2-py3-none-any.whl Python 3 none any Details

Total release size: 31.4 kB

Release files / cmake_lint_paddle-1.5.2.tar.gz

Download URL cmake_lint_paddle-1.5.2.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b8a9a10adb746b61b0c4e6705a134b6c737d70d520129f0e43ef65aa22a13298
BLAKE2b-256 checksum
How to use checksums
d7dc23be6a365f561b4c8dda05f2c2b01220b732cb633cb6d0cc991b671e7e44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.5

Release files / cmake_lint_paddle-1.5.2-py3-none-any.whl

Download URL cmake_lint_paddle-1.5.2-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
576dc70022a91bfe6f1c71843b45e6f576078d605a93196a5c8afb53be443788
BLAKE2b-256 checksum
How to use checksums
6a2e54f5e320c92018645383578dcd79534fa7487b71e070669fc203333f4c43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.5

Release history Release notifications | RSS feed

This release

1.5.2 This release

2 release files

1.5.1

2 release files

1.5.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page