-
Notifications
You must be signed in to change notification settings - Fork 612
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
[CI] Add cpplint as sanity check #1808
Conversation
Make required changes to ensure clean cpplint run. Command: $ cpplint --filter=-build/header_guard --recursive tensorflow_addons/custom_ops
Do we have a cpplint hook? |
Probably we need a |
We already have pre-commit and sanity check with |
I see no special derived extra style rules in Tensorflow: So I think we could align with clang-format pass. |
@bhack This is not for formatting, it's using cpplint. The changes here are to make everything uniform and some accepted practices for C++ ( We might want to consider adding cpplint to our CI (cc @gabrieldemarmiesse @seanpmorgan) |
Ok so It Is like in the perimeter of clang-tidy (for clang tools) |
I've seen some comments in Tensorflow source code related to clang-tidy Do you know if there Is a clang-tidy pass with a configuration in the Tensorflow CI? |
@bhack I don't think TensorFlow runs I used |
Yes the scope was just to know how to create an uniform experience. |
I'm not a C++ dev, so I'll trust you @Squadrick if you want to add another tool for c++ in the CI. You can add an entry to the sanity checks dockerfile. |
I am ok but I don't find also cpplint in their public Sanity check CI scripts. @angerson do you have any info about a |
Though we do not necessarily need to stick with the style of TF (like black), I personally prefer clang-tidy to cpplint. |
E.g. on Chromium the config Is pubblic https://github.com/chromium/chromium/blob/master/.clang-tidy |
Here's TensorFlow's style guide, which advocates clang-tidy: https://www.tensorflow.org/community/contribute/code_style?hl=en |
@angerson If you see we already mentioned that public link in this ticket. But that Is related to clang-format not about static checks (clang-tidy Is only the package name to install there not the binary to run) |
Either cpplint or clang-tidy's linter should be fine, then. Google exposes both for linting changesets, but IIRC TensorFlow's CI does not specifically enforce any linting. |
As we have no formal pass in Tensorflow and we have already clang-tidy installed from the same package of clang-format in our CI we could do what we want. I am not sure but I Remember that if we will need clang-tidy can check a superset of cpplint but I need to double check this. |
When importing changes, we do run clang-tidy with the internal config on them. So, the first question I have is, is ensorflow/addons mirrored internally, now or sometime in the future(@karmel @theadactyl ). If yes, you may want to use clang-tidy instead. |
The ideal soultion would be to have a public clang-tidy conf like in Chromium to have an homogenus experience across SIGs and Tensorflow code for contributors but I don't know the internal policies why this could be public in Chromium and not for Tensorflow as boths proejcts have close soruce versions. |
Not exactly. Chromium uses a completely different scm than the rest of google. |
@gunan Thanks for the little disclosure. I don't have a view on the internal Google repos so mine was just a reverse (engineering) guessing about how you are organized. I picked Chromium as an example cause at some point I thought it is going to integrate in the Chrome codebase and it could have a similar relationship like the opensource and closed source Tensorflow versions (and it is why I picked that specific example and e.g. not Clang tidy config in Goolge-cloud-cpp. |
@gabrieldemarmiesse @seanpmorgan I've added Could you review this, please? |
I think that we could separate |
I have an additional question. Is it still officially maintained by Google? See google/styleguide#528. |
From https://pypi.org/project/cpplint/
|
Make the required changes to ensure clean cpplint run.
Command: