-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Add cpplint pre-commit hook #9511
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
Conversation
I also disabled dropout_op_test in this PR (#9507) |
Thought we already have clang-format, and in |
It seems that |
clang-format can but can only fix a small fraction of cpplint errors. @typhoonzero |
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.
LGTM! Thanks!
TOTAL_ERRORS=0 | ||
|
||
# The trick to remove deleted files: https://stackoverflow.com/a/2413151 | ||
for file in $(git diff --cached --name-status | awk '$1 != "D" {print $2}'); do |
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.
So CI won't check cpplint since git diff is clean when running CI. Good idea, so we can turn on CI enforcement later, gradually transition into full cpplint check.
We have many code style problems in even the most recent Fluid code. An example is #9505. I am worried that during the period of performance profiling and tuning, which implies very high pressure to the team, we'd care even less about code style. So I am add cpplint into our pre-commit hook.
Fixes #9510