[BE]: Update ruff to 0.11.8 (#153249)

Fixes a ton of false negatives throughout the codebase. RUFF also properly validates NOQA comments now and most of the changes are fixing typos there or removing filewide flake8 suppressions that were also silencing ruff issues.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/153249
Approved by: https://github.com/cyyever, https://github.com/albanD, https://github.com/seemethere
This commit is contained in:
Aaron Gokaslan
2025-05-12 18:30:48 +00:00
committed by PyTorch MergeBot
parent 5c3fddb9cc
commit 3555ebb63d
43 changed files with 235 additions and 188 deletions

View File

@ -595,7 +595,7 @@ def logging_manager(*, debug: bool = False) -> Generator[logging.Logger, None, N
print(f"log file: {log_file}")
yield root_logger
except Exception as e:
logging.exception("Fatal exception")
logging.exception("Fatal exception") # noqa: LOG015
logging_record_exception(e)
print(f"log file: {log_file}")
sys.exit(1)
@ -603,7 +603,7 @@ def logging_manager(*, debug: bool = False) -> Generator[logging.Logger, None, N
# You could logging.debug here to suppress the backtrace
# entirely, but there is no reason to hide it from technically
# savvy users.
logging.info("", exc_info=True)
logging.info("", exc_info=True) # noqa: LOG015
logging_record_exception(e)
print(f"log file: {log_file}")
sys.exit(1)