[BE][Ez]: Update ruff to 0.12.2 (#157937)

Updates to the latest version of ruff and apply some fixes that it flagged and silence a few new lints

Pull Request resolved: https://github.com/pytorch/pytorch/pull/157937
Approved by: https://github.com/ezyang
This commit is contained in:
Aaron Gokaslan
2025-07-11 15:16:20 +00:00
committed by PyTorch MergeBot
parent 0d17029fea
commit 7a08755c5f
5 changed files with 18 additions and 9 deletions

View File

@ -130,6 +130,7 @@ ignore = [
"E741",
"EXE001",
"F405",
"FURB122", # writelines
# these ignores are from flake8-logging-format; please fix!
"G101",
# these ignores are from ruff NPY; please fix!
@ -152,6 +153,7 @@ ignore = [
"SIM117",
"SIM118",
"UP007", # keep-runtime-typing
"UP045", # keep-runtime-typing
"TC006",
]
select = [
@ -233,6 +235,10 @@ select = [
"YTT",
]
[tool.ruff.lint.pyupgrade]
# Preserve types, even if a file imports `from __future__ import annotations`.
keep-runtime-typing = true
[tool.ruff.lint.per-file-ignores]
"__init__.py" = [
"F401",