mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-30 19:47:52 +00:00
[ty] Document when a rule was added (#20859)
This commit is contained in:
parent
6341bb7403
commit
441ba20876
6 changed files with 485 additions and 304 deletions
|
|
@ -32,7 +32,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static UNUSED_IGNORE_COMMENT = {
|
||||
summary: "detects unused `type: ignore` comments",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Ignore,
|
||||
}
|
||||
}
|
||||
|
|
@ -57,7 +57,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static UNKNOWN_RULE = {
|
||||
summary: "detects `ty: ignore` comments that reference unknown rules",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Warn,
|
||||
}
|
||||
}
|
||||
|
|
@ -81,7 +81,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static INVALID_IGNORE_COMMENT = {
|
||||
summary: "detects ignore comments that use invalid syntax",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Warn,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static CALL_NON_CALLABLE = {
|
||||
summary: "detects calls to non-callable objects",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -151,7 +151,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static POSSIBLY_MISSING_IMPLICIT_CALL = {
|
||||
summary: "detects implicit calls to possibly missing methods",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.22"),
|
||||
default_level: Level::Warn,
|
||||
}
|
||||
}
|
||||
|
|
@ -177,7 +177,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static CONFLICTING_ARGUMENT_FORMS = {
|
||||
summary: "detects when an argument is used as both a value and a type form in a call",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -202,7 +202,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static CONFLICTING_DECLARATIONS = {
|
||||
summary: "detects conflicting declarations",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -228,7 +228,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static CONFLICTING_METACLASS = {
|
||||
summary: "detects conflicting metaclasses",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -254,7 +254,7 @@ declare_lint! {
|
|||
/// [method resolution order]: https://docs.python.org/3/glossary.html#term-method-resolution-order
|
||||
pub(crate) static CYCLIC_CLASS_DEFINITION = {
|
||||
summary: "detects cyclic class definitions",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -272,7 +272,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static DIVISION_BY_ZERO = {
|
||||
summary: "detects division by zero",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::preview("0.0.1-alpha.1"),
|
||||
default_level: Level::Ignore,
|
||||
}
|
||||
}
|
||||
|
|
@ -293,7 +293,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static DEPRECATED = {
|
||||
summary: "detects uses of deprecated items",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.16"),
|
||||
default_level: Level::Warn,
|
||||
}
|
||||
}
|
||||
|
|
@ -314,7 +314,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static DUPLICATE_BASE = {
|
||||
summary: "detects class definitions with duplicate bases",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -346,7 +346,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static DUPLICATE_KW_ONLY = {
|
||||
summary: "detects dataclass definitions with more than one usage of `KW_ONLY`",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.12"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -428,7 +428,7 @@ declare_lint! {
|
|||
/// [Method Resolution Order]: https://docs.python.org/3/glossary.html#term-method-resolution-order
|
||||
pub(crate) static INSTANCE_LAYOUT_CONFLICT = {
|
||||
summary: "detects class definitions that raise `TypeError` due to instance layout conflict",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.12"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -456,11 +456,12 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static INVALID_PROTOCOL = {
|
||||
summary: "detects invalid protocol class definitions",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
||||
// Added in #17750.
|
||||
declare_lint! {
|
||||
/// ## What it does
|
||||
/// Checks for protocol classes with members that will lead to ambiguous interfaces.
|
||||
|
|
@ -491,7 +492,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static AMBIGUOUS_PROTOCOL_MEMBER = {
|
||||
summary: "detects protocol classes with ambiguous interfaces",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.20"),
|
||||
default_level: Level::Warn,
|
||||
}
|
||||
}
|
||||
|
|
@ -517,7 +518,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static INVALID_NAMED_TUPLE = {
|
||||
summary: "detects invalid `NamedTuple` class definitions",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.19"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -541,7 +542,7 @@ declare_lint! {
|
|||
/// [method resolution order]: https://docs.python.org/3/glossary.html#term-method-resolution-order
|
||||
pub(crate) static INCONSISTENT_MRO = {
|
||||
summary: "detects class definitions with an inconsistent MRO",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -561,11 +562,12 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static INDEX_OUT_OF_BOUNDS = {
|
||||
summary: "detects index out of bounds errors",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
||||
// Added in #19763.
|
||||
declare_lint! {
|
||||
/// ## What it does
|
||||
/// Checks for subscript accesses with invalid keys.
|
||||
|
|
@ -586,7 +588,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static INVALID_KEY = {
|
||||
summary: "detects invalid subscript accesses",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.17"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -607,7 +609,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static INVALID_ARGUMENT_TYPE = {
|
||||
summary: "detects call arguments whose type is not assignable to the corresponding typed parameter",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -626,7 +628,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static INVALID_RETURN_TYPE = {
|
||||
summary: "detects returned values that can't be assigned to the function's annotated return type",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -648,7 +650,7 @@ declare_lint! {
|
|||
/// [assignable to]: https://typing.python.org/en/latest/spec/glossary.html#term-assignable
|
||||
pub(crate) static INVALID_ASSIGNMENT = {
|
||||
summary: "detects invalid assignments",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -678,7 +680,7 @@ declare_lint! {
|
|||
/// [Awaitable]: https://docs.python.org/3/library/collections.abc.html#collections.abc.Awaitable
|
||||
pub(crate) static INVALID_AWAIT = {
|
||||
summary: "detects awaiting on types that don't support it",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.19"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -696,7 +698,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static INVALID_BASE = {
|
||||
summary: "detects class bases that will cause the class definition to raise an exception at runtime",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -729,7 +731,7 @@ declare_lint! {
|
|||
/// [method resolution order]: https://docs.python.org/3/glossary.html#term-method-resolution-order
|
||||
pub(crate) static UNSUPPORTED_BASE = {
|
||||
summary: "detects class bases that are unsupported as ty could not feasibly calculate the class's MRO",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.7"),
|
||||
default_level: Level::Warn,
|
||||
}
|
||||
}
|
||||
|
|
@ -750,7 +752,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static INVALID_CONTEXT_MANAGER = {
|
||||
summary: "detects expressions used in with statements that don't implement the context manager protocol",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -773,7 +775,7 @@ declare_lint! {
|
|||
/// [assignable to]: https://typing.python.org/en/latest/spec/glossary.html#term-assignable
|
||||
pub(crate) static INVALID_DECLARATION = {
|
||||
summary: "detects invalid declarations",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -809,7 +811,7 @@ declare_lint! {
|
|||
/// This rule corresponds to Ruff's [`except-with-non-exception-classes` (`B030`)](https://docs.astral.sh/ruff/rules/except-with-non-exception-classes)
|
||||
pub(crate) static INVALID_EXCEPTION_CAUGHT = {
|
||||
summary: "detects exception handlers that catch classes that do not inherit from `BaseException`",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -835,7 +837,7 @@ declare_lint! {
|
|||
/// - [Typing spec: Generics](https://typing.python.org/en/latest/spec/generics.html#introduction)
|
||||
pub(crate) static INVALID_GENERIC_CLASS = {
|
||||
summary: "detects invalid generic classes",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -863,7 +865,7 @@ declare_lint! {
|
|||
/// - [Typing spec: Generics](https://typing.python.org/en/latest/spec/generics.html#introduction)
|
||||
pub(crate) static INVALID_LEGACY_TYPE_VARIABLE = {
|
||||
summary: "detects invalid legacy type variables",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -884,7 +886,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static INVALID_TYPE_ALIAS_TYPE = {
|
||||
summary: "detects invalid TypeAliasType definitions",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.6"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -911,7 +913,7 @@ declare_lint! {
|
|||
/// - [Python documentation: Metaclasses](https://docs.python.org/3/reference/datamodel.html#metaclasses)
|
||||
pub(crate) static INVALID_METACLASS = {
|
||||
summary: "detects invalid `metaclass=` arguments",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -954,7 +956,7 @@ declare_lint! {
|
|||
/// - [Python documentation: `@overload`](https://docs.python.org/3/library/typing.html#typing.overload)
|
||||
pub(crate) static INVALID_OVERLOAD = {
|
||||
summary: "detects invalid `@overload` usages",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1010,7 +1012,7 @@ declare_lint! {
|
|||
/// - [Python documentation: `@overload`](https://docs.python.org/3/library/typing.html#typing.overload)
|
||||
pub(crate) static USELESS_OVERLOAD_BODY = {
|
||||
summary: "detects `@overload`-decorated functions with non-stub bodies",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.22"),
|
||||
default_level: Level::Warn,
|
||||
}
|
||||
}
|
||||
|
|
@ -1030,7 +1032,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static INVALID_PARAMETER_DEFAULT = {
|
||||
summary: "detects default values that can't be assigned to the parameter's annotated type",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1073,7 +1075,7 @@ declare_lint! {
|
|||
/// - [Python documentation: Built-in Exceptions](https://docs.python.org/3/library/exceptions.html#built-in-exceptions)
|
||||
pub(crate) static INVALID_RAISE = {
|
||||
summary: "detects `raise` statements that raise invalid exceptions or use invalid causes",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1112,7 +1114,7 @@ declare_lint! {
|
|||
/// - [Python documentation: super()](https://docs.python.org/3/library/functions.html#super)
|
||||
pub(crate) static INVALID_SUPER_ARGUMENT = {
|
||||
summary: "detects invalid arguments for `super()`",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1136,7 +1138,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static INVALID_TYPE_CHECKING_CONSTANT = {
|
||||
summary: "detects invalid `TYPE_CHECKING` constant assignments",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1160,7 +1162,7 @@ declare_lint! {
|
|||
/// [type expressions]: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions
|
||||
pub(crate) static INVALID_TYPE_FORM = {
|
||||
summary: "detects invalid type forms",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1188,7 +1190,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static INVALID_TYPE_GUARD_DEFINITION = {
|
||||
summary: "detects malformed type guard functions",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.11"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1216,7 +1218,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static INVALID_TYPE_GUARD_CALL = {
|
||||
summary: "detects type guard function calls that has no narrowing effect",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.11"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1245,7 +1247,7 @@ declare_lint! {
|
|||
/// [type variables]: https://docs.python.org/3/library/typing.html#typing.TypeVar
|
||||
pub(crate) static INVALID_TYPE_VARIABLE_CONSTRAINTS = {
|
||||
summary: "detects invalid type variable constraints",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1264,7 +1266,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static MISSING_ARGUMENT = {
|
||||
summary: "detects missing required arguments in a call",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1287,7 +1289,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static NO_MATCHING_OVERLOAD = {
|
||||
summary: "detects calls that do not match any overload",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1305,7 +1307,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static NON_SUBSCRIPTABLE = {
|
||||
summary: "detects subscripting objects that do not support subscripting",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1325,7 +1327,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static NOT_ITERABLE = {
|
||||
summary: "detects iteration over an object that is not iterable",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1356,7 +1358,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static UNSUPPORTED_BOOL_CONVERSION = {
|
||||
summary: "detects boolean conversion where the object incorrectly implements `__bool__`",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1377,7 +1379,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static PARAMETER_ALREADY_ASSIGNED = {
|
||||
summary: "detects multiple arguments for the same parameter",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1399,7 +1401,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static POSSIBLY_MISSING_ATTRIBUTE = {
|
||||
summary: "detects references to possibly missing attributes",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.22"),
|
||||
default_level: Level::Warn,
|
||||
}
|
||||
}
|
||||
|
|
@ -1425,7 +1427,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static POSSIBLY_MISSING_IMPORT = {
|
||||
summary: "detects possibly missing imports",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.22"),
|
||||
default_level: Level::Warn,
|
||||
}
|
||||
}
|
||||
|
|
@ -1447,7 +1449,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static POSSIBLY_UNRESOLVED_REFERENCE = {
|
||||
summary: "detects references to possibly undefined names",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Ignore,
|
||||
}
|
||||
}
|
||||
|
|
@ -1470,7 +1472,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static SUBCLASS_OF_FINAL_CLASS = {
|
||||
summary: "detects subclasses of final classes",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1492,7 +1494,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static TYPE_ASSERTION_FAILURE = {
|
||||
summary: "detects failed type assertions",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1513,7 +1515,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static TOO_MANY_POSITIONAL_ARGUMENTS = {
|
||||
summary: "detects calls passing too many positional arguments",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1552,7 +1554,7 @@ declare_lint! {
|
|||
/// - [Python documentation: super()](https://docs.python.org/3/library/functions.html#super)
|
||||
pub(crate) static UNAVAILABLE_IMPLICIT_SUPER_ARGUMENTS = {
|
||||
summary: "detects invalid `super()` calls where implicit arguments are unavailable.",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1570,7 +1572,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub static UNDEFINED_REVEAL = {
|
||||
summary: "detects usages of `reveal_type` without importing it",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Warn,
|
||||
}
|
||||
}
|
||||
|
|
@ -1591,7 +1593,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static UNKNOWN_ARGUMENT = {
|
||||
summary: "detects unknown keyword arguments in calls",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1612,7 +1614,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static POSITIONAL_ONLY_PARAMETER_AS_KWARG = {
|
||||
summary: "detects positional-only parameters passed as keyword arguments",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.22"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1634,7 +1636,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static UNRESOLVED_ATTRIBUTE = {
|
||||
summary: "detects references to unresolved attributes",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1653,7 +1655,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static UNRESOLVED_IMPORT = {
|
||||
summary: "detects unresolved imports",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1672,7 +1674,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static UNRESOLVED_REFERENCE = {
|
||||
summary: "detects references to names that are not defined",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1694,7 +1696,7 @@ declare_lint! {
|
|||
/// ```
|
||||
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"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1713,7 +1715,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static ZERO_STEPSIZE_IN_SLICE = {
|
||||
summary: "detects a slice step size of zero",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1737,7 +1739,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static STATIC_ASSERT_ERROR = {
|
||||
summary: "Failed static assertion",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1765,7 +1767,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static INVALID_ATTRIBUTE_ACCESS = {
|
||||
summary: "Invalid attribute access",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -1786,7 +1788,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static REDUNDANT_CAST = {
|
||||
summary: "detects redundant `cast` calls",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Warn,
|
||||
}
|
||||
}
|
||||
|
|
@ -1812,6 +1814,7 @@ declare_lint! {
|
|||
/// ```
|
||||
///
|
||||
/// Use instead:
|
||||
///
|
||||
/// ```python
|
||||
/// x: int
|
||||
///
|
||||
|
|
@ -1824,6 +1827,7 @@ declare_lint! {
|
|||
/// ```
|
||||
///
|
||||
/// Or:
|
||||
///
|
||||
/// ```python
|
||||
/// x: int | None = None
|
||||
///
|
||||
|
|
@ -1836,7 +1840,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static UNRESOLVED_GLOBAL = {
|
||||
summary: "detects `global` statements with no definition in the global scope",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.15"),
|
||||
default_level: Level::Warn,
|
||||
}
|
||||
}
|
||||
|
|
@ -1863,7 +1867,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static MISSING_TYPED_DICT_KEY = {
|
||||
summary: "detects missing required keys in `TypedDict` constructors",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.20"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static FSTRING_TYPE_ANNOTATION = {
|
||||
summary: "detects F-strings in type annotation positions",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -53,7 +53,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static BYTE_STRING_TYPE_ANNOTATION = {
|
||||
summary: "detects byte strings in type annotation positions",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -78,7 +78,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static RAW_STRING_TYPE_ANNOTATION = {
|
||||
summary: "detects raw strings in type annotation positions",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -103,7 +103,7 @@ declare_lint! {
|
|||
/// ```
|
||||
pub(crate) static IMPLICIT_CONCATENATED_STRING_TYPE_ANNOTATION = {
|
||||
summary: "detects implicit concatenated strings in type annotations",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -112,7 +112,7 @@ declare_lint! {
|
|||
/// TODO #14889
|
||||
pub(crate) static INVALID_SYNTAX_IN_FORWARD_ANNOTATION = {
|
||||
summary: "detects invalid syntax in forward annotations",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
@ -121,7 +121,7 @@ declare_lint! {
|
|||
/// TODO #14889
|
||||
pub(crate) static ESCAPE_CHARACTER_IN_FORWARD_ANNOTATION = {
|
||||
summary: "detects forward type annotations with escape characters",
|
||||
status: LintStatus::preview("1.0.0"),
|
||||
status: LintStatus::stable("0.0.1-alpha.1"),
|
||||
default_level: Level::Error,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue