Skip to content

fix(C++): add .clang-tidy configuration and fix missing brackets#851

Merged
yangxk1 merged 2 commits intoapache:mainfrom
SYaoJun:0210_bracket
Feb 14, 2026
Merged

fix(C++): add .clang-tidy configuration and fix missing brackets#851
yangxk1 merged 2 commits intoapache:mainfrom
SYaoJun:0210_bracket

Conversation

@SYaoJun
Copy link
Contributor

@SYaoJun SYaoJun commented Feb 10, 2026

Reason for this PR

  1. 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.

  2. Using this configuration, I identified some warnings and primarily fixed the missing brackets in this update.

  3. 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?

@codecov-commenter
Copy link

codecov-commenter commented Feb 10, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.21%. Comparing base (1555815) to head (27762a0).

Files with missing lines Patch % Lines
cpp/src/graphar/label.cc 50.00% 1 Missing ⚠️
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           
Flag Coverage Δ
cpp 71.50% <66.66%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SYaoJun
Copy link
Contributor Author

SYaoJun commented Feb 10, 2026

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.

@SYaoJun SYaoJun force-pushed the 0210_bracket branch 3 times, most recently from 4b8ba2b to 256acff Compare February 10, 2026 14:20
@SYaoJun
Copy link
Contributor Author

SYaoJun commented Feb 11, 2026

@yangxk1 please review the code

@Sober7135
Copy link
Contributor

My question is: will clang-tidy be triggered in CI?

If not, I think you should add it.

@SYaoJun
Copy link
Contributor Author

SYaoJun commented Feb 11, 2026

My question is: will clang-tidy be triggered in CI?

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.

@Sober7135
Copy link
Contributor

My question is: will clang-tidy be triggered in CI?
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.

@SYaoJun
Copy link
Contributor Author

SYaoJun commented Feb 11, 2026

My question is: will clang-tidy be triggered in CI?
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.

@yangxk1
Copy link
Contributor

yangxk1 commented Feb 14, 2026

Nice! How much pre-commit time will increase approximately?

@SYaoJun
Copy link
Contributor Author

SYaoJun commented Feb 14, 2026

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>
Copy link
Contributor

@yangxk1 yangxk1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you @Sober7135

@yangxk1 yangxk1 merged commit eab0fa5 into apache:main Feb 14, 2026
12 checks passed
@SYaoJun SYaoJun deleted the 0210_bracket branch February 14, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants