cmake文件的静态代码检查器
cmakelint的Python项目详细描述
cmakelint
cmakelint分析cmake文件并报告样式问题。
cmakelint需要python。
安装
要从pypi安装cpplint,请运行:
。代码块::bash
$ pip install cmakelint
用法
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
$HOME/.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.
运行不带筛选器的--filter=
选项以查看可用选项。目前
这些是:
convention/filename
linelength
package/consistency
readability/logic
readability/mixedcase
readability/wonkycase
syntax
whitespace/eol
whitespace/extra
whitespace/indent
whitespace/mismatch
whitespace/newline
whitespace/tabs
例如.cmakelintrc文件如下:
filter=-whitespace/indent
使用主目录中的这个文件,运行这些命令将 相同效果:
cmakelint.py CMakeLists.txt
cmakelint.py --filter=-whitespace/indent CMakeLists.txt
输出状态代码
程序应退出以下状态代码:
- 0如果一切顺利
- 1如果发出错误消息
- 32关于使用错误