Commit Graph

8 Commits

Author SHA1 Message Date
Xuehai Pan
8a67daf283 [BE][Easy] enable postponed annotations in tools (#129375)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/129375
Approved by: https://github.com/malfet
2024-06-29 09:23:35 +00:00
PyTorch MergeBot
a32ce5ce34 Revert "[BE][Easy] enable postponed annotations in tools (#129375)"
This reverts commit 59eb2897f1.

Reverted https://github.com/pytorch/pytorch/pull/129375 on behalf of https://github.com/huydhn due to Sorry for reverting your change but I need to revert to cleanly revert https://github.com/pytorch/pytorch/pull/129374, please do a rebase and reland this ([comment](https://github.com/pytorch/pytorch/pull/129375#issuecomment-2197800541))
2024-06-29 00:44:25 +00:00
Xuehai Pan
59eb2897f1 [BE][Easy] enable postponed annotations in tools (#129375)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/129375
Approved by: https://github.com/malfet
2024-06-28 15:37:54 +00:00
Huy Do
ef035d083e Add ufmt to unify black and usort (#81157)
This reworks [80257](https://github.com/pytorch/pytorch/pull/80257) a bit to use ufmt:

* ufmt https://ufmt.omnilib.dev/en/stable/ unifies both black and usort to automatically format the file in the "most Pythonic" way
* Also make a demo run for all files in `tools/linter/**/*.py`

Pull Request resolved: https://github.com/pytorch/pytorch/pull/81157
Approved by: https://github.com/suo
2022-07-11 19:20:22 +00:00
Edward Z. Yang
a11c1bbdd0 Run Black on all of tools/
Signed-off-by: Edward Z. Yang <ezyangfb.com>

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

Approved by: https://github.com/albanD
2022-04-20 17:29:41 +00:00
Michael Suo
d8374efb53 [lint] fix spurious annotations on formatting linters
We would for some reason report formatting-based lints as showing up at
line 1 column 1. This removes them for now. Maybe eventually we can
recover better line numbers from the formatting diff and post messages
for each diff cluster, but that requires actual changes to the linting
engine.

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

Approved by: https://github.com/janeyx99
2022-04-16 04:05:30 +00:00
Michael Suo
8e2528132b [lint] small updates to .lintrunner.toml (#67942)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/67942

- Change "name" to "code" for consistency with linttool and LintMessage
format.
- Change "args" and "init_args" to "command" and "init_command" for
consistency with internal representation.

Test Plan: Imported from OSS

Reviewed By: H-Huang

Differential Revision: D32250606

Pulled By: suo

fbshipit-source-id: 557fef731bab9adca7ab1e7cc41b996956076b05
2021-11-08 09:45:26 -08:00
Michael Suo
4b021280ad [lint] add nativefunctions to lintrunner (#67890)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/67890

Adding another linter. I also added a generic initializer that installs
the right pip packages (you can invoke it by running `lintrunner init`).

Differential Revision:
D32197366
D32197366

Test Plan: Imported from OSS

Reviewed By: driazati

Pulled By: suo

fbshipit-source-id: 82844e78f1ee3047220d8444874eab41d7cc0e9e
2021-11-08 09:44:59 -08:00