fix(C++): add .clang-tidy configuration and fix missing brackets#851
fix(C++): add .clang-tidy configuration and fix missing brackets#851yangxk1 merged 2 commits intoapache:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #851 +/- ##
=========================================
Coverage 80.21% 80.21%
Complexity 615 615
=========================================
Files 93 93
Lines 10258 10258
Branches 1049 1050 +1
=========================================
Hits 8228 8228
Misses 1790 1790
Partials 240 240
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This PR maybe rely on #847. Because there are two different clang-format commands. I prefer to use pre-commit to check. It can check the whole project cpp files. |
4b8ba2b to
256acff
Compare
|
@yangxk1 please review the code |
|
My question is: will If not, I think you should add it. |
@Sober7135 thanks your suggestion. Currently, it will not be triggered in CI since there are too many warnings. I have to fix them by category for clearer review. In my second and third steps, I will add .clang-tidy to CI. |
Ok. I think you should open a issue to document this. |
good suggestion. |
256acff to
5bba90a
Compare
|
Nice! How much pre-commit time will increase approximately? |
Currently is manually check which not affect overall time. I will enable it check staged files recently and it maybe takes less than 1 second. |
Signed-off-by: 姚军 <940334249@qq.com>
yangxk1
left a comment
There was a problem hiding this comment.
LGTM, thank you @Sober7135
Reason for this PR
I found that the C++ code lacked a formal configuration to enforce formatting standards. Therefore, I copied the .clang-tidy configuration from Apache Arrow and removed the unnecessary filters.
Using this configuration, I identified some warnings and primarily fixed the missing brackets in this update.
For the next step, I plan to integrate clang-tidy into the CI pipeline and address the remaining warnings.
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?