pytorch/.github/workflows
Elton Leander Pinto a1ad28da10 Refactor clang_tidy.py (#61119)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61119

This change spilts the clang-tidy CI job into smaller steps and uses a
refactored version of the clang_tidy.py script.

The new folder structure is as follows:
```
tools/linter/clang_tidy
|_ __main__py
|_ requirements.txt
|_ run.py
|_ setup.sh
```

`__main__.py`

This script will run `tools/linter/clang_tidy/setup.sh` if a `build`
directory doesn't exist, mimicing what used to be done as a separate
step in the CI job.

After that, it will invoke `clang-tidy` with default arguments being
declared in the script itself (as opposed to declaring them in
lint.yml).

The reasoning behind this approach is two-fold:

- Make it easier to run `clang-tidy` locally using this script
- De-duplicate the option passing

`requirements.txt`

Contains a list of additional python dependencies needed by the
`clang-tidy` script.

`setup.sh`

If a build directory doesn't exist, this command will run the necessary
codegen and build commands for running `clang-tidy`

Example usage:
```
python3 tools/linter/clang_tidy --parallel
```
Notice that we don't have to put the `.py` at the end of `clang_tidy`.

Test Plan:
Run the following command:
```
python3 tools/linter/clang_tidy --paths torch/csrc/fx --parallel
```

Reviewed By: walterddr, janeyx99

Differential Revision: D29568582

Pulled By: 1ntEgr8

fbshipit-source-id: cd6d11c5cb8ba9f1344a87c35647a1cd8dd45b04
2021-07-06 16:02:11 -07:00
..
add_annotations.yml Put env before run or with in GHA workflows (#56268) 2021-04-16 11:06:39 -07:00
auto_label.yml Upgrade ShellCheck to v0.7.2 (#56445) 2021-04-20 07:58:22 -07:00
build_linux_conda.yml [BE] move general script out of .circleci/ into tools/ (#60973) 2021-06-30 17:20:05 -07:00
build_linux_libtorch.yml [BE] move general script out of .circleci/ into tools/ (#60973) 2021-06-30 17:20:05 -07:00
build_linux_wheels.yml [BE] move general script out of .circleci/ into tools/ (#60973) 2021-06-30 17:20:05 -07:00
lint.yml Refactor clang_tidy.py (#61119) 2021-07-06 16:02:11 -07:00
periodic-pytorch-win-vs2019-cuda11-cudnn8-py3.yml Fix lint (#61058) 2021-06-30 11:45:23 -07:00
push_nightly_docker_ghcr.yml
pytorch-linux-bionic-cuda10.2-cudnn7-py3.9-gcc7.yml Set sccache bucket on test runs to save some run minutes (#61140) 2021-07-06 07:29:57 -07:00
pytorch-linux-bionic-py3.8-gcc9-coverage.yml Set sccache bucket on test runs to save some run minutes (#61140) 2021-07-06 07:29:57 -07:00
pytorch-linux-xenial-cuda10.2-cudnn7-py3.6-gcc7.yml Set sccache bucket on test runs to save some run minutes (#61140) 2021-07-06 07:29:57 -07:00
pytorch-linux-xenial-cuda11.1-cudnn8-py3.6-gcc7.yml Set sccache bucket on test runs to save some run minutes (#61140) 2021-07-06 07:29:57 -07:00
pytorch-linux-xenial-py3.6-gcc5.4.yml Set sccache bucket on test runs to save some run minutes (#61140) 2021-07-06 07:29:57 -07:00
pytorch-linux-xenial-py3.6-gcc7-bazel-test.yml Add bazel actions workflow (#61039) 2021-07-06 12:18:43 -07:00
pytorch-win-vs2019-cpu-py3.yml Enable multigpu_test in GHA (#60221) 2021-06-30 08:52:38 -07:00
pytorch-win-vs2019-cuda10-cudnn7-py3.yml Enable multigpu_test in GHA (#60221) 2021-06-30 08:52:38 -07:00
pytorch-win-vs2019-cuda11-cudnn8-py3.yml Enable multigpu_test in GHA (#60221) 2021-06-30 08:52:38 -07:00
run_torchbench.yml Add script to cancel workflows (#59019) 2021-05-27 12:32:15 -07:00
stale_pull_requests.yml
test_tools.yml Add script to cancel workflows (#59019) 2021-05-27 12:32:15 -07:00
triage.yml Condense JIT/Quantization triage into one workflow (#61130) 2021-07-01 10:50:26 -07:00
update_s3_htmls.yml