Get rid of unused code in linters (#154043)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/154043
Approved by: https://github.com/XuehaiPan, https://github.com/Skylion007
This commit is contained in:
Tom Ritchford
2025-05-21 18:01:09 +00:00
committed by PyTorch MergeBot
parent 35ddad284d
commit 9a8c42ff94
9 changed files with 8 additions and 60 deletions

View File

@ -13,7 +13,7 @@ import time
from enum import Enum
from pathlib import Path
from sysconfig import get_paths as gp
from typing import Any, NamedTuple
from typing import NamedTuple
# PyTorch directory root
@ -31,7 +31,6 @@ def scm_root() -> str:
PYTORCH_ROOT = scm_root()
IS_WINDOWS: bool = os.name == "nt"
# Returns '/usr/local/include/python<version number>'
@ -39,10 +38,6 @@ def get_python_include_dir() -> str:
return gp()["include"]
def eprint(*args: Any, **kwargs: Any) -> None:
print(*args, file=sys.stderr, flush=True, **kwargs)
class LintSeverity(str, Enum):
ERROR = "error"
WARNING = "warning"
@ -62,10 +57,6 @@ class LintMessage(NamedTuple):
description: str | None
def as_posix(name: str) -> str:
return name.replace("\\", "/") if IS_WINDOWS else name
# c10/core/DispatchKey.cpp:281:26: error: 'k' used after it was moved [bugprone-use-after-move]
RESULTS_RE: re.Pattern[str] = re.compile(
r"""(?mx)