-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[tools][clang-tidy] add skip file #56632
Conversation
@GreatV 帮忙检查一下 |
tools/codestyle/clang-tidy.py
Outdated
@@ -93,6 +93,51 @@ def make_absolute(f, directory): | |||
return os.path.normpath(os.path.join(directory, f)) | |||
|
|||
|
|||
def analysis_gitignore(path, filename=".gitignore"): | |||
"""Analysis gitignore file and return ignore file list""" | |||
f = open(path + "/" + filename, "r") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里用 with open
会不会好一点
tools/codestyle/clang-tidy.py
Outdated
ignore_file_list = [] | ||
for line in lines: | ||
# Blank row | ||
if line == "\n": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
windows 下会不会把LF替换成CRLF
tools/codestyle/clang-tidy.py
Outdated
if "#" in line: | ||
if line[0] != "#": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可不可以换成这样的写法
line = line.strip()
...
if line.startswith("#")
python ./tools/codestyle/clang-tidy.py -p=build -j=10 -clang-tidy-binary=clang-tidy -extra-arg=-Wno-unknown-warning-option -extra-arg=-Wno-pessimizing-move -extra-arg=-Wno-braced-scalar-init -extra-arg=-Wno-deprecated-copy -extra-arg=-Wno-dangling-gsl -extra-arg=-Wno-final-dtor-non-final-class -extra-arg=-Wno-implicit-int-float-conversion -extra-arg=-Wno-inconsistent-missing-override -extra-arg=-Wno-infinite-recursion -extra-arg=-Wno-mismatched-tags -extra-arg=-Wno-self-assign -extra-arg=-Wno-sign-compare -extra-arg=-Wno-sometimes-uninitialized -extra-arg=-Wno-tautological-overlap-compare -extra-arg=-Wno-unused-const-variable -extra-arg=-Wno-unused-lambda-capture -extra-arg=-Wno-unused-private-field -extra-arg=-Wno-unused-value -extra-arg=-Wno-unused-variable -extra-arg=-Wno-overloaded-virtual -extra-arg=-Wno-defaulted-function-deleted -extra-arg=-Wno-delete-non-abstract-non-virtual-dtor -extra-arg=-Wno-return-type-c-linkage > clang-tidy_v2.log 2>&1 运行完还会有相关报错
|
Done |
* [clang-tidy]add skip * fix compatibility * fix
PR types
Others
PR changes
Others
Description
跳过一些
.gitignore
里面的文件, 跳过编译目录, 跳过.cu
后缀文件检查数量从 2991 减少到 2220, 减少 771 个
测试的编译选项为
相关链接: