mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Enable Ruff PGH rules (#13304)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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]: ...
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 = (),
|
||||
|
||||
Reference in New Issue
Block a user