Enable Ruff PGH rules (#13304)

This commit is contained in:
Avasam
2024-12-26 16:35:34 -05:00
committed by GitHub
parent dee35e22bb
commit dde13fb91d
5 changed files with 5 additions and 4 deletions

View File

@@ -40,6 +40,7 @@ select = [
"B", # flake8-bugbear
"FA", # flake8-future-annotations
"I", # isort
"PGH", # pygrep-hooks
"RUF", # Ruff-specific and unused-noqa
"UP", # pyupgrade
# Flake8 base rules

View File

@@ -16,4 +16,4 @@ class DefaultHTTPClient:
) -> tuple[str, str]: ...
class HTTPSHandler:
def __new__(cls, verify_ssl: bool = True) -> urllib.request.HTTPSHandler: ... # type: ignore
def __new__(cls, verify_ssl: bool = True) -> urllib.request.HTTPSHandler: ... # type: ignore[misc]

View File

@@ -20,6 +20,6 @@ class MultiDiGraph(MultiGraph[_Node], DiGraph[_Node]):
def in_degree(self) -> InMultiDegreeView[_Node]: ...
@cached_property
def out_degree(self) -> OutMultiDegreeView[_Node]: ...
def to_undirected(self, reciprocal: bool = False, as_view: bool = False) -> MultiGraph[_Node]: ... # type: ignore
def to_undirected(self, reciprocal: bool = False, as_view: bool = False) -> MultiGraph[_Node]: ... # type: ignore[override]
def reverse(self, copy: bool = True) -> MultiDiGraph[_Node]: ...
def copy(self, as_view: bool = False) -> MultiDiGraph[_Node]: ...

View File

@@ -394,7 +394,7 @@ class MultiHeadAttention(Layer[Any, tf.Tensor]):
name: str | None = None,
) -> None: ...
# @override
@overload # type: ignore
@overload # type: ignore[override]
def __call__(
self,
query: tf.Tensor,

View File

@@ -23,7 +23,7 @@ class Metric(tf.keras.layers.Layer[tf.Tensor, tf.Tensor], metaclass=ABCMeta):
def result(self) -> _Output: ...
# Metric inherits from keras.Layer, but its add_weight method is incompatible with the one from "Layer".
@override
def add_weight( # type: ignore
def add_weight( # type: ignore[override]
self,
name: str,
shape: Iterable[int | None] | None = (),