-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
C++ linter #163
C++ linter #163
Conversation
Wow these are a lot of changes, I hope it doesn't break any of the other PR, specially the one @shelhamer is doing in |
@sguada it's ok. We're going to merge the re-arrangement first then check this out. Having a clean cup of Caffe with these changes will be nice. Thanks @jeffdonahue. |
(also change EXPECT_LT and EXPECT_GT pair to EXPECT_NEAR)
this is good to go (barring any further need to rebase) |
I vote we merge this now, then do another lint pass once #165 is in. I don't want this to be relegated to @jeffdonahue ok with you? |
Yup, sounds good to me |
@jeffdonahue great job It works great, I already found some "errors" in my code. |
Lint C++ (suffer for fashion)
Lint C++ (suffer for fashion)
Lint C++ (suffer for fashion)
Moved file accidentally - moving it back
Add Google's C++ linter (scripts/cpp_lint.py) with "lint" target in Makefile (run "make lint" to run the linter on all C source/header files) and fix all of its errors for the current codebase. The linter statically checks C++ code against some of the C++ style conventions Caffe follows, heavily inspired by Google's C++ style guide.
If this PR is accepted, all future Caffe contributions should be required to run "make lint" with an output of "Total errors found: 0" before merging (returns status code 0 in this case). In some cases this may involve explicit suppression of certain false positive linter errors (or when there's just a good enough reason to break convention) using NOLINT and NOLINT_NEXTLINE (the latter of which I added to the cpp_lint.py script due to the same line NOLINT almost always making the line run over 80 characters).