Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/37127
Wrap what we're running in CI in a small script so we can exactly reproduce it locally if ncessary.
Test Plan: Imported from OSS
Reviewed By: malfet
Differential Revision: D21196804
Pulled By: suo
fbshipit-source-id: 45497daae4bafd236a0d1bb1480841f0d9f39262
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/37058
We shouldn't add advisory checks to master, because PRs will get
reverted if they fail. This PR makes the following changes:
1. Factor out the binary fetch logic into `clang_format_utils.py`
2. Copypasta the canonical git integration from llvm and modify it to
use our binary fetcher. No more bikeshedding about how to integrate,
we just use the standard integration.
3. Change the CI job to run on pull-requests only and use
`git-clang-format`.
4. The original `clang_format.py` is now renamed `clang_format_all.py`
to reflect its purpose.
5. The pre-commit hook has been changed to use `git-clang-format`.
For pre-commit hook users: no changes required.
For others: add `tools/git-clang-format` to your PATH and you can do `git clang-format` to format your working tree.
Test Plan: Imported from OSS
Differential Revision: D21180893
Pulled By: suo
fbshipit-source-id: f8358fb7ce26f11585226aaac5ed89d379257bfb