|
|
|
|
@@ -50,7 +50,7 @@ Calling a non-callable object will raise a `TypeError` at runtime.
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20call-non-callable)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L84)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L85)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `conflicting-argument-forms`
|
|
|
|
|
@@ -81,7 +81,7 @@ f(int) # error
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20conflicting-argument-forms)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L115)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L116)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `conflicting-declarations`
|
|
|
|
|
@@ -111,7 +111,7 @@ a = 1
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20conflicting-declarations)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L141)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L142)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `conflicting-metaclass`
|
|
|
|
|
@@ -142,7 +142,7 @@ class C(A, B): ...
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20conflicting-metaclass)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L166)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L167)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `cyclic-class-definition`
|
|
|
|
|
@@ -173,7 +173,7 @@ class B(A): ...
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20cyclic-class-definition)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L192)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L193)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `division-by-zero`
|
|
|
|
|
@@ -196,7 +196,7 @@ Dividing by zero raises a `ZeroDivisionError` at runtime.
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20division-by-zero)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L218)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L219)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `duplicate-base`
|
|
|
|
|
@@ -222,7 +222,7 @@ class B(A, A): ...
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20duplicate-base)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L236)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L237)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `escape-character-in-forward-annotation`
|
|
|
|
|
@@ -359,7 +359,7 @@ TypeError: multiple bases have instance lay-out conflict
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20incompatible-slots)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L257)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L258)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `inconsistent-mro`
|
|
|
|
|
@@ -388,7 +388,7 @@ class C(A, B): ...
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20inconsistent-mro)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L343)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L344)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `index-out-of-bounds`
|
|
|
|
|
@@ -413,7 +413,7 @@ t[3] # IndexError: tuple index out of range
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20index-out-of-bounds)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L367)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L368)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `invalid-argument-type`
|
|
|
|
|
@@ -439,7 +439,7 @@ func("foo") # error: [invalid-argument-type]
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-argument-type)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L387)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L388)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `invalid-assignment`
|
|
|
|
|
@@ -466,7 +466,7 @@ a: int = ''
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-assignment)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L427)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L428)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `invalid-attribute-access`
|
|
|
|
|
@@ -499,7 +499,7 @@ C.instance_var = 3 # error: Cannot assign to instance variable
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-attribute-access)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1311)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1312)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `invalid-base`
|
|
|
|
|
@@ -513,7 +513,7 @@ TODO #14889
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-base)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L449)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L450)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `invalid-context-manager`
|
|
|
|
|
@@ -539,7 +539,7 @@ with 1:
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-context-manager)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L458)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L459)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `invalid-declaration`
|
|
|
|
|
@@ -567,7 +567,7 @@ a: str
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-declaration)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L479)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L480)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `invalid-exception-caught`
|
|
|
|
|
@@ -608,7 +608,7 @@ except ZeroDivisionError:
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-exception-caught)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L502)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L503)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `invalid-generic-class`
|
|
|
|
|
@@ -639,7 +639,7 @@ class C[U](Generic[T]): ...
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-generic-class)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L538)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L539)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `invalid-legacy-type-variable`
|
|
|
|
|
@@ -672,7 +672,7 @@ def f(t: TypeVar("U")): ...
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-legacy-type-variable)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L564)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L565)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `invalid-metaclass`
|
|
|
|
|
@@ -704,7 +704,7 @@ class B(metaclass=f): ...
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-metaclass)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L592)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L593)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `invalid-overload`
|
|
|
|
|
@@ -752,7 +752,7 @@ def foo(x: int) -> int: ...
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-overload)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L619)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L620)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `invalid-parameter-default`
|
|
|
|
|
@@ -777,7 +777,7 @@ def f(a: int = ''): ...
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-parameter-default)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L662)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L663)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `invalid-protocol`
|
|
|
|
|
@@ -810,7 +810,7 @@ TypeError: Protocols can only inherit from other protocols, got <class 'int'>
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-protocol)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L315)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L316)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `invalid-raise`
|
|
|
|
|
@@ -858,7 +858,7 @@ def g():
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-raise)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L682)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L683)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `invalid-return-type`
|
|
|
|
|
@@ -882,7 +882,7 @@ def func() -> int:
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-return-type)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L408)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L409)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `invalid-super-argument`
|
|
|
|
|
@@ -926,7 +926,7 @@ super(B, A) # error: `A` does not satisfy `issubclass(A, B)`
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-super-argument)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L725)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L726)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `invalid-syntax-in-forward-annotation`
|
|
|
|
|
@@ -969,7 +969,7 @@ TYPE_CHECKING = ''
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-type-checking-constant)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L764)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L765)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `invalid-type-form`
|
|
|
|
|
@@ -997,7 +997,7 @@ b: Annotated[int] # `Annotated` expects at least two arguments
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-type-form)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L788)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L789)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `invalid-type-variable-constraints`
|
|
|
|
|
@@ -1031,7 +1031,7 @@ T = TypeVar('T', bound=str) # valid bound TypeVar
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-type-variable-constraints)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L811)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L812)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `missing-argument`
|
|
|
|
|
@@ -1055,7 +1055,7 @@ func() # TypeError: func() missing 1 required positional argument: 'x'
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20missing-argument)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L840)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L841)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `no-matching-overload`
|
|
|
|
|
@@ -1083,7 +1083,7 @@ func("string") # error: [no-matching-overload]
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20no-matching-overload)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L859)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L860)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `non-subscriptable`
|
|
|
|
|
@@ -1106,7 +1106,7 @@ Subscripting an object that does not support it will raise a `TypeError` at runt
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20non-subscriptable)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L882)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L883)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `not-iterable`
|
|
|
|
|
@@ -1131,7 +1131,7 @@ for i in 34: # TypeError: 'int' object is not iterable
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20not-iterable)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L900)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L901)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `parameter-already-assigned`
|
|
|
|
|
@@ -1157,7 +1157,7 @@ f(1, x=2) # Error raised here
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20parameter-already-assigned)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L951)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L952)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `raw-string-type-annotation`
|
|
|
|
|
@@ -1216,7 +1216,7 @@ static_assert(int(2.0 * 3.0) == 6) # error: does not have a statically known tr
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20static-assert-error)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1287)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1288)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `subclass-of-final-class`
|
|
|
|
|
@@ -1244,7 +1244,7 @@ class B(A): ... # Error raised here
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20subclass-of-final-class)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1042)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1043)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `too-many-positional-arguments`
|
|
|
|
|
@@ -1270,7 +1270,7 @@ f("foo") # Error raised here
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20too-many-positional-arguments)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1087)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1088)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `type-assertion-failure`
|
|
|
|
|
@@ -1297,7 +1297,7 @@ def _(x: int):
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20type-assertion-failure)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1065)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1066)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `unavailable-implicit-super-arguments`
|
|
|
|
|
@@ -1341,7 +1341,7 @@ class A:
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20unavailable-implicit-super-arguments)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1108)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1109)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `unknown-argument`
|
|
|
|
|
@@ -1367,7 +1367,7 @@ f(x=1, y=2) # Error raised here
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20unknown-argument)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1165)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1166)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `unresolved-attribute`
|
|
|
|
|
@@ -1394,7 +1394,7 @@ A().foo # AttributeError: 'A' object has no attribute 'foo'
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20unresolved-attribute)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1186)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1187)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `unresolved-import`
|
|
|
|
|
@@ -1418,7 +1418,7 @@ import foo # ModuleNotFoundError: No module named 'foo'
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20unresolved-import)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1208)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1209)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `unresolved-reference`
|
|
|
|
|
@@ -1442,7 +1442,7 @@ print(x) # NameError: name 'x' is not defined
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20unresolved-reference)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1227)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1228)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `unsupported-bool-conversion`
|
|
|
|
|
@@ -1478,7 +1478,7 @@ b1 < b2 < b1 # exception raised here
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20unsupported-bool-conversion)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L920)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L921)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `unsupported-operator`
|
|
|
|
|
@@ -1505,7 +1505,7 @@ A() + A() # TypeError: unsupported operand type(s) for +: 'A' and 'A'
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20unsupported-operator)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1246)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1247)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `zero-stepsize-in-slice`
|
|
|
|
|
@@ -1529,7 +1529,7 @@ l[1:10:0] # ValueError: slice step cannot be zero
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20zero-stepsize-in-slice)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1268)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1269)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `call-possibly-unbound-method`
|
|
|
|
|
@@ -1547,7 +1547,7 @@ Calling an unbound method will raise an `AttributeError` at runtime.
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20call-possibly-unbound-method)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L102)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L103)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `invalid-ignore-comment`
|
|
|
|
|
@@ -1603,7 +1603,7 @@ A.c # AttributeError: type object 'A' has no attribute 'c'
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20possibly-unbound-attribute)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L972)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L973)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `possibly-unbound-import`
|
|
|
|
|
@@ -1634,7 +1634,7 @@ from module import a # ImportError: cannot import name 'a' from 'module'
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20possibly-unbound-import)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L994)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L995)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `redundant-cast`
|
|
|
|
|
@@ -1660,7 +1660,7 @@ cast(int, f()) # Redundant
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20redundant-cast)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1339)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1340)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `undefined-reveal`
|
|
|
|
|
@@ -1683,7 +1683,7 @@ reveal_type(1) # NameError: name 'reveal_type' is not defined
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20undefined-reveal)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1147)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1148)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `unknown-rule`
|
|
|
|
|
@@ -1740,7 +1740,7 @@ print(x) # NameError: name 'x' is not defined
|
|
|
|
|
|
|
|
|
|
### Links
|
|
|
|
|
* [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20possibly-unresolved-reference)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1020)
|
|
|
|
|
* [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L1021)
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## `unused-ignore-comment`
|
|
|
|
|
|