-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Switching to Pytorch's clang-formatter. #2872
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me.
I don't know who maintains the oss-clang-format
on PyTorch side though, so it would be good to let them know that we started using it.
cc @seemethere if you know who maintains it.
./travis-scripts/run-clang-format/run-clang-format.py -r torchvision/csrc | ||
curl https://oss-clang-format.s3.us-east-2.amazonaws.com/linux64/clang-format-linux64 -o clang-format | ||
chmod +x clang-format | ||
sudo mv clang-format /opt/clang-format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: do we need to move this to /opt/clang-format
if we can specify a --clang-format-executable
in the script?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not really necessary. I did not want to leave a binary in the root of the project. Can make a change if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries, it was just for my information.
@datumbox if you have time, could you port this to torchaudio and torchtext? |
@mthrok I can have a look. From what I see, the 2 projects don't have clang-format setup on CI. So basically the task looks like:
Does that sound OK? |
Both projects do have jobs for linting, and they should be identical. The CI job is defined here; Here is the script used; (flake8 + clang_format) And the job looks like this. So, changing either the config or the job script to run the same formatter should do. |
* Switching to Pytorch's clang-formatter. * Replacing binary.
* Switching to Pytorch's clang-formatter. * Replacing binary.
Fixing #2372 by using option 2.