Skip to main content

Static code checker for CMake files

Project description

CMakeLint

Build Status PyPI PyPI - Downloads PyPI - Downloads

cmakelint parses CMake files and reports style issues.

cmakelint requires Python.

Installation

To install cmakelint from PyPI, run:

.. code-block:: bash

$ pip install cmakelint

Usage

Syntax: cmakelint [--config=file] [--filter=-x,+y] <file> [file] ...
filter=-x,+y,...
  Specify a comma separated list of filters to apply

config=file
  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.

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

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

  - repo: https://github.com/cmake-lint/cmake-lint
    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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cmakelint-1.4.2.tar.gz (69.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cmakelint-1.4.2-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file cmakelint-1.4.2.tar.gz.

File metadata

  • Download URL: cmakelint-1.4.2.tar.gz
  • Upload date:
  • Size: 69.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for cmakelint-1.4.2.tar.gz
Algorithm Hash digest
SHA256 87079ff6bb74bc961522aef64dedf2aeb90a8152718eabe105f1f261451b7329
MD5 1f8e242b9a371106819b45f4a4d3692d
BLAKE2b-256 cb117b66406852ff00e6468149bee3d3563eef515750dd716bf16e19e1513520

See more details on using hashes here.

File details

Details for the file cmakelint-1.4.2-py3-none-any.whl.

File metadata

  • Download URL: cmakelint-1.4.2-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for cmakelint-1.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7ffec322830b03d2ddf2a2cf904f4808afc8f63c39868f6b4263186d5c7ec244
MD5 27d7542c38fc86ca0adbdcb05d1c70e2
BLAKE2b-256 04bb539f97a57aaa10dbe9f71349fb22c514702676ac7fbae5a036cdbb4aabf1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page