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:
Andrew Gallant 2025-05-09 10:32:03 -04:00 committed by Andrew Gallant
parent d1bb10a66b
commit 2c4cbb6e29
89 changed files with 271 additions and 257 deletions

View file

@ -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__`)

View file

@ -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)

View file

@ -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

View file

@ -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()

View file

@ -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]

View file

@ -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.

View file

@ -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()

View file

@ -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()

View file

@ -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]

View file

@ -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`"

View file

@ -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:

View file

@ -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]

View file

@ -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

View file

@ -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

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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)

View file

@ -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):

View file

@ -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

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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

View file

@ -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]

View file

@ -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

View file

@ -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]

View file

@ -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

View file

@ -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()

View file

@ -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

View file

@ -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():

View file

@ -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

View file

@ -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

View file

@ -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]

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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()

View file

@ -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)

View file

@ -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)

View file

@ -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()

View file

@ -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 | ):

View file

@ -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]

View file

@ -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]

View file

@ -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

View file

@ -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: ...

View file

@ -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

View file

@ -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):

View file

@ -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

View file

@ -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`"

View file

@ -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): ...

View file

@ -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

View file

@ -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

View file

@ -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:

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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

View file

@ -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: ...

View file

@ -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(): ...

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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]

View file

@ -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]