Forbid extremely long line lengths in non-autogenerated stubs (#12537)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Avasam
2024-08-18 16:03:34 -04:00
committed by GitHub
parent eca1df49f3
commit 937270df0c
15 changed files with 69 additions and 27 deletions

View File

@@ -1,5 +1,6 @@
from datetime import date, datetime, time, timedelta
from decimal import Decimal
from typing import Any
from typing_extensions import TypeAlias
from openpyxl.cell.rich_text import CellRichText
@@ -20,3 +21,4 @@ _CellValue: TypeAlias = ( # noqa: Y047 # Used in other modules
| DataTableFormula
| ArrayFormula
)
_AnyCellValue: TypeAlias = Any # Any of _CellValue # noqa: Y047 # Used in other modules

View File

@@ -83,7 +83,9 @@ class Series(Serialisable):
explosion: _HasTagAndGet[ConvertibleToInt | None] | ConvertibleToInt | None = None,
extLst: Unused = None,
) -> None: ...
def to_tree(self, tagname: str | None = None, idx: _HasTagAndGet[ConvertibleToInt] | ConvertibleToInt | None = None) -> Element: ... # type: ignore[override]
def to_tree( # type: ignore[override]
self, tagname: str | None = None, idx: _HasTagAndGet[ConvertibleToInt] | ConvertibleToInt | None = None
) -> Element: ...
class XYSeries(Series):
# Same as parent

View File

@@ -1,9 +1,10 @@
from _typeshed import Incomplete, SupportsGetItem, Unused
from collections.abc import Container, Generator
from datetime import datetime
from typing import Any, Final
from typing import Final
from xml.etree.ElementTree import _FileRead
from openpyxl.cell import _AnyCellValue
from openpyxl.cell.cell import Cell
from openpyxl.cell.rich_text import CellRichText
from openpyxl.descriptors.serialisable import _ChildSerialisableTreeElement, _SerialisableTreeElement
@@ -86,12 +87,10 @@ class WorkSheetParser:
) -> None: ...
def parse(self) -> Generator[Incomplete, None, None]: ...
def parse_dimensions(self) -> _RangeBoundariesTuple | None: ...
# AnyOf[time, date, datetime, timedelta, float, int, bool, str, ArrayFormula, DataTableFormula, Translator, Text, TextBlock, CellRichText, None]
def parse_cell(self, element) -> dict[str, Any]: ...
def parse_cell(self, element) -> dict[str, _AnyCellValue]: ...
def parse_formula(self, element): ...
def parse_column_dimensions(self, col: _HasAttrib) -> None: ...
# Any: Same as parse_cell
def parse_row(self, row: _SupportsIterAndAttrib) -> tuple[int, list[dict[str, Any]]]: ...
def parse_row(self, row: _SupportsIterAndAttrib) -> tuple[int, list[dict[str, _AnyCellValue]]]: ...
def parse_formatting(self, element: _ChildSerialisableTreeElement) -> None: ...
def parse_sheet_protection(self, element: _SerialisableTreeElement) -> None: ...
def parse_extensions(self, element: _ChildSerialisableTreeElement) -> None: ...

View File

@@ -84,7 +84,9 @@ class HasManyIdents(GenericHandler):
ident_aliases: ClassVar[dict[str, str] | None]
ident: str # type: ignore[misc]
@classmethod
def using(cls, default_ident: Incomplete | None = None, ident: Incomplete | None = None, **kwds): ... # type: ignore[override]
def using( # type: ignore[override]
cls, default_ident: Incomplete | None = None, ident: Incomplete | None = None, **kwds
): ...
def __init__(self, ident: Incomplete | None = None, **kwds) -> None: ...
class HasSalt(GenericHandler):
@@ -95,7 +97,9 @@ class HasSalt(GenericHandler):
default_salt_chars: ClassVar[str | None]
salt: str | bytes | None
@classmethod
def using(cls, default_salt_size: int | None = None, salt_size: int | None = None, salt: str | bytes | None = None, **kwds): ... # type: ignore[override]
def using( # type: ignore[override]
cls, default_salt_size: int | None = None, salt_size: int | None = None, salt: str | bytes | None = None, **kwds
): ...
def __init__(self, salt: str | bytes | None = None, **kwds) -> None: ...
@classmethod
def bitsize(cls, salt_size: int | None = None, **kwds): ...

