mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 12:29:28 +00:00
ty: get rid of lint:
prefix in ID for diagnostic rendering
In #289, we seem to have consensus that this prefix isn't really pulling its weight. Ref #289
This commit is contained in:
parent
d1bb10a66b
commit
2c4cbb6e29
89 changed files with 271 additions and 257 deletions
|
@ -28,7 +28,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/attribute_as
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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]
|
||||
|
|
|
@ -20,7 +20,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: lint: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: lint: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: lint: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]
|
||||
|
|
|
@ -46,7 +46,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: lint: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]
|
||||
|
@ -76,7 +76,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: lint: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]
|
||||
|
|
|
@ -43,7 +43,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: lint: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]
|
||||
|
@ -73,7 +73,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: lint: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]
|
||||
|
|
|
@ -47,7 +47,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: lint: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]
|
||||
|
@ -77,7 +77,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: lint: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]
|
||||
|
|
|
@ -51,7 +51,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: lint: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]
|
||||
|
@ -80,7 +80,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: lint: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]
|
||||
|
|
|
@ -36,7 +36,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: lint: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]
|
||||
|
|
|
@ -54,7 +54,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: lint: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]
|
||||
|
@ -83,7 +83,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: lint: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]
|
||||
|
|
|
@ -35,7 +35,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: lint: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]
|
||||
|
|
|
@ -36,7 +36,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: lint: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)
|
||||
|
|
|
@ -31,7 +31,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: lint: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):
|
||||
|
|
|
@ -33,7 +33,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: lint: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: lint: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
|
||||
|
|
|
@ -26,7 +26,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: lint: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]
|
||||
|
|
|
@ -30,7 +30,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: lint: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]
|
||||
|
|
|
@ -41,7 +41,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/loops/for.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: lint: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]
|
||||
|
@ -70,7 +70,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: lint: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]
|
||||
|
|
|
@ -68,7 +68,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: lint: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]
|
||||
|
|
|
@ -83,7 +83,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: lint: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
|
||||
|
|
|
@ -65,7 +65,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: lint: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]
|
||||
|
|
|
@ -80,7 +80,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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
|
||||
|
@ -141,7 +141,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: lint: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: lint: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`"
|
||||
|
@ -230,7 +230,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: lint:duplicate-base: Duplicate base class `Mushrooms`
|
||||
error: duplicate-base: Duplicate base class `Mushrooms`
|
||||
--> src/mdtest_snippet.py:30:7
|
||||
|
|
||||
29 | class Mushrooms: ...
|
||||
|
@ -269,7 +269,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: lint: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: lint: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: lint:unused-ignore-comment
|
||||
info: unused-ignore-comment
|
||||
--> src/mdtest_snippet.py:72:9
|
||||
|
|
||||
70 | A,
|
||||
|
@ -358,7 +358,7 @@ info: lint:unused-ignore-comment
|
|||
```
|
||||
|
||||
```
|
||||
error: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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]
|
||||
|
@ -69,7 +69,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: lint: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`"
|
||||
|
@ -105,7 +105,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: lint: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`"
|
||||
|
|
|
@ -29,7 +29,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/protocols.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: lint: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: lint: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: lint: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):
|
||||
|
@ -110,7 +110,7 @@ info: revealed-type: Revealed type
|
|||
```
|
||||
|
||||
```
|
||||
error: lint: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
|
||||
|
|
|
@ -54,7 +54,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/function/return_type.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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
|
||||
|
|
|
@ -20,7 +20,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/shadowing.md
|
|||
# Diagnostics
|
||||
|
||||
```
|
||||
error: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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: lint: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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue