Add cpplint pre-commit hook#9511
Merged
wangkuiyi merged 5 commits intoPaddlePaddle:developfrom Mar 30, 2018
Merged
Conversation
Collaborator
Author
|
I also disabled dropout_op_test in this PR (#9507) |
Contributor
|
Thought we already have clang-format, and in |
Contributor
|
It seems that |
Collaborator
Author
|
clang-format can but can only fix a small fraction of cpplint errors. @typhoonzero |
helinwang
approved these changes
Mar 30, 2018
| 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 |
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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