tools: add clang-tidy rule in src
In short
- make cpp check rules explicit and get checked by CI
- select the rules most collaborators are comfortable with
Todo
Tools to ensure the rules
@refack told me some rules are checked.
Basically the rules should check most operating systems because we have platform-specific code such as using macro.
And should keep clang-tidy in same version when possible.
I have some thought on docker get involved in this. Hopefully I can put my thought
in node\build
group this weekends.
Google Cpp Guideline
Related to https://github.com/nodejs/node/pull/24315. clang-tidy can handle some google cpp guideline rules. I don't know should we
- use clang-tidy to ensure google-related rule
- should we add all
google-
or just some of them. see https://clang.llvm.org/extra/clang-tidy/
Rules need to be select.
The rules now included are already applied or in-review.
How to deal with false positive and make exceptions
.
cc @addaleax @bnoordhuis @refack @joyeecheung @jasnell @richardlau @danbev @trott @BridgeAR
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines