A fork of cmake-lint for PaddlePaddle
Project description
CMakeLint
cmakelint parses CMake files and reports style issues.
cmakelint requires Python.
Installation
To install cmakelint from PyPI, run:
pip install cmake-lint-paddle
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
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.0
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cmake-lint-paddle-1.5.0.tar.gz
.
File metadata
- Download URL: cmake-lint-paddle-1.5.0.tar.gz
- Upload date:
- Size: 16.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2c3ab37bb6ccc94f5bbb3cbcb96b6bce9f537192533f32d8130a43f87b8303d |
|
MD5 | af1918f4a70096d415cd3040b5519086 |
|
BLAKE2b-256 | f83fcdf372bedd31caee304ccf34b7f987b7a8a75d86b616391996882b49dd83 |
File details
Details for the file cmake_lint_paddle-1.5.0-py3-none-any.whl
.
File metadata
- Download URL: cmake_lint_paddle-1.5.0-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83bdd3fcfb1b5fb60d08fde1216d0c4ad73ea04a4a0c7fa9410d5df31870a873 |
|
MD5 | 445caf3eeffb8ca87ea3e52e80f4fc92 |
|
BLAKE2b-256 | bce0ca33370de06f6854e8188ea61452abd19da4cde8e2e57ebcb2d6dd45a8de |