deepmodeling / abacus-develop

An electronic structure package based on either plane wave basis or numerical atomic orbitals.
http://abacus.ustc.edu.cn
GNU Lesser General Public License v3.0
166 stars 129 forks source link

CI: `readability-braces-around-statements` did not work as expected #4523

Closed haozhihan closed 3 months ago

haozhihan commented 3 months ago

Describe the Code Quality Issue

https://github.com/deepmodeling/abacus-develop/blob/develop/.clang-tidy#L8

Why didn't readability-braces-around-statements work in CI?

I verified on my own server that A is working properly.

image

clang-tidy test.cpp -checks='-*,readability-braces-around-statements' -fix

image

Additional Context

No response

Task list for Issue attackers (only for developers)

caic99 commented 3 months ago

@haozhihan Please check the exact command for clang-tidy.

haozhihan commented 3 months ago

https://clang.llvm.org/extra/clang-tidy/checks/readability/braces-around-statements.html

According to this, I found that Clang-Tidy Checks does not provide fixes for readability-braces-around-statements.

But why can I achieve the effect of fix on my own server, caused by the different versions of clang-tidy?

caic99 commented 3 months ago

But why can I achieve the effect of fix on my own server, caused by the different versions of clang-tidy?

@haozhihan Maybe it is a clang-format feature?

haozhihan commented 3 months ago

wow! Great!

Is the clang-format version on our CI machine up to clang-format 15?

@caic99

caic99 commented 3 months ago

@haozhihan It is installed by apt. Please check the commands here. The version should be 14 (ref). It is also possible to install it by pip for the latest version.

haozhihan commented 3 months ago

@haozhihan It is installed by apt. Please check the commands here. The version should be 14 (ref). It is also possible to install it by pip for the latest version.

Should I use sudo pip install clang-format instead of the previous download method clang-format? like this

caic99 commented 3 months ago

Should I use sudo pip install clang-format instead of the previous download method clang-format? like this

It's OK. Don't forget to migrate clang-tidy.