-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[RFC] Add canonical and standard clang-format rules. #1732
Comments
I mainly use VIM with the vim-clang-formt plugin. I dumped the .clang-format config file: clang-format -style=google -dump-config > .clang-format I am not sure how git-hooks can automatically format code. It looks we still need developers to install these tools to comply with the style rules. Or can we do some code style check, like cpplint? But I am not aware of such a tool. |
Facebook's glow (https://github.com/pytorch/glow) has a clang-format, as well as clang-tidy, maybe we could learn something from them. |
Let us act on this, any volunteers? |
I think the easiest thing is to add a .clang-format in the project root dir as most of other projects do as @junrushao1994 suggested. If that's what we want I can probably add a simple one to follow Google style: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/.clang-format |
that sounds good, @zhiics can you open a PR, we only need to modify a bit in terms of max chars per line(we use 100 chars). |
@tqchen NP. Let me do that. |
close by #2395 |
I have noticed inconsistencies between TVM's style as written today the Google C++ style as formatted by tools such as
clang-format
.This proposal is simply a request for us to create a standard
clang-format
configuration file and apply it uniformly to all code and PRs. We could even set up git-hooks to do this automatically for TVM developers.Thoughts?
cc @zhiics
The text was updated successfully, but these errors were encountered: