diff --git a/crates/ty_python_semantic/src/types/diagnostic.rs b/crates/ty_python_semantic/src/types/diagnostic.rs index 5e62790a80..55619f869d 100644 --- a/crates/ty_python_semantic/src/types/diagnostic.rs +++ b/crates/ty_python_semantic/src/types/diagnostic.rs @@ -102,7 +102,8 @@ declare_lint! { /// ## What it does /// Checks for calls to possibly unbound methods. /// - /// TODO #14889 + /// ## Why is this bad? + /// Calling an unbound method will raise an `AttributeError` at runtime. pub(crate) static CALL_POSSIBLY_UNBOUND_METHOD = { summary: "detects calls to possibly unbound methods", status: LintStatus::preview("1.0.0"), @@ -121,7 +122,13 @@ declare_lint! { } declare_lint! { - /// TODO #14889 + /// ## What it does + /// Checks whether a variable has been declared as two conflicting types. + /// + /// ## Why is this bad + /// A variable with two conflicting declarations likely indicates a mistake. + /// Moreover, it could lead to incorrect or ill-defined type inference for + /// other code that relies on these variables. pub(crate) static CONFLICTING_DECLARATIONS = { summary: "detects conflicting declarations", status: LintStatus::preview("1.0.0"), @@ -170,7 +177,11 @@ declare_lint! { } declare_lint! { - /// TODO #14889 + /// ## What it does + /// Checks for class definitions with duplicate bases. + /// + /// ## Why is this bad? + /// Class definitions with duplicate bases raise a `TypeError` at runtime. pub(crate) static DUPLICATE_BASE = { summary: "detects class definitions with duplicate bases", status: LintStatus::preview("1.0.0"), @@ -265,7 +276,11 @@ declare_lint! { } declare_lint! { - /// TODO #14889 + /// ## What it does + /// Checks for classes with an inconsistent method resolution order (MRO). + /// + /// ## Why is this bad? + /// Classes with an inconsistent MRO will raise a `TypeError` at runtime. pub(crate) static INCONSISTENT_MRO = { summary: "detects class definitions with an inconsistent MRO", status: LintStatus::preview("1.0.0"), @@ -275,7 +290,11 @@ declare_lint! { declare_lint! { /// ## What it does - /// TODO #14889 + /// Checks for attempts to use an out of bounds index to get an item from + /// a container. + /// + /// ## Why is this bad? + /// Using an out of bounds index will raise an `IndexError` at runtime. pub(crate) static INDEX_OUT_OF_BOUNDS = { summary: "detects index out of bounds errors", status: LintStatus::preview("1.0.0"), @@ -790,7 +809,8 @@ declare_lint! { /// ## What it does /// Checks for possibly unbound attributes. /// - /// TODO #14889 + /// ## Why is this bad? + /// Attempting to access an unbound attribute will raise an `AttributeError` at runtime. pub(crate) static POSSIBLY_UNBOUND_ATTRIBUTE = { summary: "detects references to possibly unbound attributes", status: LintStatus::preview("1.0.0"), @@ -799,7 +819,12 @@ declare_lint! { } declare_lint! { - /// TODO #14889 + /// ## What it does + /// Checks for imports of symbols that may be unbound. + /// + /// ## Why is this bad? + /// Importing an unbound module or name will raise a `ModuleNotFoundError` + /// or `ImportError` at runtime. pub(crate) static POSSIBLY_UNBOUND_IMPORT = { summary: "detects possibly unbound imports", status: LintStatus::preview("1.0.0"), @@ -975,7 +1000,8 @@ declare_lint! { /// ## What it does /// Checks for unresolved attributes. /// - /// TODO #14889 + /// ## Why is this bad? + /// Accessing an unbound attribute will raise an `AttributeError` at runtime. An unresolved attribute is not guaranteed to exist from the type alone, so this could also indicate that the object is not of the type that the user expects. pub(crate) static UNRESOLVED_ATTRIBUTE = { summary: "detects references to unresolved attributes", status: LintStatus::preview("1.0.0"), @@ -988,7 +1014,8 @@ declare_lint! { /// Checks for import statements for which the module cannot be resolved. /// /// ## Why is this bad? - /// Importing a module that cannot be resolved will raise an `ImportError` at runtime. + /// Importing a module that cannot be resolved will raise an `ImportError` + /// at runtime. pub(crate) static UNRESOLVED_IMPORT = { summary: "detects unresolved imports", status: LintStatus::preview("1.0.0"), @@ -1017,9 +1044,12 @@ declare_lint! { declare_lint! { /// ## What it does - /// Checks for binary expressions, comparisons, and unary expressions where the operands don't support the operator. + /// Checks for binary expressions, comparisons, and unary expressions where + /// the operands don't support the operator. /// - /// TODO #14889 + /// ## Why is this bad? + /// Attempting to use an unsupported operator will raise a `TypeError` at + /// runtime. pub(crate) static UNSUPPORTED_OPERATOR = { summary: "detects binary, unary, or comparison expressions where the operands don't support the operator", status: LintStatus::preview("1.0.0"), diff --git a/ty.schema.json b/ty.schema.json index a928b06343..a070b862cc 100644 --- a/ty.schema.json +++ b/ty.schema.json @@ -242,7 +242,7 @@ }, "call-possibly-unbound-method": { "title": "detects calls to possibly unbound methods", - "description": "## What it does\nChecks for calls to possibly unbound methods.\n\nTODO #14889", + "description": "## What it does\nChecks for calls to possibly unbound methods.\n\n## Why is this bad?\nCalling an unbound method will raise an `AttributeError` at runtime.", "default": "warn", "oneOf": [ { @@ -262,7 +262,7 @@ }, "conflicting-declarations": { "title": "detects conflicting declarations", - "description": "TODO #14889", + "description": "## What it does\nChecks whether a variable has been declared as two conflicting types.\n\n## Why is this bad\nA variable with two conflicting declarations likely indicates a mistake.\nMoreover, it could lead to incorrect or ill-defined type inference for\nother code that relies on these variables.", "default": "error", "oneOf": [ { @@ -302,7 +302,7 @@ }, "duplicate-base": { "title": "detects class definitions with duplicate bases", - "description": "TODO #14889", + "description": "## What it does\nChecks for class definitions with duplicate bases.\n\n## Why is this bad?\nClass definitions with duplicate bases raise a `TypeError` at runtime.", "default": "error", "oneOf": [ { @@ -352,7 +352,7 @@ }, "inconsistent-mro": { "title": "detects class definitions with an inconsistent MRO", - "description": "TODO #14889", + "description": "## What it does\nChecks for classes with an inconsistent method resolution order (MRO).\n\n## Why is this bad?\nClasses with an inconsistent MRO will raise a `TypeError` at runtime.", "default": "error", "oneOf": [ { @@ -362,7 +362,7 @@ }, "index-out-of-bounds": { "title": "detects index out of bounds errors", - "description": "## What it does\nTODO #14889", + "description": "## What it does\nChecks for attempts to use an out of bounds index to get an item from\na container.\n\n## Why is this bad?\nUsing an out of bounds index will raise an `IndexError` at runtime.", "default": "error", "oneOf": [ { @@ -632,7 +632,7 @@ }, "possibly-unbound-attribute": { "title": "detects references to possibly unbound attributes", - "description": "## What it does\nChecks for possibly unbound attributes.\n\nTODO #14889", + "description": "## What it does\nChecks for possibly unbound attributes.\n\n## Why is this bad?\nAttempting to access an unbound attribute will raise an `AttributeError` at runtime.", "default": "warn", "oneOf": [ { @@ -642,7 +642,7 @@ }, "possibly-unbound-import": { "title": "detects possibly unbound imports", - "description": "TODO #14889", + "description": "## What it does\nChecks for imports of symbols that may be unbound.\n\n## Why is this bad?\nImporting an unbound module or name will raise a `ModuleNotFoundError`\nor `ImportError` at runtime.", "default": "warn", "oneOf": [ { @@ -762,7 +762,7 @@ }, "unresolved-attribute": { "title": "detects references to unresolved attributes", - "description": "## What it does\nChecks for unresolved attributes.\n\nTODO #14889", + "description": "## What it does\nChecks for unresolved attributes.\n\n## Why is this bad?\nAccessing an unbound attribute will raise an `AttributeError` at runtime. An unresolved attribute is not guaranteed to exist from the type alone, so this could also indicate that the object is not of the type that the user expects.", "default": "error", "oneOf": [ { @@ -772,7 +772,7 @@ }, "unresolved-import": { "title": "detects unresolved imports", - "description": "## What it does\nChecks for import statements for which the module cannot be resolved.\n\n## Why is this bad?\nImporting a module that cannot be resolved will raise an `ImportError` at runtime.", + "description": "## What it does\nChecks for import statements for which the module cannot be resolved.\n\n## Why is this bad?\nImporting a module that cannot be resolved will raise an `ImportError`\nat runtime.", "default": "error", "oneOf": [ { @@ -802,7 +802,7 @@ }, "unsupported-operator": { "title": "detects binary, unary, or comparison expressions where the operands don't support the operator", - "description": "## What it does\nChecks for binary expressions, comparisons, and unary expressions where the operands don't support the operator.\n\nTODO #14889", + "description": "## What it does\nChecks for binary expressions, comparisons, and unary expressions where\nthe operands don't support the operator.\n\n## Why is this bad?\nAttempting to use an unsupported operator will raise a `TypeError` at\nruntime.", "default": "error", "oneOf": [ {