mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
ty: switch to use annotate-snippets
ID functionality
We just set the ID on the `Message` and it just does what we want in this case. I think I didn't do this originally because I was trying to preserve the existing rendering? I'm not sure. I might have just missed this method.
This commit is contained in:
parent
244ea27d5f
commit
50c780fc8b
90 changed files with 332 additions and 342 deletions
|
@ -28,7 +28,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/attribute_as
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-assignment: Invalid assignment to data descriptor attribute `attr` on type `C` with custom `__set__` method
|
||||
error[invalid-assignment]: Invalid assignment to data descriptor attribute `attr` on type `C` with custom `__set__` method
|
||||
--> src/mdtest_snippet.py:11:1
|
||||
|
|
||||
10 | # TODO: ideally, we would mention why this is an invalid assignment (wrong number of arguments for `__set__`)
|
||||
|
|
|
@ -29,7 +29,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/attribute_as
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-assignment: Invalid assignment to data descriptor attribute `attr` on type `C` with custom `__set__` method
|
||||
error[invalid-assignment]: Invalid assignment to data descriptor attribute `attr` on type `C` with custom `__set__` method
|
||||
--> src/mdtest_snippet.py:12:1
|
||||
|
|
||||
11 | # TODO: ideally, we would mention why this is an invalid assignment (wrong argument type for `value` parameter)
|
||||
|
|
|
@ -26,7 +26,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/attribute_as
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-assignment: Object of type `Literal["wrong"]` is not assignable to attribute `attr` of type `int`
|
||||
error[invalid-assignment]: Object of type `Literal["wrong"]` is not assignable to attribute `attr` of type `int`
|
||||
--> src/mdtest_snippet.py:6:1
|
||||
|
|
||||
4 | instance = C()
|
||||
|
@ -41,7 +41,7 @@ info: `lint:invalid-assignment` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-assignment: Object of type `Literal["wrong"]` is not assignable to attribute `attr` of type `int`
|
||||
error[invalid-assignment]: Object of type `Literal["wrong"]` is not assignable to attribute `attr` of type `int`
|
||||
--> src/mdtest_snippet.py:9:1
|
||||
|
|
||||
8 | C.attr = 1 # fine
|
||||
|
|
|
@ -26,7 +26,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/attribute_as
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
warning: possibly-unbound-attribute: Attribute `attr` on type `<class 'C'>` is possibly unbound
|
||||
warning[possibly-unbound-attribute]: Attribute `attr` on type `<class 'C'>` is possibly unbound
|
||||
--> src/mdtest_snippet.py:6:5
|
||||
|
|
||||
4 | attr: int = 0
|
||||
|
@ -41,7 +41,7 @@ info: `lint:possibly-unbound-attribute` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
warning: possibly-unbound-attribute: Attribute `attr` on type `C` is possibly unbound
|
||||
warning[possibly-unbound-attribute]: Attribute `attr` on type `C` is possibly unbound
|
||||
--> src/mdtest_snippet.py:9:5
|
||||
|
|
||||
8 | instance = C()
|
||||
|
|
|
@ -26,7 +26,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/attribute_as
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-assignment: Object of type `Literal["wrong"]` is not assignable to attribute `attr` of type `int`
|
||||
error[invalid-assignment]: Object of type `Literal["wrong"]` is not assignable to attribute `attr` of type `int`
|
||||
--> src/mdtest_snippet.py:7:1
|
||||
|
|
||||
5 | instance = C()
|
||||
|
@ -41,7 +41,7 @@ info: `lint:invalid-assignment` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-attribute-access: Cannot assign to instance attribute `attr` from the class object `<class 'C'>`
|
||||
error[invalid-attribute-access]: Cannot assign to instance attribute `attr` from the class object `<class 'C'>`
|
||||
--> src/mdtest_snippet.py:9:1
|
||||
|
|
||||
7 | instance.attr = "wrong" # error: [invalid-assignment]
|
||||
|
|
|
@ -37,7 +37,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/attribute_as
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-assignment: Object of type `Literal[1]` is not assignable to attribute `attr` on type `<class 'C1'> | <class 'C1'>`
|
||||
error[invalid-assignment]: Object of type `Literal[1]` is not assignable to attribute `attr` on type `<class 'C1'> | <class 'C1'>`
|
||||
--> src/mdtest_snippet.py:11:5
|
||||
|
|
||||
10 | # TODO: The error message here could be improved to explain why the assignment fails.
|
||||
|
|
|
@ -23,7 +23,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/attribute_as
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: unresolved-attribute: Unresolved attribute `non_existent` on type `<class 'C'>`.
|
||||
error[unresolved-attribute]: Unresolved attribute `non_existent` on type `<class 'C'>`.
|
||||
--> src/mdtest_snippet.py:3:1
|
||||
|
|
||||
1 | class C: ...
|
||||
|
@ -38,7 +38,7 @@ info: `lint:unresolved-attribute` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: unresolved-attribute: Unresolved attribute `non_existent` on type `C`.
|
||||
error[unresolved-attribute]: Unresolved attribute `non_existent` on type `C`.
|
||||
--> src/mdtest_snippet.py:6:1
|
||||
|
|
||||
5 | instance = C()
|
||||
|
|
|
@ -27,7 +27,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/attribute_as
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-assignment: Object of type `Literal["wrong"]` is not assignable to attribute `attr` of type `int`
|
||||
error[invalid-assignment]: Object of type `Literal["wrong"]` is not assignable to attribute `attr` of type `int`
|
||||
--> src/mdtest_snippet.py:7:1
|
||||
|
|
||||
6 | C.attr = 1 # fine
|
||||
|
@ -41,7 +41,7 @@ info: `lint:invalid-assignment` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-attribute-access: Cannot assign to ClassVar `attr` from an instance of type `C`
|
||||
error[invalid-attribute-access]: Cannot assign to ClassVar `attr` from an instance of type `C`
|
||||
--> src/mdtest_snippet.py:10:1
|
||||
|
|
||||
9 | instance = C()
|
||||
|
|
|
@ -19,7 +19,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/import/basic.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: unresolved-import: Cannot resolve imported module `does_not_exist`
|
||||
error[unresolved-import]: Cannot resolve imported module `does_not_exist`
|
||||
--> src/mdtest_snippet.py:2:6
|
||||
|
|
||||
1 | # error: [unresolved-import]
|
||||
|
|
|
@ -18,7 +18,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/import/basic.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: unresolved-import: Cannot resolve imported module `zqzqzqzqzqzqzq`
|
||||
error[unresolved-import]: Cannot resolve imported module `zqzqzqzqzqzqzq`
|
||||
--> src/mdtest_snippet.py:1:8
|
||||
|
|
||||
1 | import zqzqzqzqzqzqzq # error: [unresolved-import] "Cannot resolve imported module `zqzqzqzqzqzqzq`"
|
||||
|
|
|
@ -27,7 +27,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/import/basic.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: unresolved-import: Cannot resolve imported module `a.foo`
|
||||
error[unresolved-import]: Cannot resolve imported module `a.foo`
|
||||
--> src/mdtest_snippet.py:2:8
|
||||
|
|
||||
1 | # Topmost component resolvable, submodule not resolvable:
|
||||
|
@ -41,7 +41,7 @@ info: `lint:unresolved-import` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: unresolved-import: Cannot resolve imported module `b.foo`
|
||||
error[unresolved-import]: Cannot resolve imported module `b.foo`
|
||||
--> src/mdtest_snippet.py:5:8
|
||||
|
|
||||
4 | # Topmost component unresolvable:
|
||||
|
|
|
@ -28,7 +28,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `Iterable` is not iterable
|
||||
error[not-iterable]: Object of type `Iterable` is not iterable
|
||||
--> src/mdtest_snippet.py:10:10
|
||||
|
|
||||
9 | # error: [not-iterable]
|
||||
|
@ -43,7 +43,7 @@ info: `lint:not-iterable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:11:17
|
||||
|
|
||||
9 | # error: [not-iterable]
|
||||
|
|
|
@ -20,7 +20,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `Literal[123]` is not iterable
|
||||
error[not-iterable]: Object of type `Literal[123]` is not iterable
|
||||
--> src/mdtest_snippet.py:2:10
|
||||
|
|
||||
1 | nonsense = 123
|
||||
|
|
|
@ -24,7 +24,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `NotIterable` is not iterable
|
||||
error[not-iterable]: Object of type `NotIterable` is not iterable
|
||||
--> src/mdtest_snippet.py:6:10
|
||||
|
|
||||
4 | __iter__: None = None
|
||||
|
|
|
@ -25,7 +25,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `Bad` is not iterable
|
||||
error[not-iterable]: Object of type `Bad` is not iterable
|
||||
--> src/mdtest_snippet.py:7:10
|
||||
|
|
||||
6 | # error: [not-iterable]
|
||||
|
@ -39,7 +39,7 @@ info: `lint:not-iterable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:8:17
|
||||
|
|
||||
6 | # error: [not-iterable]
|
||||
|
|
|
@ -46,7 +46,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `Iterable1` may not be iterable
|
||||
error[not-iterable]: Object of type `Iterable1` may not be iterable
|
||||
--> src/mdtest_snippet.py:22:14
|
||||
|
|
||||
21 | # error: [not-iterable]
|
||||
|
@ -62,7 +62,7 @@ info: `lint:not-iterable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:24:21
|
||||
|
|
||||
22 | for x in Iterable1():
|
||||
|
@ -76,7 +76,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `Iterable2` may not be iterable
|
||||
error[not-iterable]: Object of type `Iterable2` may not be iterable
|
||||
--> src/mdtest_snippet.py:27:14
|
||||
|
|
||||
26 | # error: [not-iterable]
|
||||
|
@ -92,7 +92,7 @@ info: `lint:not-iterable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:29:21
|
||||
|
|
||||
27 | for y in Iterable2():
|
||||
|
|
|
@ -43,7 +43,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `Iterable1` may not be iterable
|
||||
error[not-iterable]: Object of type `Iterable1` may not be iterable
|
||||
--> src/mdtest_snippet.py:20:14
|
||||
|
|
||||
19 | # error: [not-iterable]
|
||||
|
@ -59,7 +59,7 @@ info: `lint:not-iterable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:22:21
|
||||
|
|
||||
20 | for x in Iterable1():
|
||||
|
@ -73,7 +73,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `Iterable2` may not be iterable
|
||||
error[not-iterable]: Object of type `Iterable2` may not be iterable
|
||||
--> src/mdtest_snippet.py:25:14
|
||||
|
|
||||
24 | # error: [not-iterable]
|
||||
|
@ -88,7 +88,7 @@ info: `lint:not-iterable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:26:21
|
||||
|
|
||||
24 | # error: [not-iterable]
|
||||
|
|
|
@ -47,7 +47,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `Iterable1` may not be iterable
|
||||
error[not-iterable]: Object of type `Iterable1` may not be iterable
|
||||
--> src/mdtest_snippet.py:17:14
|
||||
|
|
||||
16 | # error: [not-iterable]
|
||||
|
@ -63,7 +63,7 @@ info: `lint:not-iterable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:18:21
|
||||
|
|
||||
16 | # error: [not-iterable]
|
||||
|
@ -77,7 +77,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `Iterable2` may not be iterable
|
||||
error[not-iterable]: Object of type `Iterable2` may not be iterable
|
||||
--> src/mdtest_snippet.py:28:14
|
||||
|
|
||||
27 | # error: [not-iterable]
|
||||
|
@ -92,7 +92,7 @@ info: `lint:not-iterable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:30:21
|
||||
|
|
||||
28 | for x in Iterable2():
|
||||
|
|
|
@ -51,7 +51,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `Iterable1` may not be iterable
|
||||
error[not-iterable]: Object of type `Iterable1` may not be iterable
|
||||
--> src/mdtest_snippet.py:28:14
|
||||
|
|
||||
27 | # error: [not-iterable]
|
||||
|
@ -66,7 +66,7 @@ info: `lint:not-iterable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:29:21
|
||||
|
|
||||
27 | # error: [not-iterable]
|
||||
|
@ -80,7 +80,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `Iterable2` may not be iterable
|
||||
error[not-iterable]: Object of type `Iterable2` may not be iterable
|
||||
--> src/mdtest_snippet.py:32:14
|
||||
|
|
||||
31 | # error: [not-iterable]
|
||||
|
@ -95,7 +95,7 @@ info: `lint:not-iterable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:34:21
|
||||
|
|
||||
32 | for y in Iterable2():
|
||||
|
|
|
@ -36,7 +36,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `Iterable` may not be iterable
|
||||
error[not-iterable]: Object of type `Iterable` may not be iterable
|
||||
--> src/mdtest_snippet.py:18:14
|
||||
|
|
||||
17 | # error: [not-iterable]
|
||||
|
@ -51,7 +51,7 @@ info: `lint:not-iterable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:19:21
|
||||
|
|
||||
17 | # error: [not-iterable]
|
||||
|
|
|
@ -54,7 +54,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `Iterable1` may not be iterable
|
||||
error[not-iterable]: Object of type `Iterable1` may not be iterable
|
||||
--> src/mdtest_snippet.py:31:14
|
||||
|
|
||||
30 | # error: [not-iterable]
|
||||
|
@ -69,7 +69,7 @@ info: `lint:not-iterable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:33:21
|
||||
|
|
||||
31 | for x in Iterable1():
|
||||
|
@ -83,7 +83,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `Iterable2` may not be iterable
|
||||
error[not-iterable]: Object of type `Iterable2` may not be iterable
|
||||
--> src/mdtest_snippet.py:36:14
|
||||
|
|
||||
35 | # error: [not-iterable]
|
||||
|
@ -98,7 +98,7 @@ info: `lint:not-iterable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:37:21
|
||||
|
|
||||
35 | # error: [not-iterable]
|
||||
|
|
|
@ -35,7 +35,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `Iterable` may not be iterable
|
||||
error[not-iterable]: Object of type `Iterable` may not be iterable
|
||||
--> src/mdtest_snippet.py:17:14
|
||||
|
|
||||
16 | # error: [not-iterable]
|
||||
|
@ -49,7 +49,7 @@ info: `lint:not-iterable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:18:21
|
||||
|
|
||||
16 | # error: [not-iterable]
|
||||
|
|
|
@ -36,7 +36,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `Test | Test2` may not be iterable
|
||||
error[not-iterable]: Object of type `Test | Test2` may not be iterable
|
||||
--> src/mdtest_snippet.py:18:14
|
||||
|
|
||||
16 | # TODO: Improve error message to state which union variant isn't iterable (https://github.com/astral-sh/ruff/issues/13989)
|
||||
|
@ -51,7 +51,7 @@ info: `lint:not-iterable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:19:21
|
||||
|
|
||||
17 | # error: [not-iterable]
|
||||
|
|
|
@ -31,7 +31,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `Test | Literal[42]` may not be iterable
|
||||
error[not-iterable]: Object of type `Test | Literal[42]` may not be iterable
|
||||
--> src/mdtest_snippet.py:13:14
|
||||
|
|
||||
11 | def _(flag: bool):
|
||||
|
@ -46,7 +46,7 @@ info: `lint:not-iterable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:14:21
|
||||
|
|
||||
12 | # error: [not-iterable]
|
||||
|
|
|
@ -33,7 +33,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `NotIterable` is not iterable
|
||||
error[not-iterable]: Object of type `NotIterable` is not iterable
|
||||
--> src/mdtest_snippet.py:11:14
|
||||
|
|
||||
10 | # error: [not-iterable]
|
||||
|
@ -47,7 +47,7 @@ info: `lint:not-iterable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: possibly-unresolved-reference: Name `x` used when possibly not defined
|
||||
info[possibly-unresolved-reference]: Name `x` used when possibly not defined
|
||||
--> src/mdtest_snippet.py:16:17
|
||||
|
|
||||
14 | # revealed: Unknown
|
||||
|
@ -60,7 +60,7 @@ info: `lint:possibly-unresolved-reference` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:16:17
|
||||
|
|
||||
14 | # revealed: Unknown
|
||||
|
|
|
@ -26,7 +26,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `Bad` is not iterable
|
||||
error[not-iterable]: Object of type `Bad` is not iterable
|
||||
--> src/mdtest_snippet.py:8:10
|
||||
|
|
||||
7 | # error: [not-iterable]
|
||||
|
@ -40,7 +40,7 @@ info: `lint:not-iterable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:9:17
|
||||
|
|
||||
7 | # error: [not-iterable]
|
||||
|
|
|
@ -30,7 +30,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `Iterable` is not iterable
|
||||
error[not-iterable]: Object of type `Iterable` is not iterable
|
||||
--> src/mdtest_snippet.py:12:10
|
||||
|
|
||||
11 | # error: [not-iterable]
|
||||
|
@ -45,7 +45,7 @@ info: `lint:not-iterable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:13:17
|
||||
|
|
||||
11 | # error: [not-iterable]
|
||||
|
|
|
@ -41,7 +41,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `Iterable1` is not iterable
|
||||
error[not-iterable]: Object of type `Iterable1` is not iterable
|
||||
--> src/mdtest_snippet.py:19:10
|
||||
|
|
||||
18 | # error: [not-iterable]
|
||||
|
@ -56,7 +56,7 @@ info: `lint:not-iterable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:20:17
|
||||
|
|
||||
18 | # error: [not-iterable]
|
||||
|
@ -70,7 +70,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `Iterable2` is not iterable
|
||||
error[not-iterable]: Object of type `Iterable2` is not iterable
|
||||
--> src/mdtest_snippet.py:23:10
|
||||
|
|
||||
22 | # error: [not-iterable]
|
||||
|
@ -84,7 +84,7 @@ info: `lint:not-iterable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:24:17
|
||||
|
|
||||
22 | # error: [not-iterable]
|
||||
|
|
|
@ -29,7 +29,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/generics/legacy/function
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:9:13
|
||||
|
|
||||
7 | return x
|
||||
|
@ -43,7 +43,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:10:13
|
||||
|
|
||||
9 | reveal_type(f(1)) # revealed: Literal[1]
|
||||
|
@ -56,7 +56,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:12:13
|
||||
|
|
||||
10 | reveal_type(f(True)) # revealed: Literal[True]
|
||||
|
@ -68,7 +68,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Argument to this function is incorrect
|
||||
error[invalid-argument-type]: Argument to this function is incorrect
|
||||
--> src/mdtest_snippet.py:12:15
|
||||
|
|
||||
10 | reveal_type(f(True)) # revealed: Literal[True]
|
||||
|
|
|
@ -30,7 +30,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/generics/legacy/function
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:9:13
|
||||
|
|
||||
7 | return x
|
||||
|
@ -44,7 +44,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:10:13
|
||||
|
|
||||
9 | reveal_type(f(1)) # revealed: int
|
||||
|
@ -57,7 +57,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:11:13
|
||||
|
|
||||
9 | reveal_type(f(1)) # revealed: int
|
||||
|
@ -71,7 +71,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:13:13
|
||||
|
|
||||
11 | reveal_type(f(None)) # revealed: None
|
||||
|
@ -83,7 +83,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Argument to this function is incorrect
|
||||
error[invalid-argument-type]: Argument to this function is incorrect
|
||||
--> src/mdtest_snippet.py:13:15
|
||||
|
|
||||
11 | reveal_type(f(None)) # revealed: None
|
||||
|
|
|
@ -26,7 +26,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/generics/pep695/function
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:6:13
|
||||
|
|
||||
4 | return x
|
||||
|
@ -40,7 +40,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:7:13
|
||||
|
|
||||
6 | reveal_type(f(1)) # revealed: Literal[1]
|
||||
|
@ -53,7 +53,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:9:13
|
||||
|
|
||||
7 | reveal_type(f(True)) # revealed: Literal[True]
|
||||
|
@ -65,7 +65,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Argument to this function is incorrect
|
||||
error[invalid-argument-type]: Argument to this function is incorrect
|
||||
--> src/mdtest_snippet.py:9:15
|
||||
|
|
||||
7 | reveal_type(f(True)) # revealed: Literal[True]
|
||||
|
|
|
@ -27,7 +27,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/generics/pep695/function
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:6:13
|
||||
|
|
||||
4 | return x
|
||||
|
@ -41,7 +41,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:7:13
|
||||
|
|
||||
6 | reveal_type(f(1)) # revealed: int
|
||||
|
@ -54,7 +54,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:8:13
|
||||
|
|
||||
6 | reveal_type(f(1)) # revealed: int
|
||||
|
@ -68,7 +68,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:10:13
|
||||
|
|
||||
8 | reveal_type(f(None)) # revealed: None
|
||||
|
@ -80,7 +80,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Argument to this function is incorrect
|
||||
error[invalid-argument-type]: Argument to this function is incorrect
|
||||
--> src/mdtest_snippet.py:10:15
|
||||
|
|
||||
8 | reveal_type(f(None)) # revealed: None
|
||||
|
|
|
@ -24,7 +24,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/binary/instances.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: unsupported-bool-conversion: Boolean conversion is unsupported for type `NotBoolable`
|
||||
error[unsupported-bool-conversion]: Boolean conversion is unsupported for type `NotBoolable`
|
||||
--> src/mdtest_snippet.py:7:8
|
||||
|
|
||||
6 | # error: [unsupported-bool-conversion]
|
||||
|
|
|
@ -21,7 +21,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_argu
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Argument to this function is incorrect
|
||||
error[invalid-argument-type]: Argument to this function is incorrect
|
||||
--> src/mdtest_snippet.py:4:5
|
||||
|
|
||||
2 | return x * x
|
||||
|
|
|
@ -23,7 +23,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_argu
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Argument to this function is incorrect
|
||||
error[invalid-argument-type]: Argument to this function is incorrect
|
||||
--> src/mdtest_snippet.py:6:10
|
||||
|
|
||||
5 | c = C()
|
||||
|
|
|
@ -27,7 +27,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_argu
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Argument to this function is incorrect
|
||||
error[invalid-argument-type]: Argument to this function is incorrect
|
||||
--> src/mdtest_snippet.py:3:13
|
||||
|
|
||||
1 | import package
|
||||
|
|
|
@ -22,7 +22,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_argu
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Argument to this function is incorrect
|
||||
error[invalid-argument-type]: Argument to this function is incorrect
|
||||
--> src/mdtest_snippet.py:2:9
|
||||
|
|
||||
1 | def bar():
|
||||
|
|
|
@ -21,7 +21,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_argu
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Argument to this function is incorrect
|
||||
error[invalid-argument-type]: Argument to this function is incorrect
|
||||
--> src/mdtest_snippet.py:4:8
|
||||
|
|
||||
2 | return x * y * z
|
||||
|
|
|
@ -25,7 +25,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_argu
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Argument to this function is incorrect
|
||||
error[invalid-argument-type]: Argument to this function is incorrect
|
||||
--> src/mdtest_snippet.py:8:8
|
||||
|
|
||||
6 | return x * y * z
|
||||
|
|
|
@ -24,7 +24,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_argu
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Argument to this function is incorrect
|
||||
error[invalid-argument-type]: Argument to this function is incorrect
|
||||
--> src/mdtest_snippet.py:7:5
|
||||
|
|
||||
5 | # error: [invalid-argument-type]
|
||||
|
@ -44,7 +44,7 @@ info: `lint:invalid-argument-type` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Argument to this function is incorrect
|
||||
error[invalid-argument-type]: Argument to this function is incorrect
|
||||
--> src/mdtest_snippet.py:7:10
|
||||
|
|
||||
5 | # error: [invalid-argument-type]
|
||||
|
@ -64,7 +64,7 @@ info: `lint:invalid-argument-type` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Argument to this function is incorrect
|
||||
error[invalid-argument-type]: Argument to this function is incorrect
|
||||
--> src/mdtest_snippet.py:7:15
|
||||
|
|
||||
5 | # error: [invalid-argument-type]
|
||||
|
|
|
@ -20,7 +20,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_argu
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Argument to this function is incorrect
|
||||
error[invalid-argument-type]: Argument to this function is incorrect
|
||||
--> src/mdtest_snippet.py:3:12
|
||||
|
|
||||
1 | import json
|
||||
|
|
|
@ -21,7 +21,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_argu
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Argument to this function is incorrect
|
||||
error[invalid-argument-type]: Argument to this function is incorrect
|
||||
--> src/mdtest_snippet.py:4:11
|
||||
|
|
||||
2 | return x * y * z
|
||||
|
|
|
@ -21,7 +21,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_argu
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Argument to this function is incorrect
|
||||
error[invalid-argument-type]: Argument to this function is incorrect
|
||||
--> src/mdtest_snippet.py:4:11
|
||||
|
|
||||
2 | return x * y * z
|
||||
|
|
|
@ -21,7 +21,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_argu
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Argument to this function is incorrect
|
||||
error[invalid-argument-type]: Argument to this function is incorrect
|
||||
--> src/mdtest_snippet.py:4:11
|
||||
|
|
||||
2 | return x * y * z
|
||||
|
|
|
@ -21,7 +21,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_argu
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Argument to this function is incorrect
|
||||
error[invalid-argument-type]: Argument to this function is incorrect
|
||||
--> src/mdtest_snippet.py:4:8
|
||||
|
|
||||
2 | return x * y * z
|
||||
|
|
|
@ -23,7 +23,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_argu
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Argument to this function is incorrect
|
||||
error[invalid-argument-type]: Argument to this function is incorrect
|
||||
--> src/mdtest_snippet.py:6:3
|
||||
|
|
||||
5 | c = C()
|
||||
|
|
|
@ -21,7 +21,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_argu
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Argument to this function is incorrect
|
||||
error[invalid-argument-type]: Argument to this function is incorrect
|
||||
--> src/mdtest_snippet.py:4:14
|
||||
|
|
||||
2 | return len(numbers)
|
||||
|
|
|
@ -21,7 +21,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_argu
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Argument to this function is incorrect
|
||||
error[invalid-argument-type]: Argument to this function is incorrect
|
||||
--> src/mdtest_snippet.py:4:20
|
||||
|
|
||||
2 | return len(numbers)
|
||||
|
|
|
@ -28,7 +28,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/comparison/instances/mem
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: unsupported-bool-conversion: Boolean conversion is unsupported for type `NotBoolable`
|
||||
error[unsupported-bool-conversion]: Boolean conversion is unsupported for type `NotBoolable`
|
||||
--> src/mdtest_snippet.py:9:1
|
||||
|
|
||||
8 | # error: [unsupported-bool-conversion]
|
||||
|
@ -43,7 +43,7 @@ info: `lint:unsupported-bool-conversion` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: unsupported-bool-conversion: Boolean conversion is unsupported for type `NotBoolable`
|
||||
error[unsupported-bool-conversion]: Boolean conversion is unsupported for type `NotBoolable`
|
||||
--> src/mdtest_snippet.py:11:1
|
||||
|
|
||||
9 | 10 in WithContains()
|
||||
|
|
|
@ -100,7 +100,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/mro.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: duplicate-base: Duplicate base class `str`
|
||||
error[duplicate-base]: Duplicate base class `str`
|
||||
--> src/mdtest_snippet.py:3:7
|
||||
|
|
||||
1 | from typing_extensions import reveal_type
|
||||
|
@ -127,7 +127,7 @@ info: `lint:duplicate-base` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:5:13
|
||||
|
|
||||
3 | class Foo(str, str): ... # error: [duplicate-base] "Duplicate base class `str`"
|
||||
|
@ -141,7 +141,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: duplicate-base: Duplicate base class `Spam`
|
||||
error[duplicate-base]: Duplicate base class `Spam`
|
||||
--> src/mdtest_snippet.py:16:7
|
||||
|
|
||||
14 | # error: [duplicate-base] "Duplicate base class `Spam`"
|
||||
|
@ -179,7 +179,7 @@ info: `lint:duplicate-base` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: duplicate-base: Duplicate base class `Eggs`
|
||||
error[duplicate-base]: Duplicate base class `Eggs`
|
||||
--> src/mdtest_snippet.py:16:7
|
||||
|
|
||||
14 | # error: [duplicate-base] "Duplicate base class `Spam`"
|
||||
|
@ -216,7 +216,7 @@ info: `lint:duplicate-base` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:27:13
|
||||
|
|
||||
25 | # fmt: on
|
||||
|
@ -230,7 +230,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: duplicate-base: Duplicate base class `Mushrooms`
|
||||
error[duplicate-base]: Duplicate base class `Mushrooms`
|
||||
--> src/mdtest_snippet.py:30:7
|
||||
|
|
||||
29 | class Mushrooms: ...
|
||||
|
@ -255,7 +255,7 @@ info: `lint:duplicate-base` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:32:13
|
||||
|
|
||||
30 | class Omelette(Spam, Eggs, Mushrooms, Mushrooms): ... # error: [duplicate-base]
|
||||
|
@ -269,7 +269,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: duplicate-base: Duplicate base class `Eggs`
|
||||
error[duplicate-base]: Duplicate base class `Eggs`
|
||||
--> src/mdtest_snippet.py:37:7
|
||||
|
|
||||
36 | # error: [duplicate-base] "Duplicate base class `Eggs`"
|
||||
|
@ -314,7 +314,7 @@ info: `lint:duplicate-base` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: duplicate-base: Duplicate base class `A`
|
||||
error[duplicate-base]: Duplicate base class `A`
|
||||
--> src/mdtest_snippet.py:69:7
|
||||
|
|
||||
68 | # error: [duplicate-base]
|
||||
|
@ -345,7 +345,7 @@ info: `lint:duplicate-base` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: unused-ignore-comment:
|
||||
info[unused-ignore-comment]
|
||||
--> src/mdtest_snippet.py:72:9
|
||||
|
|
||||
70 | A,
|
||||
|
@ -358,7 +358,7 @@ info: unused-ignore-comment:
|
|||
```
|
||||
|
||||
```
|
||||
error: duplicate-base: Duplicate base class `A`
|
||||
error[duplicate-base]: Duplicate base class `A`
|
||||
--> src/mdtest_snippet.py:76:7
|
||||
|
|
||||
75 | # error: [duplicate-base]
|
||||
|
@ -388,7 +388,7 @@ info: `lint:duplicate-base` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: unused-ignore-comment:
|
||||
info[unused-ignore-comment]
|
||||
--> src/mdtest_snippet.py:81:13
|
||||
|
|
||||
79 | ):
|
||||
|
|
|
@ -18,7 +18,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/no_matching_
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: no-matching-overload: No overload of class `type` matches arguments
|
||||
error[no-matching-overload]: No overload of class `type` matches arguments
|
||||
--> src/mdtest_snippet.py:1:1
|
||||
|
|
||||
1 | type("Foo", ()) # error: [no-matching-overload]
|
||||
|
|
|
@ -22,7 +22,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/unary/not.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: unsupported-bool-conversion: Boolean conversion is unsupported for type `NotBoolable`
|
||||
error[unsupported-bool-conversion]: Boolean conversion is unsupported for type `NotBoolable`
|
||||
--> src/mdtest_snippet.py:5:1
|
||||
|
|
||||
4 | # error: [unsupported-bool-conversion]
|
||||
|
|
|
@ -35,7 +35,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/overloads.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-overload: Overloaded function `func` requires at least two overloads
|
||||
error[invalid-overload]: Overloaded function `func` requires at least two overloads
|
||||
--> src/mdtest_snippet.py:4:5
|
||||
|
|
||||
3 | @overload
|
||||
|
@ -52,7 +52,7 @@ info: `lint:invalid-overload` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-overload: Overloaded function `func` requires at least two overloads
|
||||
error[invalid-overload]: Overloaded function `func` requires at least two overloads
|
||||
--> src/mdtest_snippet.pyi:5:5
|
||||
|
|
||||
3 | @overload
|
||||
|
|
|
@ -72,7 +72,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/overloads.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-overload: Overloaded function `try_from1` does not use the `@classmethod` decorator consistently
|
||||
error[invalid-overload]: Overloaded function `try_from1` does not use the `@classmethod` decorator consistently
|
||||
--> src/mdtest_snippet.py:13:9
|
||||
|
|
||||
11 | def try_from1(cls, x: int) -> CheckClassMethod: ...
|
||||
|
@ -91,7 +91,7 @@ info: `lint:invalid-overload` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-overload: Overloaded function `try_from2` does not use the `@classmethod` decorator consistently
|
||||
error[invalid-overload]: Overloaded function `try_from2` does not use the `@classmethod` decorator consistently
|
||||
--> src/mdtest_snippet.py:28:9
|
||||
|
|
||||
26 | @classmethod
|
||||
|
@ -114,7 +114,7 @@ info: `lint:invalid-overload` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-overload: Overloaded function `try_from3` does not use the `@classmethod` decorator consistently
|
||||
error[invalid-overload]: Overloaded function `try_from3` does not use the `@classmethod` decorator consistently
|
||||
--> src/mdtest_snippet.py:40:9
|
||||
|
|
||||
38 | def try_from3(cls, x: str) -> None: ...
|
||||
|
|
|
@ -65,7 +65,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/overloads.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-overload: `@final` decorator should be applied only to the overload implementation
|
||||
error[invalid-overload]: `@final` decorator should be applied only to the overload implementation
|
||||
--> src/mdtest_snippet.py:18:9
|
||||
|
|
||||
16 | def method2(self, x: str) -> str: ...
|
||||
|
@ -81,7 +81,7 @@ info: `lint:invalid-overload` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-overload: `@final` decorator should be applied only to the overload implementation
|
||||
error[invalid-overload]: `@final` decorator should be applied only to the overload implementation
|
||||
--> src/mdtest_snippet.py:27:9
|
||||
|
|
||||
25 | def method3(self, x: str) -> str: ...
|
||||
|
@ -97,7 +97,7 @@ info: `lint:invalid-overload` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-overload: `@final` decorator should be applied only to the first overload
|
||||
error[invalid-overload]: `@final` decorator should be applied only to the first overload
|
||||
--> src/mdtest_snippet.pyi:11:9
|
||||
|
|
||||
10 | @overload
|
||||
|
|
|
@ -82,7 +82,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/overloads.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-overload: `@override` decorator should be applied only to the overload implementation
|
||||
error[invalid-overload]: `@override` decorator should be applied only to the overload implementation
|
||||
--> src/mdtest_snippet.py:27:9
|
||||
|
|
||||
25 | def method(self, x: str) -> str: ...
|
||||
|
@ -98,7 +98,7 @@ info: `lint:invalid-overload` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-overload: `@override` decorator should be applied only to the overload implementation
|
||||
error[invalid-overload]: `@override` decorator should be applied only to the overload implementation
|
||||
--> src/mdtest_snippet.py:37:9
|
||||
|
|
||||
35 | def method(self, x: str) -> str: ...
|
||||
|
@ -114,7 +114,7 @@ info: `lint:invalid-overload` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-overload: `@override` decorator should be applied only to the first overload
|
||||
error[invalid-overload]: `@override` decorator should be applied only to the first overload
|
||||
--> src/mdtest_snippet.pyi:18:9
|
||||
|
|
||||
16 | class Sub2(Base):
|
||||
|
|
|
@ -31,7 +31,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/overloads.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-overload: Overloaded non-stub function `func` must have an implementation
|
||||
error[invalid-overload]: Overloaded non-stub function `func` must have an implementation
|
||||
--> src/mdtest_snippet.py:7:5
|
||||
|
|
||||
5 | @overload
|
||||
|
@ -46,7 +46,7 @@ info: `lint:invalid-overload` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-overload: Overloaded non-stub function `method` must have an implementation
|
||||
error[invalid-overload]: Overloaded non-stub function `method` must have an implementation
|
||||
--> src/mdtest_snippet.py:14:9
|
||||
|
|
||||
12 | @overload
|
||||
|
|
|
@ -42,7 +42,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/protocols.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: call-non-callable: Object of type `typing.Protocol` is not callable
|
||||
error[call-non-callable]: Object of type `typing.Protocol` is not callable
|
||||
--> src/mdtest_snippet.py:4:13
|
||||
|
|
||||
3 | # error: [call-non-callable]
|
||||
|
@ -56,7 +56,7 @@ info: `lint:call-non-callable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:4:13
|
||||
|
|
||||
3 | # error: [call-non-callable]
|
||||
|
@ -69,7 +69,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: call-non-callable: Cannot instantiate class `MyProtocol`
|
||||
error[call-non-callable]: Cannot instantiate class `MyProtocol`
|
||||
--> src/mdtest_snippet.py:10:13
|
||||
|
|
||||
9 | # error: [call-non-callable] "Cannot instantiate class `MyProtocol`"
|
||||
|
@ -92,7 +92,7 @@ info: `lint:call-non-callable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:10:13
|
||||
|
|
||||
9 | # error: [call-non-callable] "Cannot instantiate class `MyProtocol`"
|
||||
|
@ -105,7 +105,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: call-non-callable: Cannot instantiate class `GenericProtocol`
|
||||
error[call-non-callable]: Cannot instantiate class `GenericProtocol`
|
||||
--> src/mdtest_snippet.py:16:13
|
||||
|
|
||||
15 | # error: [call-non-callable] "Cannot instantiate class `GenericProtocol`"
|
||||
|
@ -127,7 +127,7 @@ info: `lint:call-non-callable` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:16:13
|
||||
|
|
||||
15 | # error: [call-non-callable] "Cannot instantiate class `GenericProtocol`"
|
||||
|
@ -139,7 +139,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:19:13
|
||||
|
|
||||
17 | class SubclassOfMyProtocol(MyProtocol): ...
|
||||
|
@ -153,7 +153,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:23:13
|
||||
|
|
||||
21 | class SubclassOfGenericProtocol[T](GenericProtocol[T]): ...
|
||||
|
@ -167,7 +167,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:25:17
|
||||
|
|
||||
23 | reveal_type(SubclassOfGenericProtocol[int]()) # revealed: SubclassOfGenericProtocol[int]
|
||||
|
|
|
@ -29,7 +29,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/protocols.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Invalid argument to `get_protocol_members`
|
||||
error[invalid-argument-type]: Invalid argument to `get_protocol_members`
|
||||
--> src/mdtest_snippet.py:5:1
|
||||
|
|
||||
3 | class NotAProtocol: ...
|
||||
|
@ -57,7 +57,7 @@ info: `lint:invalid-argument-type` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Invalid argument to `get_protocol_members`
|
||||
error[invalid-argument-type]: Invalid argument to `get_protocol_members`
|
||||
--> src/mdtest_snippet.py:9:1
|
||||
|
|
||||
7 | class AlsoNotAProtocol(NotAProtocol, object): ...
|
||||
|
|
|
@ -57,7 +57,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/protocols.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Class `HasX` cannot be used as the second argument to `isinstance`
|
||||
error[invalid-argument-type]: Class `HasX` cannot be used as the second argument to `isinstance`
|
||||
--> src/mdtest_snippet.py:7:8
|
||||
|
|
||||
6 | def f(arg: object, arg2: type):
|
||||
|
@ -82,7 +82,7 @@ info: `lint:invalid-argument-type` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:8:21
|
||||
|
|
||||
6 | def f(arg: object, arg2: type):
|
||||
|
@ -96,7 +96,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:10:21
|
||||
|
|
||||
8 | reveal_type(arg) # revealed: HasX
|
||||
|
@ -110,7 +110,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-argument-type: Class `HasX` cannot be used as the second argument to `issubclass`
|
||||
error[invalid-argument-type]: Class `HasX` cannot be used as the second argument to `issubclass`
|
||||
--> src/mdtest_snippet.py:12:8
|
||||
|
|
||||
10 | reveal_type(arg) # revealed: ~HasX
|
||||
|
@ -136,7 +136,7 @@ info: `lint:invalid-argument-type` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:13:21
|
||||
|
|
||||
12 | if issubclass(arg2, HasX): # error: [invalid-argument-type]
|
||||
|
@ -149,7 +149,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:15:21
|
||||
|
|
||||
13 | reveal_type(arg2) # revealed: type[HasX]
|
||||
|
@ -162,7 +162,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:24:21
|
||||
|
|
||||
22 | def f(arg: object):
|
||||
|
@ -176,7 +176,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:26:21
|
||||
|
|
||||
24 | reveal_type(arg) # revealed: RuntimeCheckableHasX
|
||||
|
@ -190,7 +190,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:33:21
|
||||
|
|
||||
31 | def f(arg1: type, arg2: type):
|
||||
|
@ -204,7 +204,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:35:21
|
||||
|
|
||||
33 | reveal_type(arg1) # revealed: type[RuntimeCheckableHasX]
|
||||
|
@ -218,7 +218,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:38:21
|
||||
|
|
||||
37 | if issubclass(arg2, OnlyMethodMembers): # no error!
|
||||
|
@ -231,7 +231,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
info: revealed-type: Revealed type
|
||||
info[revealed-type]: Revealed type
|
||||
--> src/mdtest_snippet.py:40:21
|
||||
|
|
||||
38 | reveal_type(arg2) # revealed: type[OnlyMethodMembers]
|
||||
|
|
|
@ -54,7 +54,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/function/return_type.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-return-type: Return type does not match returned value
|
||||
error[invalid-return-type]: Return type does not match returned value
|
||||
--> src/mdtest_snippet.py:19:12
|
||||
|
|
||||
17 | yield from i()
|
||||
|
@ -71,7 +71,7 @@ info: `lint:invalid-return-type` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-return-type: Return type does not match returned value
|
||||
error[invalid-return-type]: Return type does not match returned value
|
||||
--> src/mdtest_snippet.py:36:18
|
||||
|
|
||||
34 | yield 42
|
||||
|
|
|
@ -31,7 +31,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/function/return_type.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-return-type: Return type does not match returned value
|
||||
error[invalid-return-type]: Return type does not match returned value
|
||||
--> src/mdtest_snippet.py:1:22
|
||||
|
|
||||
1 | def f(cond: bool) -> str:
|
||||
|
@ -50,7 +50,7 @@ info: `lint:invalid-return-type` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-return-type: Return type does not match returned value
|
||||
error[invalid-return-type]: Return type does not match returned value
|
||||
--> src/mdtest_snippet.py:8:22
|
||||
|
|
||||
6 | return 1
|
||||
|
@ -69,7 +69,7 @@ info: `lint:invalid-return-type` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-return-type: Return type does not match returned value
|
||||
error[invalid-return-type]: Return type does not match returned value
|
||||
--> src/mdtest_snippet.py:14:16
|
||||
|
|
||||
12 | else:
|
||||
|
|
|
@ -40,7 +40,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/function/return_type.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-return-type: Return type does not match returned value
|
||||
error[invalid-return-type]: Return type does not match returned value
|
||||
--> src/mdtest_snippet.py:1:12
|
||||
|
|
||||
1 | def f() -> None:
|
||||
|
@ -57,7 +57,7 @@ info: `lint:invalid-return-type` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-return-type: Function can implicitly return `None`, which is not assignable to return type `int`
|
||||
error[invalid-return-type]: Function can implicitly return `None`, which is not assignable to return type `int`
|
||||
--> src/mdtest_snippet.py:7:22
|
||||
|
|
||||
6 | # error: [invalid-return-type]
|
||||
|
@ -71,7 +71,7 @@ info: `lint:invalid-return-type` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-return-type: Function can implicitly return `None`, which is not assignable to return type `int`
|
||||
error[invalid-return-type]: Function can implicitly return `None`, which is not assignable to return type `int`
|
||||
--> src/mdtest_snippet.py:12:22
|
||||
|
|
||||
11 | # error: [invalid-return-type]
|
||||
|
@ -85,7 +85,7 @@ info: `lint:invalid-return-type` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-return-type: Function can implicitly return `None`, which is not assignable to return type `int`
|
||||
error[invalid-return-type]: Function can implicitly return `None`, which is not assignable to return type `int`
|
||||
--> src/mdtest_snippet.py:17:22
|
||||
|
|
||||
16 | # error: [invalid-return-type]
|
||||
|
|
|
@ -35,7 +35,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/function/return_type.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-return-type: Function can implicitly return `None`, which is not assignable to return type `int`
|
||||
error[invalid-return-type]: Function can implicitly return `None`, which is not assignable to return type `int`
|
||||
--> src/mdtest_snippet.py:2:12
|
||||
|
|
||||
1 | # error: [invalid-return-type]
|
||||
|
@ -48,7 +48,7 @@ info: `lint:invalid-return-type` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-return-type: Return type does not match returned value
|
||||
error[invalid-return-type]: Return type does not match returned value
|
||||
--> src/mdtest_snippet.py:5:12
|
||||
|
|
||||
3 | 1
|
||||
|
@ -66,7 +66,7 @@ info: `lint:invalid-return-type` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-return-type: Return type does not match returned value
|
||||
error[invalid-return-type]: Return type does not match returned value
|
||||
--> src/mdtest_snippet.py:9:12
|
||||
|
|
||||
7 | return 1
|
||||
|
@ -84,7 +84,7 @@ info: `lint:invalid-return-type` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-return-type: Function can implicitly return `None`, which is not assignable to return type `T`
|
||||
error[invalid-return-type]: Function can implicitly return `None`, which is not assignable to return type `T`
|
||||
--> src/mdtest_snippet.py:18:16
|
||||
|
|
||||
17 | # error: [invalid-return-type]
|
||||
|
|
|
@ -30,7 +30,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/function/return_type.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-return-type: Return type does not match returned value
|
||||
error[invalid-return-type]: Return type does not match returned value
|
||||
--> src/mdtest_snippet.pyi:1:12
|
||||
|
|
||||
1 | def f() -> int:
|
||||
|
@ -46,7 +46,7 @@ info: `lint:invalid-return-type` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-return-type: Function can implicitly return `None`, which is not assignable to return type `int`
|
||||
error[invalid-return-type]: Function can implicitly return `None`, which is not assignable to return type `int`
|
||||
--> src/mdtest_snippet.pyi:6:14
|
||||
|
|
||||
5 | # error: [invalid-return-type]
|
||||
|
@ -60,7 +60,7 @@ info: `lint:invalid-return-type` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: invalid-return-type: Function can implicitly return `None`, which is not assignable to return type `int`
|
||||
error[invalid-return-type]: Function can implicitly return `None`, which is not assignable to return type `int`
|
||||
--> src/mdtest_snippet.pyi:11:14
|
||||
|
|
||||
10 | # error: [invalid-return-type]
|
||||
|
|
|
@ -33,7 +33,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/comparison/instances/ric
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: unsupported-bool-conversion: Boolean conversion is unsupported for type `NotBoolable`
|
||||
error[unsupported-bool-conversion]: Boolean conversion is unsupported for type `NotBoolable`
|
||||
--> src/mdtest_snippet.py:12:1
|
||||
|
|
||||
11 | # error: [unsupported-bool-conversion]
|
||||
|
@ -48,7 +48,7 @@ info: `lint:unsupported-bool-conversion` is enabled by default
|
|||
```
|
||||
|
||||
```
|
||||
error: unsupported-bool-conversion: Boolean conversion is unsupported for type `NotBoolable`
|
||||
error[unsupported-bool-conversion]: Boolean conversion is unsupported for type `NotBoolable`
|
||||
--> src/mdtest_snippet.py:14:1
|
||||
|
|
||||
12 | 10 < Comparable() < 20
|
||||
|
|
|
@ -32,7 +32,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/semantic_syn
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-syntax:
|
||||
error[invalid-syntax]
|
||||
--> src/mdtest_snippet.py:6:19
|
||||
|
|
||||
4 | async def f():
|
||||
|
|
|
@ -20,7 +20,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/shadowing.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-assignment: Implicit shadowing of class `C`
|
||||
error[invalid-assignment]: Implicit shadowing of class `C`
|
||||
--> src/mdtest_snippet.py:3:1
|
||||
|
|
||||
1 | class C: ...
|
||||
|
|
|
@ -20,7 +20,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/shadowing.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-assignment: Implicit shadowing of function `f`
|
||||
error[invalid-assignment]: Implicit shadowing of function `f`
|
||||
--> src/mdtest_snippet.py:3:1
|
||||
|
|
||||
1 | def f(): ...
|
||||
|
|
|
@ -34,7 +34,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/comparison/tuples.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: unsupported-bool-conversion: Boolean conversion is unsupported for type `NotBoolable | Literal[False]`
|
||||
error[unsupported-bool-conversion]: Boolean conversion is unsupported for type `NotBoolable | Literal[False]`
|
||||
--> src/mdtest_snippet.py:15:1
|
||||
|
|
||||
14 | # error: [unsupported-bool-conversion]
|
||||
|
|
|
@ -26,7 +26,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/comparison/tuples.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: unsupported-bool-conversion: Boolean conversion is unsupported for type `NotBoolable`
|
||||
error[unsupported-bool-conversion]: Boolean conversion is unsupported for type `NotBoolable`
|
||||
--> src/mdtest_snippet.py:9:1
|
||||
|
|
||||
8 | # error: [unsupported-bool-conversion]
|
||||
|
|
|
@ -18,7 +18,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/unpacking.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-assignment: Not enough values to unpack
|
||||
error[invalid-assignment]: Not enough values to unpack
|
||||
--> src/mdtest_snippet.py:1:1
|
||||
|
|
||||
1 | a, b = (1,) # error: [invalid-assignment]
|
||||
|
|
|
@ -18,7 +18,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/unpacking.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-assignment: Too many values to unpack
|
||||
error[invalid-assignment]: Too many values to unpack
|
||||
--> src/mdtest_snippet.py:1:1
|
||||
|
|
||||
1 | a, b = (1, 2, 3) # error: [invalid-assignment]
|
||||
|
|
|
@ -18,7 +18,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/unpacking.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: not-iterable: Object of type `Literal[1]` is not iterable
|
||||
error[not-iterable]: Object of type `Literal[1]` is not iterable
|
||||
--> src/mdtest_snippet.py:1:8
|
||||
|
|
||||
1 | a, b = 1 # error: [not-iterable]
|
||||
|
|
|
@ -18,7 +18,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/unpacking.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-assignment: Not enough values to unpack
|
||||
error[invalid-assignment]: Not enough values to unpack
|
||||
--> src/mdtest_snippet.py:1:1
|
||||
|
|
||||
1 | [a, *b, c, d] = (1, 2) # error: [invalid-assignment]
|
||||
|
|
|
@ -20,7 +20,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/unresolved_i
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: unresolved-import: Cannot resolve imported module `does_not_exist`
|
||||
error[unresolved-import]: Cannot resolve imported module `does_not_exist`
|
||||
--> src/mdtest_snippet.py:1:8
|
||||
|
|
||||
1 | import does_not_exist # error: [unresolved-import]
|
||||
|
|
|
@ -25,7 +25,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/unresolved_i
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: unresolved-import: Module `a` has no member `does_not_exist`
|
||||
error[unresolved-import]: Module `a` has no member `does_not_exist`
|
||||
--> src/mdtest_snippet.py:1:28
|
||||
|
|
||||
1 | from a import does_exist1, does_not_exist, does_exist2 # error: [unresolved-import]
|
||||
|
|
|
@ -20,7 +20,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/unresolved_i
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: unresolved-import: Cannot resolve imported module `.does_not_exist`
|
||||
error[unresolved-import]: Cannot resolve imported module `.does_not_exist`
|
||||
--> src/mdtest_snippet.py:1:7
|
||||
|
|
||||
1 | from .does_not_exist import add # error: [unresolved-import]
|
||||
|
|
|
@ -20,7 +20,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/unresolved_i
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: unresolved-import: Cannot resolve imported module `.does_not_exist.foo.bar`
|
||||
error[unresolved-import]: Cannot resolve imported module `.does_not_exist.foo.bar`
|
||||
--> src/mdtest_snippet.py:1:7
|
||||
|
|
||||
1 | from .does_not_exist.foo.bar import add # error: [unresolved-import]
|
||||
|
|
|
@ -20,7 +20,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/unresolved_i
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: unresolved-import: Cannot resolve imported module `does_not_exist`
|
||||
error[unresolved-import]: Cannot resolve imported module `does_not_exist`
|
||||
--> src/mdtest_snippet.py:1:6
|
||||
|
|
||||
1 | from does_not_exist import add # error: [unresolved-import]
|
||||
|
|
|
@ -32,7 +32,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/unresolved_i
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: unresolved-import: Cannot resolve imported module `....foo`
|
||||
error[unresolved-import]: Cannot resolve imported module `....foo`
|
||||
--> src/package/subpackage/subsubpackage/__init__.py:1:10
|
||||
|
|
||||
1 | from ....foo import add # error: [unresolved-import]
|
||||
|
|
|
@ -24,7 +24,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/unsupported_
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: unsupported-bool-conversion: Boolean conversion is unsupported for type `NotBoolable`
|
||||
error[unsupported-bool-conversion]: Boolean conversion is unsupported for type `NotBoolable`
|
||||
--> src/mdtest_snippet.py:7:8
|
||||
|
|
||||
6 | # error: [unsupported-bool-conversion]
|
||||
|
|
|
@ -25,7 +25,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/unsupported_
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: unsupported-bool-conversion: Boolean conversion is unsupported for type `NotBoolable`
|
||||
error[unsupported-bool-conversion]: Boolean conversion is unsupported for type `NotBoolable`
|
||||
--> src/mdtest_snippet.py:8:8
|
||||
|
|
||||
7 | # error: [unsupported-bool-conversion]
|
||||
|
|
|
@ -25,7 +25,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/unsupported_
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: unsupported-bool-conversion: Boolean conversion is unsupported for type `NotBoolable`
|
||||
error[unsupported-bool-conversion]: Boolean conversion is unsupported for type `NotBoolable`
|
||||
--> src/mdtest_snippet.py:8:8
|
||||
|
|
||||
7 | # error: [unsupported-bool-conversion]
|
||||
|
|
|
@ -32,7 +32,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/unsupported_
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: unsupported-bool-conversion: Boolean conversion is unsupported for union `NotBoolable1 | NotBoolable2 | NotBoolable3` because `NotBoolable1` doesn't implement `__bool__` correctly
|
||||
error[unsupported-bool-conversion]: Boolean conversion is unsupported for union `NotBoolable1 | NotBoolable2 | NotBoolable3` because `NotBoolable1` doesn't implement `__bool__` correctly
|
||||
--> src/mdtest_snippet.py:15:8
|
||||
|
|
||||
14 | # error: [unsupported-bool-conversion]
|
||||
|
|
|
@ -20,7 +20,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/version_rela
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: invalid-syntax:
|
||||
error[invalid-syntax]
|
||||
--> src/mdtest_snippet.py:1:1
|
||||
|
|
||||
1 | match 2: # error: 1 [invalid-syntax] "Cannot use `match` statement on Python 3.9 (syntax was added in Python 3.10)"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue