如何使用 cpplint 忽略文件夹
How to ignore folders with cpplint
你如何告诉cpplint忽略特定名称的文件夹?
我有.build
包含自动生成文件的文件夹,当我运行cpplint --recursive src
时,它会遍历这些文件夹并发现大量我不关心的错误。
我尝试使用 --exclude
参数,例如:
cpplint --recursive --exclude=.build src
但这没有效果。
我也试过:
cpplint --recursive --exclude=*/.build src
以及其他使用通配符的变体,但这些变体也没有效果。
试试这个:
./cpplint.py
$( find . -name *.h -or -name *.cc | grep -vE "^./<excluded_folder_name>/" )
您可以将此参数与 cpplint 命令一起使用:
find $PWD -not ( -path $PWD/<folder1> -prune ) -not ( -path $PWD/<folder2> -prune ) -not ( -path $PWD/<folder3> -prune ) -name *.cpp
要在所有子文件夹上递归运行而不检查特定的文件夹或文件,第一个参数应该从递归检查中排除,然后才启用递归。
我正在使用以下命令:
cpplint --exclude=./src/autogenerated --recursive ./src/ > /dev/null 2> ./codestyle.log
在这种情况下,cpplint
将以递归方式在所有文件夹中运行./src
但会省略./src/autogenerated dir
所有标准输出都将重定向到/dev/null 垃圾箱,所有我要修复的错误都将重定向到我的日志文件./codestyle.log
cpplint --exclude=fold/ * --exclude=fold/ * / * --exclude=fold/ * / * / *
exam.c
相关文章:
- 如何将更多文件夹添加到c++include路径
- GetShortPathName在网络驱动器上使用中文文件夹时失败
- VS2017,C++包含目录与附加包含目录,子文件夹包含失败-但为什么
- 在 Windows 上,是否可以让 dll 在不使用 PATH 环境变量的情况下在另一个文件夹中查找依赖项?
- 如何在文档文件夹中创建目录
- "assimp/config.h"找不到,但它在文件夹中
- C++入门 5 版:类消息和文件夹
- 我可以在 Arduino 的库文件夹之外安装库吗?
- 如何按文件扩展名引用文件夹中的文件
- 在QTreeView中仅显示共享驱动器和文件夹
- 加载与引用 .NET DLL 位于同一文件夹中的引用的 .NET DLL 时"Not found"异常
- 介子复制/安装头文件到输出目录并保持文件夹结构
- vcruntime.h 从 Windows 包含文件夹中丢失?
- 在文件夹迭代上实现 RAII
- 使用 Powershell 命令将 cpp 文件的文件夹编译为 GNU 的 g++
- 使文件夹中的所有文件可供所有项目(子目录)访问
- 无法使用 CMake 从其他文件夹添加源文件
- 如何在安卓工作室中将c ++头文件从一个文件夹导入到另一个文件夹?
- 如何从Windows控制台调用.exe(C++)以在不同的目录(或任何目录)中创建文件夹?
- 如何使用 cpplint 忽略文件夹