Skip to content

Commit dde13fb

Browse files
authored
Enable Ruff PGH rules (#13304)
1 parent dee35e2 commit dde13fb

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ select = [
4040
"B", # flake8-bugbear
4141
"FA", # flake8-future-annotations
4242
"I", # isort
43+
"PGH", # pygrep-hooks
4344
"RUF", # Ruff-specific and unused-noqa
4445
"UP", # pyupgrade
4546
# Flake8 base rules

stubs/m3u8/m3u8/httpclient.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ class DefaultHTTPClient:
1616
) -> tuple[str, str]: ...
1717

1818
class HTTPSHandler:
19-
def __new__(cls, verify_ssl: bool = True) -> urllib.request.HTTPSHandler: ... # type: ignore
19+
def __new__(cls, verify_ssl: bool = True) -> urllib.request.HTTPSHandler: ... # type: ignore[misc]

stubs/networkx/networkx/classes/multidigraph.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ class MultiDiGraph(MultiGraph[_Node], DiGraph[_Node]):
2020
def in_degree(self) -> InMultiDegreeView[_Node]: ...
2121
@cached_property
2222
def out_degree(self) -> OutMultiDegreeView[_Node]: ...
23-
def to_undirected(self, reciprocal: bool = False, as_view: bool = False) -> MultiGraph[_Node]: ... # type: ignore
23+
def to_undirected(self, reciprocal: bool = False, as_view: bool = False) -> MultiGraph[_Node]: ... # type: ignore[override]
2424
def reverse(self, copy: bool = True) -> MultiDiGraph[_Node]: ...
2525
def copy(self, as_view: bool = False) -> MultiDiGraph[_Node]: ...

stubs/tensorflow/tensorflow/keras/layers/__init__.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ class MultiHeadAttention(Layer[Any, tf.Tensor]):
394394
name: str | None = None,
395395
) -> None: ...
396396
# @override
397-
@overload # type: ignore
397+
@overload # type: ignore[override]
398398
def __call__(
399399
self,
400400
query: tf.Tensor,

stubs/tensorflow/tensorflow/keras/metrics.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Metric(tf.keras.layers.Layer[tf.Tensor, tf.Tensor], metaclass=ABCMeta):
2323
def result(self) -> _Output: ...
2424
# Metric inherits from keras.Layer, but its add_weight method is incompatible with the one from "Layer".
2525
@override
26-
def add_weight( # type: ignore
26+
def add_weight( # type: ignore[override]
2727
self,
2828
name: str,
2929
shape: Iterable[int | None] | None = (),

0 commit comments

Comments
 (0)