Apply ufmt linter to all py files under tools (#81285)

With ufmt in place https://github.com/pytorch/pytorch/pull/81157, we can now use it to gradually format all files. I'm breaking this down into multiple smaller batches to avoid too many merge conflicts later on.

This batch (as copied from the current BLACK linter config):
* `tools/**/*.py`

Upcoming batchs:
* `torchgen/**/*.py`
* `torch/package/**/*.py`
* `torch/onnx/**/*.py`
* `torch/_refs/**/*.py`
* `torch/_prims/**/*.py`
* `torch/_meta_registrations.py`
* `torch/_decomp/**/*.py`
* `test/onnx/**/*.py`

Once they are all formatted, BLACK linter will be removed.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/81285
Approved by: https://github.com/suo
This commit is contained in:
Huy Do
2022-07-13 07:59:20 +00:00
committed by PyTorch MergeBot
parent d3acbc821e
commit 347b036350
52 changed files with 357 additions and 330 deletions

View File

@ -2,10 +2,10 @@
import argparse
import os
from typing import Set
from torchgen.selective_build.selector import SelectiveBuilder
from torchgen.code_template import CodeTemplate
import yaml
from torchgen.code_template import CodeTemplate
from torchgen.selective_build.selector import SelectiveBuilder
# Safely load fast C Yaml loader/dumper if they are available
try: