Commit Graph

2 Commits

Author SHA1 Message Date
Nikita Shulga
627ec8badf Type-annotate tools/generate_torch_version (#51637)
Summary:
And add it to mypy.ini

Pull Request resolved: https://github.com/pytorch/pytorch/pull/51637

Reviewed By: janeyx99

Differential Revision: D26225123

Pulled By: malfet

fbshipit-source-id: d70d539ae58a14321e82f4592aaa44b3ce6b6358
2021-02-03 18:07:01 -08:00
Michael Suo
cf77e56938 clang-format don't run on master (#37058)
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
2020-04-22 11:37:22 -07:00