From 4e4e428a95cde7c47bb8437b98db2541e6fd9625 Mon Sep 17 00:00:00 2001 From: David Peter Date: Wed, 2 Jul 2025 16:21:32 +0200 Subject: [PATCH] [ty] Fix link in generate_ty_rules (#19090) --- crates/ruff_dev/src/generate_ty_rules.rs | 2 +- crates/ty/docs/rules.md | 132 +++++++++++------------ 2 files changed, 67 insertions(+), 67 deletions(-) diff --git a/crates/ruff_dev/src/generate_ty_rules.rs b/crates/ruff_dev/src/generate_ty_rules.rs index 360fbb3add..988bc1d8dd 100644 --- a/crates/ruff_dev/src/generate_ty_rules.rs +++ b/crates/ruff_dev/src/generate_ty_rules.rs @@ -91,7 +91,7 @@ fn generate_markdown() -> String { let _ = writeln!( &mut output, r#" -Default level: [`{level}`](/rules/#rule-levels "This lint has a default severity of '{level}'.") · +Default level: [`{level}`](../rules.md#rule-levels "This lint has a default level of '{level}'.") · [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20{encoded_name}) · [View source](https://github.com/astral-sh/ruff/blob/main/{file}#L{line}) diff --git a/crates/ty/docs/rules.md b/crates/ty/docs/rules.md index fb8575bc23..3bc95ad99f 100644 --- a/crates/ty/docs/rules.md +++ b/crates/ty/docs/rules.md @@ -5,7 +5,7 @@ ## `byte-string-type-annotation` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20byte-string-type-annotation) · [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fstring_annotation.rs#L36) @@ -34,7 +34,7 @@ def test(): -> "int": ## `call-non-callable` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L98) @@ -56,7 +56,7 @@ Calling a non-callable object will raise a `TypeError` at runtime. ## `conflicting-argument-forms` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L142) @@ -86,7 +86,7 @@ f(int) # error ## `conflicting-declarations` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L168) @@ -115,7 +115,7 @@ a = 1 ## `conflicting-metaclass` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L193) @@ -146,7 +146,7 @@ class C(A, B): ... ## `cyclic-class-definition` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L219) @@ -177,7 +177,7 @@ class B(A): ... ## `duplicate-base` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L263) @@ -203,7 +203,7 @@ class B(A, A): ... ## `duplicate-kw-only` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20duplicate-kw-only) · [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L284) @@ -239,7 +239,7 @@ class A: # Crash at runtime ## `escape-character-in-forward-annotation` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20escape-character-in-forward-annotation) · [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fstring_annotation.rs#L120) @@ -249,7 +249,7 @@ TODO #14889 ## `fstring-type-annotation` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20fstring-type-annotation) · [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fstring_annotation.rs#L11) @@ -278,7 +278,7 @@ def test(): -> "int": ## `implicit-concatenated-string-type-annotation` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20implicit-concatenated-string-type-annotation) · [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fstring_annotation.rs#L86) @@ -307,7 +307,7 @@ def test(): -> "Literal[5]": ## `inconsistent-mro` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L426) @@ -336,7 +336,7 @@ class C(A, B): ... ## `index-out-of-bounds` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L450) @@ -360,7 +360,7 @@ t[3] # IndexError: tuple index out of range ## `instance-layout-conflict` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20instance-layout-conflict) · [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L316) @@ -449,7 +449,7 @@ an atypical memory layout. ## `invalid-argument-type` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L470) @@ -474,7 +474,7 @@ func("foo") # error: [invalid-argument-type] ## `invalid-assignment` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L510) @@ -500,7 +500,7 @@ a: int = '' ## `invalid-attribute-access` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L1514) @@ -532,7 +532,7 @@ C.instance_var = 3 # error: Cannot assign to instance variable ## `invalid-base` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L532) @@ -554,7 +554,7 @@ class A(42): ... # error: [invalid-base] ## `invalid-context-manager` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L583) @@ -580,7 +580,7 @@ with 1: ## `invalid-declaration` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L604) @@ -607,7 +607,7 @@ a: str ## `invalid-exception-caught` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L627) @@ -649,7 +649,7 @@ except ZeroDivisionError: ## `invalid-generic-class` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L663) @@ -681,7 +681,7 @@ class C[U](Generic[T]): ... ## `invalid-legacy-type-variable` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L689) @@ -715,7 +715,7 @@ def f(t: TypeVar("U")): ... ## `invalid-metaclass` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L738) @@ -748,7 +748,7 @@ class B(metaclass=f): ... ## `invalid-overload` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L765) @@ -796,7 +796,7 @@ def foo(x: int) -> int: ... ## `invalid-parameter-default` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L808) @@ -820,7 +820,7 @@ def f(a: int = ''): ... ## `invalid-protocol` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L398) @@ -852,7 +852,7 @@ TypeError: Protocols can only inherit from other protocols, got ## `invalid-raise` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L828) @@ -899,7 +899,7 @@ def g(): ## `invalid-return-type` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L491) @@ -922,7 +922,7 @@ def func() -> int: ## `invalid-super-argument` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L871) @@ -966,7 +966,7 @@ super(B, A) # error: `A` does not satisfy `issubclass(A, B)` ## `invalid-syntax-in-forward-annotation` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-syntax-in-forward-annotation) · [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fstring_annotation.rs#L111) @@ -976,7 +976,7 @@ TODO #14889 ## `invalid-type-alias-type` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-type-alias-type) · [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L717) @@ -1001,7 +1001,7 @@ NewAlias = TypeAliasType(get_name(), int) # error: TypeAliasType name mus ## `invalid-type-checking-constant` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L910) @@ -1029,7 +1029,7 @@ TYPE_CHECKING = '' ## `invalid-type-form` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L934) @@ -1057,7 +1057,7 @@ b: Annotated[int] # `Annotated` expects at least two arguments ## `invalid-type-guard-call` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-type-guard-call) · [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L986) @@ -1089,7 +1089,7 @@ f(10) # Error ## `invalid-type-guard-definition` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-type-guard-definition) · [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L958) @@ -1121,7 +1121,7 @@ class C: ## `invalid-type-variable-constraints` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L1014) @@ -1155,7 +1155,7 @@ T = TypeVar('T', bound=str) # valid bound TypeVar ## `missing-argument` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L1043) @@ -1178,7 +1178,7 @@ func() # TypeError: func() missing 1 required positional argument: 'x' ## `no-matching-overload` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L1062) @@ -1205,7 +1205,7 @@ func("string") # error: [no-matching-overload] ## `non-subscriptable` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L1085) @@ -1227,7 +1227,7 @@ Subscripting an object that does not support it will raise a `TypeError` at runt ## `not-iterable` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L1103) @@ -1251,7 +1251,7 @@ for i in 34: # TypeError: 'int' object is not iterable ## `parameter-already-assigned` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L1154) @@ -1276,7 +1276,7 @@ f(1, x=2) # Error raised here ## `raw-string-type-annotation` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20raw-string-type-annotation) · [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fstring_annotation.rs#L61) @@ -1305,7 +1305,7 @@ def test(): -> "int": ## `static-assert-error` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L1490) @@ -1333,7 +1333,7 @@ static_assert(int(2.0 * 3.0) == 6) # error: does not have a statically known tr ## `subclass-of-final-class` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L1245) @@ -1360,7 +1360,7 @@ class B(A): ... # Error raised here ## `too-many-positional-arguments` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L1290) @@ -1385,7 +1385,7 @@ f("foo") # Error raised here ## `type-assertion-failure` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L1268) @@ -1411,7 +1411,7 @@ def _(x: int): ## `unavailable-implicit-super-arguments` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L1311) @@ -1455,7 +1455,7 @@ class A: ## `unknown-argument` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L1368) @@ -1480,7 +1480,7 @@ f(x=1, y=2) # Error raised here ## `unresolved-attribute` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L1389) @@ -1506,7 +1506,7 @@ A().foo # AttributeError: 'A' object has no attribute 'foo' ## `unresolved-import` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L1411) @@ -1529,7 +1529,7 @@ import foo # ModuleNotFoundError: No module named 'foo' ## `unresolved-reference` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L1430) @@ -1552,7 +1552,7 @@ print(x) # NameError: name 'x' is not defined ## `unsupported-bool-conversion` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L1123) @@ -1587,7 +1587,7 @@ b1 < b2 < b1 # exception raised here ## `unsupported-operator` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L1449) @@ -1613,7 +1613,7 @@ A() + A() # TypeError: unsupported operand type(s) for +: 'A' and 'A' ## `zero-stepsize-in-slice` -Default level: [`error`](/rules/#rule-levels "This lint has a default severity of 'error'.") · +Default level: [`error`](../rules.md#rule-levels "This lint has a default level of 'error'.") · [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#L1471) @@ -1636,7 +1636,7 @@ l[1:10:0] # ValueError: slice step cannot be zero ## `invalid-ignore-comment` -Default level: [`warn`](/rules/#rule-levels "This lint has a default severity of 'warn'.") · +Default level: [`warn`](../rules.md#rule-levels "This lint has a default level of 'warn'.") · [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20invalid-ignore-comment) · [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Fsuppression.rs#L65) @@ -1664,7 +1664,7 @@ a = 20 / 0 # type: ignore ## `possibly-unbound-attribute` -Default level: [`warn`](/rules/#rule-levels "This lint has a default severity of 'warn'.") · +Default level: [`warn`](../rules.md#rule-levels "This lint has a default level of 'warn'.") · [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#L1175) @@ -1690,7 +1690,7 @@ A.c # AttributeError: type object 'A' has no attribute 'c' ## `possibly-unbound-implicit-call` -Default level: [`warn`](/rules/#rule-levels "This lint has a default severity of 'warn'.") · +Default level: [`warn`](../rules.md#rule-levels "This lint has a default level of 'warn'.") · [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20possibly-unbound-implicit-call) · [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L116) @@ -1720,7 +1720,7 @@ A()[0] # TypeError: 'A' object is not subscriptable ## `possibly-unbound-import` -Default level: [`warn`](/rules/#rule-levels "This lint has a default severity of 'warn'.") · +Default level: [`warn`](../rules.md#rule-levels "This lint has a default level of 'warn'.") · [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#L1197) @@ -1752,7 +1752,7 @@ from module import a # ImportError: cannot import name 'a' from 'module' ## `redundant-cast` -Default level: [`warn`](/rules/#rule-levels "This lint has a default severity of 'warn'.") · +Default level: [`warn`](../rules.md#rule-levels "This lint has a default level of 'warn'.") · [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#L1542) @@ -1777,7 +1777,7 @@ cast(int, f()) # Redundant ## `undefined-reveal` -Default level: [`warn`](/rules/#rule-levels "This lint has a default severity of 'warn'.") · +Default level: [`warn`](../rules.md#rule-levels "This lint has a default level of 'warn'.") · [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#L1350) @@ -1799,7 +1799,7 @@ reveal_type(1) # NameError: name 'reveal_type' is not defined ## `unknown-rule` -Default level: [`warn`](/rules/#rule-levels "This lint has a default severity of 'warn'.") · +Default level: [`warn`](../rules.md#rule-levels "This lint has a default level of 'warn'.") · [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20unknown-rule) · [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Fsuppression.rs#L40) @@ -1828,7 +1828,7 @@ a = 20 / 0 # ty: ignore[division-by-zero] ## `unsupported-base` -Default level: [`warn`](/rules/#rule-levels "This lint has a default severity of 'warn'.") · +Default level: [`warn`](../rules.md#rule-levels "This lint has a default level of 'warn'.") · [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20unsupported-base) · [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Ftypes%2Fdiagnostic.rs#L550) @@ -1865,7 +1865,7 @@ class D(C): ... # error: [unsupported-base] ## `division-by-zero` -Default level: [`ignore`](/rules/#rule-levels "This lint has a default severity of 'ignore'.") · +Default level: [`ignore`](../rules.md#rule-levels "This lint has a default level of 'ignore'.") · [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#L245) @@ -1887,7 +1887,7 @@ Dividing by zero raises a `ZeroDivisionError` at runtime. ## `possibly-unresolved-reference` -Default level: [`ignore`](/rules/#rule-levels "This lint has a default severity of 'ignore'.") · +Default level: [`ignore`](../rules.md#rule-levels "This lint has a default level of 'ignore'.") · [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#L1223) @@ -1913,7 +1913,7 @@ print(x) # NameError: name 'x' is not defined ## `unused-ignore-comment` -Default level: [`ignore`](/rules/#rule-levels "This lint has a default severity of 'ignore'.") · +Default level: [`ignore`](../rules.md#rule-levels "This lint has a default level of 'ignore'.") · [Related issues](https://github.com/astral-sh/ty/issues?q=sort%3Aupdated-desc%20is%3Aissue%20is%3Aopen%20unused-ignore-comment) · [View source](https://github.com/astral-sh/ruff/blob/main/crates%2Fty_python_semantic%2Fsrc%2Fsuppression.rs#L15)