View File

@@ -217,7 +217,7 @@ class ConnectionInfo:
# [1]: https://www.psycopg.org/docs/extensions.html#psycopg2.extensions.ConnectionInfo
# [2]: https://github.com/psycopg/psycopg2/blob/1d3a89a0bba621dc1cc9b32db6d241bd2da85ad1/psycopg/conninfo_type.c#L52 and below
# [3]: https://www.postgresql.org/docs/current/libpq-status.html
# [4]: https://github.com/postgres/postgres/blob/b39838889e76274b107935fa8e8951baf0e8b31b/src/interfaces/libpq/fe-connect.c#L6754 and below
# [4]: https://github.com/postgres/postgres/blob/b39838889e76274b107935fa8e8951baf0e8b31b/src/interfaces/libpq/fe-connect.c#L6754 and below # noqa: E501
@property
def backend_pid(self) -> int: ...
@property

View File

@@ -485,7 +485,9 @@ class Pipeline(Redis[_StrType]):
def slowlog_reset(self) -> Pipeline[_StrType]: ... # type: ignore[override]
def time(self) -> Pipeline[_StrType]: ... # type: ignore[override]
def append(self, key, value) -> Pipeline[_StrType]: ...
def bitcount(self, key: _Key, start: int | None = None, end: int | None = None, mode: str | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def bitcount( # type: ignore[override]
self, key: _Key, start: int | None = None, end: int | None = None, mode: str | None = None
) -> Pipeline[_StrType]: ...
def bitop(self, operation, dest, *keys) -> Pipeline[_StrType]: ...
def bitpos(self, key, bit, start=None, end=None, mode: str | None = None) -> Pipeline[_StrType]: ...
def decr(self, name, amount=1) -> Pipeline[_StrType]: ... # type: ignore[override]
@@ -494,7 +496,9 @@ class Pipeline(Redis[_StrType]):
def dump(self, name) -> Pipeline[_StrType]: ... # type: ignore[override]
def exists(self, *names: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def __contains__(self, *names: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def expire(self, name: _Key, time: int | timedelta, nx: bool = False, xx: bool = False, gt: bool = False, lt: bool = False) -> Pipeline[_StrType]: ... # type: ignore[override]
def expire( # type: ignore[override]
self, name: _Key, time: int | timedelta, nx: bool = False, xx: bool = False, gt: bool = False, lt: bool = False
) -> Pipeline[_StrType]: ...
def expireat(
self, name, when, nx: bool = False, xx: bool = False, gt: bool = False, lt: bool = False
) -> Pipeline[_StrType]: ...
@@ -512,8 +516,12 @@ class Pipeline(Redis[_StrType]):
def msetnx(self, mapping: Mapping[_Key, _Value]) -> Pipeline[_StrType]: ... # type: ignore[override]
def move(self, name: _Key, db: int) -> Pipeline[_StrType]: ... # type: ignore[override]
def persist(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def pexpire(self, name: _Key, time: int | timedelta, nx: bool = False, xx: bool = False, gt: bool = False, lt: bool = False) -> Pipeline[_StrType]: ... # type: ignore[override]
def pexpireat(self, name: _Key, when: int | datetime, nx: bool = False, xx: bool = False, gt: bool = False, lt: bool = False) -> Pipeline[_StrType]: ... # type: ignore[override]
def pexpire( # type: ignore[override]
self, name: _Key, time: int | timedelta, nx: bool = False, xx: bool = False, gt: bool = False, lt: bool = False
) -> Pipeline[_StrType]: ...
def pexpireat( # type: ignore[override]
self, name: _Key, when: int | datetime, nx: bool = False, xx: bool = False, gt: bool = False, lt: bool = False
) -> Pipeline[_StrType]: ...
def psetex(self, name, time_ms, value) -> Pipeline[_StrType]: ...
def pttl(self, name) -> Pipeline[_StrType]: ... # type: ignore[override]
def randomkey(self) -> Pipeline[_StrType]: ... # type: ignore[override]
@@ -598,7 +606,9 @@ class Pipeline(Redis[_StrType]):
store: _Key | None = None,
groups: bool = False,
) -> Pipeline[_StrType]: ...
def scan(self, cursor: int = 0, match: _Key | None = None, count: int | None = None, _type: str | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def scan( # type: ignore[override]
self, cursor: int = 0, match: _Key | None = None, count: int | None = None, _type: str | None = None
) -> Pipeline[_StrType]: ...
def scan_iter(self, match: _Key | None = None, count: int | None = None, _type: str | None = None) -> Iterator[Any]: ... # type: ignore[override]
def sscan(self, name: _Key, cursor: int = 0, match: _Key | None = None, count: int | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def sscan_iter(self, name: _Key, match: _Key | None = None, count: int | None = None) -> Iterator[Any]: ...
@@ -680,7 +690,9 @@ class Pipeline(Redis[_StrType]):
def zcard(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def zcount(self, name: _Key, min: _Value, max: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
def zincrby(self, name: _Key, amount: float, value: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
def zinterstore(self, dest: _Key, keys: Iterable[_Key], aggregate: Literal["SUM", "MIN", "MAX"] | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def zinterstore( # type: ignore[override]
self, dest: _Key, keys: Iterable[_Key], aggregate: Literal["SUM", "MIN", "MAX"] | None = None
) -> Pipeline[_StrType]: ...
def zlexcount(self, name: _Key, min: _Value, max: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
def zpopmax(self, name: _Key, count: int | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def zpopmin(self, name: _Key, count: int | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
@@ -699,7 +711,9 @@ class Pipeline(Redis[_StrType]):
offset: int | None = None,
num: int | None = None,
) -> Pipeline[_StrType]: ...
def zrangebylex(self, name: _Key, min: _Value, max: _Value, start: int | None = None, num: int | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def zrangebylex( # type: ignore[override]
self, name: _Key, min: _Value, max: _Value, start: int | None = None, num: int | None = None
) -> Pipeline[_StrType]: ...
def zrangebyscore( # type: ignore[override]
self,
name: _Key,
@@ -733,7 +747,9 @@ class Pipeline(Redis[_StrType]):
) -> Pipeline[_StrType]: ...
def zrevrank(self, name: _Key, value: _Value, withscore: bool = False) -> Pipeline[_StrType]: ... # type: ignore[override]
def zscore(self, name: _Key, value: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
def zunionstore(self, dest: _Key, keys: Iterable[_Key], aggregate: Literal["SUM", "MIN", "MAX"] | None = None) -> Pipeline[_StrType]: ... # type: ignore[override]
def zunionstore( # type: ignore[override]
self, dest: _Key, keys: Iterable[_Key], aggregate: Literal["SUM", "MIN", "MAX"] | None = None
) -> Pipeline[_StrType]: ...
def pfadd(self, name: _Key, *values: _Value) -> Pipeline[_StrType]: ... # type: ignore[override]
def pfcount(self, name: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]
def pfmerge(self, dest: _Key, *sources: _Key) -> Pipeline[_StrType]: ... # type: ignore[override]

View File

@@ -264,4 +264,10 @@ class BaseDocTemplate:
class SimpleDocTemplate(BaseDocTemplate):
def handle_pageBegin(self) -> None: ...
def build(self, flowables: list[Flowable], onFirstPage: _PageCallback = ..., onLaterPages: _PageCallback = ..., canvasmaker: _CanvasMaker = ...) -> None: ... # type: ignore[override]
def build( # type: ignore[override]
self,
flowables: list[Flowable],
onFirstPage: _PageCallback = ...,
onLaterPages: _PageCallback = ...,
canvasmaker: _CanvasMaker = ...,
) -> None: ...