Skip to content

Enable Ruff PGH rules #13304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion stubs/m3u8/m3u8/httpclient.pyi
Original file line number Diff line number Diff line change
@@ -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]
2 changes: 1 addition & 1 deletion stubs/networkx/networkx/classes/multidigraph.pyi
Original file line number Diff line number Diff line change
@@ -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]: ...
2 changes: 1 addition & 1 deletion stubs/tensorflow/tensorflow/keras/layers/__init__.pyi
Original file line number Diff line number Diff line change
@@ -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,
2 changes: 1 addition & 1 deletion stubs/tensorflow/tensorflow/keras/metrics.pyi
Original file line number Diff line number Diff line change
@@ -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 = (),