-
Notifications
You must be signed in to change notification settings - Fork 529
[DO NOT MERGE][WIP] lint: Add clang-tidy to pre-commits #1845
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @yzh119, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request integrates Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with π and π on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces clang-tidy
as a pre-commit hook to lint the C++/CUDA codebase, which is a great addition for maintaining code quality. The configuration is added in a new .clang-tidy
file and the hook is defined in .pre-commit-config.yaml
. My review found a potential misconfiguration in the .clang-tidy
file that could lead to unexpected linting behavior for member variables. Please see the specific comment for details and a suggested fix.
- key: readability-identifier-naming.ParameterCase | ||
value: lower_case | ||
- key: readability-identifier-naming.MemberCase | ||
value: lower_case_ |
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.
The value lower_case_
for MemberCase
seems incorrect, especially in combination with PrivateMemberSuffix: '_'
. This configuration implies that non-private member variables must end with an underscore (e.g., var_
), and private member variables must end with a double underscore (e.g., var__
) to pass the linter. This is likely not the intended style.
This is also inconsistent with VariableCase
and ParameterCase
which are set to lower_case
.
For a more conventional style where private members are suffixed with an underscore and public members are not, you should set MemberCase
to lower_case
.
value: lower_case
π Description
π Related Issues
π Pull Request Checklist
Add clang-tidy linter for C++/CUDA codebase as part of pre-commits
β Pre-commit Checks
pre-commit
by runningpip install pre-commit
(or used your preferred method).pre-commit install
.pre-commit run --all-files
and fixed any reported issues.π§ͺ Tests
unittest
, etc.).Reviewer Notes