gpt4 book ai didi

c++ - 如何使用 cpplint 忽略文件夹

转载 作者:行者123 更新时间:2023-11-30 05:17:36 24 4
gpt4 key购买 nike

你怎么知道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

关于c++ - 如何使用 cpplint 忽略文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42060045/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com