-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Clang-formatter results in different formatting? #596
Comments
Hi @chrishkchris , I have tested on windows at my side. Could you please check again your configuration? I hope this guide could help: https://github.com/apache/singa-doc/blob/0efbdbee811901fbcd7ce1f2d057669cb246e4c9/docs-site/docs/contribute-code.md You might need to install LLVM in windows, and add below lines to VS Code configuration:
|
I have installed LLVM, and the following VS code configuration: { "[cpp]": { "editor.formatOnSave": true, Seems to be strange. I think my setting corresponding to clang-formatter is the same as you? |
is it due to the different of cpplint we uses? |
hi @chrishkchris have you installed this extension https://marketplace.visualstudio.com/items?itemName=xaver.clang-format |
clang-format is independent from cpplint |
version is the same? |
extension is auto updated i think |
may be for workaround could you try to set 'clang-format.language.cpp.style' this option to google. |
ok, I will try this one |
Yes, this is the solution Could you update this to the instruction so everyone can use the same? thanks a lot |
@shicong I will submit a PR in singa-doc to make this clear in the introduction |
@shicong I have updated the instruction in apache/singa-doc#4. I will close this issue when everything is okay. Thanks a lot for your advice! |
In apache/singa-doc#4, I also added also the google style for python yapf : |
Hi @chrishkchris FYI |
@chrishkchris is this issue fixed? |
@nudles I think to solve is to use the same version of formatters as well as the same config for all the contributors, where I addressed in the new doc repo for the instruction of how to do the formatting apache/singa-doc#4 @XJDKC I remembered that Rulin has even proposed a better method than me (the same docker container with the formatter pre-installed, with the same git hooks) |
I used the clang-formatter with VS-code after I alter the tensor.h file, it results in different format with the dev branch.
The tensor.cc should have re-formatted before in PR #581. So, did I use incorrect setting in clang-formatter?
The text was updated successfully, but these errors were encountered: