Skip to content

Commit c75ecf0

Browse files
authored
Fix invalid noqa comments and poorly formatted type ignores (#11497)
1 parent 5e9589d commit c75ecf0

File tree

21 files changed

+43
-43
lines changed

21 files changed

+43
-43
lines changed

stubs/WTForms/@tests/test_cases/check_filters.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ def also_not_a_filter() -> None: ...
3535

3636
# but if we pass in some callables with an incompatible param spec
3737
# then we should get type errors
38-
Field(filters=(str.upper, str.lower, int, not_a_filter)) # type:ignore
39-
Field(filters=(Filter1(), Filter2(), also_not_a_filter)) # type:ignore
40-
Field(filters=[str.upper, str.lower, int, also_not_a_filter]) # type:ignore
41-
Field(filters=[Filter1(), Filter2(), not_a_filter]) # type:ignore
42-
field.process(None, extra_filters=(str.upper, str.lower, int, not_a_filter)) # type:ignore
43-
field.process(None, extra_filters=(Filter1(), Filter2(), also_not_a_filter)) # type:ignore
44-
field.process(None, extra_filters=[str.upper, str.lower, int, also_not_a_filter]) # type:ignore
45-
field.process(None, extra_filters=[Filter1(), Filter2(), not_a_filter]) # type:ignore
38+
Field(filters=(str.upper, str.lower, int, not_a_filter)) # type: ignore
39+
Field(filters=(Filter1(), Filter2(), also_not_a_filter)) # type: ignore
40+
Field(filters=[str.upper, str.lower, int, also_not_a_filter]) # type: ignore
41+
Field(filters=[Filter1(), Filter2(), not_a_filter]) # type: ignore
42+
field.process(None, extra_filters=(str.upper, str.lower, int, not_a_filter)) # type: ignore
43+
field.process(None, extra_filters=(Filter1(), Filter2(), also_not_a_filter)) # type: ignore
44+
field.process(None, extra_filters=[str.upper, str.lower, int, also_not_a_filter]) # type: ignore
45+
field.process(None, extra_filters=[Filter1(), Filter2(), not_a_filter]) # type: ignore

stubs/WTForms/@tests/test_cases/check_validators.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@
1414
string_field.validate(form, (Optional(), Email()))
1515

1616
# but not on Field
17-
field = Field(validators=(Optional(), Email())) # type:ignore
18-
field.validate(form, (Optional(), Email())) # type:ignore
17+
field = Field(validators=(Optional(), Email())) # type: ignore
18+
field.validate(form, (Optional(), Email())) # type: ignore
1919

2020
# unless we only pass the Field validator
2121
Field(validators=(Optional(),))
2222
field.validate(form, (Optional(),))
2323

2424
# DateField should accept Field validators but not StringField validators
25-
date_field = DateField(validators=(Optional(), Email())) # type:ignore
26-
date_field.validate(form, (Optional(), Email())) # type:ignore
25+
date_field = DateField(validators=(Optional(), Email())) # type: ignore
26+
date_field.validate(form, (Optional(), Email())) # type: ignore
2727
DateField(validators=(Optional(),))
2828

2929
# for lists we can't be as strict so we won't get type errors here

stubs/WTForms/@tests/test_cases/check_widgets.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
# more specific widgets should only work on more specific fields
77
Field(widget=Input())
8-
Field(widget=TextArea()) # type:ignore
9-
Field(widget=Select()) # type:ignore
8+
Field(widget=TextArea()) # type: ignore
9+
Field(widget=Select()) # type: ignore
1010

1111
# less specific widgets are fine, even if they're often not what you want
1212
StringField(widget=Input())
@@ -15,7 +15,7 @@
1515
SelectField(widget=Input(), option_widget=Input())
1616
SelectField(widget=Select(), option_widget=Option())
1717
# a more specific type other than Option widget is not allowed
18-
SelectField(widget=Select(), option_widget=TextArea()) # type:ignore
18+
SelectField(widget=Select(), option_widget=TextArea()) # type: ignore
1919

2020
# we should be able to pass Field() even though it wants an unbound_field
2121
# this gets around __new__ not working in type checking

stubs/WebOb/webob/cachecontrol.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class _ResponseCacheControl(_BaseCacheControl):
8383
stale_if_error: _IntValueProperty[None]
8484

8585
class _AnyCacheControl(_RequestCacheControl, _ResponseCacheControl):
86-
type: None # type:ignore[assignment]
86+
type: None # type: ignore[assignment]
8787

8888
class CacheControl(_AnyCacheControl):
8989
@overload

stubs/WebOb/webob/cookies.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ class Cookie(dict[str, Morsel]):
4141
def __init__(self, input: str | None = None) -> None: ...
4242
def load(self, data: str) -> None: ...
4343
def add(self, key: str | bytes, val: str | bytes) -> Morsel: ...
44-
def __setitem__(self, key: str | bytes, val: str | bytes) -> Morsel: ... # type:ignore[override]
44+
def __setitem__(self, key: str | bytes, val: str | bytes) -> Morsel: ... # type: ignore[override]
4545
def serialize(self, full: bool = True) -> str: ...
46-
def values(self) -> list[Morsel]: ... # type:ignore[override]
46+
def values(self) -> list[Morsel]: ... # type: ignore[override]
4747
def __str__(self, full: bool = True) -> str: ...
4848

4949
class Morsel(dict[bytes, bytes | bool | None]):

stubs/WebOb/webob/exc.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class WSGIHTTPException(Response, HTTPException):
4040
def json_body(self, environ: WSGIEnvironment) -> str: ...
4141
def generate_response(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ...
4242
@property
43-
def wsgi_response(self) -> Self: ... # type:ignore[override]
44-
def __str__(self) -> str: ... # type:ignore[override] # noqaY029
43+
def wsgi_response(self) -> Self: ... # type: ignore[override]
44+
def __str__(self) -> str: ... # type: ignore[override] # noqa: Y029
4545

4646
class HTTPError(WSGIHTTPException): ...
4747
class HTTPRedirection(WSGIHTTPException): ...

stubs/WebOb/webob/headers.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class EnvironHeaders(MutableMapping[str, str]):
1111
def __getitem__(self, hname: str) -> str: ...
1212
def __setitem__(self, hname: str, value: str) -> None: ...
1313
def __delitem__(self, hname: str) -> None: ...
14-
def keys(self) -> list[str]: ... # type:ignore[override]
14+
def keys(self) -> list[str]: ... # type: ignore[override]
1515
def __contains__(self, hname: object) -> bool: ...
1616
def __len__(self) -> int: ...
1717
def __iter__(self) -> Iterator[str]: ...

stubs/WebOb/webob/multidict.pyi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class MultiDict(MutableMapping[_KT, _VT]):
4545
@overload
4646
def pop(self, key: _KT, default: _T) -> _VT | _T: ...
4747
def popitem(self) -> tuple[_KT, _VT]: ...
48-
@overload # type:ignore[override]
48+
@overload # type: ignore[override]
4949
def update(self, __m: Collection[tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
5050
@overload
5151
def update(self, **kwargs: _VT) -> None: ...
@@ -58,10 +58,10 @@ class MultiDict(MutableMapping[_KT, _VT]):
5858
@overload
5959
def extend(self, other: None = None, **kwargs: _VT) -> None: ...
6060
def __len__(self) -> int: ...
61-
def keys(self) -> Iterator[_KT]: ... # type:ignore[override]
61+
def keys(self) -> Iterator[_KT]: ... # type: ignore[override]
6262
__iter__ = keys
63-
def values(self) -> Iterator[_VT]: ... # type:ignore[override]
64-
def items(self) -> Iterator[tuple[_KT, _VT]]: ... # type:ignore[override]
63+
def values(self) -> Iterator[_VT]: ... # type: ignore[override]
64+
def items(self) -> Iterator[tuple[_KT, _VT]]: ... # type: ignore[override]
6565

6666
class GetDict(MultiDict[str, str]):
6767
env: WSGIEnvironment
@@ -82,7 +82,7 @@ class NestedMultiDict(MultiDict[_KT, _VT]):
8282
def pop(self, key: _KT, default: Any = ...) -> Any: ...
8383
def popitem(self) -> tuple[_KT, _VT]: ...
8484
def update(self, *args: Any, **kwargs: _VT) -> None: ...
85-
def copy(self) -> MultiDict[_KT, _VT]: ... # type:ignore[override]
85+
def copy(self) -> MultiDict[_KT, _VT]: ... # type: ignore[override]
8686

8787
class NoVars:
8888
reason: str

stubs/fanstatic/fanstatic/compiler.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class CoffeeScript(CommandlineBase, Compiler):
7070
name: ClassVar[Literal["coffee"]]
7171
command: ClassVar[Literal["coffee"]]
7272
source_extension = NotImplemented
73-
def process( # type:ignore[override]
73+
def process( # type: ignore[override]
7474
self, source: StrOrBytesPath | _SourceType, target: StrOrBytesPath | _TargetType
7575
) -> None: ...
7676

stubs/fanstatic/fanstatic/core.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class Group(Dependable):
174174
depends: set[Dependable]
175175
supports: set[Dependable]
176176
def __init__(self, depends: Iterable[Dependable]) -> None: ...
177-
def set_dependencies(self, depends: Iterable[Dependable]) -> None: ... # type:ignore[override]
177+
def set_dependencies(self, depends: Iterable[Dependable]) -> None: ... # type: ignore[override]
178178
def list_assets(self) -> set[Asset]: ...
179179
def need(self, slots: dict[Slot, Resource] | None = None) -> None: ...
180180

0 commit comments

Comments
 (0)