From b71ef8a26ec6f0d919512e2bd8e1319fb6c3b206 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Fri, 9 May 2025 12:12:30 -0400 Subject: [PATCH] ruff_db: completely rip `lint:` prefix out This does a deeper removal of the `lint:` prefix by removing the `DiagnosticId::as_str` method and replacing it with `as_concise_str`. We remove the associated error type and simplify the `Display` impl for `DiagnosticId` as well. This turned out to catch a `lint:` that was still in the diagnostic output: the part that says why a lint is enabled. --- crates/ruff_db/src/diagnostic/mod.rs | 67 ++----------------- crates/ruff_db/src/diagnostic/render.rs | 4 +- ..._-_Invalid_`__set__`_method_signature.snap | 2 +- ...a_descriptors_-_Invalid_argument_type.snap | 2 +- ..._attributes_with_class-level_defaults.snap | 4 +- ...ignment_-_Possibly-unbound_attributes.snap | 4 +- ...assignment_-_Pure_instance_attributes.snap | 4 +- ...t_-_Setting_attributes_on_union_types.snap | 2 +- ...ibute_assignment_-_Unknown_attributes.snap | 4 +- ..._-_Attribute_assignment_-_`ClassVar`s.snap | 4 +- ...ts_imported_from_an_unresolved_module.snap | 2 +- ...ructures_-_Unresolvable_module_import.snap | 2 +- ...ures_-_Unresolvable_submodule_imports.snap | 4 +- ..._For_loops_-_Bad_`__getitem__`_method.snap | 2 +- ...for.md_-_For_loops_-_Invalid_iterable.snap | 2 +- ...New_over_old_style_iteration_protocol.snap | 2 +- ...hod_and_`__getitem__`_is_not_callable.snap | 2 +- ...bly-not-callable_`__getitem__`_method.snap | 4 +- ...ossibly_invalid_`__getitem__`_methods.snap | 4 +- ...-_Possibly_invalid_`__iter__`_methods.snap | 4 +- ..._-_Possibly_invalid_`__next__`_method.snap | 4 +- ..._iter__`_and_bad_`__getitem__`_method.snap | 2 +- ..._`_and_possibly_invalid_`__getitem__`.snap | 4 +- ..._`_and_possibly_unbound_`__getitem__`.snap | 2 +- ...element_has_invalid_`__iter__`_method.snap | 2 +- ...nion_element_has_no_`__iter__`_method.snap | 2 +- ...or_loops_-_With_non-callable_iterator.snap | 4 +- ...__iter__`_does_not_return_an_iterator.snap | 2 +- ...__iter__`_method_with_a_bad_signature.snap | 2 +- ...tor_with_an_invalid_`__next__`_method.snap | 4 +- ...cy_syntax_-_Inferring_a_bound_typevar.snap | 2 +- ...tax_-_Inferring_a_constrained_typevar.snap | 2 +- ...95_syntax_-_Inferring_a_bound_typevar.snap | 2 +- ...tax_-_Inferring_a_constrained_typevar.snap | 2 +- ...types_with_invalid_`__bool__`_methods.snap | 2 +- ...lid_argument_type_diagnostics_-_Basic.snap | 2 +- ...t_type_diagnostics_-_Calls_to_methods.snap | 2 +- ...nt_type_diagnostics_-_Different_files.snap | 2 +- ..._diagnostics_-_Different_source_order.snap | 2 +- ...nt_type_diagnostics_-_Many_parameters.snap | 2 +- ...Many_parameters_across_multiple_lines.snap | 2 +- ...eters_with_multiple_invalid_arguments.snap | 6 +- ...hose_type_is_vendored_from_`typeshed`.snap | 2 +- ...gument_types_-_Keyword_only_arguments.snap | 2 +- ..._of_argument_types_-_Mix_of_arguments.snap | 2 +- ...argument_types_-_One_keyword_argument.snap | 2 +- ...y_of_argument_types_-_Only_positional.snap | 2 +- ..._argument_types_-_Synthetic_arguments.snap | 2 +- ...f_argument_types_-_Variadic_arguments.snap | 2 +- ...nt_types_-_Variadic_keyword_arguments.snap | 2 +- ...oesn't_implement_`__bool__`_correctly.snap | 4 +- ...__bases__`_lists_with_duplicate_bases.snap | 14 ++-- ...stics_-_Calls_to_overloaded_functions.snap | 2 +- ...hat_implements_`__bool__`_incorrectly.snap | 2 +- ...ds_-_Invalid_-_At_least_two_overloads.snap | 4 +- ...onsistent_decorators_-_`@classmethod`.snap | 6 +- ..._-_Inconsistent_decorators_-_`@final`.snap | 6 +- ...Inconsistent_decorators_-_`@override`.snap | 6 +- ...t_an_implementation_-_Regular_modules.snap | 4 +- ...Protocols_-_Calls_to_protocol_classes.snap | 6 +- ...lid_calls_to_`get_protocol_members()`.snap | 4 +- ..._-_Protocols_-_Narrowing_of_protocols.snap | 4 +- ...ion_return_type_-_Generator_functions.snap | 4 +- ...ype_-_Invalid_conditional_return_type.snap | 6 +- ...n_type_-_Invalid_implicit_return_type.snap | 8 +-- ...ion_return_type_-_Invalid_return_type.snap | 8 +-- ...pe_-_Invalid_return_type_in_stub_file.snap | 6 +- ..._don't_implement_`__bool__`_correctly.snap | 4 +- ..._Shadowing_-_Implicit_class_shadowing.snap | 2 +- ...adowing_-_Implicit_function_shadowing.snap | 2 +- ...that_incorrectly_implement_`__bool__`.snap | 2 +- ...that_incorrectly_implement_`__bool__`.snap | 2 +- ...ng_-_Exactly_too_few_values_to_unpack.snap | 2 +- ...g_-_Exactly_too_many_values_to_unpack.snap | 2 +- ...acking_-_Right_hand_side_not_iterable.snap | 2 +- ..._Unpacking_-_Too_few_values_to_unpack.snap | 2 +- ...vable_import_that_does_not_use_`from`.snap | 2 +- ...solvable_module_but_unresolvable_item.snap | 2 +- ...`from`_with_an_unknown_current_module.snap | 2 +- ..._`from`_with_an_unknown_nested_module.snap | 2 +- ...ng_`from`_with_an_unresolvable_module.snap | 2 +- ...ing_`from`_with_too_many_leading_dots.snap | 2 +- ...l__`_attribute,_but_it's_not_callable.snap | 2 +- ...hod,_but_has_an_incorrect_return_type.snap | 2 +- ..._method,_but_has_incorrect_parameters.snap | 2 +- ...ember_has_incorrect_`__bool__`_method.snap | 2 +- crates/ty_test/src/matcher.rs | 21 +++--- crates/ty_wasm/tests/api.rs | 2 +- 88 files changed, 148 insertions(+), 206 deletions(-) diff --git a/crates/ruff_db/src/diagnostic/mod.rs b/crates/ruff_db/src/diagnostic/mod.rs index c04964e26d..ccb5e3d40c 100644 --- a/crates/ruff_db/src/diagnostic/mod.rs +++ b/crates/ruff_db/src/diagnostic/mod.rs @@ -2,7 +2,6 @@ use std::{fmt::Formatter, sync::Arc}; use render::{FileResolver, Input}; use ruff_source_file::{SourceCode, SourceFile}; -use thiserror::Error; use ruff_annotate_snippets::Level as AnnotateLevel; use ruff_text_size::{Ranged, TextRange}; @@ -613,53 +612,18 @@ impl DiagnosticId { code.split_once(':').map(|(_, rest)| rest) } - /// Returns `true` if this `DiagnosticId` matches the given name. + /// Returns a concise description of this diagnostic ID. /// - /// ## Examples - /// ``` - /// use ruff_db::diagnostic::DiagnosticId; - /// - /// assert!(DiagnosticId::Io.matches("io")); - /// assert!(DiagnosticId::lint("test").matches("lint:test")); - /// assert!(!DiagnosticId::lint("test").matches("test")); - /// ``` - pub fn matches(&self, expected_name: &str) -> bool { - match self.as_str() { - Ok(id) => id == expected_name, - Err(DiagnosticAsStrError::Category { category, name }) => expected_name - .strip_prefix(category) - .and_then(|prefix| prefix.strip_prefix(":")) - .is_some_and(|rest| rest == name), - } - } - - pub fn as_str(&self) -> Result<&str, DiagnosticAsStrError> { - Ok(match self { + /// Note that this doesn't include the lint's category. It + /// only includes the lint's name. + pub fn as_str(&self) -> &str { + match self { DiagnosticId::Panic => "panic", DiagnosticId::Io => "io", DiagnosticId::InvalidSyntax => "invalid-syntax", - DiagnosticId::Lint(name) => { - return Err(DiagnosticAsStrError::Category { - category: "lint", - name: name.as_str(), - }) - } + DiagnosticId::Lint(name) => name.as_str(), DiagnosticId::RevealedType => "revealed-type", DiagnosticId::UnknownRule => "unknown-rule", - }) - } - - /// Returns a "concise" description of this diagnostic ID. - /// - /// Specifically, this avoids adding a `lint:` prefix (or other - /// possible category prefixes, although `lint` is the only one - /// as of 2025-05-09) to the diagnostic ID when this is a lint - /// identifier. This is useful in diagnostic rendering where we - /// want to elide this prefix. - fn as_concise_str(&self) -> &str { - match self.as_str() { - Ok(name) => name, - Err(DiagnosticAsStrError::Category { name, .. }) => name, } } @@ -668,26 +632,9 @@ impl DiagnosticId { } } -#[derive(Copy, Clone, Debug, Eq, PartialEq, Error)] -pub enum DiagnosticAsStrError { - /// The id can't be converted to a string because it belongs to a sub-category. - #[error("id from a sub-category: {category}:{name}")] - Category { - /// The id's category. - category: &'static str, - /// The diagnostic id in this category. - name: &'static str, - }, -} - impl std::fmt::Display for DiagnosticId { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - match self.as_str() { - Ok(name) => f.write_str(name), - Err(DiagnosticAsStrError::Category { category, name }) => { - write!(f, "{category}:{name}") - } - } + write!(f, "{}", self.as_str()) } } diff --git a/crates/ruff_db/src/diagnostic/render.rs b/crates/ruff_db/src/diagnostic/render.rs index a8ee622491..4e95f87fbe 100644 --- a/crates/ruff_db/src/diagnostic/render.rs +++ b/crates/ruff_db/src/diagnostic/render.rs @@ -79,7 +79,7 @@ impl std::fmt::Display for DisplayDiagnostic<'_> { f, "{severity}[{id}]", severity = fmt_styled(severity, severity_style), - id = fmt_styled(self.diag.id().as_concise_str(), stylesheet.emphasis) + id = fmt_styled(self.diag.id(), stylesheet.emphasis) )?; if let Some(span) = self.diag.primary_span() { @@ -195,7 +195,7 @@ impl<'a> ResolvedDiagnostic<'a> { ResolvedAnnotation::new(path, &diagnostic_source, ann) }) .collect(); - let id = Some(diag.inner.id.as_concise_str().to_string()); + let id = Some(diag.inner.id.to_string()); let message = diag.inner.message.as_str().to_string(); ResolvedDiagnostic { severity: diag.inner.severity, diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Data_descriptors_-_Invalid_`__set__`_method_signature.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Data_descriptors_-_Invalid_`__set__`_method_signature.snap index fbf8a4ac6e..5f9493b658 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Data_descriptors_-_Invalid_`__set__`_method_signature.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Data_descriptors_-_Invalid_`__set__`_method_signature.snap @@ -35,6 +35,6 @@ error[invalid-assignment]: Invalid assignment to data descriptor attribute `attr 11 | instance.attr = 1 # error: [invalid-assignment] | ^^^^^^^^^^^^^ | -info: `lint:invalid-assignment` is enabled by default +info: `invalid-assignment` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Data_descriptors_-_Invalid_argument_type.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Data_descriptors_-_Invalid_argument_type.snap index 5d9a63e85e..1d390cd628 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Data_descriptors_-_Invalid_argument_type.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Data_descriptors_-_Invalid_argument_type.snap @@ -36,6 +36,6 @@ error[invalid-assignment]: Invalid assignment to data descriptor attribute `attr 12 | instance.attr = "wrong" # error: [invalid-assignment] | ^^^^^^^^^^^^^ | -info: `lint:invalid-assignment` is enabled by default +info: `invalid-assignment` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Instance_attributes_with_class-level_defaults.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Instance_attributes_with_class-level_defaults.snap index f9f08682f9..d01615b5f9 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Instance_attributes_with_class-level_defaults.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Instance_attributes_with_class-level_defaults.snap @@ -36,7 +36,7 @@ error[invalid-assignment]: Object of type `Literal["wrong"]` is not assignable t 7 | 8 | C.attr = 1 # fine | -info: `lint:invalid-assignment` is enabled by default +info: `invalid-assignment` is enabled by default ``` @@ -48,6 +48,6 @@ error[invalid-assignment]: Object of type `Literal["wrong"]` is not assignable t 9 | C.attr = "wrong" # error: [invalid-assignment] | ^^^^^^ | -info: `lint:invalid-assignment` is enabled by default +info: `invalid-assignment` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Possibly-unbound_attributes.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Possibly-unbound_attributes.snap index ba0abff7a8..8b89349a11 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Possibly-unbound_attributes.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Possibly-unbound_attributes.snap @@ -36,7 +36,7 @@ warning[possibly-unbound-attribute]: Attribute `attr` on type `` is p 7 | 8 | instance = C() | -info: `lint:possibly-unbound-attribute` is enabled by default +info: `possibly-unbound-attribute` is enabled by default ``` @@ -48,6 +48,6 @@ warning[possibly-unbound-attribute]: Attribute `attr` on type `C` is possibly un 9 | instance.attr = 1 # error: [possibly-unbound-attribute] | ^^^^^^^^^^^^^ | -info: `lint:possibly-unbound-attribute` is enabled by default +info: `possibly-unbound-attribute` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Pure_instance_attributes.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Pure_instance_attributes.snap index b2163e4af4..74aa6f471b 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Pure_instance_attributes.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Pure_instance_attributes.snap @@ -36,7 +36,7 @@ error[invalid-assignment]: Object of type `Literal["wrong"]` is not assignable t 8 | 9 | C.attr = 1 # error: [invalid-attribute-access] | -info: `lint:invalid-assignment` is enabled by default +info: `invalid-assignment` is enabled by default ``` @@ -49,6 +49,6 @@ error[invalid-attribute-access]: Cannot assign to instance attribute `attr` from 9 | C.attr = 1 # error: [invalid-attribute-access] | ^^^^^^ | -info: `lint:invalid-attribute-access` is enabled by default +info: `invalid-attribute-access` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Setting_attributes_on_union_types.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Setting_attributes_on_union_types.snap index 934c8512b4..56edf828e9 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Setting_attributes_on_union_types.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Setting_attributes_on_union_types.snap @@ -46,6 +46,6 @@ error[invalid-assignment]: Object of type `Literal[1]` is not assignable to attr 12 | 13 | class C2: | -info: `lint:invalid-assignment` is enabled by default +info: `invalid-assignment` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Unknown_attributes.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Unknown_attributes.snap index b97fe96103..c17f11fdf5 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Unknown_attributes.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/attribute_assignment.md_-_Attribute_assignment_-_Unknown_attributes.snap @@ -33,7 +33,7 @@ error[unresolved-attribute]: Unresolved attribute `non_existent` on type ` int) | None`, which is not callable -info: `lint:not-iterable` is enabled by default +info: `not-iterable` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_invalid_`__getitem__`_methods.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_invalid_`__getitem__`_methods.snap index 10bc336b5d..b8f211480c 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_invalid_`__getitem__`_methods.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_invalid_`__getitem__`_methods.snap @@ -54,7 +54,7 @@ error[not-iterable]: Object of type `Iterable1` may not be iterable | info: It has no `__iter__` method and its `__getitem__` attribute is invalid info: `__getitem__` has type `(bound method Iterable1.__getitem__(item: int) -> str) | None`, which is not callable -info: `lint:not-iterable` is enabled by default +info: `not-iterable` is enabled by default ``` @@ -83,7 +83,7 @@ error[not-iterable]: Object of type `Iterable2` may not be iterable | info: It has no `__iter__` method and its `__getitem__` method (with type `(bound method Iterable2.__getitem__(item: int) -> str) | (bound method Iterable2.__getitem__(item: str) -> int)`) may have an incorrect signature for the old-style iteration protocol info: `__getitem__` must be at least as permissive as `def __getitem__(self, key: int): ...` to satisfy the old-style iteration protocol -info: `lint:not-iterable` is enabled by default +info: `not-iterable` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_invalid_`__iter__`_methods.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_invalid_`__iter__`_methods.snap index f322bbee35..fc7be2bc20 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_invalid_`__iter__`_methods.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_invalid_`__iter__`_methods.snap @@ -58,7 +58,7 @@ error[not-iterable]: Object of type `Iterable1` may not be iterable info: Its `__iter__` method may have an invalid signature info: Type of `__iter__` is `(bound method Iterable1.__iter__() -> Iterator) | (bound method Iterable1.__iter__(invalid_extra_arg) -> Iterator)` info: Expected signature for `__iter__` is `def __iter__(self): ...` -info: `lint:not-iterable` is enabled by default +info: `not-iterable` is enabled by default ``` @@ -87,7 +87,7 @@ error[not-iterable]: Object of type `Iterable2` may not be iterable 30 | reveal_type(x) # revealed: int | Unknown | info: Its `__iter__` attribute (with type `(bound method Iterable2.__iter__() -> Iterator) | None`) may not be callable -info: `lint:not-iterable` is enabled by default +info: `not-iterable` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_invalid_`__next__`_method.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_invalid_`__next__`_method.snap index 8c91453e98..32164a51f3 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_invalid_`__next__`_method.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_invalid_`__next__`_method.snap @@ -61,7 +61,7 @@ error[not-iterable]: Object of type `Iterable1` may not be iterable | info: Its `__iter__` method returns an object of type `Iterator1`, which may have an invalid `__next__` method info: Expected signature for `__next__` is `def __next__(self): ...`) -info: `lint:not-iterable` is enabled by default +info: `not-iterable` is enabled by default ``` @@ -90,7 +90,7 @@ error[not-iterable]: Object of type `Iterable2` may not be iterable 34 | reveal_type(y) # revealed: int | Unknown | info: Its `__iter__` method returns an object of type `Iterator2`, which has a `__next__` attribute that may not be callable -info: `lint:not-iterable` is enabled by default +info: `not-iterable` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_unbound_`__iter__`_and_bad_`__getitem__`_method.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_unbound_`__iter__`_and_bad_`__getitem__`_method.snap index edde575d8a..ca1328ccaa 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_unbound_`__iter__`_and_bad_`__getitem__`_method.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_unbound_`__iter__`_and_bad_`__getitem__`_method.snap @@ -46,7 +46,7 @@ error[not-iterable]: Object of type `Iterable` may not be iterable | info: It may not have an `__iter__` method and its `__getitem__` method has an incorrect signature for the old-style iteration protocol info: `__getitem__` must be at least as permissive as `def __getitem__(self, key: int): ...` to satisfy the old-style iteration protocol -info: `lint:not-iterable` is enabled by default +info: `not-iterable` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_unbound_`__iter__`_and_possibly_invalid_`__getitem__`.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_unbound_`__iter__`_and_possibly_invalid_`__getitem__`.snap index 3025233c52..8cf36a3960 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_unbound_`__iter__`_and_possibly_invalid_`__getitem__`.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_unbound_`__iter__`_and_possibly_invalid_`__getitem__`.snap @@ -64,7 +64,7 @@ error[not-iterable]: Object of type `Iterable1` may not be iterable 33 | reveal_type(x) # revealed: bytes | str | Unknown | info: It may not have an `__iter__` method and its `__getitem__` attribute (with type `(bound method Iterable1.__getitem__(item: int) -> str) | None`) may not be callable -info: `lint:not-iterable` is enabled by default +info: `not-iterable` is enabled by default ``` @@ -93,7 +93,7 @@ error[not-iterable]: Object of type `Iterable2` may not be iterable | info: It may not have an `__iter__` method and its `__getitem__` method (with type `(bound method Iterable2.__getitem__(item: int) -> str) | (bound method Iterable2.__getitem__(item: str) -> int)`) may have an incorrect signature for the old-style iteration protocol info: `__getitem__` must be at least as permissive as `def __getitem__(self, key: int): ...` to satisfy the old-style iteration protocol -info: `lint:not-iterable` is enabled by default +info: `not-iterable` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_unbound_`__iter__`_and_possibly_unbound_`__getitem__`.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_unbound_`__iter__`_and_possibly_unbound_`__getitem__`.snap index 9a408bb99f..6441d32008 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_unbound_`__iter__`_and_possibly_unbound_`__getitem__`.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Possibly_unbound_`__iter__`_and_possibly_unbound_`__getitem__`.snap @@ -44,7 +44,7 @@ error[not-iterable]: Object of type `Iterable` may not be iterable 18 | reveal_type(x) # revealed: int | bytes | info: It may not have an `__iter__` method or a `__getitem__` method -info: `lint:not-iterable` is enabled by default +info: `not-iterable` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Union_type_as_iterable_where_one_union_element_has_invalid_`__iter__`_method.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Union_type_as_iterable_where_one_union_element_has_invalid_`__iter__`_method.snap index 93a0c5d611..69f9a2bad7 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Union_type_as_iterable_where_one_union_element_has_invalid_`__iter__`_method.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Union_type_as_iterable_where_one_union_element_has_invalid_`__iter__`_method.snap @@ -46,7 +46,7 @@ error[not-iterable]: Object of type `Test | Test2` may not be iterable 19 | reveal_type(x) # revealed: int | info: Its `__iter__` method returns an object of type `TestIter | int`, which may not have a `__next__` method -info: `lint:not-iterable` is enabled by default +info: `not-iterable` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Union_type_as_iterable_where_one_union_element_has_no_`__iter__`_method.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Union_type_as_iterable_where_one_union_element_has_no_`__iter__`_method.snap index 2c259d34e8..1b92f8f990 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Union_type_as_iterable_where_one_union_element_has_no_`__iter__`_method.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_Union_type_as_iterable_where_one_union_element_has_no_`__iter__`_method.snap @@ -41,7 +41,7 @@ error[not-iterable]: Object of type `Test | Literal[42]` may not be iterable 14 | reveal_type(x) # revealed: int | info: It may not have an `__iter__` method and it doesn't have a `__getitem__` method -info: `lint:not-iterable` is enabled by default +info: `not-iterable` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_With_non-callable_iterator.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_With_non-callable_iterator.snap index fb9f43501f..e7b32c95d6 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_With_non-callable_iterator.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_With_non-callable_iterator.snap @@ -42,7 +42,7 @@ error[not-iterable]: Object of type `NotIterable` is not iterable 12 | pass | info: Its `__iter__` attribute has type `int | None`, which is not callable -info: `lint:not-iterable` is enabled by default +info: `not-iterable` is enabled by default ``` @@ -55,7 +55,7 @@ info[possibly-unresolved-reference]: Name `x` used when possibly not defined 16 | reveal_type(x) | ^ | -info: `lint:possibly-unresolved-reference` is enabled by default +info: `possibly-unresolved-reference` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_`__iter__`_does_not_return_an_iterator.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_`__iter__`_does_not_return_an_iterator.snap index 848e1fa447..34820107ce 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_`__iter__`_does_not_return_an_iterator.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_`__iter__`_does_not_return_an_iterator.snap @@ -35,7 +35,7 @@ error[not-iterable]: Object of type `Bad` is not iterable 9 | reveal_type(x) # revealed: Unknown | info: Its `__iter__` method returns an object of type `int`, which has no `__next__` method -info: `lint:not-iterable` is enabled by default +info: `not-iterable` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_`__iter__`_method_with_a_bad_signature.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_`__iter__`_method_with_a_bad_signature.snap index 4ad3c5113a..2a515bad22 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_`__iter__`_method_with_a_bad_signature.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_`__iter__`_method_with_a_bad_signature.snap @@ -40,7 +40,7 @@ error[not-iterable]: Object of type `Iterable` is not iterable | info: Its `__iter__` method has an invalid signature info: Expected signature `def __iter__(self): ...` -info: `lint:not-iterable` is enabled by default +info: `not-iterable` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_`__iter__`_returns_an_iterator_with_an_invalid_`__next__`_method.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_`__iter__`_returns_an_iterator_with_an_invalid_`__next__`_method.snap index a511f4a091..362ad58707 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_`__iter__`_returns_an_iterator_with_an_invalid_`__next__`_method.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/for.md_-_For_loops_-_`__iter__`_returns_an_iterator_with_an_invalid_`__next__`_method.snap @@ -51,7 +51,7 @@ error[not-iterable]: Object of type `Iterable1` is not iterable | info: Its `__iter__` method returns an object of type `Iterator1`, which has an invalid `__next__` method info: Expected signature for `__next__` is `def __next__(self): ...` -info: `lint:not-iterable` is enabled by default +info: `not-iterable` is enabled by default ``` @@ -79,7 +79,7 @@ error[not-iterable]: Object of type `Iterable2` is not iterable 24 | reveal_type(y) # revealed: Unknown | info: Its `__iter__` method returns an object of type `Iterator2`, which has a `__next__` attribute that is not callable -info: `lint:not-iterable` is enabled by default +info: `not-iterable` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/functions.md_-_Generic_functions___Legacy_syntax_-_Inferring_a_bound_typevar.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/functions.md_-_Generic_functions___Legacy_syntax_-_Inferring_a_bound_typevar.snap index 1ca5a30f87..cac47eee3e 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/functions.md_-_Generic_functions___Legacy_syntax_-_Inferring_a_bound_typevar.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/functions.md_-_Generic_functions___Legacy_syntax_-_Inferring_a_bound_typevar.snap @@ -86,6 +86,6 @@ info: Type variable defined here 5 | 6 | def f(x: T) -> T: | -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/functions.md_-_Generic_functions___Legacy_syntax_-_Inferring_a_constrained_typevar.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/functions.md_-_Generic_functions___Legacy_syntax_-_Inferring_a_constrained_typevar.snap index 2b1ab5c784..a934f8206d 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/functions.md_-_Generic_functions___Legacy_syntax_-_Inferring_a_constrained_typevar.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/functions.md_-_Generic_functions___Legacy_syntax_-_Inferring_a_constrained_typevar.snap @@ -101,6 +101,6 @@ info: Type variable defined here 5 | 6 | def f(x: T) -> T: | -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/functions.md_-_Generic_functions___PEP_695_syntax_-_Inferring_a_bound_typevar.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/functions.md_-_Generic_functions___PEP_695_syntax_-_Inferring_a_bound_typevar.snap index c3a207cef0..2900a6671d 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/functions.md_-_Generic_functions___PEP_695_syntax_-_Inferring_a_bound_typevar.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/functions.md_-_Generic_functions___PEP_695_syntax_-_Inferring_a_bound_typevar.snap @@ -82,6 +82,6 @@ info: Type variable defined here | ^^^^^^ 4 | return x | -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/functions.md_-_Generic_functions___PEP_695_syntax_-_Inferring_a_constrained_typevar.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/functions.md_-_Generic_functions___PEP_695_syntax_-_Inferring_a_constrained_typevar.snap index 29ea8f1441..57eb90a95f 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/functions.md_-_Generic_functions___PEP_695_syntax_-_Inferring_a_constrained_typevar.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/functions.md_-_Generic_functions___PEP_695_syntax_-_Inferring_a_constrained_typevar.snap @@ -97,6 +97,6 @@ info: Type variable defined here | ^^^^^^^^^^^^^^ 4 | return x | -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/instances.md_-_Binary_operations_on_instances_-_Operations_involving_types_with_invalid_`__bool__`_methods.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/instances.md_-_Binary_operations_on_instances_-_Operations_involving_types_with_invalid_`__bool__`_methods.snap index 876e326ed4..76cc458b19 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/instances.md_-_Binary_operations_on_instances_-_Operations_involving_types_with_invalid_`__bool__`_methods.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/instances.md_-_Binary_operations_on_instances_-_Operations_involving_types_with_invalid_`__bool__`_methods.snap @@ -32,6 +32,6 @@ error[unsupported-bool-conversion]: Boolean conversion is unsupported for type ` | ^ | info: `__bool__` on `NotBoolable` must be callable -info: `lint:unsupported-bool-conversion` is enabled by default +info: `unsupported-bool-conversion` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Basic.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Basic.snap index fa66fc25e0..b6d8d86d25 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Basic.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Basic.snap @@ -36,6 +36,6 @@ info: Function defined here | ^^^ ------ Parameter declared here 2 | return x * x | -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Calls_to_methods.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Calls_to_methods.snap index 8d65e97deb..1be0e562f1 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Calls_to_methods.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Calls_to_methods.snap @@ -38,6 +38,6 @@ info: Function defined here | ^^^^^^ ------ Parameter declared here 3 | return x * x | -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Different_files.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Different_files.snap index 481a47a894..9293cf184e 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Different_files.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Different_files.snap @@ -42,6 +42,6 @@ info: Function defined here | ^^^ ------ Parameter declared here 2 | return x * x | -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Different_source_order.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Different_source_order.snap index 7f3ac4d5f1..29c466d3c3 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Different_source_order.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Different_source_order.snap @@ -40,6 +40,6 @@ info: Function defined here | ^^^ ------ Parameter declared here 5 | return x * x | -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Many_parameters.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Many_parameters.snap index 74d7871420..7de8796083 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Many_parameters.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Many_parameters.snap @@ -36,6 +36,6 @@ info: Function defined here | ^^^ ------ Parameter declared here 2 | return x * y * z | -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Many_parameters_across_multiple_lines.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Many_parameters_across_multiple_lines.snap index 4ea1464548..f558144b07 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Many_parameters_across_multiple_lines.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Many_parameters_across_multiple_lines.snap @@ -44,6 +44,6 @@ info: Function defined here 4 | z: int, 5 | ) -> int: | -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Many_parameters_with_multiple_invalid_arguments.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Many_parameters_with_multiple_invalid_arguments.snap index d229411472..023fc78df1 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Many_parameters_with_multiple_invalid_arguments.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Many_parameters_with_multiple_invalid_arguments.snap @@ -39,7 +39,7 @@ info: Function defined here | ^^^ ------ Parameter declared here 2 | return x * y * z | -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` @@ -59,7 +59,7 @@ info: Function defined here | ^^^ ------ Parameter declared here 2 | return x * y * z | -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` @@ -79,6 +79,6 @@ info: Function defined here | ^^^ ------ Parameter declared here 2 | return x * y * z | -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Test_calling_a_function_whose_type_is_vendored_from_`typeshed`.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Test_calling_a_function_whose_type_is_vendored_from_`typeshed`.snap index 4ddd9738a3..1e1bdd1f17 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Test_calling_a_function_whose_type_is_vendored_from_`typeshed`.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Test_calling_a_function_whose_type_is_vendored_from_`typeshed`.snap @@ -40,6 +40,6 @@ info: Function defined here 41 | *, 42 | cls: type[JSONDecoder] | None = None, | -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Keyword_only_arguments.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Keyword_only_arguments.snap index e5c549d021..2b8fba2de4 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Keyword_only_arguments.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Keyword_only_arguments.snap @@ -36,6 +36,6 @@ info: Function defined here | ^^^ ---------- Parameter declared here 2 | return x * y * z | -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Mix_of_arguments.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Mix_of_arguments.snap index 69d59b109f..de4b2e16c2 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Mix_of_arguments.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Mix_of_arguments.snap @@ -36,6 +36,6 @@ info: Function defined here | ^^^ ---------- Parameter declared here 2 | return x * y * z | -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_One_keyword_argument.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_One_keyword_argument.snap index d779cf66bc..fb6d69d999 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_One_keyword_argument.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_One_keyword_argument.snap @@ -36,6 +36,6 @@ info: Function defined here | ^^^ ---------- Parameter declared here 2 | return x * y * z | -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Only_positional.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Only_positional.snap index 31c1e2f08d..e222277fa9 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Only_positional.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Only_positional.snap @@ -36,6 +36,6 @@ info: Function defined here | ^^^ ------ Parameter declared here 2 | return x * y * z | -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Synthetic_arguments.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Synthetic_arguments.snap index f425e8365e..e9d144d630 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Synthetic_arguments.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Synthetic_arguments.snap @@ -38,6 +38,6 @@ info: Function defined here | ^^^^^^^^ ------ Parameter declared here 3 | return 1 | -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Variadic_arguments.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Variadic_arguments.snap index 45977a87fa..7e18db62f5 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Variadic_arguments.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Variadic_arguments.snap @@ -36,6 +36,6 @@ info: Function defined here | ^^^ ------------- Parameter declared here 2 | return len(numbers) | -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Variadic_keyword_arguments.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Variadic_keyword_arguments.snap index a3c636a559..2b36d64363 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Variadic_keyword_arguments.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_type.md_-_Invalid_argument_type_diagnostics_-_Tests_for_a_variety_of_argument_types_-_Variadic_keyword_arguments.snap @@ -36,6 +36,6 @@ info: Function defined here | ^^^ -------------- Parameter declared here 2 | return len(numbers) | -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/membership_test.md_-_Comparison___Membership_Test_-_Return_type_that_doesn't_implement_`__bool__`_correctly.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/membership_test.md_-_Comparison___Membership_Test_-_Return_type_that_doesn't_implement_`__bool__`_correctly.snap index 1c7e385193..3ab4b39aae 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/membership_test.md_-_Comparison___Membership_Test_-_Return_type_that_doesn't_implement_`__bool__`_correctly.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/membership_test.md_-_Comparison___Membership_Test_-_Return_type_that_doesn't_implement_`__bool__`_correctly.snap @@ -38,7 +38,7 @@ error[unsupported-bool-conversion]: Boolean conversion is unsupported for type ` 11 | 10 not in WithContains() | info: `__bool__` on `NotBoolable` must be callable -info: `lint:unsupported-bool-conversion` is enabled by default +info: `unsupported-bool-conversion` is enabled by default ``` @@ -52,6 +52,6 @@ error[unsupported-bool-conversion]: Boolean conversion is unsupported for type ` | ^^^^^^^^^^^^^^^^^^^^^^^^ | info: `__bool__` on `NotBoolable` must be callable -info: `lint:unsupported-bool-conversion` is enabled by default +info: `unsupported-bool-conversion` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Order_tests_-_`__bases__`_lists_with_duplicate_bases.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Order_tests_-_`__bases__`_lists_with_duplicate_bases.snap index 4e35b7a2b1..54f2deb8af 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Order_tests_-_`__bases__`_lists_with_duplicate_bases.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Order_tests_-_`__bases__`_lists_with_duplicate_bases.snap @@ -122,7 +122,7 @@ info: The definition of class `Foo` will raise `TypeError` at runtime 4 | 5 | reveal_type(Foo.__mro__) # revealed: tuple[, Unknown, ] | -info: `lint:duplicate-base` is enabled by default +info: `duplicate-base` is enabled by default ``` @@ -174,7 +174,7 @@ info: The definition of class `Ham` will raise `TypeError` at runtime 22 | Eggs, 23 | ): ... | -info: `lint:duplicate-base` is enabled by default +info: `duplicate-base` is enabled by default ``` @@ -211,7 +211,7 @@ info: The definition of class `Ham` will raise `TypeError` at runtime | ^^^^ Class `Eggs` later repeated here 23 | ): ... | -info: `lint:duplicate-base` is enabled by default +info: `duplicate-base` is enabled by default ``` @@ -250,7 +250,7 @@ info: The definition of class `Omelette` will raise `TypeError` at runtime 31 | 32 | reveal_type(Omelette.__mro__) # revealed: tuple[, Unknown, ] | -info: `lint:duplicate-base` is enabled by default +info: `duplicate-base` is enabled by default ``` @@ -309,7 +309,7 @@ info: The definition of class `VeryEggyOmelette` will raise `TypeError` at runti | ^^^^ Class `Eggs` later repeated here 47 | ): ... | -info: `lint:duplicate-base` is enabled by default +info: `duplicate-base` is enabled by default ``` @@ -340,7 +340,7 @@ info: The definition of class `D` will raise `TypeError` at runtime | ^ Class `A` later repeated here 73 | ): ... | -info: `lint:duplicate-base` is enabled by default +info: `duplicate-base` is enabled by default ``` @@ -383,7 +383,7 @@ info: The definition of class `E` will raise `TypeError` at runtime 79 | ): 80 | # error: [unused-ignore-comment] | -info: `lint:duplicate-base` is enabled by default +info: `duplicate-base` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload.md_-_No_matching_overload_diagnostics_-_Calls_to_overloaded_functions.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload.md_-_No_matching_overload_diagnostics_-_Calls_to_overloaded_functions.snap index e31d4d3ba3..d438d5967f 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload.md_-_No_matching_overload_diagnostics_-_Calls_to_overloaded_functions.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload.md_-_No_matching_overload_diagnostics_-_Calls_to_overloaded_functions.snap @@ -24,6 +24,6 @@ error[no-matching-overload]: No overload of class `type` matches arguments 1 | type("Foo", ()) # error: [no-matching-overload] | ^^^^^^^^^^^^^^^ | -info: `lint:no-matching-overload` is enabled by default +info: `no-matching-overload` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/not.md_-_Unary_not_-_Object_that_implements_`__bool__`_incorrectly.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/not.md_-_Unary_not_-_Object_that_implements_`__bool__`_incorrectly.snap index 1c4b27c09a..547db0bcf0 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/not.md_-_Unary_not_-_Object_that_implements_`__bool__`_incorrectly.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/not.md_-_Unary_not_-_Object_that_implements_`__bool__`_incorrectly.snap @@ -30,6 +30,6 @@ error[unsupported-bool-conversion]: Boolean conversion is unsupported for type ` | ^^^^^^^^^^^^^^^^^ | info: `__bool__` on `NotBoolable` must be callable -info: `lint:unsupported-bool-conversion` is enabled by default +info: `unsupported-bool-conversion` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_At_least_two_overloads.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_At_least_two_overloads.snap index 6e7add6b37..32b3b92d71 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_At_least_two_overloads.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_At_least_two_overloads.snap @@ -47,7 +47,7 @@ error[invalid-overload]: Overloaded function `func` requires at least two overlo | ^^^^ 8 | return x | -info: `lint:invalid-overload` is enabled by default +info: `invalid-overload` is enabled by default ``` @@ -62,6 +62,6 @@ error[invalid-overload]: Overloaded function `func` requires at least two overlo | | | Only one overload defined here | -info: `lint:invalid-overload` is enabled by default +info: `invalid-overload` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorators_-_`@classmethod`.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorators_-_`@classmethod`.snap index 41d84d7ec2..ab0e933c58 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorators_-_`@classmethod`.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorators_-_`@classmethod`.snap @@ -86,7 +86,7 @@ error[invalid-overload]: Overloaded function `try_from1` does not use the `@clas 17 | if isinstance(x, int): 18 | return cls(x) | -info: `lint:invalid-overload` is enabled by default +info: `invalid-overload` is enabled by default ``` @@ -109,7 +109,7 @@ error[invalid-overload]: Overloaded function `try_from2` does not use the `@clas 23 | @overload 24 | @classmethod | -info: `lint:invalid-overload` is enabled by default +info: `invalid-overload` is enabled by default ``` @@ -126,6 +126,6 @@ error[invalid-overload]: Overloaded function `try_from3` does not use the `@clas 41 | if isinstance(x, int): 42 | return cls(x) | -info: `lint:invalid-overload` is enabled by default +info: `invalid-overload` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorators_-_`@final`.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorators_-_`@final`.snap index bf7aa13d44..47a0c2744c 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorators_-_`@final`.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorators_-_`@final`.snap @@ -76,7 +76,7 @@ error[invalid-overload]: `@final` decorator should be applied only to the overlo | Implementation defined here 19 | return x | -info: `lint:invalid-overload` is enabled by default +info: `invalid-overload` is enabled by default ``` @@ -92,7 +92,7 @@ error[invalid-overload]: `@final` decorator should be applied only to the overlo | Implementation defined here 28 | return x | -info: `lint:invalid-overload` is enabled by default +info: `invalid-overload` is enabled by default ``` @@ -109,6 +109,6 @@ error[invalid-overload]: `@final` decorator should be applied only to the first 15 | def method2(self, x: str) -> str: ... | ^^^^^^^ | -info: `lint:invalid-overload` is enabled by default +info: `invalid-overload` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorators_-_`@override`.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorators_-_`@override`.snap index a55b66862f..2577e2ddf0 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorators_-_`@override`.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorators_-_`@override`.snap @@ -93,7 +93,7 @@ error[invalid-overload]: `@override` decorator should be applied only to the ove | Implementation defined here 28 | return x | -info: `lint:invalid-overload` is enabled by default +info: `invalid-overload` is enabled by default ``` @@ -109,7 +109,7 @@ error[invalid-overload]: `@override` decorator should be applied only to the ove | Implementation defined here 38 | return x | -info: `lint:invalid-overload` is enabled by default +info: `invalid-overload` is enabled by default ``` @@ -127,6 +127,6 @@ error[invalid-overload]: `@override` decorator should be applied only to the fir 22 | def method(self, x: str) -> str: ... | ^^^^^^ | -info: `lint:invalid-overload` is enabled by default +info: `invalid-overload` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Overload_without_an_implementation_-_Regular_modules.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Overload_without_an_implementation_-_Regular_modules.snap index 2fe8a01977..9ced86c4f4 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Overload_without_an_implementation_-_Regular_modules.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Overload_without_an_implementation_-_Regular_modules.snap @@ -41,7 +41,7 @@ error[invalid-overload]: Overloaded non-stub function `func` must have an implem 8 | 9 | class Foo: | -info: `lint:invalid-overload` is enabled by default +info: `invalid-overload` is enabled by default ``` @@ -54,6 +54,6 @@ error[invalid-overload]: Overloaded non-stub function `method` must have an impl 14 | def method(self, x: str) -> str: ... | ^^^^^^ | -info: `lint:invalid-overload` is enabled by default +info: `invalid-overload` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Calls_to_protocol_classes.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Calls_to_protocol_classes.snap index de6b4fbcaa..8a65752dc4 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Calls_to_protocol_classes.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Calls_to_protocol_classes.snap @@ -51,7 +51,7 @@ error[call-non-callable]: Object of type `typing.Protocol` is not callable 5 | 6 | class MyProtocol(Protocol): | -info: `lint:call-non-callable` is enabled by default +info: `call-non-callable` is enabled by default ``` @@ -87,7 +87,7 @@ info: Protocol classes cannot be instantiated | ^^^^^^^^^^^^^^^^^^^^ `MyProtocol` declared as a protocol here 7 | x: int | -info: `lint:call-non-callable` is enabled by default +info: `call-non-callable` is enabled by default ``` @@ -122,7 +122,7 @@ info: Protocol classes cannot be instantiated | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `GenericProtocol` declared as a protocol here 13 | x: T | -info: `lint:call-non-callable` is enabled by default +info: `call-non-callable` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Invalid_calls_to_`get_protocol_members()`.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Invalid_calls_to_`get_protocol_members()`.snap index 6c4b488934..c22ff204fc 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Invalid_calls_to_`get_protocol_members()`.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Invalid_calls_to_`get_protocol_members()`.snap @@ -52,7 +52,7 @@ info: `NotAProtocol` is declared here, but it is not a protocol class: | info: A class is only a protocol class if it directly inherits from `typing.Protocol` or `typing_extensions.Protocol` info: See https://typing.python.org/en/latest/spec/protocol.html# -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` @@ -79,6 +79,6 @@ info: `AlsoNotAProtocol` is declared here, but it is not a protocol class: | info: A class is only a protocol class if it directly inherits from `typing.Protocol` or `typing_extensions.Protocol` info: See https://typing.python.org/en/latest/spec/protocol.html# -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Narrowing_of_protocols.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Narrowing_of_protocols.snap index dea0bb1a20..dd7628a74d 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Narrowing_of_protocols.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Narrowing_of_protocols.snap @@ -77,7 +77,7 @@ info: `HasX` is declared as a protocol class, but it is not declared as runtime- | info: A protocol class can only be used in `isinstance` checks if it is decorated with `@typing.runtime_checkable` or `@typing_extensions.runtime_checkable` info: See https://docs.python.org/3/library/typing.html#typing.runtime_checkable -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` @@ -131,7 +131,7 @@ info: `HasX` is declared as a protocol class, but it is not declared as runtime- | info: A protocol class can only be used in `issubclass` checks if it is decorated with `@typing.runtime_checkable` or `@typing_extensions.runtime_checkable` info: See https://docs.python.org/3/library/typing.html#typing.runtime_checkable -info: `lint:invalid-argument-type` is enabled by default +info: `invalid-argument-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Generator_functions.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Generator_functions.snap index f7ad20c7e7..bcec9763b3 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Generator_functions.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Generator_functions.snap @@ -66,7 +66,7 @@ error[invalid-return-type]: Return type does not match returned value | info: Function is inferred as returning `types.GeneratorType` because it is a generator function info: See https://docs.python.org/3/glossary.html#term-generator for more details -info: `lint:invalid-return-type` is enabled by default +info: `invalid-return-type` is enabled by default ``` @@ -82,6 +82,6 @@ error[invalid-return-type]: Return type does not match returned value | info: Function is inferred as returning `types.AsyncGeneratorType` because it is an async generator function info: See https://docs.python.org/3/glossary.html#term-asynchronous-generator for more details -info: `lint:invalid-return-type` is enabled by default +info: `invalid-return-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_conditional_return_type.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_conditional_return_type.snap index 046c0d0e2a..817169603d 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_conditional_return_type.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_conditional_return_type.snap @@ -45,7 +45,7 @@ error[invalid-return-type]: Return type does not match returned value 7 | 8 | def f(cond: bool) -> str: | -info: `lint:invalid-return-type` is enabled by default +info: `invalid-return-type` is enabled by default ``` @@ -64,7 +64,7 @@ error[invalid-return-type]: Return type does not match returned value 12 | else: 13 | # error: [invalid-return-type] | -info: `lint:invalid-return-type` is enabled by default +info: `invalid-return-type` is enabled by default ``` @@ -86,6 +86,6 @@ error[invalid-return-type]: Return type does not match returned value 9 | if cond: 10 | # error: [invalid-return-type] | -info: `lint:invalid-return-type` is enabled by default +info: `invalid-return-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_implicit_return_type.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_implicit_return_type.snap index 2bf6c6f7b3..3a97bc897b 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_implicit_return_type.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_implicit_return_type.snap @@ -52,7 +52,7 @@ error[invalid-return-type]: Return type does not match returned value 5 | 6 | # error: [invalid-return-type] | -info: `lint:invalid-return-type` is enabled by default +info: `invalid-return-type` is enabled by default ``` @@ -66,7 +66,7 @@ error[invalid-return-type]: Function can implicitly return `None`, which is not 8 | if cond: 9 | return 1 | -info: `lint:invalid-return-type` is enabled by default +info: `invalid-return-type` is enabled by default ``` @@ -80,7 +80,7 @@ error[invalid-return-type]: Function can implicitly return `None`, which is not 13 | if cond: 14 | raise ValueError() | -info: `lint:invalid-return-type` is enabled by default +info: `invalid-return-type` is enabled by default ``` @@ -94,6 +94,6 @@ error[invalid-return-type]: Function can implicitly return `None`, which is not 18 | if cond: 19 | cond = False | -info: `lint:invalid-return-type` is enabled by default +info: `invalid-return-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type.snap index 2fb4ba732a..ced45db216 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type.snap @@ -43,7 +43,7 @@ error[invalid-return-type]: Function can implicitly return `None`, which is not | ^^^ 3 | 1 | -info: `lint:invalid-return-type` is enabled by default +info: `invalid-return-type` is enabled by default ``` @@ -61,7 +61,7 @@ error[invalid-return-type]: Return type does not match returned value 8 | 9 | def f() -> int: | -info: `lint:invalid-return-type` is enabled by default +info: `invalid-return-type` is enabled by default ``` @@ -79,7 +79,7 @@ error[invalid-return-type]: Return type does not match returned value 12 | 13 | from typing import TypeVar | -info: `lint:invalid-return-type` is enabled by default +info: `invalid-return-type` is enabled by default ``` @@ -91,6 +91,6 @@ error[invalid-return-type]: Function can implicitly return `None`, which is not 18 | def m(x: T) -> T: ... | ^ | -info: `lint:invalid-return-type` is enabled by default +info: `invalid-return-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type_in_stub_file.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type_in_stub_file.snap index 8a39adbbf6..f67b82d1b4 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type_in_stub_file.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type_in_stub_file.snap @@ -41,7 +41,7 @@ error[invalid-return-type]: Return type does not match returned value 4 | 5 | # error: [invalid-return-type] | -info: `lint:invalid-return-type` is enabled by default +info: `invalid-return-type` is enabled by default ``` @@ -55,7 +55,7 @@ error[invalid-return-type]: Function can implicitly return `None`, which is not 7 | print("...") 8 | ... | -info: `lint:invalid-return-type` is enabled by default +info: `invalid-return-type` is enabled by default ``` @@ -69,6 +69,6 @@ error[invalid-return-type]: Function can implicitly return `None`, which is not 12 | f"""{foo} is a function that ...""" 13 | ... | -info: `lint:invalid-return-type` is enabled by default +info: `invalid-return-type` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/rich_comparison.md_-_Comparison___Rich_Comparison_-_Chained_comparisons_with_objects_that_don't_implement_`__bool__`_correctly.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/rich_comparison.md_-_Comparison___Rich_Comparison_-_Chained_comparisons_with_objects_that_don't_implement_`__bool__`_correctly.snap index 8949a32efe..2d0ac7ef1e 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/rich_comparison.md_-_Comparison___Rich_Comparison_-_Chained_comparisons_with_objects_that_don't_implement_`__bool__`_correctly.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/rich_comparison.md_-_Comparison___Rich_Comparison_-_Chained_comparisons_with_objects_that_don't_implement_`__bool__`_correctly.snap @@ -43,7 +43,7 @@ error[unsupported-bool-conversion]: Boolean conversion is unsupported for type ` 14 | 10 < Comparable() < Comparable() | info: `__bool__` on `NotBoolable` must be callable -info: `lint:unsupported-bool-conversion` is enabled by default +info: `unsupported-bool-conversion` is enabled by default ``` @@ -59,6 +59,6 @@ error[unsupported-bool-conversion]: Boolean conversion is unsupported for type ` 16 | Comparable() < Comparable() # fine | info: `__bool__` on `NotBoolable` must be callable -info: `lint:unsupported-bool-conversion` is enabled by default +info: `unsupported-bool-conversion` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/shadowing.md_-_Shadowing_-_Implicit_class_shadowing.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/shadowing.md_-_Shadowing_-_Implicit_class_shadowing.snap index 56fa5791cc..8dbd678be7 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/shadowing.md_-_Shadowing_-_Implicit_class_shadowing.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/shadowing.md_-_Shadowing_-_Implicit_class_shadowing.snap @@ -29,6 +29,6 @@ error[invalid-assignment]: Implicit shadowing of class `C` | ^ | info: Annotate to make it explicit if this is intentional -info: `lint:invalid-assignment` is enabled by default +info: `invalid-assignment` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/shadowing.md_-_Shadowing_-_Implicit_function_shadowing.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/shadowing.md_-_Shadowing_-_Implicit_function_shadowing.snap index d8db13c263..ed53f7409a 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/shadowing.md_-_Shadowing_-_Implicit_function_shadowing.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/shadowing.md_-_Shadowing_-_Implicit_function_shadowing.snap @@ -29,6 +29,6 @@ error[invalid-assignment]: Implicit shadowing of function `f` | ^ | info: Annotate to make it explicit if this is intentional -info: `lint:invalid-assignment` is enabled by default +info: `invalid-assignment` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Chained_comparisons_with_elements_that_incorrectly_implement_`__bool__`.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Chained_comparisons_with_elements_that_incorrectly_implement_`__bool__`.snap index 3adb239bfc..ca136e3af0 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Chained_comparisons_with_elements_that_incorrectly_implement_`__bool__`.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Chained_comparisons_with_elements_that_incorrectly_implement_`__bool__`.snap @@ -44,6 +44,6 @@ error[unsupported-bool-conversion]: Boolean conversion is unsupported for type ` 17 | a < b # fine | info: `__bool__` on `NotBoolable | Literal[False]` must be callable -info: `lint:unsupported-bool-conversion` is enabled by default +info: `unsupported-bool-conversion` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Equality_with_elements_that_incorrectly_implement_`__bool__`.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Equality_with_elements_that_incorrectly_implement_`__bool__`.snap index 505f027cc6..a51d350514 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Equality_with_elements_that_incorrectly_implement_`__bool__`.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Equality_with_elements_that_incorrectly_implement_`__bool__`.snap @@ -34,6 +34,6 @@ error[unsupported-bool-conversion]: Boolean conversion is unsupported for type ` | ^^^^^^^^^^^^^^^^ | info: `__bool__` on `NotBoolable` must be callable -info: `lint:unsupported-bool-conversion` is enabled by default +info: `unsupported-bool-conversion` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/unpacking.md_-_Unpacking_-_Exactly_too_few_values_to_unpack.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/unpacking.md_-_Unpacking_-_Exactly_too_few_values_to_unpack.snap index 4047b1e070..f91f2bac36 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/unpacking.md_-_Unpacking_-_Exactly_too_few_values_to_unpack.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/unpacking.md_-_Unpacking_-_Exactly_too_few_values_to_unpack.snap @@ -26,6 +26,6 @@ error[invalid-assignment]: Not enough values to unpack | | | Expected 2 | -info: `lint:invalid-assignment` is enabled by default +info: `invalid-assignment` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/unpacking.md_-_Unpacking_-_Exactly_too_many_values_to_unpack.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/unpacking.md_-_Unpacking_-_Exactly_too_many_values_to_unpack.snap index c52a714151..8ce8075bd8 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/unpacking.md_-_Unpacking_-_Exactly_too_many_values_to_unpack.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/unpacking.md_-_Unpacking_-_Exactly_too_many_values_to_unpack.snap @@ -26,6 +26,6 @@ error[invalid-assignment]: Too many values to unpack | | | Expected 2 | -info: `lint:invalid-assignment` is enabled by default +info: `invalid-assignment` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/unpacking.md_-_Unpacking_-_Right_hand_side_not_iterable.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/unpacking.md_-_Unpacking_-_Right_hand_side_not_iterable.snap index 113dcc24a1..5b1ff5e7c4 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/unpacking.md_-_Unpacking_-_Right_hand_side_not_iterable.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/unpacking.md_-_Unpacking_-_Right_hand_side_not_iterable.snap @@ -25,6 +25,6 @@ error[not-iterable]: Object of type `Literal[1]` is not iterable | ^ | info: It doesn't have an `__iter__` method or a `__getitem__` method -info: `lint:not-iterable` is enabled by default +info: `not-iterable` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/unpacking.md_-_Unpacking_-_Too_few_values_to_unpack.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/unpacking.md_-_Unpacking_-_Too_few_values_to_unpack.snap index 8527d6d119..df56e07909 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/unpacking.md_-_Unpacking_-_Too_few_values_to_unpack.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/unpacking.md_-_Unpacking_-_Too_few_values_to_unpack.snap @@ -26,6 +26,6 @@ error[invalid-assignment]: Not enough values to unpack | | | Expected 3 or more | -info: `lint:invalid-assignment` is enabled by default +info: `invalid-assignment` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_An_unresolvable_import_that_does_not_use_`from`.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_An_unresolvable_import_that_does_not_use_`from`.snap index 03c93f0da7..c466235b27 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_An_unresolvable_import_that_does_not_use_`from`.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_An_unresolvable_import_that_does_not_use_`from`.snap @@ -28,6 +28,6 @@ error[unresolved-import]: Cannot resolve imported module `does_not_exist` 2 | 3 | x = does_not_exist.foo | -info: `lint:unresolved-import` is enabled by default +info: `unresolved-import` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_Using_`from`_with_a_resolvable_module_but_unresolvable_item.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_Using_`from`_with_a_resolvable_module_but_unresolvable_item.snap index f347d9aaf7..6ddf795bc3 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_Using_`from`_with_a_resolvable_module_but_unresolvable_item.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_Using_`from`_with_a_resolvable_module_but_unresolvable_item.snap @@ -31,6 +31,6 @@ error[unresolved-import]: Module `a` has no member `does_not_exist` 1 | from a import does_exist1, does_not_exist, does_exist2 # error: [unresolved-import] | ^^^^^^^^^^^^^^ | -info: `lint:unresolved-import` is enabled by default +info: `unresolved-import` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_Using_`from`_with_an_unknown_current_module.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_Using_`from`_with_an_unknown_current_module.snap index 1ba4c0f24d..012ee03d72 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_Using_`from`_with_an_unknown_current_module.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_Using_`from`_with_an_unknown_current_module.snap @@ -28,6 +28,6 @@ error[unresolved-import]: Cannot resolve imported module `.does_not_exist` 2 | 3 | stat = add(10, 15) | -info: `lint:unresolved-import` is enabled by default +info: `unresolved-import` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_Using_`from`_with_an_unknown_nested_module.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_Using_`from`_with_an_unknown_nested_module.snap index 7e06ef0bbf..ce8f76e18b 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_Using_`from`_with_an_unknown_nested_module.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_Using_`from`_with_an_unknown_nested_module.snap @@ -28,6 +28,6 @@ error[unresolved-import]: Cannot resolve imported module `.does_not_exist.foo.ba 2 | 3 | stat = add(10, 15) | -info: `lint:unresolved-import` is enabled by default +info: `unresolved-import` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_Using_`from`_with_an_unresolvable_module.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_Using_`from`_with_an_unresolvable_module.snap index 1a2b51e10c..1295e1cd61 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_Using_`from`_with_an_unresolvable_module.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_Using_`from`_with_an_unresolvable_module.snap @@ -28,6 +28,6 @@ error[unresolved-import]: Cannot resolve imported module `does_not_exist` 2 | 3 | stat = add(10, 15) | -info: `lint:unresolved-import` is enabled by default +info: `unresolved-import` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_Using_`from`_with_too_many_leading_dots.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_Using_`from`_with_too_many_leading_dots.snap index 8f7f635b19..194e613487 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_Using_`from`_with_too_many_leading_dots.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_diagnostics_-_Using_`from`_with_too_many_leading_dots.snap @@ -40,6 +40,6 @@ error[unresolved-import]: Cannot resolve imported module `....foo` 2 | 3 | stat = add(10, 15) | -info: `lint:unresolved-import` is enabled by default +info: `unresolved-import` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_conversion.md_-_Different_ways_that_`unsupported-bool-conversion`_can_occur_-_Has_a_`__bool__`_attribute,_but_it's_not_callable.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_conversion.md_-_Different_ways_that_`unsupported-bool-conversion`_can_occur_-_Has_a_`__bool__`_attribute,_but_it's_not_callable.snap index 1aaa70ea91..133c9416f1 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_conversion.md_-_Different_ways_that_`unsupported-bool-conversion`_can_occur_-_Has_a_`__bool__`_attribute,_but_it's_not_callable.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_conversion.md_-_Different_ways_that_`unsupported-bool-conversion`_can_occur_-_Has_a_`__bool__`_attribute,_but_it's_not_callable.snap @@ -32,6 +32,6 @@ error[unsupported-bool-conversion]: Boolean conversion is unsupported for type ` | ^ | info: `__bool__` on `NotBoolable` must be callable -info: `lint:unsupported-bool-conversion` is enabled by default +info: `unsupported-bool-conversion` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_conversion.md_-_Different_ways_that_`unsupported-bool-conversion`_can_occur_-_Has_a_`__bool__`_method,_but_has_an_incorrect_return_type.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_conversion.md_-_Different_ways_that_`unsupported-bool-conversion`_can_occur_-_Has_a_`__bool__`_method,_but_has_an_incorrect_return_type.snap index 6143f630fd..c32d97b04c 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_conversion.md_-_Different_ways_that_`unsupported-bool-conversion`_can_occur_-_Has_a_`__bool__`_method,_but_has_an_incorrect_return_type.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_conversion.md_-_Different_ways_that_`unsupported-bool-conversion`_can_occur_-_Has_a_`__bool__`_method,_but_has_an_incorrect_return_type.snap @@ -42,6 +42,6 @@ info: `str` is not assignable to `bool` | Method defined here 3 | return "wat" | -info: `lint:unsupported-bool-conversion` is enabled by default +info: `unsupported-bool-conversion` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_conversion.md_-_Different_ways_that_`unsupported-bool-conversion`_can_occur_-_Has_a_`__bool__`_method,_but_has_incorrect_parameters.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_conversion.md_-_Different_ways_that_`unsupported-bool-conversion`_can_occur_-_Has_a_`__bool__`_method,_but_has_incorrect_parameters.snap index e19cf34843..3c8f6dd918 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_conversion.md_-_Different_ways_that_`unsupported-bool-conversion`_can_occur_-_Has_a_`__bool__`_method,_but_has_incorrect_parameters.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_conversion.md_-_Different_ways_that_`unsupported-bool-conversion`_can_occur_-_Has_a_`__bool__`_method,_but_has_incorrect_parameters.snap @@ -42,6 +42,6 @@ info: `__bool__` methods must only have a `self` parameter | Method defined here 3 | return False | -info: `lint:unsupported-bool-conversion` is enabled by default +info: `unsupported-bool-conversion` is enabled by default ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_conversion.md_-_Different_ways_that_`unsupported-bool-conversion`_can_occur_-_Part_of_a_union_where_at_least_one_member_has_incorrect_`__bool__`_method.snap b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_conversion.md_-_Different_ways_that_`unsupported-bool-conversion`_can_occur_-_Part_of_a_union_where_at_least_one_member_has_incorrect_`__bool__`_method.snap index bf05df7ece..790f9a7bfe 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_conversion.md_-_Different_ways_that_`unsupported-bool-conversion`_can_occur_-_Part_of_a_union_where_at_least_one_member_has_incorrect_`__bool__`_method.snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_conversion.md_-_Different_ways_that_`unsupported-bool-conversion`_can_occur_-_Part_of_a_union_where_at_least_one_member_has_incorrect_`__bool__`_method.snap @@ -39,6 +39,6 @@ error[unsupported-bool-conversion]: Boolean conversion is unsupported for union 15 | 10 and get() and True | ^^^^^ | -info: `lint:unsupported-bool-conversion` is enabled by default +info: `unsupported-bool-conversion` is enabled by default ``` diff --git a/crates/ty_test/src/matcher.rs b/crates/ty_test/src/matcher.rs index 4beeb478e7..fa1f853205 100644 --- a/crates/ty_test/src/matcher.rs +++ b/crates/ty_test/src/matcher.rs @@ -4,7 +4,7 @@ use crate::assertion::{InlineFileAssertions, ParsedAssertion, UnparsedAssertion} use crate::db::Db; use crate::diagnostic::SortedDiagnostics; use colored::Colorize; -use ruff_db::diagnostic::{Diagnostic, DiagnosticAsStrError, DiagnosticId}; +use ruff_db::diagnostic::{Diagnostic, DiagnosticId}; use ruff_db::files::File; use ruff_db::source::{line_index, source_text, SourceText}; use ruff_source_file::{LineIndex, OneIndexed}; @@ -168,29 +168,24 @@ fn maybe_add_undefined_reveal_clarification( impl Unmatched for &Diagnostic { fn unmatched(&self) -> String { - let id = self.id(); - let id = id.as_str().unwrap_or_else(|error| match error { - DiagnosticAsStrError::Category { name, .. } => name, - }); - maybe_add_undefined_reveal_clarification( self, - format_args!(r#"[{id}] "{message}""#, message = self.concise_message()), + format_args!( + r#"[{id}] "{message}""#, + id = self.id(), + message = self.concise_message() + ), ) } } impl UnmatchedWithColumn for &Diagnostic { fn unmatched_with_column(&self, column: OneIndexed) -> String { - let id = self.id(); - let id = id.as_str().unwrap_or_else(|error| match error { - DiagnosticAsStrError::Category { name, .. } => name, - }); - maybe_add_undefined_reveal_clarification( self, format_args!( r#"{column} [{id}] "{message}""#, + id = self.id(), message = self.concise_message() ), ) @@ -284,7 +279,7 @@ impl Matcher { ParsedAssertion::Error(error) => { let position = unmatched.iter().position(|diagnostic| { let lint_name_matches = !error.rule.is_some_and(|rule| { - !(diagnostic.id().is_lint_named(rule) || diagnostic.id().matches(rule)) + !(diagnostic.id().is_lint_named(rule) || diagnostic.id().as_str() == rule) }); let column_matches = error .column diff --git a/crates/ty_wasm/tests/api.rs b/crates/ty_wasm/tests/api.rs index 1d46fe8e38..f98381f43b 100644 --- a/crates/ty_wasm/tests/api.rs +++ b/crates/ty_wasm/tests/api.rs @@ -22,7 +22,7 @@ fn check() { let diagnostic = &result[0]; - assert_eq!(diagnostic.id(), "lint:unresolved-import"); + assert_eq!(diagnostic.id(), "unresolved-import"); assert_eq!( diagnostic.to_range(&workspace).unwrap().start, Position { line: 1, column: 8 }