mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 18:58:04 +00:00
ruff_db: completely rip lint:
prefix out
This does a deeper removal of the `lint:` prefix by removing the `DiagnosticId::as_str` method and replacing it with `as_concise_str`. We remove the associated error type and simplify the `Display` impl for `DiagnosticId` as well. This turned out to catch a `lint:` that was still in the diagnostic output: the part that says why a lint is enabled.
This commit is contained in:
parent
50c780fc8b
commit
b71ef8a26e
88 changed files with 148 additions and 206 deletions
|
@ -35,6 +35,6 @@ error[invalid-assignment]: Invalid assignment to data descriptor attribute `attr
|
|||
11 | instance.attr = 1 # error: [invalid-assignment]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
info: `lint:invalid-assignment` is enabled by default
|
||||
info: `invalid-assignment` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -36,6 +36,6 @@ error[invalid-assignment]: Invalid assignment to data descriptor attribute `attr
|
|||
12 | instance.attr = "wrong" # error: [invalid-assignment]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
info: `lint:invalid-assignment` is enabled by default
|
||||
info: `invalid-assignment` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -36,7 +36,7 @@ error[invalid-assignment]: Object of type `Literal["wrong"]` is not assignable t
|
|||
7 |
|
||||
8 | C.attr = 1 # fine
|
||||
|
|
||||
info: `lint:invalid-assignment` is enabled by default
|
||||
info: `invalid-assignment` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -48,6 +48,6 @@ error[invalid-assignment]: Object of type `Literal["wrong"]` is not assignable t
|
|||
9 | C.attr = "wrong" # error: [invalid-assignment]
|
||||
| ^^^^^^
|
||||
|
|
||||
info: `lint:invalid-assignment` is enabled by default
|
||||
info: `invalid-assignment` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -36,7 +36,7 @@ warning[possibly-unbound-attribute]: Attribute `attr` on type `<class 'C'>` is p
|
|||
7 |
|
||||
8 | instance = C()
|
||||
|
|
||||
info: `lint:possibly-unbound-attribute` is enabled by default
|
||||
info: `possibly-unbound-attribute` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -48,6 +48,6 @@ warning[possibly-unbound-attribute]: Attribute `attr` on type `C` is possibly un
|
|||
9 | instance.attr = 1 # error: [possibly-unbound-attribute]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
info: `lint:possibly-unbound-attribute` is enabled by default
|
||||
info: `possibly-unbound-attribute` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -36,7 +36,7 @@ error[invalid-assignment]: Object of type `Literal["wrong"]` is not assignable t
|
|||
8 |
|
||||
9 | C.attr = 1 # error: [invalid-attribute-access]
|
||||
|
|
||||
info: `lint:invalid-assignment` is enabled by default
|
||||
info: `invalid-assignment` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -49,6 +49,6 @@ error[invalid-attribute-access]: Cannot assign to instance attribute `attr` from
|
|||
9 | C.attr = 1 # error: [invalid-attribute-access]
|
||||
| ^^^^^^
|
||||
|
|
||||
info: `lint:invalid-attribute-access` is enabled by default
|
||||
info: `invalid-attribute-access` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -46,6 +46,6 @@ error[invalid-assignment]: Object of type `Literal[1]` is not assignable to attr
|
|||
12 |
|
||||
13 | class C2:
|
||||
|
|
||||
info: `lint:invalid-assignment` is enabled by default
|
||||
info: `invalid-assignment` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -33,7 +33,7 @@ error[unresolved-attribute]: Unresolved attribute `non_existent` on type `<class
|
|||
4 |
|
||||
5 | instance = C()
|
||||
|
|
||||
info: `lint:unresolved-attribute` is enabled by default
|
||||
info: `unresolved-attribute` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -45,6 +45,6 @@ error[unresolved-attribute]: Unresolved attribute `non_existent` on type `C`.
|
|||
6 | instance.non_existent = 1 # error: [unresolved-attribute]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
info: `lint:unresolved-attribute` is enabled by default
|
||||
info: `unresolved-attribute` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -36,7 +36,7 @@ error[invalid-assignment]: Object of type `Literal["wrong"]` is not assignable t
|
|||
8 |
|
||||
9 | instance = C()
|
||||
|
|
||||
info: `lint:invalid-assignment` is enabled by default
|
||||
info: `invalid-assignment` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -48,6 +48,6 @@ error[invalid-attribute-access]: Cannot assign to ClassVar `attr` from an instan
|
|||
10 | instance.attr = 1 # error: [invalid-attribute-access]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
info: `lint:invalid-attribute-access` is enabled by default
|
||||
info: `invalid-attribute-access` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -26,6 +26,6 @@ error[unresolved-import]: Cannot resolve imported module `does_not_exist`
|
|||
2 | from does_not_exist import foo, bar, baz
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
info: `lint:unresolved-import` is enabled by default
|
||||
info: `unresolved-import` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -24,6 +24,6 @@ error[unresolved-import]: Cannot resolve imported module `zqzqzqzqzqzqzq`
|
|||
1 | import zqzqzqzqzqzqzq # error: [unresolved-import] "Cannot resolve imported module `zqzqzqzqzqzqzq`"
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
info: `lint:unresolved-import` is enabled by default
|
||||
info: `unresolved-import` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -36,7 +36,7 @@ error[unresolved-import]: Cannot resolve imported module `a.foo`
|
|||
3 |
|
||||
4 | # Topmost component unresolvable:
|
||||
|
|
||||
info: `lint:unresolved-import` is enabled by default
|
||||
info: `unresolved-import` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -48,6 +48,6 @@ error[unresolved-import]: Cannot resolve imported module `b.foo`
|
|||
5 | import b.foo # error: [unresolved-import] "Cannot resolve imported module `b.foo`"
|
||||
| ^^^^^
|
||||
|
|
||||
info: `lint:unresolved-import` is enabled by default
|
||||
info: `unresolved-import` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -38,7 +38,7 @@ error[not-iterable]: Object of type `Iterable` is not iterable
|
|||
|
|
||||
info: It has no `__iter__` method and its `__getitem__` method has an incorrect signature for the old-style iteration protocol
|
||||
info: `__getitem__` must be at least as permissive as `def __getitem__(self, key: int): ...` to satisfy the old-style iteration protocol
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -29,6 +29,6 @@ error[not-iterable]: Object of type `Literal[123]` is not iterable
|
|||
3 | pass
|
||||
|
|
||||
info: It doesn't have an `__iter__` method or a `__getitem__` method
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -34,6 +34,6 @@ error[not-iterable]: Object of type `NotIterable` is not iterable
|
|||
7 | pass
|
||||
|
|
||||
info: Its `__iter__` attribute has type `None`, which is not callable
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -34,7 +34,7 @@ error[not-iterable]: Object of type `Bad` is not iterable
|
|||
8 | reveal_type(x) # revealed: Unknown
|
||||
|
|
||||
info: It has no `__iter__` method and its `__getitem__` attribute has type `None`, which is not callable
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ error[not-iterable]: Object of type `Iterable1` may not be iterable
|
|||
|
|
||||
info: It has no `__iter__` method and its `__getitem__` attribute is invalid
|
||||
info: `__getitem__` has type `CustomCallable`, which is not callable
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -87,7 +87,7 @@ error[not-iterable]: Object of type `Iterable2` may not be iterable
|
|||
|
|
||||
info: It has no `__iter__` method and its `__getitem__` attribute is invalid
|
||||
info: `__getitem__` has type `(bound method Iterable2.__getitem__(key: int) -> int) | None`, which is not callable
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ error[not-iterable]: Object of type `Iterable1` may not be iterable
|
|||
|
|
||||
info: It has no `__iter__` method and its `__getitem__` attribute is invalid
|
||||
info: `__getitem__` has type `(bound method Iterable1.__getitem__(item: int) -> str) | None`, which is not callable
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -83,7 +83,7 @@ error[not-iterable]: Object of type `Iterable2` may not be iterable
|
|||
|
|
||||
info: It has no `__iter__` method and its `__getitem__` method (with type `(bound method Iterable2.__getitem__(item: int) -> str) | (bound method Iterable2.__getitem__(item: str) -> int)`) may have an incorrect signature for the old-style iteration protocol
|
||||
info: `__getitem__` must be at least as permissive as `def __getitem__(self, key: int): ...` to satisfy the old-style iteration protocol
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ error[not-iterable]: Object of type `Iterable1` may not be iterable
|
|||
info: Its `__iter__` method may have an invalid signature
|
||||
info: Type of `__iter__` is `(bound method Iterable1.__iter__() -> Iterator) | (bound method Iterable1.__iter__(invalid_extra_arg) -> Iterator)`
|
||||
info: Expected signature for `__iter__` is `def __iter__(self): ...`
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -87,7 +87,7 @@ error[not-iterable]: Object of type `Iterable2` may not be iterable
|
|||
30 | reveal_type(x) # revealed: int | Unknown
|
||||
|
|
||||
info: Its `__iter__` attribute (with type `(bound method Iterable2.__iter__() -> Iterator) | None`) may not be callable
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ error[not-iterable]: Object of type `Iterable1` may not be iterable
|
|||
|
|
||||
info: Its `__iter__` method returns an object of type `Iterator1`, which may have an invalid `__next__` method
|
||||
info: Expected signature for `__next__` is `def __next__(self): ...`)
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -90,7 +90,7 @@ error[not-iterable]: Object of type `Iterable2` may not be iterable
|
|||
34 | reveal_type(y) # revealed: int | Unknown
|
||||
|
|
||||
info: Its `__iter__` method returns an object of type `Iterator2`, which has a `__next__` attribute that may not be callable
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ error[not-iterable]: Object of type `Iterable` may not be iterable
|
|||
|
|
||||
info: It may not have an `__iter__` method and its `__getitem__` method has an incorrect signature for the old-style iteration protocol
|
||||
info: `__getitem__` must be at least as permissive as `def __getitem__(self, key: int): ...` to satisfy the old-style iteration protocol
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ error[not-iterable]: Object of type `Iterable1` may not be iterable
|
|||
33 | reveal_type(x) # revealed: bytes | str | Unknown
|
||||
|
|
||||
info: It may not have an `__iter__` method and its `__getitem__` attribute (with type `(bound method Iterable1.__getitem__(item: int) -> str) | None`) may not be callable
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -93,7 +93,7 @@ error[not-iterable]: Object of type `Iterable2` may not be iterable
|
|||
|
|
||||
info: It may not have an `__iter__` method and its `__getitem__` method (with type `(bound method Iterable2.__getitem__(item: int) -> str) | (bound method Iterable2.__getitem__(item: str) -> int)`) may have an incorrect signature for the old-style iteration protocol
|
||||
info: `__getitem__` must be at least as permissive as `def __getitem__(self, key: int): ...` to satisfy the old-style iteration protocol
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ error[not-iterable]: Object of type `Iterable` may not be iterable
|
|||
18 | reveal_type(x) # revealed: int | bytes
|
||||
|
|
||||
info: It may not have an `__iter__` method or a `__getitem__` method
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ error[not-iterable]: Object of type `Test | Test2` may not be iterable
|
|||
19 | reveal_type(x) # revealed: int
|
||||
|
|
||||
info: Its `__iter__` method returns an object of type `TestIter | int`, which may not have a `__next__` method
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ error[not-iterable]: Object of type `Test | Literal[42]` may not be iterable
|
|||
14 | reveal_type(x) # revealed: int
|
||||
|
|
||||
info: It may not have an `__iter__` method and it doesn't have a `__getitem__` method
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ error[not-iterable]: Object of type `NotIterable` is not iterable
|
|||
12 | pass
|
||||
|
|
||||
info: Its `__iter__` attribute has type `int | None`, which is not callable
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -55,7 +55,7 @@ info[possibly-unresolved-reference]: Name `x` used when possibly not defined
|
|||
16 | reveal_type(x)
|
||||
| ^
|
||||
|
|
||||
info: `lint:possibly-unresolved-reference` is enabled by default
|
||||
info: `possibly-unresolved-reference` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ error[not-iterable]: Object of type `Bad` is not iterable
|
|||
9 | reveal_type(x) # revealed: Unknown
|
||||
|
|
||||
info: Its `__iter__` method returns an object of type `int`, which has no `__next__` method
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ error[not-iterable]: Object of type `Iterable` is not iterable
|
|||
|
|
||||
info: Its `__iter__` method has an invalid signature
|
||||
info: Expected signature `def __iter__(self): ...`
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ error[not-iterable]: Object of type `Iterable1` is not iterable
|
|||
|
|
||||
info: Its `__iter__` method returns an object of type `Iterator1`, which has an invalid `__next__` method
|
||||
info: Expected signature for `__next__` is `def __next__(self): ...`
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -79,7 +79,7 @@ error[not-iterable]: Object of type `Iterable2` is not iterable
|
|||
24 | reveal_type(y) # revealed: Unknown
|
||||
|
|
||||
info: Its `__iter__` method returns an object of type `Iterator2`, which has a `__next__` attribute that is not callable
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -86,6 +86,6 @@ info: Type variable defined here
|
|||
5 |
|
||||
6 | def f(x: T) -> T:
|
||||
|
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -101,6 +101,6 @@ info: Type variable defined here
|
|||
5 |
|
||||
6 | def f(x: T) -> T:
|
||||
|
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -82,6 +82,6 @@ info: Type variable defined here
|
|||
| ^^^^^^
|
||||
4 | return x
|
||||
|
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -97,6 +97,6 @@ info: Type variable defined here
|
|||
| ^^^^^^^^^^^^^^
|
||||
4 | return x
|
||||
|
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -32,6 +32,6 @@ error[unsupported-bool-conversion]: Boolean conversion is unsupported for type `
|
|||
| ^
|
||||
|
|
||||
info: `__bool__` on `NotBoolable` must be callable
|
||||
info: `lint:unsupported-bool-conversion` is enabled by default
|
||||
info: `unsupported-bool-conversion` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -36,6 +36,6 @@ info: Function defined here
|
|||
| ^^^ ------ Parameter declared here
|
||||
2 | return x * x
|
||||
|
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -38,6 +38,6 @@ info: Function defined here
|
|||
| ^^^^^^ ------ Parameter declared here
|
||||
3 | return x * x
|
||||
|
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -42,6 +42,6 @@ info: Function defined here
|
|||
| ^^^ ------ Parameter declared here
|
||||
2 | return x * x
|
||||
|
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -40,6 +40,6 @@ info: Function defined here
|
|||
| ^^^ ------ Parameter declared here
|
||||
5 | return x * x
|
||||
|
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -36,6 +36,6 @@ info: Function defined here
|
|||
| ^^^ ------ Parameter declared here
|
||||
2 | return x * y * z
|
||||
|
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -44,6 +44,6 @@ info: Function defined here
|
|||
4 | z: int,
|
||||
5 | ) -> int:
|
||||
|
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -39,7 +39,7 @@ info: Function defined here
|
|||
| ^^^ ------ Parameter declared here
|
||||
2 | return x * y * z
|
||||
|
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -59,7 +59,7 @@ info: Function defined here
|
|||
| ^^^ ------ Parameter declared here
|
||||
2 | return x * y * z
|
||||
|
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -79,6 +79,6 @@ info: Function defined here
|
|||
| ^^^ ------ Parameter declared here
|
||||
2 | return x * y * z
|
||||
|
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -40,6 +40,6 @@ info: Function defined here
|
|||
41 | *,
|
||||
42 | cls: type[JSONDecoder] | None = None,
|
||||
|
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -36,6 +36,6 @@ info: Function defined here
|
|||
| ^^^ ---------- Parameter declared here
|
||||
2 | return x * y * z
|
||||
|
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -36,6 +36,6 @@ info: Function defined here
|
|||
| ^^^ ---------- Parameter declared here
|
||||
2 | return x * y * z
|
||||
|
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -36,6 +36,6 @@ info: Function defined here
|
|||
| ^^^ ---------- Parameter declared here
|
||||
2 | return x * y * z
|
||||
|
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -36,6 +36,6 @@ info: Function defined here
|
|||
| ^^^ ------ Parameter declared here
|
||||
2 | return x * y * z
|
||||
|
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -38,6 +38,6 @@ info: Function defined here
|
|||
| ^^^^^^^^ ------ Parameter declared here
|
||||
3 | return 1
|
||||
|
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -36,6 +36,6 @@ info: Function defined here
|
|||
| ^^^ ------------- Parameter declared here
|
||||
2 | return len(numbers)
|
||||
|
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -36,6 +36,6 @@ info: Function defined here
|
|||
| ^^^ -------------- Parameter declared here
|
||||
2 | return len(numbers)
|
||||
|
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -38,7 +38,7 @@ error[unsupported-bool-conversion]: Boolean conversion is unsupported for type `
|
|||
11 | 10 not in WithContains()
|
||||
|
|
||||
info: `__bool__` on `NotBoolable` must be callable
|
||||
info: `lint:unsupported-bool-conversion` is enabled by default
|
||||
info: `unsupported-bool-conversion` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -52,6 +52,6 @@ error[unsupported-bool-conversion]: Boolean conversion is unsupported for type `
|
|||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
info: `__bool__` on `NotBoolable` must be callable
|
||||
info: `lint:unsupported-bool-conversion` is enabled by default
|
||||
info: `unsupported-bool-conversion` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -122,7 +122,7 @@ info: The definition of class `Foo` will raise `TypeError` at runtime
|
|||
4 |
|
||||
5 | reveal_type(Foo.__mro__) # revealed: tuple[<class 'Foo'>, Unknown, <class 'object'>]
|
||||
|
|
||||
info: `lint:duplicate-base` is enabled by default
|
||||
info: `duplicate-base` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -174,7 +174,7 @@ info: The definition of class `Ham` will raise `TypeError` at runtime
|
|||
22 | Eggs,
|
||||
23 | ): ...
|
||||
|
|
||||
info: `lint:duplicate-base` is enabled by default
|
||||
info: `duplicate-base` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -211,7 +211,7 @@ info: The definition of class `Ham` will raise `TypeError` at runtime
|
|||
| ^^^^ Class `Eggs` later repeated here
|
||||
23 | ): ...
|
||||
|
|
||||
info: `lint:duplicate-base` is enabled by default
|
||||
info: `duplicate-base` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -250,7 +250,7 @@ info: The definition of class `Omelette` will raise `TypeError` at runtime
|
|||
31 |
|
||||
32 | reveal_type(Omelette.__mro__) # revealed: tuple[<class 'Omelette'>, Unknown, <class 'object'>]
|
||||
|
|
||||
info: `lint:duplicate-base` is enabled by default
|
||||
info: `duplicate-base` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -309,7 +309,7 @@ info: The definition of class `VeryEggyOmelette` will raise `TypeError` at runti
|
|||
| ^^^^ Class `Eggs` later repeated here
|
||||
47 | ): ...
|
||||
|
|
||||
info: `lint:duplicate-base` is enabled by default
|
||||
info: `duplicate-base` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -340,7 +340,7 @@ info: The definition of class `D` will raise `TypeError` at runtime
|
|||
| ^ Class `A` later repeated here
|
||||
73 | ): ...
|
||||
|
|
||||
info: `lint:duplicate-base` is enabled by default
|
||||
info: `duplicate-base` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -383,7 +383,7 @@ info: The definition of class `E` will raise `TypeError` at runtime
|
|||
79 | ):
|
||||
80 | # error: [unused-ignore-comment]
|
||||
|
|
||||
info: `lint:duplicate-base` is enabled by default
|
||||
info: `duplicate-base` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -24,6 +24,6 @@ error[no-matching-overload]: No overload of class `type` matches arguments
|
|||
1 | type("Foo", ()) # error: [no-matching-overload]
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
info: `lint:no-matching-overload` is enabled by default
|
||||
info: `no-matching-overload` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -30,6 +30,6 @@ error[unsupported-bool-conversion]: Boolean conversion is unsupported for type `
|
|||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
info: `__bool__` on `NotBoolable` must be callable
|
||||
info: `lint:unsupported-bool-conversion` is enabled by default
|
||||
info: `unsupported-bool-conversion` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -47,7 +47,7 @@ error[invalid-overload]: Overloaded function `func` requires at least two overlo
|
|||
| ^^^^
|
||||
8 | return x
|
||||
|
|
||||
info: `lint:invalid-overload` is enabled by default
|
||||
info: `invalid-overload` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -62,6 +62,6 @@ error[invalid-overload]: Overloaded function `func` requires at least two overlo
|
|||
| |
|
||||
| Only one overload defined here
|
||||
|
|
||||
info: `lint:invalid-overload` is enabled by default
|
||||
info: `invalid-overload` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -86,7 +86,7 @@ error[invalid-overload]: Overloaded function `try_from1` does not use the `@clas
|
|||
17 | if isinstance(x, int):
|
||||
18 | return cls(x)
|
||||
|
|
||||
info: `lint:invalid-overload` is enabled by default
|
||||
info: `invalid-overload` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -109,7 +109,7 @@ error[invalid-overload]: Overloaded function `try_from2` does not use the `@clas
|
|||
23 | @overload
|
||||
24 | @classmethod
|
||||
|
|
||||
info: `lint:invalid-overload` is enabled by default
|
||||
info: `invalid-overload` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -126,6 +126,6 @@ error[invalid-overload]: Overloaded function `try_from3` does not use the `@clas
|
|||
41 | if isinstance(x, int):
|
||||
42 | return cls(x)
|
||||
|
|
||||
info: `lint:invalid-overload` is enabled by default
|
||||
info: `invalid-overload` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -76,7 +76,7 @@ error[invalid-overload]: `@final` decorator should be applied only to the overlo
|
|||
| Implementation defined here
|
||||
19 | return x
|
||||
|
|
||||
info: `lint:invalid-overload` is enabled by default
|
||||
info: `invalid-overload` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -92,7 +92,7 @@ error[invalid-overload]: `@final` decorator should be applied only to the overlo
|
|||
| Implementation defined here
|
||||
28 | return x
|
||||
|
|
||||
info: `lint:invalid-overload` is enabled by default
|
||||
info: `invalid-overload` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -109,6 +109,6 @@ error[invalid-overload]: `@final` decorator should be applied only to the first
|
|||
15 | def method2(self, x: str) -> str: ...
|
||||
| ^^^^^^^
|
||||
|
|
||||
info: `lint:invalid-overload` is enabled by default
|
||||
info: `invalid-overload` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -93,7 +93,7 @@ error[invalid-overload]: `@override` decorator should be applied only to the ove
|
|||
| Implementation defined here
|
||||
28 | return x
|
||||
|
|
||||
info: `lint:invalid-overload` is enabled by default
|
||||
info: `invalid-overload` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -109,7 +109,7 @@ error[invalid-overload]: `@override` decorator should be applied only to the ove
|
|||
| Implementation defined here
|
||||
38 | return x
|
||||
|
|
||||
info: `lint:invalid-overload` is enabled by default
|
||||
info: `invalid-overload` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -127,6 +127,6 @@ error[invalid-overload]: `@override` decorator should be applied only to the fir
|
|||
22 | def method(self, x: str) -> str: ...
|
||||
| ^^^^^^
|
||||
|
|
||||
info: `lint:invalid-overload` is enabled by default
|
||||
info: `invalid-overload` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -41,7 +41,7 @@ error[invalid-overload]: Overloaded non-stub function `func` must have an implem
|
|||
8 |
|
||||
9 | class Foo:
|
||||
|
|
||||
info: `lint:invalid-overload` is enabled by default
|
||||
info: `invalid-overload` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -54,6 +54,6 @@ error[invalid-overload]: Overloaded non-stub function `method` must have an impl
|
|||
14 | def method(self, x: str) -> str: ...
|
||||
| ^^^^^^
|
||||
|
|
||||
info: `lint:invalid-overload` is enabled by default
|
||||
info: `invalid-overload` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -51,7 +51,7 @@ error[call-non-callable]: Object of type `typing.Protocol` is not callable
|
|||
5 |
|
||||
6 | class MyProtocol(Protocol):
|
||||
|
|
||||
info: `lint:call-non-callable` is enabled by default
|
||||
info: `call-non-callable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -87,7 +87,7 @@ info: Protocol classes cannot be instantiated
|
|||
| ^^^^^^^^^^^^^^^^^^^^ `MyProtocol` declared as a protocol here
|
||||
7 | x: int
|
||||
|
|
||||
info: `lint:call-non-callable` is enabled by default
|
||||
info: `call-non-callable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -122,7 +122,7 @@ info: Protocol classes cannot be instantiated
|
|||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `GenericProtocol` declared as a protocol here
|
||||
13 | x: T
|
||||
|
|
||||
info: `lint:call-non-callable` is enabled by default
|
||||
info: `call-non-callable` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ info: `NotAProtocol` is declared here, but it is not a protocol class:
|
|||
|
|
||||
info: A class is only a protocol class if it directly inherits from `typing.Protocol` or `typing_extensions.Protocol`
|
||||
info: See https://typing.python.org/en/latest/spec/protocol.html#
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -79,6 +79,6 @@ info: `AlsoNotAProtocol` is declared here, but it is not a protocol class:
|
|||
|
|
||||
info: A class is only a protocol class if it directly inherits from `typing.Protocol` or `typing_extensions.Protocol`
|
||||
info: See https://typing.python.org/en/latest/spec/protocol.html#
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -77,7 +77,7 @@ info: `HasX` is declared as a protocol class, but it is not declared as runtime-
|
|||
|
|
||||
info: A protocol class can only be used in `isinstance` checks if it is decorated with `@typing.runtime_checkable` or `@typing_extensions.runtime_checkable`
|
||||
info: See https://docs.python.org/3/library/typing.html#typing.runtime_checkable
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -131,7 +131,7 @@ info: `HasX` is declared as a protocol class, but it is not declared as runtime-
|
|||
|
|
||||
info: A protocol class can only be used in `issubclass` checks if it is decorated with `@typing.runtime_checkable` or `@typing_extensions.runtime_checkable`
|
||||
info: See https://docs.python.org/3/library/typing.html#typing.runtime_checkable
|
||||
info: `lint:invalid-argument-type` is enabled by default
|
||||
info: `invalid-argument-type` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ error[invalid-return-type]: Return type does not match returned value
|
|||
|
|
||||
info: Function is inferred as returning `types.GeneratorType` because it is a generator function
|
||||
info: See https://docs.python.org/3/glossary.html#term-generator for more details
|
||||
info: `lint:invalid-return-type` is enabled by default
|
||||
info: `invalid-return-type` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -82,6 +82,6 @@ error[invalid-return-type]: Return type does not match returned value
|
|||
|
|
||||
info: Function is inferred as returning `types.AsyncGeneratorType` because it is an async generator function
|
||||
info: See https://docs.python.org/3/glossary.html#term-asynchronous-generator for more details
|
||||
info: `lint:invalid-return-type` is enabled by default
|
||||
info: `invalid-return-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -45,7 +45,7 @@ error[invalid-return-type]: Return type does not match returned value
|
|||
7 |
|
||||
8 | def f(cond: bool) -> str:
|
||||
|
|
||||
info: `lint:invalid-return-type` is enabled by default
|
||||
info: `invalid-return-type` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -64,7 +64,7 @@ error[invalid-return-type]: Return type does not match returned value
|
|||
12 | else:
|
||||
13 | # error: [invalid-return-type]
|
||||
|
|
||||
info: `lint:invalid-return-type` is enabled by default
|
||||
info: `invalid-return-type` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -86,6 +86,6 @@ error[invalid-return-type]: Return type does not match returned value
|
|||
9 | if cond:
|
||||
10 | # error: [invalid-return-type]
|
||||
|
|
||||
info: `lint:invalid-return-type` is enabled by default
|
||||
info: `invalid-return-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -52,7 +52,7 @@ error[invalid-return-type]: Return type does not match returned value
|
|||
5 |
|
||||
6 | # error: [invalid-return-type]
|
||||
|
|
||||
info: `lint:invalid-return-type` is enabled by default
|
||||
info: `invalid-return-type` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -66,7 +66,7 @@ error[invalid-return-type]: Function can implicitly return `None`, which is not
|
|||
8 | if cond:
|
||||
9 | return 1
|
||||
|
|
||||
info: `lint:invalid-return-type` is enabled by default
|
||||
info: `invalid-return-type` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -80,7 +80,7 @@ error[invalid-return-type]: Function can implicitly return `None`, which is not
|
|||
13 | if cond:
|
||||
14 | raise ValueError()
|
||||
|
|
||||
info: `lint:invalid-return-type` is enabled by default
|
||||
info: `invalid-return-type` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -94,6 +94,6 @@ error[invalid-return-type]: Function can implicitly return `None`, which is not
|
|||
18 | if cond:
|
||||
19 | cond = False
|
||||
|
|
||||
info: `lint:invalid-return-type` is enabled by default
|
||||
info: `invalid-return-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -43,7 +43,7 @@ error[invalid-return-type]: Function can implicitly return `None`, which is not
|
|||
| ^^^
|
||||
3 | 1
|
||||
|
|
||||
info: `lint:invalid-return-type` is enabled by default
|
||||
info: `invalid-return-type` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -61,7 +61,7 @@ error[invalid-return-type]: Return type does not match returned value
|
|||
8 |
|
||||
9 | def f() -> int:
|
||||
|
|
||||
info: `lint:invalid-return-type` is enabled by default
|
||||
info: `invalid-return-type` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -79,7 +79,7 @@ error[invalid-return-type]: Return type does not match returned value
|
|||
12 |
|
||||
13 | from typing import TypeVar
|
||||
|
|
||||
info: `lint:invalid-return-type` is enabled by default
|
||||
info: `invalid-return-type` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -91,6 +91,6 @@ error[invalid-return-type]: Function can implicitly return `None`, which is not
|
|||
18 | def m(x: T) -> T: ...
|
||||
| ^
|
||||
|
|
||||
info: `lint:invalid-return-type` is enabled by default
|
||||
info: `invalid-return-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -41,7 +41,7 @@ error[invalid-return-type]: Return type does not match returned value
|
|||
4 |
|
||||
5 | # error: [invalid-return-type]
|
||||
|
|
||||
info: `lint:invalid-return-type` is enabled by default
|
||||
info: `invalid-return-type` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -55,7 +55,7 @@ error[invalid-return-type]: Function can implicitly return `None`, which is not
|
|||
7 | print("...")
|
||||
8 | ...
|
||||
|
|
||||
info: `lint:invalid-return-type` is enabled by default
|
||||
info: `invalid-return-type` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -69,6 +69,6 @@ error[invalid-return-type]: Function can implicitly return `None`, which is not
|
|||
12 | f"""{foo} is a function that ..."""
|
||||
13 | ...
|
||||
|
|
||||
info: `lint:invalid-return-type` is enabled by default
|
||||
info: `invalid-return-type` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -43,7 +43,7 @@ error[unsupported-bool-conversion]: Boolean conversion is unsupported for type `
|
|||
14 | 10 < Comparable() < Comparable()
|
||||
|
|
||||
info: `__bool__` on `NotBoolable` must be callable
|
||||
info: `lint:unsupported-bool-conversion` is enabled by default
|
||||
info: `unsupported-bool-conversion` is enabled by default
|
||||
|
||||
```
|
||||
|
||||
|
@ -59,6 +59,6 @@ error[unsupported-bool-conversion]: Boolean conversion is unsupported for type `
|
|||
16 | Comparable() < Comparable() # fine
|
||||
|
|
||||
info: `__bool__` on `NotBoolable` must be callable
|
||||
info: `lint:unsupported-bool-conversion` is enabled by default
|
||||
info: `unsupported-bool-conversion` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -29,6 +29,6 @@ error[invalid-assignment]: Implicit shadowing of class `C`
|
|||
| ^
|
||||
|
|
||||
info: Annotate to make it explicit if this is intentional
|
||||
info: `lint:invalid-assignment` is enabled by default
|
||||
info: `invalid-assignment` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -29,6 +29,6 @@ error[invalid-assignment]: Implicit shadowing of function `f`
|
|||
| ^
|
||||
|
|
||||
info: Annotate to make it explicit if this is intentional
|
||||
info: `lint:invalid-assignment` is enabled by default
|
||||
info: `invalid-assignment` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -44,6 +44,6 @@ error[unsupported-bool-conversion]: Boolean conversion is unsupported for type `
|
|||
17 | a < b # fine
|
||||
|
|
||||
info: `__bool__` on `NotBoolable | Literal[False]` must be callable
|
||||
info: `lint:unsupported-bool-conversion` is enabled by default
|
||||
info: `unsupported-bool-conversion` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -34,6 +34,6 @@ error[unsupported-bool-conversion]: Boolean conversion is unsupported for type `
|
|||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
info: `__bool__` on `NotBoolable` must be callable
|
||||
info: `lint:unsupported-bool-conversion` is enabled by default
|
||||
info: `unsupported-bool-conversion` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -26,6 +26,6 @@ error[invalid-assignment]: Not enough values to unpack
|
|||
| |
|
||||
| Expected 2
|
||||
|
|
||||
info: `lint:invalid-assignment` is enabled by default
|
||||
info: `invalid-assignment` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -26,6 +26,6 @@ error[invalid-assignment]: Too many values to unpack
|
|||
| |
|
||||
| Expected 2
|
||||
|
|
||||
info: `lint:invalid-assignment` is enabled by default
|
||||
info: `invalid-assignment` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -25,6 +25,6 @@ error[not-iterable]: Object of type `Literal[1]` is not iterable
|
|||
| ^
|
||||
|
|
||||
info: It doesn't have an `__iter__` method or a `__getitem__` method
|
||||
info: `lint:not-iterable` is enabled by default
|
||||
info: `not-iterable` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -26,6 +26,6 @@ error[invalid-assignment]: Not enough values to unpack
|
|||
| |
|
||||
| Expected 3 or more
|
||||
|
|
||||
info: `lint:invalid-assignment` is enabled by default
|
||||
info: `invalid-assignment` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -28,6 +28,6 @@ error[unresolved-import]: Cannot resolve imported module `does_not_exist`
|
|||
2 |
|
||||
3 | x = does_not_exist.foo
|
||||
|
|
||||
info: `lint:unresolved-import` is enabled by default
|
||||
info: `unresolved-import` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -31,6 +31,6 @@ error[unresolved-import]: Module `a` has no member `does_not_exist`
|
|||
1 | from a import does_exist1, does_not_exist, does_exist2 # error: [unresolved-import]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
info: `lint:unresolved-import` is enabled by default
|
||||
info: `unresolved-import` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -28,6 +28,6 @@ error[unresolved-import]: Cannot resolve imported module `.does_not_exist`
|
|||
2 |
|
||||
3 | stat = add(10, 15)
|
||||
|
|
||||
info: `lint:unresolved-import` is enabled by default
|
||||
info: `unresolved-import` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -28,6 +28,6 @@ error[unresolved-import]: Cannot resolve imported module `.does_not_exist.foo.ba
|
|||
2 |
|
||||
3 | stat = add(10, 15)
|
||||
|
|
||||
info: `lint:unresolved-import` is enabled by default
|
||||
info: `unresolved-import` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -28,6 +28,6 @@ error[unresolved-import]: Cannot resolve imported module `does_not_exist`
|
|||
2 |
|
||||
3 | stat = add(10, 15)
|
||||
|
|
||||
info: `lint:unresolved-import` is enabled by default
|
||||
info: `unresolved-import` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -40,6 +40,6 @@ error[unresolved-import]: Cannot resolve imported module `....foo`
|
|||
2 |
|
||||
3 | stat = add(10, 15)
|
||||
|
|
||||
info: `lint:unresolved-import` is enabled by default
|
||||
info: `unresolved-import` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -32,6 +32,6 @@ error[unsupported-bool-conversion]: Boolean conversion is unsupported for type `
|
|||
| ^
|
||||
|
|
||||
info: `__bool__` on `NotBoolable` must be callable
|
||||
info: `lint:unsupported-bool-conversion` is enabled by default
|
||||
info: `unsupported-bool-conversion` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -42,6 +42,6 @@ info: `str` is not assignable to `bool`
|
|||
| Method defined here
|
||||
3 | return "wat"
|
||||
|
|
||||
info: `lint:unsupported-bool-conversion` is enabled by default
|
||||
info: `unsupported-bool-conversion` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -42,6 +42,6 @@ info: `__bool__` methods must only have a `self` parameter
|
|||
| Method defined here
|
||||
3 | return False
|
||||
|
|
||||
info: `lint:unsupported-bool-conversion` is enabled by default
|
||||
info: `unsupported-bool-conversion` is enabled by default
|
||||
|
||||
```
|
||||
|
|
|
@ -39,6 +39,6 @@ error[unsupported-bool-conversion]: Boolean conversion is unsupported for union
|
|||
15 | 10 and get() and True
|
||||
| ^^^^^
|
||||
|
|
||||
info: `lint:unsupported-bool-conversion` is enabled by default
|
||||
info: `unsupported-bool-conversion` is enabled by default
|
||||
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue