From a4827e7d5677c04beb2c7d282f0a01d33dc812df Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 26 Jun 2026 15:59:22 -0500 Subject: [PATCH 01/34] Vendor latest annotate-snippets Pulled from ef2875e7057991a8a3f31ece19291410f29d23a4 --- Cargo.lock | 56 +- Cargo.toml | 1 - crates/ruff_annotate_snippets/Cargo.toml | 87 +- .../examples/custom_error.rs | 32 + .../custom_error.svg} | 14 +- .../examples/custom_level.rs | 64 + .../examples/custom_level.svg | 62 + .../examples/elide_header.rs | 21 + .../examples/elide_header.svg | 44 + .../examples/expected_type.rs | 34 +- .../examples/expected_type.svg | 26 +- .../ruff_annotate_snippets/examples/footer.rs | 27 +- .../examples/footer.svg | 18 +- .../ruff_annotate_snippets/examples/format.rs | 40 +- .../examples/format.svg | 63 +- .../examples/highlight_message.rs | 67 + .../examples/highlight_message.svg | 64 + .../examples/highlight_source.rs | 31 + .../examples/highlight_source.svg | 40 + .../examples/id_hyperlink.rs | 32 + .../examples/id_hyperlink.svg | 40 + .../examples/multi_suggestion.rs | 75 + .../examples/multi_suggestion.svg | 82 + .../examples/multislice.rs | 26 +- .../examples/multislice.svg | 20 +- .../examples/struct_name_as_context.rs | 27 + .../examples/struct_name_as_context.svg | 44 + crates/ruff_annotate_snippets/src/level.rs | 233 + crates/ruff_annotate_snippets/src/lib.rs | 133 +- .../src/renderer/display_list.rs | 1946 ------ .../src/renderer/margin.rs | 21 +- .../src/renderer/mod.rs | 401 +- .../src/renderer/render.rs | 2804 +++++++++ .../src/renderer/source_map.rs | 800 +++ .../src/renderer/styled_buffer.rs | 118 +- .../src/renderer/stylesheet.rs | 46 +- crates/ruff_annotate_snippets/src/snippet.rs | 618 +- .../ann_eof.ascii.term.svg} | 10 +- .../tests/color/ann_eof.rs | 21 + .../tests/color/ann_eof.unicode.term.svg | 34 + .../ann_insertion.ascii.term.svg} | 10 +- .../tests/color/ann_insertion.rs | 21 + .../color/ann_insertion.unicode.term.svg | 34 + .../ann_multiline.ascii.term.svg} | 16 +- .../tests/color/ann_multiline.rs | 34 + .../color/ann_multiline.unicode.term.svg | 40 + .../tests/color/ann_multiline2.ascii.term.svg | 42 + .../tests/color/ann_multiline2.rs | 34 + .../color/ann_multiline2.unicode.term.svg | 42 + .../ann_removed_nl.ascii.term.svg} | 10 +- .../tests/color/ann_removed_nl.rs | 21 + .../color/ann_removed_nl.unicode.term.svg | 34 + ...sure_emoji_highlight_width.ascii.term.svg} | 10 +- .../color/ensure_emoji_highlight_width.rs | 25 + ...ure_emoji_highlight_width.unicode.term.svg | 34 + .../first_snippet_is_primary.ascii.term.svg | 54 + .../tests/color/first_snippet_is_primary.rs | 52 + .../first_snippet_is_primary.unicode.term.svg | 54 + .../fold_ann_multiline.ascii.term.svg} | 23 +- .../tests/color/fold_ann_multiline.rs | 55 + .../color/fold_ann_multiline.unicode.term.svg | 48 + .../fold_bad_origin_line.ascii.term.svg} | 13 +- .../tests/color/fold_bad_origin_line.rs | 26 + .../fold_bad_origin_line.unicode.term.svg | 34 + .../fold_leading.ascii.term.svg} | 10 +- .../tests/color/fold_leading.rs | 37 + .../fold_leading.unicode.term.svg} | 14 +- .../fold_trailing.ascii.term.svg} | 10 +- .../tests/color/fold_trailing.rs | 36 + .../color/fold_trailing.unicode.term.svg | 34 + ...f_line_with_wide_characters.ascii.term.svg | 54 + ...ighlight_diff_line_with_wide_characters.rs | 44 + ...line_with_wide_characters.unicode.term.svg | 54 + ...light_duplicated_diff_lines.ascii.term.svg | 62 + .../color/highlight_duplicated_diff_lines.rs | 75 + ...ght_duplicated_diff_lines.unicode.term.svg | 62 + ...ighlight_first_line_tab_371.ascii.term.svg | 41 + .../color/highlight_first_line_tab_371.rs | 21 + .../highlight_source.ascii.term.svg} | 12 +- .../tests/color/highlight_source.rs | 43 + .../color/highlight_source.unicode.term.svg | 38 + ...ht_source_multi_width_chars.ascii.term.svg | 30 + .../highlight_source_multi_width_chars.rs | 20 + ..._source_multi_width_chars.unicode.term.svg | 30 + ...ght_source_zero_width_chars.ascii.term.svg | 30 + .../highlight_source_zero_width_chars.rs | 21 + ...t_source_zero_width_chars.unicode.term.svg | 30 + .../issue_9.ascii.term.svg} | 23 +- .../tests/color/issue_9.rs | 33 + .../tests/color/issue_9.unicode.term.svg | 46 + .../tests/color/main.rs | 30 + .../multiline_removal_indent.ascii.term.svg | 34 + .../tests/color/multiline_removal_indent.rs | 19 + .../multiline_removal_indent.unicode.term.svg | 34 + ...line_removal_last_line_tabs.ascii.term.svg | 37 + .../color/multiline_removal_last_line_tabs.rs | 18 + ...ne_removal_last_line_tabs.unicode.term.svg | 37 + ...ultiline_removal_suggestion.ascii.term.svg | 68 + .../color/multiline_removal_suggestion.rs | 110 + ...tiline_removal_suggestion.unicode.term.svg | 68 + .../multiple_annotations.ascii.term.svg} | 20 +- .../tests/color/multiple_annotations.rs | 46 + .../multiple_annotations.unicode.term.svg | 54 + ...ltiple_highlight_duplicated.ascii.term.svg | 78 + .../color/multiple_highlight_duplicated.rs | 93 + ...iple_highlight_duplicated.unicode.term.svg | 78 + .../multiple_multiline_removal.ascii.term.svg | 120 + .../tests/color/multiple_multiline_removal.rs | 93 + ...ultiple_multiline_removal.unicode.term.svg | 120 + ...primary_title_second_group.ascii.term.svg} | 17 +- .../tests/color/primary_title_second_group.rs | 31 + ...rimary_title_second_group.unicode.term.svg | 41 + .../simple.ascii.term.svg} | 17 +- .../tests/color/simple.rs | 37 + .../tests/color/simple.unicode.term.svg | 42 + .../tests/color/strip_line.ascii.term.svg | 34 + .../tests/color/strip_line.rs | 30 + .../tests/color/strip_line.unicode.term.svg | 34 + .../color/strip_line_char.ascii.term.svg | 34 + .../tests/color/strip_line_char.rs | 30 + .../color/strip_line_char.unicode.term.svg | 34 + .../color/strip_line_non_ws.ascii.term.svg | 38 + .../tests/color/strip_line_non_ws.rs | 36 + .../color/strip_line_non_ws.unicode.term.svg | 38 + .../tests/color/styled_title.ascii.term.svg | 56 + .../tests/color/styled_title.rs | 50 + .../tests/color/styled_title.unicode.term.svg | 56 + .../ruff_annotate_snippets/tests/examples.rs | 96 +- .../tests/fixtures/color/ann_eof.toml | 15 - .../tests/fixtures/color/ann_insertion.toml | 15 - .../tests/fixtures/color/ann_multiline.toml | 21 - .../tests/fixtures/color/ann_multiline2.toml | 21 - .../tests/fixtures/color/ann_removed_nl.toml | 15 - .../color/ensure-emoji-highlight-width.toml | 18 - .../fixtures/color/fold_ann_multiline.toml | 44 - .../fixtures/color/fold_bad_origin_line.toml | 20 - .../tests/fixtures/color/fold_leading.toml | 29 - .../tests/fixtures/color/fold_trailing.toml | 28 - .../tests/fixtures/color/issue_9.toml | 31 - .../fixtures/color/multiple_annotations.toml | 32 - ...egression_leading_tab_label_alignment.toml | 45 - .../regression_leading_tab_long_line.svg | 36 - .../regression_leading_tab_long_line.toml | 20 - .../tests/fixtures/color/simple.toml | 22 - .../tests/fixtures/color/strip_line.toml | 18 - .../tests/fixtures/color/strip_line_char.toml | 18 - .../fixtures/color/strip_line_non_ws.svg | 40 - .../fixtures/color/strip_line_non_ws.toml | 26 - .../tests/fixtures/deserialize.rs | 130 - .../tests/fixtures/main.rs | 41 - .../ruff_annotate_snippets/tests/formatter.rs | 5223 ++++++++++++++-- .../tests/rustc_tests.rs | 5548 ++++++++++++++++- 152 files changed, 19387 insertions(+), 3975 deletions(-) create mode 100644 crates/ruff_annotate_snippets/examples/custom_error.rs rename crates/ruff_annotate_snippets/{tests/fixtures/color/strip_line.svg => examples/custom_error.svg} (57%) create mode 100644 crates/ruff_annotate_snippets/examples/custom_level.rs create mode 100644 crates/ruff_annotate_snippets/examples/custom_level.svg create mode 100644 crates/ruff_annotate_snippets/examples/elide_header.rs create mode 100644 crates/ruff_annotate_snippets/examples/elide_header.svg create mode 100644 crates/ruff_annotate_snippets/examples/highlight_message.rs create mode 100644 crates/ruff_annotate_snippets/examples/highlight_message.svg create mode 100644 crates/ruff_annotate_snippets/examples/highlight_source.rs create mode 100644 crates/ruff_annotate_snippets/examples/highlight_source.svg create mode 100644 crates/ruff_annotate_snippets/examples/id_hyperlink.rs create mode 100644 crates/ruff_annotate_snippets/examples/id_hyperlink.svg create mode 100644 crates/ruff_annotate_snippets/examples/multi_suggestion.rs create mode 100644 crates/ruff_annotate_snippets/examples/multi_suggestion.svg create mode 100644 crates/ruff_annotate_snippets/examples/struct_name_as_context.rs create mode 100644 crates/ruff_annotate_snippets/examples/struct_name_as_context.svg create mode 100644 crates/ruff_annotate_snippets/src/level.rs delete mode 100644 crates/ruff_annotate_snippets/src/renderer/display_list.rs create mode 100644 crates/ruff_annotate_snippets/src/renderer/render.rs create mode 100644 crates/ruff_annotate_snippets/src/renderer/source_map.rs rename crates/ruff_annotate_snippets/tests/{fixtures/color/ann_removed_nl.svg => color/ann_eof.ascii.term.svg} (75%) create mode 100644 crates/ruff_annotate_snippets/tests/color/ann_eof.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/ann_eof.unicode.term.svg rename crates/ruff_annotate_snippets/tests/{fixtures/color/ann_insertion.svg => color/ann_insertion.ascii.term.svg} (76%) create mode 100644 crates/ruff_annotate_snippets/tests/color/ann_insertion.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/ann_insertion.unicode.term.svg rename crates/ruff_annotate_snippets/tests/{fixtures/color/ann_multiline.svg => color/ann_multiline.ascii.term.svg} (60%) create mode 100644 crates/ruff_annotate_snippets/tests/color/ann_multiline.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/ann_multiline.unicode.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/ann_multiline2.ascii.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/ann_multiline2.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/ann_multiline2.unicode.term.svg rename crates/ruff_annotate_snippets/tests/{fixtures/color/ann_eof.svg => color/ann_removed_nl.ascii.term.svg} (75%) create mode 100644 crates/ruff_annotate_snippets/tests/color/ann_removed_nl.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/ann_removed_nl.unicode.term.svg rename crates/ruff_annotate_snippets/tests/{fixtures/color/ensure-emoji-highlight-width.svg => color/ensure_emoji_highlight_width.ascii.term.svg} (65%) create mode 100644 crates/ruff_annotate_snippets/tests/color/ensure_emoji_highlight_width.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/ensure_emoji_highlight_width.unicode.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/first_snippet_is_primary.ascii.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/first_snippet_is_primary.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/first_snippet_is_primary.unicode.term.svg rename crates/ruff_annotate_snippets/tests/{fixtures/color/fold_ann_multiline.svg => color/fold_ann_multiline.ascii.term.svg} (55%) create mode 100644 crates/ruff_annotate_snippets/tests/color/fold_ann_multiline.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/fold_ann_multiline.unicode.term.svg rename crates/ruff_annotate_snippets/tests/{fixtures/color/fold_bad_origin_line.svg => color/fold_bad_origin_line.ascii.term.svg} (66%) create mode 100644 crates/ruff_annotate_snippets/tests/color/fold_bad_origin_line.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/fold_bad_origin_line.unicode.term.svg rename crates/ruff_annotate_snippets/tests/{fixtures/color/fold_leading.svg => color/fold_leading.ascii.term.svg} (73%) create mode 100644 crates/ruff_annotate_snippets/tests/color/fold_leading.rs rename crates/ruff_annotate_snippets/tests/{fixtures/color/strip_line_char.svg => color/fold_leading.unicode.term.svg} (56%) rename crates/ruff_annotate_snippets/tests/{fixtures/color/fold_trailing.svg => color/fold_trailing.ascii.term.svg} (73%) create mode 100644 crates/ruff_annotate_snippets/tests/color/fold_trailing.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/fold_trailing.unicode.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/highlight_diff_line_with_wide_characters.ascii.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/highlight_diff_line_with_wide_characters.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/highlight_diff_line_with_wide_characters.unicode.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/highlight_duplicated_diff_lines.ascii.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/highlight_duplicated_diff_lines.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/highlight_duplicated_diff_lines.unicode.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/highlight_first_line_tab_371.ascii.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/highlight_first_line_tab_371.rs rename crates/ruff_annotate_snippets/tests/{fixtures/color/regression_leading_tab_label_alignment.svg => color/highlight_source.ascii.term.svg} (59%) create mode 100644 crates/ruff_annotate_snippets/tests/color/highlight_source.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/highlight_source.unicode.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/highlight_source_multi_width_chars.ascii.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/highlight_source_multi_width_chars.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/highlight_source_multi_width_chars.unicode.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/highlight_source_zero_width_chars.ascii.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/highlight_source_zero_width_chars.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/highlight_source_zero_width_chars.unicode.term.svg rename crates/ruff_annotate_snippets/tests/{fixtures/color/issue_9.svg => color/issue_9.ascii.term.svg} (59%) create mode 100644 crates/ruff_annotate_snippets/tests/color/issue_9.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/issue_9.unicode.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/main.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/multiline_removal_indent.ascii.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/multiline_removal_indent.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/multiline_removal_indent.unicode.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/multiline_removal_last_line_tabs.ascii.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/multiline_removal_last_line_tabs.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/multiline_removal_last_line_tabs.unicode.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/multiline_removal_suggestion.ascii.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/multiline_removal_suggestion.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/multiline_removal_suggestion.unicode.term.svg rename crates/ruff_annotate_snippets/tests/{fixtures/color/multiple_annotations.svg => color/multiple_annotations.ascii.term.svg} (67%) create mode 100644 crates/ruff_annotate_snippets/tests/color/multiple_annotations.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/multiple_annotations.unicode.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/multiple_highlight_duplicated.ascii.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/multiple_highlight_duplicated.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/multiple_highlight_duplicated.unicode.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/multiple_multiline_removal.ascii.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/multiple_multiline_removal.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/multiple_multiline_removal.unicode.term.svg rename crates/ruff_annotate_snippets/tests/{fixtures/color/ann_multiline2.svg => color/primary_title_second_group.ascii.term.svg} (52%) create mode 100644 crates/ruff_annotate_snippets/tests/color/primary_title_second_group.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/primary_title_second_group.unicode.term.svg rename crates/ruff_annotate_snippets/tests/{fixtures/color/simple.svg => color/simple.ascii.term.svg} (53%) create mode 100644 crates/ruff_annotate_snippets/tests/color/simple.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/simple.unicode.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/strip_line.ascii.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/strip_line.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/strip_line.unicode.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/strip_line_char.ascii.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/strip_line_char.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/strip_line_char.unicode.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/strip_line_non_ws.ascii.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/strip_line_non_ws.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/strip_line_non_ws.unicode.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/styled_title.ascii.term.svg create mode 100644 crates/ruff_annotate_snippets/tests/color/styled_title.rs create mode 100644 crates/ruff_annotate_snippets/tests/color/styled_title.unicode.term.svg delete mode 100644 crates/ruff_annotate_snippets/tests/fixtures/color/ann_eof.toml delete mode 100644 crates/ruff_annotate_snippets/tests/fixtures/color/ann_insertion.toml delete mode 100644 crates/ruff_annotate_snippets/tests/fixtures/color/ann_multiline.toml delete mode 100644 crates/ruff_annotate_snippets/tests/fixtures/color/ann_multiline2.toml delete mode 100644 crates/ruff_annotate_snippets/tests/fixtures/color/ann_removed_nl.toml delete mode 100644 crates/ruff_annotate_snippets/tests/fixtures/color/ensure-emoji-highlight-width.toml delete mode 100644 crates/ruff_annotate_snippets/tests/fixtures/color/fold_ann_multiline.toml delete mode 100644 crates/ruff_annotate_snippets/tests/fixtures/color/fold_bad_origin_line.toml delete mode 100644 crates/ruff_annotate_snippets/tests/fixtures/color/fold_leading.toml delete mode 100644 crates/ruff_annotate_snippets/tests/fixtures/color/fold_trailing.toml delete mode 100644 crates/ruff_annotate_snippets/tests/fixtures/color/issue_9.toml delete mode 100644 crates/ruff_annotate_snippets/tests/fixtures/color/multiple_annotations.toml delete mode 100644 crates/ruff_annotate_snippets/tests/fixtures/color/regression_leading_tab_label_alignment.toml delete mode 100644 crates/ruff_annotate_snippets/tests/fixtures/color/regression_leading_tab_long_line.svg delete mode 100644 crates/ruff_annotate_snippets/tests/fixtures/color/regression_leading_tab_long_line.toml delete mode 100644 crates/ruff_annotate_snippets/tests/fixtures/color/simple.toml delete mode 100644 crates/ruff_annotate_snippets/tests/fixtures/color/strip_line.toml delete mode 100644 crates/ruff_annotate_snippets/tests/fixtures/color/strip_line_char.toml delete mode 100644 crates/ruff_annotate_snippets/tests/fixtures/color/strip_line_non_ws.svg delete mode 100644 crates/ruff_annotate_snippets/tests/fixtures/color/strip_line_non_ws.toml delete mode 100644 crates/ruff_annotate_snippets/tests/fixtures/deserialize.rs delete mode 100644 crates/ruff_annotate_snippets/tests/fixtures/main.rs diff --git a/Cargo.lock b/Cargo.lock index 868cb2053a2787..d34a10c5b9bf29 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -948,7 +948,7 @@ checksum = "a867d7322eb69cf3a68a5426387a25b45cb3b9c5ee41023ee6cea92e2afadd82" dependencies = [ "camino", "fancy-regex", - "libtest-mimic 0.8.1", + "libtest-mimic", "walkdir", ] @@ -1968,18 +1968,6 @@ dependencies = [ "libc", ] -[[package]] -name = "libtest-mimic" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc0bda45ed5b3a2904262c1bb91e526127aa70e7ef3758aba2ef93cf896b9b58" -dependencies = [ - "clap", - "escape8259", - "termcolor", - "threadpool", -] - [[package]] name = "libtest-mimic" version = "0.8.1" @@ -2286,16 +2274,6 @@ dependencies = [ "libm", ] -[[package]] -name = "num_cpus" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "objc2" version = "0.6.3" @@ -3146,10 +3124,7 @@ dependencies = [ "anstyle", "memchr", "ruff_annotate_snippets", - "serde", "snapbox", - "toml 1.1.3+spec-1.1.0", - "tryfn", "unicode-width", ] @@ -4255,15 +4230,6 @@ dependencies = [ "windows-sys 0.61.0", ] -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - [[package]] name = "terminal_size" version = "0.4.3" @@ -4383,15 +4349,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "threadpool" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" -dependencies = [ - "num_cpus", -] - [[package]] name = "tikv-jemalloc-sys" version = "0.6.1+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7" @@ -4608,17 +4565,6 @@ dependencies = [ "tracing-log", ] -[[package]] -name = "tryfn" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f68b00518dd6c69ee2289900b140e55dad068cb925678603bfa8d539f61ef6c1" -dependencies = [ - "ignore", - "libtest-mimic 0.7.3", - "snapbox", -] - [[package]] name = "ty" version = "0.0.0" diff --git a/Cargo.toml b/Cargo.toml index d0775eb89006bf..e209367e60c870 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -202,7 +202,6 @@ tracing-subscriber = { version = "0.3.18", default-features = false, features = "ansi", "smallvec", ] } -tryfn = { version = "1.0.0" } typed-arena = { version = "2.0.2" } unicode-ident = { version = "1.0.12" } unicode-normalization = { version = "0.1.23" } diff --git a/crates/ruff_annotate_snippets/Cargo.toml b/crates/ruff_annotate_snippets/Cargo.toml index 560501ece5d202..2235b38b4dbcc5 100644 --- a/crates/ruff_annotate_snippets/Cargo.toml +++ b/crates/ruff_annotate_snippets/Cargo.toml @@ -12,28 +12,91 @@ license = "MIT OR Apache-2.0" [dependencies] anstyle = { workspace = true } -memchr = { workspace = true } +memchr = { workspace = true, optional = true } unicode-width = { workspace = true } [dev-dependencies] ruff_annotate_snippets = { path = ".", features = ["testing-colors"] } - anstream = { workspace = true } -serde = { workspace = true, features = ["derive"] } -snapbox = { workspace = true, features = ["diff", "term-svg", "cmd", "examples"] } -toml = { workspace = true } -tryfn = { workspace = true } +snapbox = { workspace = true } [features] -default = [] +default = ["std"] +std = ["anstyle/std", "memchr?/std"] +simd = ["dep:memchr"] testing-colors = [] -[[test]] -name = "fixtures" -harness = false +# Using upstream lints +[lints.rust] +rust_2018_idioms = { level = "warn", priority = -1 } +unnameable_types = "warn" +unreachable_pub = "warn" +unsafe_op_in_unsafe_fn = "warn" +unused_lifetimes = "warn" +unused_macro_rules = "warn" +unused_qualifications = "warn" -[lints] -workspace = true +[lints.clippy] +disallowed_methods = "allow" # HACK: minimize changes from upstream +bool_assert_comparison = "allow" +branches_sharing_code = "allow" +checked_conversions = "warn" +collapsible_else_if = "allow" +create_dir = "warn" +dbg_macro = "warn" +debug_assert_with_mut_call = "warn" +doc_markdown = "warn" +empty_enums = "warn" +enum_glob_use = "warn" +expl_impl_clone_on_copy = "warn" +explicit_deref_methods = "warn" +explicit_into_iter_loop = "warn" +fallible_impl_from = "warn" +filter_map_next = "warn" +flat_map_option = "warn" +float_cmp_const = "warn" +fn_params_excessive_bools = "warn" +from_iter_instead_of_collect = "warn" +if_same_then_else = "allow" +implicit_clone = "warn" +imprecise_flops = "warn" +inconsistent_struct_constructor = "warn" +inefficient_to_string = "warn" +infinite_loop = "warn" +invalid_upcast_comparisons = "warn" +large_digit_groups = "warn" +large_stack_arrays = "warn" +large_types_passed_by_value = "warn" +let_and_return = "allow" # sometimes good to name what you are returning +linkedlist = "warn" +lossy_float_literal = "warn" +macro_use_imports = "warn" +mem_forget = "warn" +mutex_integer = "warn" +needless_continue = "allow" +needless_for_each = "warn" +negative_feature_names = "warn" +path_buf_push_overwrite = "warn" +ptr_as_ptr = "warn" +rc_mutex = "warn" +redundant_feature_names = "warn" +ref_option_ref = "warn" +rest_pat_in_fully_bound_structs = "warn" +result_large_err = "allow" +same_functions_in_if_condition = "warn" +self_named_module_files = "warn" +semicolon_if_nothing_returned = "warn" +str_to_string = "warn" +string_add = "warn" +string_add_assign = "warn" +string_lit_as_bytes = "warn" +todo = "warn" +trait_duplication_in_bounds = "warn" +uninlined_format_args = "warn" +verbose_file_reads = "warn" +wildcard_imports = "warn" +zero_sized_map_values = "warn" [lib] +name = "annotate_snippets" test = false diff --git a/crates/ruff_annotate_snippets/examples/custom_error.rs b/crates/ruff_annotate_snippets/examples/custom_error.rs new file mode 100644 index 00000000000000..1618d3f0cf6fd4 --- /dev/null +++ b/crates/ruff_annotate_snippets/examples/custom_error.rs @@ -0,0 +1,32 @@ +use annotate_snippets::renderer::DecorStyle; +use annotate_snippets::{AnnotationKind, Level, Renderer, Snippet}; + +fn main() { + let source = r#"//@ compile-flags: -Ztreat-err-as-bug +//@ failure-status: 101 +//@ error-pattern: aborting due to `-Z treat-err-as-bug=1` +//@ error-pattern: [eval_static_initializer] evaluating initializer of static `C` +//@ normalize-stderr: "note: .*\n\n" -> "" +//@ normalize-stderr: "thread 'rustc' panicked.*:\n.*\n" -> "" +//@ rustc-env:RUST_BACKTRACE=0 + +#![crate_type = "rlib"] + +pub static C: u32 = 0 - 1; +//~^ ERROR could not evaluate static initializer +"#; + let report = &[Level::ERROR + .with_name(Some("error: internal compiler error")) + .primary_title("could not evaluate static initializer") + .id("E0080") + .element( + Snippet::source(source).path("$DIR/err.rs").annotation( + AnnotationKind::Primary + .span(386..391) + .label("attempt to compute `0_u32 - 1_u32`, which would overflow"), + ), + )]; + + let renderer = Renderer::styled().decor_style(DecorStyle::Unicode); + anstream::println!("{}", renderer.render(report)); +} diff --git a/crates/ruff_annotate_snippets/tests/fixtures/color/strip_line.svg b/crates/ruff_annotate_snippets/examples/custom_error.svg similarity index 57% rename from crates/ruff_annotate_snippets/tests/fixtures/color/strip_line.svg rename to crates/ruff_annotate_snippets/examples/custom_error.svg index 75709d703a435c..8c05a6c47a1d08 100644 --- a/crates/ruff_annotate_snippets/tests/fixtures/color/strip_line.svg +++ b/crates/ruff_annotate_snippets/examples/custom_error.svg @@ -1,4 +1,4 @@ - +
+ /// + /// Text passed to this function is considered "untrusted input", as such + /// all text is passed through a normalization function. Styled text is + /// not allowed to be passed to this function. + /// + ///
+ pub fn primary_title(self, text: impl Into>) -> Title<'a> { + Title { + level: self, + id: None, + text: text.into(), + allows_styling: false, + } + } + + /// For any secondary, or context, [`Group`][crate::Group]s (subsequent) in a [`Report`][crate::Report] + /// + /// See [`Group::with_title`][crate::Group::with_title] + /// + ///
+ /// + /// Text passed to this function is allowed to be styled, as such all + /// text is considered "trusted input" and has no normalizations applied to + /// it. [`normalize_untrusted_str`](crate::normalize_untrusted_str) can be + /// used to normalize untrusted text before it is passed to this function. + /// + ///
+ pub fn secondary_title(self, text: impl Into>) -> Title<'a> { + Title { + level: self, + id: None, + text: text.into(), + allows_styling: true, + } + } + + /// A text [`Element`][crate::Element] in a [`Group`][crate::Group] + /// + ///
+ /// + /// Text passed to this function is allowed to be styled, as such all + /// text is considered "trusted input" and has no normalizations applied to + /// it. [`normalize_untrusted_str`](crate::normalize_untrusted_str) can be + /// used to normalize untrusted text before it is passed to this function. + /// + ///
+ pub fn message(self, text: impl Into>) -> Message<'a> { + Message { + level: self, + text: text.into(), + } + } + + pub(crate) fn as_str(&'a self) -> &'a str { + match (&self.name, self.level) { + (Some(Some(name)), _) => name.as_ref(), + (Some(None), _) => "", + (None, LevelInner::Error) => ERROR_TXT, + (None, LevelInner::Warning) => WARNING_TXT, + (None, LevelInner::Info) => INFO_TXT, + (None, LevelInner::Note) => NOTE_TXT, + (None, LevelInner::Help) => HELP_TXT, + } + } + + pub(crate) fn style(&self, stylesheet: &Stylesheet) -> Style { + self.level.style(stylesheet) + } +} + +/// # Customize the `Level` +impl<'a> Level<'a> { + /// Replace the name describing this [`Level`] + /// + ///
+ /// + /// Text passed to this function is considered "untrusted input", as such + /// all text is passed through a normalization function. Pre-styled text is + /// not allowed to be passed to this function. + /// + ///
+ /// + /// # Example + /// + /// ```rust + /// # #[allow(clippy::needless_doctest_main)] + #[doc = include_str!("../examples/custom_level.rs")] + /// ``` + #[doc = include_str!("../examples/custom_level.svg")] + pub fn with_name(self, name: impl Into>) -> Level<'a> { + Level { + name: Some(name.into().0), + level: self.level, + } + } + + /// Do not show the [`Level`]s name + /// + /// Useful for: + /// - Another layer of the application will include the level (e.g. when rendering errors) + /// - [`Message`]s that are part of a previous [`Group`][crate::Group] [`Element`][crate::Element]s + /// + /// # Example + /// + /// ```rust + /// # use annotate_snippets::{Group, Snippet, AnnotationKind, Level}; + ///let source = r#"fn main() { + /// let b: &[u8] = include_str!("file.txt"); //~ ERROR mismatched types + /// let s: &str = include_bytes!("file.txt"); //~ ERROR mismatched types + /// }"#; + /// let report = &[ + /// Level::ERROR.primary_title("mismatched types").id("E0308") + /// .element( + /// Snippet::source(source) + /// .path("$DIR/mismatched-types.rs") + /// .annotation( + /// AnnotationKind::Primary + /// .span(105..131) + /// .label("expected `&str`, found `&[u8; 0]`"), + /// ) + /// .annotation( + /// AnnotationKind::Context + /// .span(98..102) + /// .label("expected due to this"), + /// ), + /// ) + /// .element( + /// Level::NOTE + /// .no_name() + /// .message("expected reference `&str`\nfound reference `&'static [u8; 0]`"), + /// ), + /// ]; + /// ``` + pub fn no_name(self) -> Level<'a> { + self.with_name(None::<&str>) + } +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)] +pub(crate) enum LevelInner { + Error, + Warning, + Info, + Note, + Help, +} + +impl LevelInner { + pub(crate) fn style(self, stylesheet: &Stylesheet) -> Style { + match self { + LevelInner::Error => stylesheet.error, + LevelInner::Warning => stylesheet.warning, + LevelInner::Info => stylesheet.info, + LevelInner::Note => stylesheet.note, + LevelInner::Help => stylesheet.help, + } + } +} diff --git a/crates/ruff_annotate_snippets/src/lib.rs b/crates/ruff_annotate_snippets/src/lib.rs index f8d0e1e5c6028b..e47083464acfb6 100644 --- a/crates/ruff_annotate_snippets/src/lib.rs +++ b/crates/ruff_annotate_snippets/src/lib.rs @@ -1,35 +1,93 @@ -//! A library for formatting of text or programming code snippets. -//! -//! It's primary purpose is to build an ASCII-graphical representation of the snippet -//! with annotations. +//! Format [diagnostic reports][Report], including highlighting snippets of text //! //! # Example //! //! ```rust +//! # #[allow(clippy::needless_doctest_main)] #![doc = include_str!("../examples/expected_type.rs")] //! ``` //! #![doc = include_str!("../examples/expected_type.svg")] //! -//! The crate uses a three stage process with two conversions between states: +//! # Visual overview +//! +//! [`Report`] +//! +#![doc = include_str!("../examples/multi_suggestion.svg")] +//! +//! ### Primary group +//! +//! [`Title`] +//! ```text +//! error: cannot construct `Box<_, _>` with struct literal syntax due to private fields +//! ``` +//! +//! +//! [`Annotation`] on a [`Snippet`] +//! ```text +//! ╭▸ $DIR/multi-suggestion.rs:17:13 +//! │ +//! 17 │ let _ = Box {}; +//! │ ━━━ +//! │ +//! ``` +//! +//! [`Message`] +//! ```text +//! ╰ note: private fields `0` and `1` that were not provided +//! ``` +//! +//! +//! +//! ### Secondary group: suggested fix +//! +//! [`Title`] (proposed solution) +//! ```text +//! help: you might have meant to use an associated function to build this type +//! ``` +//! +//! [`Patch`] Option 1 on a [`Snippet`] +//! ```text +//! ╭╴ +//! 21 - let _ = Box {}; +//! 21 + let _ = Box::new(_); +//! ├╴ +//! ``` //! +//! [`Patch`] Option 2 on a [`Snippet`] //! ```text -//! Message --> Renderer --> impl Display +//! ├╴ +//! 17 - let _ = Box {}; +//! 17 + let _ = Box::new_uninit(); +//! ├╴ //! ``` //! -//! The input type - [Message] is a structure designed -//! to align with likely output from any parser whose code snippet is to be -//! annotated. +//! *etc for Options 3 and 4* +//! +//! [`Message`] +//! ```text +//! ╰ and 12 other candidates +//! ``` //! -//! The middle structure - [Renderer] is a structure designed -//! to convert a snippet into an internal structure that is designed to store -//! the snippet data in a way that is easy to format. -//! [Renderer] also handles the user-configurable formatting -//! options, such as color, or margins. +//! ### Secondary group: alternative suggested fix //! -//! Finally, `impl Display` into a final `String` output. +//! [`Title`] (proposed solution) +//! ```text +//! help: consider using the `Default` trait +//! ``` +//! +//! Only [`Patch`] on a [`Snippet`] +//! ```text +//! ╭╴ +//! 17 - let _ = Box {}; +//! 17 + let _ = ::default(); +//! ╰╴ +//! ``` +//! +//! # Cargo `features` +//! +//! - `simd` - Speeds up folding //! -//! # features //! - `testing-colors` - Makes [Renderer::styled] colors OS independent, which //! allows for easier testing when testing colored output. It should be added as //! a feature in `[dev-dependencies]`, which can be done with the following command: @@ -37,33 +95,36 @@ //! cargo add annotate-snippets --dev --feature testing-colors //! ``` -#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(all(not(feature = "std"), not(test)), no_std)] +#![cfg_attr(docsrs, feature(doc_cfg))] #![warn(clippy::print_stderr)] #![warn(clippy::print_stdout)] +#![warn(clippy::std_instead_of_alloc)] +#![warn(clippy::std_instead_of_core)] #![warn(missing_debug_implementations)] -// Since this is a vendored copy of `annotate-snippets`, we squash Clippy -// warnings from upstream in order to the reduce the diff. If our copy drifts -// far from upstream such that patches become impractical to apply in both -// places, then we can get rid of these suppressions and fix the lints. -#![allow( - clippy::return_self_not_must_use, - clippy::cast_possible_truncation, - clippy::cast_precision_loss, - clippy::explicit_iter_loop, - clippy::unused_self, - clippy::unnecessary_wraps, - clippy::range_plus_one, - clippy::redundant_closure_for_method_calls, - clippy::struct_field_names, - clippy::cloned_instead_of_copied, - clippy::cast_sign_loss, - clippy::needless_as_bytes, - clippy::unnecessary_map_or -)] +extern crate alloc; + +use alloc::string::String; + +pub mod level; pub mod renderer; mod snippet; +/// Normalize the string to avoid any unicode control characters. +/// +/// This is important for untrusted input, as it can contain +/// invalid unicode sequences. +pub fn normalize_untrusted_str(s: &str) -> String { + renderer::normalize_whitespace(s).into_owned() +} + +#[doc(inline)] +pub use level::Level; #[doc(inline)] pub use renderer::Renderer; pub use snippet::*; + +#[doc = include_str!("../README.md")] +#[cfg(doctest)] +pub struct ReadmeDoctests; diff --git a/crates/ruff_annotate_snippets/src/renderer/display_list.rs b/crates/ruff_annotate_snippets/src/renderer/display_list.rs deleted file mode 100644 index 85396c0a309a0c..00000000000000 --- a/crates/ruff_annotate_snippets/src/renderer/display_list.rs +++ /dev/null @@ -1,1946 +0,0 @@ -//! `display_list` module stores the output model for the snippet. -//! -//! `DisplayList` is a central structure in the crate, which contains -//! the structured list of lines to be displayed. -//! -//! It is made of two types of lines: `Source` and `Raw`. All `Source` lines -//! are structured using four columns: -//! -//! ```text -//! /------------ (1) Line number column. -//! | /--------- (2) Line number column delimiter. -//! | | /------- (3) Inline marks column. -//! | | | /--- (4) Content column with the source and annotations for slices. -//! | | | | -//! ============================================================================= -//! error[E0308]: mismatched types -//! --> src/format.rs:51:5 -//! | -//! 151 | / fn test() -> String { -//! 152 | | return "test"; -//! 153 | | } -//! | |___^ error: expected `String`, for `&str`. -//! | -//! ``` -//! -//! The first two lines of the example above are `Raw` lines, while the rest -//! are `Source` lines. -//! -//! `DisplayList` does not store column alignment information, and those are -//! only calculated by the implementation of `std::fmt::Display` using information such as -//! styling. -//! -//! The above snippet has been built out of the following structure: -use crate::{Id, snippet}; -use std::borrow::Cow; -use std::cmp::{Reverse, max, min}; -use std::collections::HashMap; -use std::fmt::Display; -use std::ops::Range; -use std::{cmp, fmt}; - -use unicode_width::UnicodeWidthStr; - -use crate::renderer::styled_buffer::StyledBuffer; -use crate::renderer::{DEFAULT_TERM_WIDTH, Margin, Style, stylesheet::Stylesheet}; - -const ANONYMIZED_LINE_NUM: &str = "LL"; -const ERROR_TXT: &str = "error"; -const HELP_TXT: &str = "help"; -const INFO_TXT: &str = "info"; -const NOTE_TXT: &str = "note"; -const WARNING_TXT: &str = "warning"; - -/// List of lines to be displayed. -pub(crate) struct DisplayList<'a> { - pub(crate) body: Vec>, - pub(crate) stylesheet: &'a Stylesheet, - pub(crate) anonymized_line_numbers: bool, - pub(crate) cut_indicator: &'static str, - pub(crate) lineno_offset: usize, -} - -impl PartialEq for DisplayList<'_> { - fn eq(&self, other: &Self) -> bool { - self.body == other.body && self.anonymized_line_numbers == other.anonymized_line_numbers - } -} - -impl fmt::Debug for DisplayList<'_> { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("DisplayList") - .field("body", &self.body) - .field("anonymized_line_numbers", &self.anonymized_line_numbers) - .finish() - } -} - -impl Display for DisplayList<'_> { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let lineno_width = self.body.iter().fold(0, |max, set| { - set.display_lines.iter().fold(max, |max, line| match line { - DisplayLine::Source { lineno, .. } => cmp::max(lineno.unwrap_or(0), max), - _ => max, - }) - }); - let lineno_width = self.lineno_offset - + if lineno_width == 0 { - lineno_width - } else if self.anonymized_line_numbers { - ANONYMIZED_LINE_NUM.len() - } else { - ((lineno_width as f64).log10().floor() as usize) + 1 - }; - - let multiline_depth = self.body.iter().fold(0, |max, set| { - set.display_lines.iter().fold(max, |max2, line| match line { - DisplayLine::Source { annotations, .. } => cmp::max( - annotations.iter().fold(max2, |max3, line| { - cmp::max( - match line.annotation_part { - DisplayAnnotationPart::Standalone => 0, - DisplayAnnotationPart::LabelContinuation => 0, - DisplayAnnotationPart::MultilineStart(depth) => depth + 1, - DisplayAnnotationPart::MultilineEnd(depth) => depth + 1, - }, - max3, - ) - }), - max, - ), - _ => max2, - }) - }); - let mut buffer = StyledBuffer::new(); - for set in self.body.iter() { - self.format_set(set, lineno_width, multiline_depth, &mut buffer)?; - } - write!(f, "{}", buffer.render(self.stylesheet)?) - } -} - -impl<'a> DisplayList<'a> { - pub(crate) fn new( - message: snippet::Message<'a>, - stylesheet: &'a Stylesheet, - anonymized_line_numbers: bool, - term_width: usize, - cut_indicator: &'static str, - ) -> DisplayList<'a> { - let lineno_offset = message.lineno_offset; - let body = format_message( - message, - term_width, - anonymized_line_numbers, - cut_indicator, - true, - ); - - Self { - body, - stylesheet, - anonymized_line_numbers, - cut_indicator, - lineno_offset, - } - } - - fn format_set( - &self, - set: &DisplaySet<'_>, - lineno_width: usize, - multiline_depth: usize, - buffer: &mut StyledBuffer, - ) -> fmt::Result { - for line in &set.display_lines { - set.format_line( - line, - lineno_width, - multiline_depth, - self.stylesheet, - self.anonymized_line_numbers, - self.cut_indicator, - buffer, - )?; - } - Ok(()) - } -} - -#[derive(Debug, PartialEq)] -pub(crate) struct DisplaySet<'a> { - pub(crate) display_lines: Vec>, - pub(crate) margin: Margin, -} - -impl DisplaySet<'_> { - fn format_label( - &self, - line_offset: usize, - label: &[DisplayTextFragment<'_>], - stylesheet: &Stylesheet, - buffer: &mut StyledBuffer, - ) -> fmt::Result { - for fragment in label { - let style = match fragment.style { - DisplayTextStyle::Regular => stylesheet.none(), - DisplayTextStyle::Emphasis => stylesheet.emphasis(), - }; - buffer.append(line_offset, fragment.content, *style); - } - Ok(()) - } - - fn format_annotation( - &self, - line_offset: usize, - annotation: &Annotation<'_>, - continuation: bool, - stylesheet: &Stylesheet, - buffer: &mut StyledBuffer, - ) -> fmt::Result { - let hide_severity = annotation.annotation_type.is_none(); - let color = get_annotation_style(&annotation.annotation_type, stylesheet); - - let formatted_len = if let Some(id) = &annotation.id { - let id_len = id.id.len(); - if hide_severity { - id_len - } else { - 2 + id_len + annotation_type_len(&annotation.annotation_type) - } - } else { - annotation_type_len(&annotation.annotation_type) - }; - - if continuation { - for _ in 0..formatted_len + 2 { - buffer.append(line_offset, " ", Style::new()); - } - return self.format_label(line_offset, &annotation.label, stylesheet, buffer); - } - if formatted_len == 0 { - self.format_label(line_offset, &annotation.label, stylesheet, buffer) - } else { - // TODO(brent) All of this complicated checking of `hide_severity` should be reverted - // once we have real severities in Ruff. This code is trying to account for two - // different cases: - // - // - main diagnostic message - // - subdiagnostic message - // - // In the first case, signaled by `hide_severity = true`, we want to print the ID (the - // noqa code for a ruff lint diagnostic, e.g. `F401`, or `invalid-syntax` for a syntax - // error) without brackets. Instead, for subdiagnostics, we actually want to print the - // severity (usually `help`) regardless of the `hide_severity` setting. This is signaled - // by an ID of `None`. - // - // With real severities these should be reported more like in ty: - // - // ``` - // error[F401]: `math` imported but unused - // error[invalid-syntax]: Cannot use `match` statement on Python 3.9... - // ``` - // - // instead of the current versions intended to mimic the old Ruff output format: - // - // ``` - // F401 `math` imported but unused - // invalid-syntax: Cannot use `match` statement on Python 3.9... - // ``` - // - // Note that the `invalid-syntax` colon is added manually in `ruff_db`, not here. We - // could eventually add a colon to Ruff lint diagnostics (`F401:`) and then make the - // colon below unconditional again. - // - // This also applies to the hard-coded `stylesheet.error()` styling of the - // hidden-severity `id`. This should just be `*color` again later, but for now we don't - // want an unformatted `id`, which is what `get_annotation_style` returns for - // `DisplayAnnotationType::None`. - let annotation_type = annotation_type_str(&annotation.annotation_type); - if let Some(id) = annotation.id { - if hide_severity { - buffer.append( - line_offset, - &format!("{id} ", id = fmt_with_hyperlink(id.id, id.url, stylesheet)), - *stylesheet.error(), - ); - } else { - buffer.append( - line_offset, - &format!( - "{annotation_type}[{id}]", - id = fmt_with_hyperlink(id.id, id.url, stylesheet) - ), - *color, - ); - } - } else { - buffer.append(line_offset, annotation_type, *color); - } - - if annotation.is_fixable { - buffer.append(line_offset, "[", stylesheet.none); - buffer.append(line_offset, "*", stylesheet.help); - buffer.append(line_offset, "]", stylesheet.none); - // In the hide-severity case, we need a space instead of the colon and space below. - if hide_severity { - buffer.append(line_offset, " ", stylesheet.none); - } - } - - if !is_annotation_empty(annotation) { - if annotation.id.is_none() || !hide_severity { - buffer.append(line_offset, ": ", stylesheet.none); - } - self.format_label(line_offset, &annotation.label, stylesheet, buffer)?; - } - Ok(()) - } - } - - #[inline] - fn format_raw_line( - &self, - line_offset: usize, - line: &DisplayRawLine<'_>, - lineno_width: usize, - stylesheet: &Stylesheet, - anonymized_line_numbers: bool, - buffer: &mut StyledBuffer, - ) -> fmt::Result { - match line { - DisplayRawLine::Origin { - path, - pos, - header_type, - } => { - let header_sigil = match header_type { - DisplayHeaderType::Initial => "-->", - DisplayHeaderType::Continuation => ":::", - }; - let lineno_color = stylesheet.line_no(); - buffer.puts(line_offset, lineno_width, header_sigil, *lineno_color); - buffer.puts(line_offset, lineno_width + 4, path, stylesheet.none); - if let Some(Position { row, col, cell }) = pos { - if let Some(cell) = cell { - buffer.append(line_offset, ":", stylesheet.none); - buffer.append(line_offset, &format!("cell {cell}"), stylesheet.none); - } - buffer.append(line_offset, ":", stylesheet.none); - if anonymized_line_numbers { - buffer.append(line_offset, ANONYMIZED_LINE_NUM, stylesheet.none); - } else { - buffer.append(line_offset, row.to_string().as_str(), stylesheet.none); - } - buffer.append(line_offset, ":", stylesheet.none); - buffer.append(line_offset, col.to_string().as_str(), stylesheet.none); - } - Ok(()) - } - DisplayRawLine::Annotation { - annotation, - source_aligned, - continuation, - } => { - if *source_aligned { - if *continuation { - for _ in 0..lineno_width + 3 { - buffer.append(line_offset, " ", stylesheet.none); - } - } else { - let lineno_color = stylesheet.line_no(); - for _ in 0..lineno_width + 1 { - buffer.append(line_offset, " ", stylesheet.none); - } - buffer.append(line_offset, "=", *lineno_color); - buffer.append(line_offset, " ", *lineno_color); - } - } - self.format_annotation(line_offset, annotation, *continuation, stylesheet, buffer) - } - } - } - - // Adapted from https://github.com/rust-lang/rust/blob/d371d17496f2ce3a56da76aa083f4ef157572c20/compiler/rustc_errors/src/emitter.rs#L706-L1211 - #[expect(clippy::too_many_arguments)] - #[inline] - fn format_line( - &self, - dl: &DisplayLine<'_>, - lineno_width: usize, - multiline_depth: usize, - stylesheet: &Stylesheet, - anonymized_line_numbers: bool, - cut_indicator: &'static str, - buffer: &mut StyledBuffer, - ) -> fmt::Result { - let line_offset = buffer.num_lines(); - match dl { - DisplayLine::Source { - lineno, - inline_marks, - line, - annotations, - } => { - let lineno_color = stylesheet.line_no(); - if anonymized_line_numbers && lineno.is_some() { - let num = format!("{ANONYMIZED_LINE_NUM:>lineno_width$} |"); - buffer.puts(line_offset, 0, &num, *lineno_color); - } else { - match lineno { - Some(n) => { - let num = format!("{n:>lineno_width$} |"); - buffer.puts(line_offset, 0, &num, *lineno_color); - } - None => { - buffer.putc(line_offset, lineno_width + 1, '|', *lineno_color); - } - } - } - if let DisplaySourceLine::Content { text, .. } = line { - // The width of the line number, a space, pipe, and a space - // `123 | ` is `lineno_width + 3`. - let width_offset = lineno_width + 3; - let code_offset = if multiline_depth == 0 { - width_offset - } else { - width_offset + multiline_depth + 1 - }; - - // Add any inline marks to the code line - if !inline_marks.is_empty() || 0 < multiline_depth { - format_inline_marks( - line_offset, - inline_marks, - lineno_width, - stylesheet, - buffer, - )?; - } - - let text = normalize_whitespace(text); - let line_len = text.as_bytes().len(); - let left = self.margin.left(line_len); - let right = self.margin.right(line_len); - - // On long lines, we strip the source line, accounting for unicode. - let mut taken = 0; - let mut was_cut_right = false; - let mut code = String::new(); - for ch in text.chars().skip(left) { - // Make sure that the trimming on the right will fall within the terminal width. - // FIXME: `unicode_width` sometimes disagrees with terminals on how wide a `char` - // is. For now, just accept that sometimes the code line will be longer than - // desired. - let next = char_width(ch).unwrap_or(1); - if taken + next > right - left { - was_cut_right = true; - break; - } - taken += next; - code.push(ch); - } - buffer.puts(line_offset, code_offset, &code, Style::new()); - if self.margin.was_cut_left() { - // We have stripped some code/whitespace from the beginning, make it clear. - buffer.puts(line_offset, code_offset, cut_indicator, *lineno_color); - } - if was_cut_right { - buffer.puts( - line_offset, - code_offset + taken - cut_indicator.width(), - cut_indicator, - *lineno_color, - ); - } - - let left: usize = text - .chars() - .take(left) - .map(|ch| char_width(ch).unwrap_or(1)) - .sum(); - - let mut annotations = annotations.clone(); - annotations.sort_by_key(|a| Reverse(a.range.0)); - - let mut annotations_positions = vec![]; - let mut line_len: usize = 0; - let mut p = 0; - for (i, annotation) in annotations.iter().enumerate() { - for (j, next) in annotations.iter().enumerate() { - // This label overlaps with another one and both take space ( - // they have text and are not multiline lines). - if overlaps(next, annotation, 0) - && annotation.has_label() - && j > i - && p == 0 - // We're currently on the first line, move the label one line down - { - // If we're overlapping with an un-labelled annotation with the same span - // we can just merge them in the output - if next.range.0 == annotation.range.0 - && next.range.1 == annotation.range.1 - && !next.has_label() - { - continue; - } - - // This annotation needs a new line in the output. - p += 1; - break; - } - } - annotations_positions.push((p, annotation)); - for (j, next) in annotations.iter().enumerate() { - if j > i { - let l = next - .annotation - .label - .iter() - .map(|label| label.content) - .collect::>() - .join("") - .len() - + 2; - // Do not allow two labels to be in the same line if they - // overlap including padding, to avoid situations like: - // - // fn foo(x: u32) { - // -------^------ - // | | - // fn_spanx_span - // - // Both labels must have some text, otherwise they are not - // overlapping. Do not add a new line if this annotation or - // the next are vertical line placeholders. If either this - // or the next annotation is multiline start/end, move it - // to a new line so as not to overlap the horizontal lines. - if (overlaps(next, annotation, l) - && annotation.has_label() - && next.has_label()) - || (annotation.takes_space() && next.has_label()) - || (annotation.has_label() && next.takes_space()) - || (annotation.takes_space() && next.takes_space()) - || (overlaps(next, annotation, l) - && next.range.1 <= annotation.range.1 - && next.has_label() - && p == 0) - // Avoid #42595. - { - // This annotation needs a new line in the output. - p += 1; - break; - } - } - } - line_len = max(line_len, p); - } - - if line_len != 0 { - line_len += 1; - } - - if annotations_positions.iter().all(|(_, ann)| { - matches!( - ann.annotation_part, - DisplayAnnotationPart::MultilineStart(_) - ) - }) { - if let Some(max_pos) = - annotations_positions.iter().map(|(pos, _)| *pos).max() - { - // Special case the following, so that we minimize overlapping multiline spans. - // - // 3 │ X0 Y0 Z0 - // │ ┏━━━━━┛ │ │ < We are writing these lines - // │ ┃┌───────┘ │ < by reverting the "depth" of - // │ ┃│┌─────────┘ < their multiline spans. - // 4 │ ┃││ X1 Y1 Z1 - // 5 │ ┃││ X2 Y2 Z2 - // │ ┃│└────╿──│──┘ `Z` label - // │ ┃└─────│──┤ - // │ ┗━━━━━━┥ `Y` is a good letter too - // ╰╴ `X` is a good letter - for (pos, _) in &mut annotations_positions { - *pos = max_pos - *pos; - } - // We know then that we don't need an additional line for the span label, saving us - // one line of vertical space. - line_len = line_len.saturating_sub(1); - } - } - - // This is a special case where we have a multiline - // annotation that is at the start of the line disregarding - // any leading whitespace, and no other multiline - // annotations overlap it. In this case, we want to draw - // - // 2 | fn foo() { - // | _^ - // 3 | | - // 4 | | } - // | |_^ test - // - // we simplify the output to: - // - // 2 | / fn foo() { - // 3 | | - // 4 | | } - // | |_^ test - if multiline_depth == 1 - && annotations_positions.len() == 1 - && annotations_positions - .first() - .map_or(false, |(_, annotation)| { - matches!( - annotation.annotation_part, - DisplayAnnotationPart::MultilineStart(_) - ) && text - .chars() - .take(annotation.range.0) - .all(|c| c.is_whitespace()) - }) - { - let (_, ann) = annotations_positions.remove(0); - let style = get_annotation_style(&ann.annotation_type, stylesheet); - buffer.putc(line_offset, 3 + lineno_width, '/', *style); - } - - // Draw the column separator for any extra lines that were - // created - // - // After this we will have: - // - // 2 | fn foo() { - // | - // | - // | - // 3 | - // 4 | } - // | - if !annotations_positions.is_empty() { - for pos in 0..=line_len { - buffer.putc( - line_offset + pos + 1, - lineno_width + 1, - '|', - stylesheet.line_no, - ); - } - } - - // Write the horizontal lines for multiline annotations - // (only the first and last lines need this). - // - // After this we will have: - // - // 2 | fn foo() { - // | __________ - // | - // | - // 3 | - // 4 | } - // | _ - for &(pos, annotation) in &annotations_positions { - let style = get_annotation_style(&annotation.annotation_type, stylesheet); - let pos = pos + 1; - match annotation.annotation_part { - DisplayAnnotationPart::MultilineStart(depth) - | DisplayAnnotationPart::MultilineEnd(depth) => { - for col in width_offset + depth - ..(code_offset + annotation.range.0).saturating_sub(left) - { - buffer.putc(line_offset + pos, col + 1, '_', *style); - } - } - _ => {} - } - } - - // Write the vertical lines for labels that are on a different line as the underline. - // - // After this we will have: - // - // 2 | fn foo() { - // | __________ - // | | | - // | | - // 3 | | - // 4 | | } - // | |_ - for &(pos, annotation) in &annotations_positions { - let style = get_annotation_style(&annotation.annotation_type, stylesheet); - let pos = pos + 1; - if pos > 1 && (annotation.has_label() || annotation.takes_space()) { - for p in line_offset + 2..=line_offset + pos { - buffer.putc( - p, - (code_offset + annotation.range.0).saturating_sub(left), - '|', - *style, - ); - } - } - match annotation.annotation_part { - DisplayAnnotationPart::MultilineStart(depth) => { - for p in line_offset + pos + 1..line_offset + line_len + 2 { - buffer.putc(p, width_offset + depth, '|', *style); - } - } - DisplayAnnotationPart::MultilineEnd(depth) => { - for p in line_offset..=line_offset + pos { - buffer.putc(p, width_offset + depth, '|', *style); - } - } - _ => {} - } - } - - // Add in any inline marks for any extra lines that have - // been created. Output should look like above. - for inline_mark in inline_marks { - let DisplayMarkType::AnnotationThrough(depth) = inline_mark.mark_type; - let style = get_annotation_style(&inline_mark.annotation_type, stylesheet); - if annotations_positions.is_empty() { - buffer.putc(line_offset, width_offset + depth, '|', *style); - } else { - for p in line_offset..=line_offset + line_len + 1 { - buffer.putc(p, width_offset + depth, '|', *style); - } - } - } - - // Write the labels on the annotations that actually have a label. - // - // After this we will have: - // - // 2 | fn foo() { - // | __________ - // | | - // | something about `foo` - // 3 | - // 4 | } - // | _ test - for &(pos, annotation) in &annotations_positions { - if !is_annotation_empty(&annotation.annotation) { - let style = - get_annotation_style(&annotation.annotation_type, stylesheet); - let mut formatted_len = if let Some(id) = &annotation.annotation.id { - 2 + id.id.len() - + annotation_type_len(&annotation.annotation.annotation_type) - } else { - annotation_type_len(&annotation.annotation.annotation_type) - }; - let (pos, col) = if pos == 0 { - (pos + 1, (annotation.range.1 + 1).saturating_sub(left)) - } else { - (pos + 2, annotation.range.0.saturating_sub(left)) - }; - if annotation.annotation_part - == DisplayAnnotationPart::LabelContinuation - { - formatted_len = 0; - } else if formatted_len != 0 { - formatted_len += 2; - let id = match &annotation.annotation.id { - Some(id) => format!( - "[{id}]", - id = fmt_with_hyperlink(&id.id, id.url, stylesheet) - ), - None => String::new(), - }; - buffer.puts( - line_offset + pos, - col + code_offset, - &format!( - "{}{}: ", - annotation_type_str(&annotation.annotation_type), - id - ), - *style, - ); - } else { - formatted_len = 0; - } - let mut before = 0; - for fragment in &annotation.annotation.label { - let inner_col = before + formatted_len + col + code_offset; - buffer.puts(line_offset + pos, inner_col, fragment.content, *style); - before += fragment.content.len(); - } - } - } - - // Sort from biggest span to smallest span so that smaller spans are - // represented in the output: - // - // x | fn foo() - // | ^^^---^^ - // | | | - // | | something about `foo` - // | something about `fn foo()` - annotations_positions.sort_by_key(|(_, ann)| { - // Decreasing order. When annotations share the same length, prefer `Primary`. - Reverse(ann.len()) - }); - - // Write the underlines. - // - // After this we will have: - // - // 2 | fn foo() { - // | ____-_____^ - // | | - // | something about `foo` - // 3 | - // 4 | } - // | _^ test - for &(_, annotation) in &annotations_positions { - let mark = match annotation.annotation_type { - DisplayAnnotationType::Error => '^', - DisplayAnnotationType::Warning => '-', - DisplayAnnotationType::Info => '-', - DisplayAnnotationType::Note => '-', - DisplayAnnotationType::Help => '-', - DisplayAnnotationType::None => ' ', - }; - let style = get_annotation_style(&annotation.annotation_type, stylesheet); - for p in annotation.range.0..annotation.range.1 { - buffer.putc( - line_offset + 1, - (code_offset + p).saturating_sub(left), - mark, - *style, - ); - } - } - } else if !inline_marks.is_empty() { - format_inline_marks( - line_offset, - inline_marks, - lineno_width, - stylesheet, - buffer, - )?; - } - Ok(()) - } - DisplayLine::Fold { inline_marks } => { - buffer.puts(line_offset, 0, cut_indicator, *stylesheet.line_no()); - if !inline_marks.is_empty() || 0 < multiline_depth { - format_inline_marks( - line_offset, - inline_marks, - lineno_width, - stylesheet, - buffer, - )?; - } - Ok(()) - } - DisplayLine::Raw(line) => self.format_raw_line( - line_offset, - line, - lineno_width, - stylesheet, - anonymized_line_numbers, - buffer, - ), - } - } -} - -/// Inline annotation which can be used in either Raw or Source line. -#[derive(Clone, Debug, PartialEq)] -pub(crate) struct Annotation<'a> { - pub(crate) annotation_type: DisplayAnnotationType, - pub(crate) id: Option>, - pub(crate) label: Vec>, - pub(crate) is_fixable: bool, -} - -/// A single line used in `DisplayList`. -#[derive(Debug, PartialEq)] -pub(crate) enum DisplayLine<'a> { - /// A line with `lineno` portion of the slice. - Source { - lineno: Option, - inline_marks: Vec, - line: DisplaySourceLine<'a>, - annotations: Vec>, - }, - - /// A line indicating a folded part of the slice. - Fold { inline_marks: Vec }, - - /// A line which is displayed outside of slices. - Raw(DisplayRawLine<'a>), -} - -/// A source line. -#[derive(Debug, PartialEq)] -pub(crate) enum DisplaySourceLine<'a> { - /// A line with the content of the Snippet. - Content { - text: &'a str, - range: (usize, usize), // meta information for annotation placement. - end_line: EndLine, - }, - /// An empty source line. - Empty, -} - -#[derive(Clone, Debug, PartialEq)] -pub(crate) struct DisplaySourceAnnotation<'a> { - pub(crate) annotation: Annotation<'a>, - pub(crate) range: (usize, usize), - pub(crate) annotation_type: DisplayAnnotationType, - pub(crate) annotation_part: DisplayAnnotationPart, -} - -impl DisplaySourceAnnotation<'_> { - fn has_label(&self) -> bool { - !self - .annotation - .label - .iter() - .all(|label| label.content.is_empty()) - } - - // Length of this annotation as displayed in the stderr output - fn len(&self) -> usize { - // Account for usize underflows - self.range.1.abs_diff(self.range.0) - } - - fn takes_space(&self) -> bool { - // Multiline annotations always have to keep vertical space. - matches!( - self.annotation_part, - DisplayAnnotationPart::MultilineStart(_) | DisplayAnnotationPart::MultilineEnd(_) - ) - } -} - -#[derive(Debug, PartialEq)] -pub(crate) struct Position { - row: usize, - col: usize, - cell: Option, -} - -/// Raw line - a line which does not have the `lineno` part and is not considered -/// a part of the snippet. -#[derive(Debug, PartialEq)] -pub(crate) enum DisplayRawLine<'a> { - /// A line which provides information about the location of the given - /// slice in the project structure. - Origin { - path: &'a str, - pos: Option, - header_type: DisplayHeaderType, - }, - - /// An annotation line which is not part of any snippet. - Annotation { - annotation: Annotation<'a>, - - /// If set to `true`, the annotation will be aligned to the - /// lineno delimiter of the snippet. - source_aligned: bool, - /// If set to `true`, only the label of the `Annotation` will be - /// displayed. It allows for a multiline annotation to be aligned - /// without displaying the meta information (`type` and `id`) to be - /// displayed on each line. - continuation: bool, - }, -} - -/// An inline text fragment which any label is composed of. -#[derive(Clone, Debug, PartialEq)] -pub(crate) struct DisplayTextFragment<'a> { - pub(crate) content: &'a str, - pub(crate) style: DisplayTextStyle, -} - -/// A style for the `DisplayTextFragment` which can be visually formatted. -/// -/// This information may be used to emphasis parts of the label. -#[derive(Debug, Clone, Copy, PartialEq)] -pub(crate) enum DisplayTextStyle { - Regular, - Emphasis, -} - -/// An indicator of what part of the annotation a given `Annotation` is. -#[derive(Debug, Clone, PartialEq)] -pub(crate) enum DisplayAnnotationPart { - /// A standalone, single-line annotation. - Standalone, - /// A continuation of a multi-line label of an annotation. - LabelContinuation, - /// A line starting a multiline annotation. - MultilineStart(usize), - /// A line ending a multiline annotation. - MultilineEnd(usize), -} - -/// A visual mark used in `inline_marks` field of the `DisplaySourceLine`. -#[derive(Debug, Clone, PartialEq)] -pub(crate) struct DisplayMark { - pub(crate) mark_type: DisplayMarkType, - pub(crate) annotation_type: DisplayAnnotationType, -} - -/// A type of the `DisplayMark`. -#[derive(Debug, Clone, PartialEq)] -pub(crate) enum DisplayMarkType { - /// A mark indicating a multiline annotation going through the current line. - AnnotationThrough(usize), -} - -/// A type of the `Annotation` which may impact the sigils, style or text displayed. -/// -/// There are several ways to uses this information when formatting the `DisplayList`: -/// -/// * An annotation may display the name of the type like `error` or `info`. -/// * An underline for `Error` may be `^^^` while for `Warning` it could be `---`. -/// * `ColorStylesheet` may use different colors for different annotations. -#[derive(Debug, Clone, PartialEq)] -pub(crate) enum DisplayAnnotationType { - None, - Error, - Warning, - Info, - Note, - Help, -} - -impl DisplayAnnotationType { - #[inline] - const fn is_none(&self) -> bool { - matches!(self, Self::None) - } -} - -impl From for DisplayAnnotationType { - fn from(at: snippet::Level) -> Self { - match at { - snippet::Level::None => DisplayAnnotationType::None, - snippet::Level::Error => DisplayAnnotationType::Error, - snippet::Level::Warning => DisplayAnnotationType::Warning, - snippet::Level::Info => DisplayAnnotationType::Info, - snippet::Level::Note => DisplayAnnotationType::Note, - snippet::Level::Help => DisplayAnnotationType::Help, - } - } -} - -/// Information whether the header is the initial one or a consecutive one -/// for multi-slice cases. -// TODO: private -#[derive(Debug, Clone, PartialEq)] -pub(crate) enum DisplayHeaderType { - /// Initial header is the first header in the snippet. - Initial, - - /// Continuation marks all headers of following slices in the snippet. - Continuation, -} - -struct CursorLines<'a>(&'a str); - -impl CursorLines<'_> { - fn new(src: &str) -> CursorLines<'_> { - CursorLines(src) - } -} - -#[derive(Copy, Clone, Debug, PartialEq)] -pub(crate) enum EndLine { - Eof, - Lf, - Crlf, -} - -impl EndLine { - /// The number of characters this line ending occupies in bytes. - pub(crate) fn len(self) -> usize { - match self { - EndLine::Eof => 0, - EndLine::Lf => 1, - EndLine::Crlf => 2, - } - } -} - -impl<'a> Iterator for CursorLines<'a> { - type Item = (&'a str, EndLine); - - fn next(&mut self) -> Option { - if self.0.is_empty() { - None - } else { - self.0 - .find('\n') - .map(|x| { - let ret = if 0 < x { - if self.0.as_bytes()[x - 1] == b'\r' { - (&self.0[..x - 1], EndLine::Crlf) - } else { - (&self.0[..x], EndLine::Lf) - } - } else { - ("", EndLine::Lf) - }; - self.0 = &self.0[x + 1..]; - ret - }) - .or_else(|| { - let ret = Some((self.0, EndLine::Eof)); - self.0 = ""; - ret - }) - } - } -} - -fn format_message<'m>( - message: snippet::Message<'m>, - term_width: usize, - anonymized_line_numbers: bool, - cut_indicator: &'static str, - primary: bool, -) -> Vec> { - let snippet::Message { - level, - id, - title, - footer, - snippets, - is_fixable, - lineno_offset: _, - } = message; - - let mut sets = vec![]; - let body = if !snippets.is_empty() || primary { - vec![format_title(level, id, title, is_fixable)] - } else { - format_footer(level, id, title) - }; - - for (idx, snippet) in snippets.into_iter().enumerate() { - let snippet = fold_prefix_suffix(snippet); - sets.push(format_snippet( - snippet, - idx == 0, - !footer.is_empty(), - term_width, - anonymized_line_numbers, - cut_indicator, - )); - } - - if let Some(first) = sets.first_mut() { - for line in body { - first.display_lines.insert(0, line); - } - } else { - sets.push(DisplaySet { - display_lines: body, - margin: Margin::new(0, 0, 0, 0, DEFAULT_TERM_WIDTH, 0), - }); - } - - for annotation in footer { - sets.extend(format_message( - annotation, - term_width, - anonymized_line_numbers, - cut_indicator, - false, - )); - } - - sets -} - -fn format_title<'a>( - level: crate::Level, - id: Option>, - label: &'a str, - is_fixable: bool, -) -> DisplayLine<'a> { - DisplayLine::Raw(DisplayRawLine::Annotation { - annotation: Annotation { - annotation_type: DisplayAnnotationType::from(level), - id, - label: format_label(Some(label), Some(DisplayTextStyle::Emphasis)), - is_fixable, - }, - source_aligned: false, - continuation: false, - }) -} - -fn format_footer<'a>( - level: crate::Level, - id: Option>, - label: &'a str, -) -> Vec> { - let mut result = vec![]; - for (i, line) in label.lines().enumerate() { - result.push(DisplayLine::Raw(DisplayRawLine::Annotation { - annotation: Annotation { - annotation_type: DisplayAnnotationType::from(level), - id, - label: format_label(Some(line), None), - is_fixable: false, - }, - source_aligned: true, - continuation: i != 0, - })); - } - result -} - -fn format_label( - label: Option<&str>, - style: Option, -) -> Vec> { - let mut result = vec![]; - if let Some(label) = label { - let element_style = style.unwrap_or(DisplayTextStyle::Regular); - result.push(DisplayTextFragment { - content: label, - style: element_style, - }); - } - result -} - -fn format_snippet<'m>( - snippet: snippet::Snippet<'m>, - is_first: bool, - has_footer: bool, - term_width: usize, - anonymized_line_numbers: bool, - cut_indicator: &'static str, -) -> DisplaySet<'m> { - let main_range = snippet.annotations.first().map(|x| x.range.start); - let origin = snippet.origin; - let need_empty_header = origin.is_some() || is_first; - - let is_file_level = snippet.annotations.iter().any(|ann| ann.is_file_level); - if is_file_level { - // TODO(brent) enable this assertion again once we set `is_file_level` for individual rules. - // It's causing too many false positives currently when the default is to make any - // annotation with a default range file-level. See - // https://github.com/astral-sh/ruff/issues/19688. - // - // assert!( - // snippet.source.is_empty(), - // "Non-empty file-level snippet that won't be rendered: {:?}", - // snippet.source - // ); - let header = format_header(origin, main_range, &[], is_first, snippet.cell_index); - return DisplaySet { - display_lines: header.map_or_else(Vec::new, |header| vec![header]), - margin: Margin::new(0, 0, 0, 0, term_width, 0), - }; - } - - let cell_index = snippet.cell_index; - - let mut body = format_body( - snippet, - need_empty_header, - has_footer, - term_width, - anonymized_line_numbers, - cut_indicator, - ); - let header = format_header( - origin, - main_range, - &body.display_lines, - is_first, - cell_index, - ); - - if let Some(header) = header { - body.display_lines.insert(0, header); - } - - body -} - -fn format_header<'a>( - origin: Option<&'a str>, - main_range: Option, - body: &[DisplayLine<'_>], - is_first: bool, - cell_index: Option, -) -> Option> { - let display_header = if is_first { - DisplayHeaderType::Initial - } else { - DisplayHeaderType::Continuation - }; - - if let Some((main_range, path)) = main_range.zip(origin) { - let mut col = 1; - let mut line_offset = 1; - - for item in body { - if let DisplayLine::Source { - line: - DisplaySourceLine::Content { - text, - range, - end_line, - }, - lineno, - .. - } = item - { - // At the very end of the `main_range`, report the location as the first character - // in the next line instead of falling back to the default location of `1:1`. This - // is another divergence from upstream. - let end_of_range = range.1 + max(*end_line as usize, 1); - if main_range >= range.0 && main_range < end_of_range { - let char_column = text[0..(main_range - range.0).min(text.len())] - .chars() - .count(); - col = char_column + 1; - line_offset = lineno.unwrap_or(1); - break; - } else if main_range == end_of_range { - line_offset = lineno.map_or(1, |line| line + 1); - break; - } - } - } - - return Some(DisplayLine::Raw(DisplayRawLine::Origin { - path, - pos: Some(Position { - row: line_offset, - col, - cell: cell_index, - }), - header_type: display_header, - })); - } - - if let Some(path) = origin { - return Some(DisplayLine::Raw(DisplayRawLine::Origin { - path, - pos: None, - header_type: display_header, - })); - } - - None -} - -fn fold_prefix_suffix(mut snippet: snippet::Snippet<'_>) -> snippet::Snippet<'_> { - if !snippet.fold { - return snippet; - } - - let ann_start = snippet - .annotations - .iter() - .map(|ann| ann.range.start) - .min() - .unwrap_or(0); - if let Some(before_new_start) = snippet.source[0..ann_start].rfind('\n') { - let new_start = before_new_start + 1; - - let line_offset = newline_count(&snippet.source[..new_start]); - snippet.line_start += line_offset; - - snippet.source = &snippet.source[new_start..]; - - for ann in &mut snippet.annotations { - let range_start = ann.range.start - new_start; - let range_end = ann.range.end - new_start; - ann.range = range_start..range_end; - } - } - - let ann_end = snippet - .annotations - .iter() - .map(|ann| ann.range.end) - .max() - .unwrap_or(snippet.source.len()); - if let Some(end_offset) = snippet.source[ann_end..].find('\n') { - let new_end = ann_end + end_offset; - snippet.source = &snippet.source[..new_end]; - } - - snippet -} - -fn newline_count(body: &str) -> usize { - memchr::memchr_iter(b'\n', body.as_bytes()).count() -} - -fn fold_body(body: Vec>) -> Vec> { - const INNER_CONTEXT: usize = 1; - const INNER_UNFOLD_SIZE: usize = INNER_CONTEXT * 2 + 1; - - let mut lines = vec![]; - let mut unhighlighted_lines = vec![]; - for line in body { - match &line { - DisplayLine::Source { annotations, .. } => { - if annotations.is_empty() { - unhighlighted_lines.push(line); - } else { - if lines.is_empty() { - // Ignore leading unhighlighted lines - unhighlighted_lines.clear(); - } - match unhighlighted_lines.len() { - 0 => {} - n if n <= INNER_UNFOLD_SIZE => { - // Rather than render our cut indicator, don't fold - lines.append(&mut unhighlighted_lines); - } - _ => { - lines.extend(unhighlighted_lines.drain(..INNER_CONTEXT)); - let inline_marks = lines - .last() - .and_then(|line| { - if let DisplayLine::Source { inline_marks, .. } = line { - let inline_marks = inline_marks.clone(); - Some(inline_marks) - } else { - None - } - }) - .unwrap_or_default(); - lines.push(DisplayLine::Fold { - inline_marks: inline_marks.clone(), - }); - unhighlighted_lines - .drain(..unhighlighted_lines.len().saturating_sub(INNER_CONTEXT)); - lines.append(&mut unhighlighted_lines); - } - } - lines.push(line); - } - } - _ => { - unhighlighted_lines.push(line); - } - } - } - - lines -} - -fn format_body<'m>( - snippet: snippet::Snippet<'m>, - need_empty_header: bool, - has_footer: bool, - term_width: usize, - anonymized_line_numbers: bool, - cut_indicator: &'static str, -) -> DisplaySet<'m> { - let source_len = snippet.source.len(); - if let Some(bigger) = snippet.annotations.iter().find_map(|x| { - // Allow highlighting one past the last character in the source. - if source_len + 1 < x.range.end { - Some(&x.range) - } else { - None - } - }) { - panic!("SourceAnnotation range `{bigger:?}` is beyond the end of buffer `{source_len}`") - } - - let mut body = vec![]; - let mut current_line = snippet.line_start; - let mut current_index = 0; - - let mut whitespace_margin = usize::MAX; - let mut span_left_margin = usize::MAX; - let mut span_right_margin = 0; - let mut label_right_margin = 0; - let mut max_line_len = 0; - - let mut depth_map: HashMap = HashMap::new(); - let mut current_depth = 0; - let mut annotations = snippet.annotations; - let ranges = annotations - .iter() - .map(|a| a.range.clone()) - .collect::>(); - // We want to merge multiline annotations that have the same range into one - // multiline annotation to save space. This is done by making any duplicate - // multiline annotations into a single-line annotation pointing at the end - // of the range. - // - // 3 | X0 Y0 Z0 - // | _____^ - // | | ____| - // | || ___| - // | ||| - // 4 | ||| X1 Y1 Z1 - // 5 | ||| X2 Y2 Z2 - // | ||| ^ - // | |||____| - // | ||____`X` is a good letter - // | |____`Y` is a good letter too - // | `Z` label - // Should be - // error: foo - // --> test.rs:3:3 - // | - // 3 | / X0 Y0 Z0 - // 4 | | X1 Y1 Z1 - // 5 | | X2 Y2 Z2 - // | | ^ - // | |____| - // | `X` is a good letter - // | `Y` is a good letter too - // | `Z` label - // | - ranges.iter().enumerate().for_each(|(r_idx, range)| { - annotations - .iter_mut() - .enumerate() - .skip(r_idx + 1) - .for_each(|(ann_idx, ann)| { - // Skip if the annotation's index matches the range index - if ann_idx != r_idx - // We only want to merge multiline annotations - && snippet.source[ann.range.clone()].lines().count() > 1 - // We only want to merge annotations that have the same range - && ann.range.start == range.start - && ann.range.end == range.end - { - ann.range.start = ann.range.end.saturating_sub(1); - } - }); - }); - annotations.sort_by_key(|a| a.range.start); - let mut annotations = annotations.into_iter().enumerate().collect::>(); - - for (idx, (line, end_line)) in CursorLines::new(snippet.source).enumerate() { - let line_length: usize = line.len(); - let line_range = (current_index, current_index + line_length); - let end_line_size = end_line.len(); - - body.push(DisplayLine::Source { - lineno: Some(current_line), - inline_marks: vec![], - line: DisplaySourceLine::Content { - text: line, - range: line_range, - end_line, - }, - annotations: vec![], - }); - - let leading_whitespace = line - .chars() - .take_while(|c| c.is_whitespace()) - .map(|c| { - match c { - // Tabs are displayed as 4 spaces - '\t' => 4, - _ => 1, - } - }) - .sum(); - whitespace_margin = min(whitespace_margin, leading_whitespace); - max_line_len = max(max_line_len, line_length); - - let line_start_index = line_range.0; - let line_end_index = line_range.1; - current_line += 1; - current_index += line_length + end_line_size; - - // It would be nice to use filter_drain here once it's stable. - annotations.retain(|(key, annotation)| { - let body_idx = idx; - let annotation_type = match annotation.level { - snippet::Level::Error => DisplayAnnotationType::None, - snippet::Level::Warning => DisplayAnnotationType::None, - _ => DisplayAnnotationType::from(annotation.level), - }; - let label_right = annotation.label.map_or(0, |label| label.len() + 1); - match annotation.range { - // This handles if the annotation is on the next line. We add - // the `end_line_size` to account for annotating the line end. - Range { start, .. } if start > line_end_index + end_line_size => true, - // This handles the case where an annotation is contained - // within the current line including any line-end characters. - Range { start, end } - if start >= line_start_index - // We add at least one to `line_end_index` to allow - // highlighting the end of a file - && end <= line_end_index + max(end_line_size, 1) => - { - if let DisplayLine::Source { - ref mut annotations, - .. - } = body[body_idx] - { - let annotation_start_col = line - [0..(start - line_start_index).min(line_length)] - .chars() - .map(|c| char_width(c).unwrap_or(0)) - .sum::(); - let mut annotation_end_col = line - [0..(end - line_start_index).min(line_length)] - .chars() - .map(|c| char_width(c).unwrap_or(0)) - .sum::(); - if annotation_start_col == annotation_end_col { - // At least highlight something - annotation_end_col += 1; - } - - span_left_margin = min(span_left_margin, annotation_start_col); - span_right_margin = max(span_right_margin, annotation_end_col); - label_right_margin = - max(label_right_margin, annotation_end_col + label_right); - - let range = (annotation_start_col, annotation_end_col); - annotations.push(DisplaySourceAnnotation { - annotation: Annotation { - annotation_type, - id: None, - label: format_label(annotation.label, None), - is_fixable: false, - }, - range, - annotation_type: DisplayAnnotationType::from(annotation.level), - annotation_part: DisplayAnnotationPart::Standalone, - }); - } - false - } - // This handles the case where a multiline annotation starts - // somewhere on the current line, including any line-end chars - Range { start, end } - if start >= line_start_index - // The annotation can start on a line ending - && start <= line_end_index + end_line_size.saturating_sub(1) - && end > line_end_index => - { - if let DisplayLine::Source { - ref mut annotations, - .. - } = body[body_idx] - { - let annotation_start_col = line - [0..(start - line_start_index).min(line_length)] - .chars() - .map(|c| char_width(c).unwrap_or(0)) - .sum::(); - let annotation_end_col = annotation_start_col + 1; - - span_left_margin = min(span_left_margin, annotation_start_col); - span_right_margin = max(span_right_margin, annotation_end_col); - label_right_margin = - max(label_right_margin, annotation_end_col + label_right); - - let range = (annotation_start_col, annotation_end_col); - annotations.push(DisplaySourceAnnotation { - annotation: Annotation { - annotation_type, - id: None, - label: vec![], - is_fixable: false, - }, - range, - annotation_type: DisplayAnnotationType::from(annotation.level), - annotation_part: DisplayAnnotationPart::MultilineStart(current_depth), - }); - depth_map.insert(*key, current_depth); - current_depth += 1; - } - true - } - // This handles the case where a multiline annotation starts - // somewhere before this line and ends after it as well - Range { start, end } - if start < line_start_index && end > line_end_index + max(end_line_size, 1) => - { - if let DisplayLine::Source { - ref mut inline_marks, - .. - } = body[body_idx] - { - let depth = depth_map.get(key).cloned().unwrap_or_default(); - inline_marks.push(DisplayMark { - mark_type: DisplayMarkType::AnnotationThrough(depth), - annotation_type: DisplayAnnotationType::from(annotation.level), - }); - } - true - } - // This handles the case where a multiline annotation ends - // somewhere on the current line, including any line-end chars - Range { start, end } - if start < line_start_index - && end >= line_start_index - // We add at least one to `line_end_index` to allow - // highlighting the end of a file - && end <= line_end_index + max(end_line_size, 1) => - { - if let DisplayLine::Source { - ref mut annotations, - .. - } = body[body_idx] - { - let end_mark = line[0..(end - line_start_index).min(line_length)] - .chars() - .map(|c| char_width(c).unwrap_or(0)) - .sum::() - .saturating_sub(1); - // If the annotation ends on a line-end character, we - // need to annotate one past the end of the line - let (end_mark, end_plus_one) = if end > line_end_index - // Special case for highlighting the end of a file - || (end == line_end_index + 1 && end_line_size == 0) - { - (end_mark + 1, end_mark + 2) - } else { - (end_mark, end_mark + 1) - }; - - span_left_margin = min(span_left_margin, end_mark); - span_right_margin = max(span_right_margin, end_plus_one); - label_right_margin = max(label_right_margin, end_plus_one + label_right); - - let range = (end_mark, end_plus_one); - let depth = depth_map.remove(key).unwrap_or(0); - annotations.push(DisplaySourceAnnotation { - annotation: Annotation { - annotation_type, - id: None, - - label: format_label(annotation.label, None), - is_fixable: false, - }, - range, - annotation_type: DisplayAnnotationType::from(annotation.level), - annotation_part: DisplayAnnotationPart::MultilineEnd(depth), - }); - } - false - } - _ => true, - } - }); - // Reset the depth counter, but only after we've processed all - // annotations for a given line. - let max = depth_map.len(); - if current_depth > max { - current_depth = max; - } - } - - if snippet.fold { - body = fold_body(body); - } - - if need_empty_header { - body.insert( - 0, - DisplayLine::Source { - lineno: None, - inline_marks: vec![], - line: DisplaySourceLine::Empty, - annotations: vec![], - }, - ); - } - - if has_footer { - body.push(DisplayLine::Source { - lineno: None, - inline_marks: vec![], - line: DisplaySourceLine::Empty, - annotations: vec![], - }); - } else if let Some(DisplayLine::Source { .. }) = body.last() { - body.push(DisplayLine::Source { - lineno: None, - inline_marks: vec![], - line: DisplaySourceLine::Empty, - annotations: vec![], - }); - } - let max_line_num_len = if anonymized_line_numbers { - ANONYMIZED_LINE_NUM.len() - } else { - current_line.to_string().len() - }; - - let width_offset = cut_indicator.len() + max_line_num_len; - - if span_left_margin == usize::MAX { - span_left_margin = 0; - } - - let margin = Margin::new( - whitespace_margin, - span_left_margin, - span_right_margin, - label_right_margin, - term_width.saturating_sub(width_offset), - max_line_len, - ); - - DisplaySet { - display_lines: body, - margin, - } -} - -#[inline] -fn annotation_type_str(annotation_type: &DisplayAnnotationType) -> &'static str { - match annotation_type { - DisplayAnnotationType::Error => ERROR_TXT, - DisplayAnnotationType::Help => HELP_TXT, - DisplayAnnotationType::Info => INFO_TXT, - DisplayAnnotationType::Note => NOTE_TXT, - DisplayAnnotationType::Warning => WARNING_TXT, - DisplayAnnotationType::None => "", - } -} - -fn annotation_type_len(annotation_type: &DisplayAnnotationType) -> usize { - match annotation_type { - DisplayAnnotationType::Error => ERROR_TXT.len(), - DisplayAnnotationType::Help => HELP_TXT.len(), - DisplayAnnotationType::Info => INFO_TXT.len(), - DisplayAnnotationType::Note => NOTE_TXT.len(), - DisplayAnnotationType::Warning => WARNING_TXT.len(), - DisplayAnnotationType::None => 0, - } -} - -fn get_annotation_style<'a>( - annotation_type: &DisplayAnnotationType, - stylesheet: &'a Stylesheet, -) -> &'a Style { - match annotation_type { - DisplayAnnotationType::Error => stylesheet.error(), - DisplayAnnotationType::Warning => stylesheet.warning(), - DisplayAnnotationType::Info => stylesheet.info(), - DisplayAnnotationType::Note => stylesheet.note(), - DisplayAnnotationType::Help => stylesheet.help(), - DisplayAnnotationType::None => stylesheet.none(), - } -} - -#[inline] -fn is_annotation_empty(annotation: &Annotation<'_>) -> bool { - annotation - .label - .iter() - .all(|fragment| fragment.content.is_empty()) -} - -// We replace some characters so the CLI output is always consistent and underlines aligned. -const OUTPUT_REPLACEMENTS: &[(char, &str)] = &[ - ('\t', " "), // We do our own tab replacement - ('\u{200D}', ""), // Replace ZWJ with nothing for consistent terminal output of grapheme clusters. - ('\u{202A}', ""), // The following unicode text flow control characters are inconsistently - ('\u{202B}', ""), // supported across CLIs and can cause confusion due to the bytes on disk - ('\u{202D}', ""), // not corresponding to the visible source code, so we replace them always. - ('\u{202E}', ""), - ('\u{2066}', ""), - ('\u{2067}', ""), - ('\u{2068}', ""), - ('\u{202C}', ""), - ('\u{2069}', ""), -]; - -fn normalize_whitespace(str: &str) -> Cow<'_, str> { - // This is an optimization to avoid repeated `str::replace` calls in the typical case of no - // valid replacements. Note that this list needs to be kept in sync with `OUTPUT_REPLACEMENTS`. - if !str.contains([ - '\t', '\u{200d}', '\u{202a}', '\u{202b}', '\u{202d}', '\u{202e}', '\u{2066}', '\u{2067}', - '\u{2068}', '\u{202c}', '\u{2069}', - ]) { - return Cow::Borrowed(str); - } - - let mut s = str.to_owned(); - for (c, replacement) in OUTPUT_REPLACEMENTS { - s = s.replace(*c, replacement); - } - Cow::Owned(s) -} - -fn overlaps( - a1: &DisplaySourceAnnotation<'_>, - a2: &DisplaySourceAnnotation<'_>, - padding: usize, -) -> bool { - (a2.range.0..a2.range.1).contains(&a1.range.0) - || (a1.range.0..a1.range.1 + padding).contains(&a2.range.0) -} - -fn format_inline_marks( - line: usize, - inline_marks: &[DisplayMark], - lineno_width: usize, - stylesheet: &Stylesheet, - buf: &mut StyledBuffer, -) -> fmt::Result { - for mark in inline_marks.iter() { - let annotation_style = get_annotation_style(&mark.annotation_type, stylesheet); - match mark.mark_type { - DisplayMarkType::AnnotationThrough(depth) => { - buf.putc(line, 3 + lineno_width + depth, '|', *annotation_style); - } - } - } - Ok(()) -} - -fn char_width(c: char) -> Option { - if c == '\t' { - Some(4) - } else { - unicode_width::UnicodeWidthChar::width(c) - } -} - -pub(super) fn fmt_with_hyperlink<'a, T>( - content: T, - url: Option<&'a str>, - stylesheet: &Stylesheet, -) -> impl std::fmt::Display + 'a -where - T: std::fmt::Display + 'a, -{ - let url = if stylesheet.hyperlink { url } else { None }; - - fmt::from_fn(move |f| { - if let Some(url) = url { - write!(f, "\x1B]8;;{url}\x1B\\")?; - } - - content.fmt(f)?; - - if url.is_some() { - f.write_str("\x1B]8;;\x1B\\")?; - } - - Ok(()) - }) -} diff --git a/crates/ruff_annotate_snippets/src/renderer/margin.rs b/crates/ruff_annotate_snippets/src/renderer/margin.rs index 40e94e504887ba..32503f99e5fc26 100644 --- a/crates/ruff_annotate_snippets/src/renderer/margin.rs +++ b/crates/ruff_annotate_snippets/src/renderer/margin.rs @@ -1,4 +1,4 @@ -use std::cmp::{max, min}; +use core::cmp::{max, min}; const ELLIPSIS_PASSING: usize = 6; const LONG_WHITESPACE: usize = 20; @@ -17,7 +17,7 @@ pub(crate) struct Margin { /// The end of the line to be displayed. computed_right: usize, /// The current width of the terminal. 140 by default and in tests. - term_width: usize, + pub(crate) term_width: usize, /// The end column of a span label, including the span. Doesn't account for labels not in the /// same line as the span. label_right: usize, @@ -41,15 +41,9 @@ impl Margin { // | ^^^^^^^^^ // ``` - let whitespace_left = whitespace_left.saturating_sub(ELLIPSIS_PASSING); - let span_left = span_left.saturating_sub(ELLIPSIS_PASSING); - let mut m = Margin { - // When an annotation points at leading whitespace (e.g. an indentation error), - // `whitespace_left` can exceed `span_left`. Clamp it so that trimming whitespace - // never hides the leftmost annotation. - whitespace_left: min(whitespace_left, span_left), - span_left, + whitespace_left: whitespace_left.saturating_sub(ELLIPSIS_PASSING), + span_left: span_left.saturating_sub(ELLIPSIS_PASSING), span_right: span_right + ELLIPSIS_PASSING, computed_left: 0, computed_right: 0, @@ -77,7 +71,12 @@ impl Margin { if self.computed_right - self.computed_left > self.term_width { // Trimming only whitespace isn't enough, let's get craftier. - if self.label_right - self.whitespace_left <= self.term_width { + if self.label_right.saturating_sub(self.whitespace_left) <= self.term_width + // Trimming whitespace when the right-most label is somewhrere + // within it would result in the label pointing to the wrong + // place + && self.label_right >= self.whitespace_left + { // Attempt to fit the code window only trimming whitespace. self.computed_left = self.whitespace_left; self.computed_right = self.computed_left + self.term_width; diff --git a/crates/ruff_annotate_snippets/src/renderer/mod.rs b/crates/ruff_annotate_snippets/src/renderer/mod.rs index a48af545b64cff..2a2a3c2677ff86 100644 --- a/crates/ruff_annotate_snippets/src/renderer/mod.rs +++ b/crates/ruff_annotate_snippets/src/renderer/mod.rs @@ -1,37 +1,116 @@ -//! The renderer for [`Message`]s +//! The [Renderer] and its settings //! //! # Example +//! //! ``` -//! use ruff_annotate_snippets::{Renderer, Snippet, Level}; -//! let snippet = Level::Error.title("mismatched types") -//! .snippet(Snippet::source("Foo").line_start(51).origin("src/format.rs")) -//! .snippet(Snippet::source("Faa").line_start(129).origin("src/display.rs")); +//! # use annotate_snippets::*; +//! # use annotate_snippets::renderer::*; +//! # use annotate_snippets::Level; +//! let report = // ... +//! # &[Group::with_title( +//! # Level::ERROR +//! # .primary_title("unresolved import `baz::zed`") +//! # .id("E0432") +//! # )]; //! -//! let renderer = Renderer::styled(); -//! println!("{}", renderer.render(snippet)); +//! let renderer = Renderer::styled().decor_style(DecorStyle::Unicode); +//! let output = renderer.render(report); +//! anstream::println!("{output}"); //! ``` -mod display_list; +pub(crate) mod render; +pub(crate) mod source_map; +pub(crate) mod stylesheet; + mod margin; mod styled_buffer; -pub(crate) mod stylesheet; -use crate::snippet::Message; +use alloc::string::String; + +use crate::Report; + +pub(crate) use render::ElementStyle; +pub(crate) use render::UnderlineParts; +pub(crate) use render::normalize_whitespace; +pub(crate) use render::{LineAnnotation, LineAnnotationType, char_width, num_overlap}; +pub(crate) use stylesheet::Stylesheet; + pub use anstyle::*; -use display_list::DisplayList; -use margin::Margin; -use std::fmt::Display; -use stylesheet::Stylesheet; +/// See [`Renderer::term_width`] pub const DEFAULT_TERM_WIDTH: usize = 140; -/// A renderer for [`Message`]s +const USE_WINDOWS_COLORS: bool = cfg!(windows) && !cfg!(feature = "testing-colors"); +const BRIGHT_BLUE: Style = if USE_WINDOWS_COLORS { + AnsiColor::BrightCyan.on_default() +} else { + AnsiColor::BrightBlue.on_default() +}; +/// [`Renderer::error`] applied by [`Renderer::styled`] +pub const DEFAULT_ERROR_STYLE: Style = AnsiColor::BrightRed.on_default().effects(Effects::BOLD); +/// [`Renderer::warning`] applied by [`Renderer::styled`] +pub const DEFAULT_WARNING_STYLE: Style = if USE_WINDOWS_COLORS { + AnsiColor::BrightYellow.on_default() +} else { + AnsiColor::Yellow.on_default() +} +.effects(Effects::BOLD); +/// [`Renderer::info`] applied by [`Renderer::styled`] +pub const DEFAULT_INFO_STYLE: Style = BRIGHT_BLUE.effects(Effects::BOLD); +/// [`Renderer::note`] applied by [`Renderer::styled`] +pub const DEFAULT_NOTE_STYLE: Style = AnsiColor::BrightGreen.on_default().effects(Effects::BOLD); +/// [`Renderer::help`] applied by [`Renderer::styled`] +pub const DEFAULT_HELP_STYLE: Style = AnsiColor::BrightCyan.on_default().effects(Effects::BOLD); +/// [`Renderer::line_num`] applied by [`Renderer::styled`] +pub const DEFAULT_LINE_NUM_STYLE: Style = BRIGHT_BLUE.effects(Effects::BOLD); +/// [`Renderer::emphasis`] applied by [`Renderer::styled`] +pub const DEFAULT_EMPHASIS_STYLE: Style = if USE_WINDOWS_COLORS { + AnsiColor::BrightWhite.on_default() +} else { + Style::new() +} +.effects(Effects::BOLD); +/// [`Renderer::none`] applied by [`Renderer::styled`] +pub const DEFAULT_NONE_STYLE: Style = Style::new(); +/// [`Renderer::context`] applied by [`Renderer::styled`] +pub const DEFAULT_CONTEXT_STYLE: Style = BRIGHT_BLUE.effects(Effects::BOLD); +/// [`Renderer::addition`] applied by [`Renderer::styled`] +pub const DEFAULT_ADDITION_STYLE: Style = AnsiColor::BrightGreen.on_default(); +/// [`Renderer::removal`] applied by [`Renderer::styled`] +pub const DEFAULT_REMOVAL_STYLE: Style = AnsiColor::BrightRed.on_default(); + +/// The [Renderer] for a [`Report`] +/// +/// The caller is expected to detect any relevant terminal features and configure the renderer, +/// including +/// - ANSI Escape code support (always outputted with [`Renderer::styled`]) +/// - Terminal width ([`Renderer::term_width`]) +/// - Unicode support ([`Renderer::decor_style`]) +/// +/// # Example +/// +/// ``` +/// # use annotate_snippets::*; +/// # use annotate_snippets::renderer::*; +/// # use annotate_snippets::Level; +/// let report = // ... +/// # &[Group::with_title( +/// # Level::ERROR +/// # .primary_title("unresolved import `baz::zed`") +/// # .id("E0432") +/// # )]; +/// +/// let renderer = Renderer::styled(); +/// let output = renderer.render(report); +/// anstream::println!("{output}"); +/// ``` #[derive(Clone, Debug)] pub struct Renderer { anonymized_line_numbers: bool, term_width: usize, + decor_style: DecorStyle, stylesheet: Stylesheet, - cut_indicator: &'static str, + short_message: bool, } impl Renderer { @@ -40,57 +119,68 @@ impl Renderer { Self { anonymized_line_numbers: false, term_width: DEFAULT_TERM_WIDTH, + decor_style: DecorStyle::Ascii, stylesheet: Stylesheet::plain(), - cut_indicator: "...", + short_message: false, } } /// Default terminal styling /// + /// If ANSI escape codes are not supported, either + /// - Call [`Renderer::plain`] instead + /// - Strip them after the fact, like with [`anstream`](https://docs.rs/anstream/latest/anstream/) + /// /// # Note + /// /// When testing styled terminal output, see the [`testing-colors` feature](crate#features) pub const fn styled() -> Self { - const USE_WINDOWS_COLORS: bool = cfg!(windows) && !cfg!(feature = "testing-colors"); - const BRIGHT_BLUE: Style = if USE_WINDOWS_COLORS { - AnsiColor::BrightCyan.on_default() - } else { - AnsiColor::BrightBlue.on_default() - }; Self { stylesheet: Stylesheet { - error: AnsiColor::BrightRed.on_default().effects(Effects::BOLD), - warning: if USE_WINDOWS_COLORS { - AnsiColor::BrightYellow.on_default() - } else { - AnsiColor::Yellow.on_default() - } - .effects(Effects::BOLD), - info: BRIGHT_BLUE.effects(Effects::BOLD), - note: AnsiColor::BrightGreen.on_default().effects(Effects::BOLD), - help: AnsiColor::BrightCyan.on_default().effects(Effects::BOLD), - line_no: BRIGHT_BLUE.effects(Effects::BOLD), - emphasis: if USE_WINDOWS_COLORS { - AnsiColor::BrightWhite.on_default() - } else { - Style::new() - } - .effects(Effects::BOLD), - none: Style::new(), - hyperlink: true, + error: DEFAULT_ERROR_STYLE, + warning: DEFAULT_WARNING_STYLE, + info: DEFAULT_INFO_STYLE, + note: DEFAULT_NOTE_STYLE, + help: DEFAULT_HELP_STYLE, + line_num: DEFAULT_LINE_NUM_STYLE, + emphasis: DEFAULT_EMPHASIS_STYLE, + none: DEFAULT_NONE_STYLE, + context: DEFAULT_CONTEXT_STYLE, + addition: DEFAULT_ADDITION_STYLE, + removal: DEFAULT_REMOVAL_STYLE, }, ..Self::plain() } } + /// Abbreviate the message + pub const fn short_message(mut self, short_message: bool) -> Self { + self.short_message = short_message; + self + } + + /// Set the width to render within + /// + /// Affects the rendering of [`Snippet`][crate::Snippet]s + pub const fn term_width(mut self, term_width: usize) -> Self { + self.term_width = term_width; + self + } + + /// Set the character set used for rendering decor + pub const fn decor_style(mut self, decor_style: DecorStyle) -> Self { + self.decor_style = decor_style; + self + } + /// Anonymize line numbers /// - /// This enables (or disables) line number anonymization. When enabled, line numbers are replaced - /// with `LL`. + /// When enabled, line numbers are replaced with `LL` which is useful for tests. /// /// # Example /// /// ```text - /// --> $DIR/whitespace-trimming.rs:LL:193 + /// --> $DIR/whitespace-trimming.rs:4:193 /// | /// LL | ... let _: () = 42; /// | ^^ expected (), found integer @@ -100,82 +190,239 @@ impl Renderer { self.anonymized_line_numbers = anonymized_line_numbers; self } +} - /// Set the terminal width - pub const fn term_width(mut self, term_width: usize) -> Self { - self.term_width = term_width; - self +impl Renderer { + /// Render a diagnostic [`Report`] + pub fn render(&self, groups: Report<'_>) -> String { + render::render(self, groups) } +} - /// Set the output style for `error` +/// Customize [`Renderer::styled`] +impl Renderer { + /// Override the output style for [error][crate::Level::ERROR] pub const fn error(mut self, style: Style) -> Self { self.stylesheet.error = style; self } - /// Set the output style for `warning` + /// Override the output style for [warnings][crate::Level::WARNING] pub const fn warning(mut self, style: Style) -> Self { self.stylesheet.warning = style; self } - /// Set the output style for `info` + /// Override the output style for [info][crate::Level::INFO] pub const fn info(mut self, style: Style) -> Self { self.stylesheet.info = style; self } - /// Set the output style for `note` + /// Override the output style for [notes][crate::Level::NOTE] pub const fn note(mut self, style: Style) -> Self { self.stylesheet.note = style; self } - /// Set the output style for `help` + /// Override the output style for [help][crate::Level::HELP] pub const fn help(mut self, style: Style) -> Self { self.stylesheet.help = style; self } - /// Set the output style for line numbers - pub const fn line_no(mut self, style: Style) -> Self { - self.stylesheet.line_no = style; + /// Override the output style for line numbers in the [`Snippet`][crate::Snippet] gutter + pub const fn line_num(mut self, style: Style) -> Self { + self.stylesheet.line_num = style; self } - /// Set the output style for emphasis + /// Override the output style for emphasis for the + /// [`primary_title`][crate::Level::primary_title] pub const fn emphasis(mut self, style: Style) -> Self { self.stylesheet.emphasis = style; self } - /// Set the output style for none - pub const fn none(mut self, style: Style) -> Self { - self.stylesheet.none = style; + /// Override the output style for [`AnnotationKind::Context`][crate::AnnotationKind::Context] + pub const fn context(mut self, style: Style) -> Self { + self.stylesheet.context = style; self } - pub const fn hyperlink(mut self, hyperlink: bool) -> Self { - self.stylesheet.hyperlink = hyperlink; + /// Override the output style for [`Patch`][crate::Patch] additions + pub const fn addition(mut self, style: Style) -> Self { + self.stylesheet.addition = style; self } - /// Set the string used for when a long line is cut. - /// - /// The default is `...` (three `U+002E` characters). - pub const fn cut_indicator(mut self, string: &'static str) -> Self { - self.cut_indicator = string; + /// Override the output style for [`Patch`][crate::Patch] removals + pub const fn removal(mut self, style: Style) -> Self { + self.stylesheet.removal = style; + self + } + + /// Override the output style for all other text + pub const fn none(mut self, style: Style) -> Self { + self.stylesheet.none = style; self } +} + +/// The character set for rendering for decor +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum DecorStyle { + Ascii, + Unicode, +} + +impl DecorStyle { + fn col_separator(&self) -> char { + match self { + DecorStyle::Ascii => '|', + DecorStyle::Unicode => '│', + } + } + + fn note_separator(&self, is_cont: bool) -> &str { + match self { + DecorStyle::Ascii => "= ", + DecorStyle::Unicode if is_cont => "├ ", + DecorStyle::Unicode => "╰ ", + } + } + + fn multi_suggestion_separator(&self) -> &'static str { + match self { + DecorStyle::Ascii => "|", + DecorStyle::Unicode => "├╴", + } + } + + fn file_start(&self, is_first: bool, alone: bool) -> &'static str { + match self { + DecorStyle::Ascii => "--> ", + DecorStyle::Unicode if is_first && alone => " ─▸ ", + DecorStyle::Unicode if is_first => " ╭▸ ", + DecorStyle::Unicode => " ├▸ ", + } + } - /// Render a snippet into a `Display`able object - pub fn render<'a>(&'a self, msg: Message<'a>) -> impl Display + 'a { - DisplayList::new( - msg, - &self.stylesheet, - self.anonymized_line_numbers, - self.term_width, - self.cut_indicator, - ) + fn secondary_file_start(&self) -> &'static str { + match self { + DecorStyle::Ascii => "::: ", + DecorStyle::Unicode => " ⸬ ", + } + } + + fn diff(&self) -> char { + match self { + DecorStyle::Ascii => '~', + DecorStyle::Unicode => '±', + } + } + + fn margin(&self) -> &'static str { + match self { + DecorStyle::Ascii => "...", + DecorStyle::Unicode => "…", + } + } + + fn underline(&self, is_primary: bool) -> UnderlineParts { + // X0 Y0 + // label_start > ┯━━━━ < underline + // │ < vertical_text_line + // text + + // multiline_start_down ⤷ X0 Y0 + // top_left > ┌───╿──┘ < top_right_flat + // top_left > ┏│━━━┙ < top_right + // multiline_vertical > ┃│ + // ┃│ X1 Y1 + // ┃│ X2 Y2 + // ┃└────╿──┘ < multiline_end_same_line + // bottom_left > ┗━━━━━┥ < bottom_right_with_text + // multiline_horizontal ^ `X` is a good letter + + // multiline_whole_line > ┏ X0 Y0 + // ┃ X1 Y1 + // ┗━━━━┛ < multiline_end_same_line + + // multiline_whole_line > ┏ X0 Y0 + // ┃ X1 Y1 + // ┃ ╿ < multiline_end_up + // ┗━━┛ < bottom_right + + match (self, is_primary) { + (DecorStyle::Ascii, true) => UnderlineParts { + style: ElementStyle::UnderlinePrimary, + underline: '^', + label_start: '^', + vertical_text_line: '|', + multiline_vertical: '|', + multiline_horizontal: '_', + multiline_whole_line: '/', + multiline_start_down: '^', + bottom_right: '|', + top_left: ' ', + top_right_flat: '^', + bottom_left: '|', + multiline_end_up: '^', + multiline_end_same_line: '^', + multiline_bottom_right_with_text: '|', + }, + (DecorStyle::Ascii, false) => UnderlineParts { + style: ElementStyle::UnderlineSecondary, + underline: '-', + label_start: '-', + vertical_text_line: '|', + multiline_vertical: '|', + multiline_horizontal: '_', + multiline_whole_line: '/', + multiline_start_down: '-', + bottom_right: '|', + top_left: ' ', + top_right_flat: '-', + bottom_left: '|', + multiline_end_up: '-', + multiline_end_same_line: '-', + multiline_bottom_right_with_text: '|', + }, + (DecorStyle::Unicode, true) => UnderlineParts { + style: ElementStyle::UnderlinePrimary, + underline: '━', + label_start: '┯', + vertical_text_line: '│', + multiline_vertical: '┃', + multiline_horizontal: '━', + multiline_whole_line: '┏', + multiline_start_down: '╿', + bottom_right: '┙', + top_left: '┏', + top_right_flat: '┛', + bottom_left: '┗', + multiline_end_up: '╿', + multiline_end_same_line: '┛', + multiline_bottom_right_with_text: '┥', + }, + (DecorStyle::Unicode, false) => UnderlineParts { + style: ElementStyle::UnderlineSecondary, + underline: '─', + label_start: '┬', + vertical_text_line: '│', + multiline_vertical: '│', + multiline_horizontal: '─', + multiline_whole_line: '┌', + multiline_start_down: '│', + bottom_right: '┘', + top_left: '┌', + top_right_flat: '┘', + bottom_left: '└', + multiline_end_up: '│', + multiline_end_same_line: '┘', + multiline_bottom_right_with_text: '┤', + }, + } } } diff --git a/crates/ruff_annotate_snippets/src/renderer/render.rs b/crates/ruff_annotate_snippets/src/renderer/render.rs new file mode 100644 index 00000000000000..5bf3e3c1b68828 --- /dev/null +++ b/crates/ruff_annotate_snippets/src/renderer/render.rs @@ -0,0 +1,2804 @@ +// Most of this file is adapted from https://github.com/rust-lang/rust/blob/160905b6253f42967ed4aef4b98002944c7df24c/compiler/rustc_errors/src/emitter.rs + +use alloc::borrow::Cow; +use alloc::collections::BTreeMap; +use alloc::string::{String, ToString}; +use alloc::{format, vec, vec::Vec}; +use core::cmp::{Ordering, Reverse, max, min}; +use core::fmt; + +use anstyle::Style; + +use super::DecorStyle; +use super::Renderer; +use super::margin::Margin; +use super::stylesheet::Stylesheet; +use crate::level::{Level, LevelInner}; +use crate::renderer::source_map::{ + AnnotatedLineInfo, LineInfo, Loc, SourceMap, SplicedLines, SubstitutionHighlight, TrimmedPatch, +}; +use crate::renderer::styled_buffer::StyledBuffer; +use crate::snippet::Id; +use crate::{ + Annotation, AnnotationKind, Element, Group, Message, Origin, Padding, Patch, Report, Snippet, + Title, +}; + +const ANONYMIZED_LINE_NUM: &str = "LL"; + +pub(crate) fn render(renderer: &Renderer, groups: Report<'_>) -> String { + if renderer.short_message { + render_short_message(renderer, groups).unwrap() + } else { + let (max_line_num, og_primary_path, groups) = pre_process(groups); + let max_line_num_len = if renderer.anonymized_line_numbers { + ANONYMIZED_LINE_NUM.len() + } else { + num_decimal_digits(max_line_num) + }; + let mut out_string = String::new(); + let group_len = groups.len(); + for ( + g, + PreProcessedGroup { + group, + elements, + primary_path, + max_depth, + }, + ) in groups.into_iter().enumerate() + { + let mut buffer = StyledBuffer::new(); + let level = group.primary_level.clone(); + let mut message_iter = elements.into_iter().enumerate().peekable(); + if let Some(title) = &group.title { + let peek = message_iter.peek().map(|(_, s)| s); + let title_style = if title.allows_styling { + TitleStyle::Header + } else { + TitleStyle::MainHeader + }; + let buffer_msg_line_offset = buffer.num_lines(); + render_title( + renderer, + &mut buffer, + title, + max_line_num_len, + title_style, + matches!(peek, Some(PreProcessedElement::Message(_))), + buffer_msg_line_offset, + ); + let buffer_msg_line_offset = buffer.num_lines(); + + if matches!(peek, Some(PreProcessedElement::Message(_))) { + draw_col_separator_no_space( + renderer, + &mut buffer, + buffer_msg_line_offset, + max_line_num_len + 1, + ); + } + if peek.is_none() + && title_style == TitleStyle::MainHeader + && g == 0 + && group_len > 1 + { + draw_col_separator_end( + renderer, + &mut buffer, + buffer_msg_line_offset, + max_line_num_len + 1, + ); + } + } + let mut seen_primary = false; + let mut last_suggestion_path = None; + while let Some((i, section)) = message_iter.next() { + let peek = message_iter.peek().map(|(_, s)| s); + let is_first = i == 0; + match section { + PreProcessedElement::Message(title) => { + let title_style = TitleStyle::Secondary; + let buffer_msg_line_offset = buffer.num_lines(); + render_title( + renderer, + &mut buffer, + title, + max_line_num_len, + title_style, + peek.is_some(), + buffer_msg_line_offset, + ); + } + PreProcessedElement::Cause((cause, source_map, annotated_lines)) => { + let is_primary = primary_path == cause.path.as_ref() && !seen_primary; + seen_primary |= is_primary; + render_snippet_annotations( + renderer, + &mut buffer, + max_line_num_len, + cause, + is_primary, + &source_map, + &annotated_lines, + max_depth, + peek.is_some() || (g == 0 && group_len > 1), + is_first, + ); + + if g == 0 { + let current_line = buffer.num_lines(); + match peek { + Some(PreProcessedElement::Message(_)) => { + draw_col_separator_no_space( + renderer, + &mut buffer, + current_line, + max_line_num_len + 1, + ); + } + None if group_len > 1 => draw_col_separator_end( + renderer, + &mut buffer, + current_line, + max_line_num_len + 1, + ), + _ => {} + } + } + } + PreProcessedElement::Suggestion(( + suggestion, + source_map, + spliced_lines, + display_suggestion, + )) => { + let matches_previous_suggestion = + last_suggestion_path == Some(suggestion.path.as_ref()); + emit_suggestion_default( + renderer, + &mut buffer, + suggestion, + spliced_lines, + display_suggestion, + max_line_num_len, + &source_map, + primary_path.or(og_primary_path), + matches_previous_suggestion, + is_first, + //matches!(peek, Some(Element::Message(_) | Element::Padding(_))), + peek.is_some(), + ); + + if matches!(peek, Some(PreProcessedElement::Suggestion(_))) { + last_suggestion_path = Some(suggestion.path.as_ref()); + } else { + last_suggestion_path = None; + } + } + + PreProcessedElement::Origin(origin) => { + let buffer_msg_line_offset = buffer.num_lines(); + let is_primary = primary_path == Some(&origin.path) && !seen_primary; + seen_primary |= is_primary; + render_origin( + renderer, + &mut buffer, + max_line_num_len, + origin, + is_primary, + is_first, + peek.is_none(), + buffer_msg_line_offset, + ); + let current_line = buffer.num_lines(); + if g == 0 && peek.is_none() && group_len > 1 { + draw_col_separator_end( + renderer, + &mut buffer, + current_line, + max_line_num_len + 1, + ); + } + } + PreProcessedElement::Padding(_) => { + let current_line = buffer.num_lines(); + if peek.is_none() { + draw_col_separator_end( + renderer, + &mut buffer, + current_line, + max_line_num_len + 1, + ); + } else { + draw_col_separator_no_space( + renderer, + &mut buffer, + current_line, + max_line_num_len + 1, + ); + } + } + } + } + buffer + .render(&level, &renderer.stylesheet, &mut out_string) + .unwrap(); + if g != group_len - 1 { + out_string.push('\n'); + } + } + out_string + } +} + +fn render_short_message(renderer: &Renderer, groups: &[Group<'_>]) -> Result { + let mut buffer = StyledBuffer::new(); + let mut labels = None; + let group = groups.first().expect("Expected at least one group"); + + let Some(title) = &group.title else { + panic!("Expected a Title"); + }; + + if let Some(Element::Cause(cause)) = group + .elements + .iter() + .find(|e| matches!(e, Element::Cause(_))) + { + let labels_inner = cause + .markers + .iter() + .filter_map(|ann| match &ann.label { + Some(msg) if ann.kind.is_primary() => { + if !msg.trim().is_empty() { + Some(msg.to_string()) + } else { + None + } + } + _ => None, + }) + .collect::>() + .join(", "); + if !labels_inner.is_empty() { + labels = Some(labels_inner); + } + + if let Some(path) = &cause.path { + let mut origin = Origin::path(path.as_ref()); + + let source_map = SourceMap::new(&cause.source, cause.line_start); + let (_depth, annotated_lines) = + source_map.annotated_lines(cause.markers.clone(), cause.fold); + + if let Some(primary_line) = annotated_lines + .iter() + .find(|l| l.annotations.iter().any(LineAnnotation::is_primary)) + .or(annotated_lines.iter().find(|l| !l.annotations.is_empty())) + { + origin.line = Some(primary_line.line_index); + if let Some(first_annotation) = primary_line + .annotations + .iter() + .min_by_key(|a| (Reverse(a.is_primary()), a.start.char)) + { + origin.char_column = Some(first_annotation.start.char + 1); + } + } + + render_origin(renderer, &mut buffer, 0, &origin, true, true, true, 0); + buffer.append(0, ": ", ElementStyle::LineAndColumn); + } + } + + render_title( + renderer, + &mut buffer, + title, + 0, // No line numbers in short messages + TitleStyle::MainHeader, + false, + 0, + ); + + if let Some(labels) = labels { + buffer.append(0, &format!(": {labels}"), ElementStyle::NoStyle); + } + + let mut out_string = String::new(); + buffer.render(&title.level, &renderer.stylesheet, &mut out_string)?; + + Ok(out_string) +} + +#[allow(clippy::too_many_arguments)] +fn render_title( + renderer: &Renderer, + buffer: &mut StyledBuffer, + title: &dyn MessageOrTitle, + max_line_num_len: usize, + title_style: TitleStyle, + is_cont: bool, + buffer_msg_line_offset: usize, +) { + let (label_style, title_element_style) = match title_style { + TitleStyle::MainHeader => ( + ElementStyle::Level(title.level().level), + if renderer.short_message { + ElementStyle::NoStyle + } else { + ElementStyle::MainHeaderMsg + }, + ), + TitleStyle::Header => ( + ElementStyle::Level(title.level().level), + ElementStyle::HeaderMsg, + ), + TitleStyle::Secondary => { + for _ in 0..max_line_num_len { + buffer.append(buffer_msg_line_offset, " ", ElementStyle::NoStyle); + } + + draw_note_separator( + renderer, + buffer, + buffer_msg_line_offset, + max_line_num_len + 1, + is_cont, + ); + (ElementStyle::MainHeaderMsg, ElementStyle::NoStyle) + } + }; + let mut label_width = 0; + + if title.level().name != Some(None) { + buffer.append(buffer_msg_line_offset, title.level().as_str(), label_style); + label_width += title.level().as_str().len(); + if let Some(Id { id: Some(id), url }) = &title.id() { + buffer.append(buffer_msg_line_offset, "[", label_style); + if let Some(url) = url.as_ref() { + buffer.append( + buffer_msg_line_offset, + &format!("\x1B]8;;{url}\x1B\\"), + label_style, + ); + } + buffer.append(buffer_msg_line_offset, id, label_style); + if url.is_some() { + buffer.append(buffer_msg_line_offset, "\x1B]8;;\x1B\\", label_style); + } + buffer.append(buffer_msg_line_offset, "]", label_style); + label_width += 2 + id.len(); + } + buffer.append(buffer_msg_line_offset, ": ", title_element_style); + label_width += 2; + } + + let padding = " ".repeat(if title_style == TitleStyle::Secondary { + // The extra 3 ` ` is padding that's always needed to align to the + // label i.e. `note: `: + // + // error: message + // --> file.rs:13:20 + // | + // 13 | + // | ^^^^ + // | + // = note: multiline + // message + // ++^^^------ + // | | | + // | | | + // | | width of label + // | magic `3` + // `max_line_num_len` + max_line_num_len + 3 + label_width + } else { + label_width + }); + + let (title_str, style) = if title.allows_styling() { + (Cow::Borrowed(title.text()), ElementStyle::NoStyle) + } else { + (normalize_whitespace(title.text()), title_element_style) + }; + for (i, text) in title_str.split('\n').enumerate() { + if i != 0 { + buffer.append(buffer_msg_line_offset + i, &padding, ElementStyle::NoStyle); + if title_style == TitleStyle::Secondary + && is_cont + && matches!(renderer.decor_style, DecorStyle::Unicode) + { + // There's another note after this one, associated to the subwindow above. + // We write additional vertical lines to join them: + // ╭▸ test.rs:3:3 + // │ + // 3 │ code + // │ ━━━━ + // │ + // ├ note: foo + // │ bar + // ╰ note: foo + // bar + draw_col_separator_no_space( + renderer, + buffer, + buffer_msg_line_offset + i, + max_line_num_len + 1, + ); + } + } + buffer.append(buffer_msg_line_offset + i, text, style); + } +} + +#[allow(clippy::too_many_arguments)] +fn render_origin( + renderer: &Renderer, + buffer: &mut StyledBuffer, + max_line_num_len: usize, + origin: &Origin<'_>, + is_primary: bool, + is_first: bool, + alone: bool, + buffer_msg_line_offset: usize, +) { + if !renderer.short_message { + for _ in 0..max_line_num_len { + buffer.append(buffer_msg_line_offset, " ", ElementStyle::NoStyle); + } + } + + if is_primary && !renderer.short_message { + buffer.append( + buffer_msg_line_offset, + renderer.decor_style.file_start(is_first, alone), + ElementStyle::LineNumber, + ); + } else if !renderer.short_message { + // if !origin.standalone { + // // Add spacing line, as shown: + // // --> $DIR/file:54:15 + // // | + // // LL | code + // // | ^^^^ + // // | (<- It prints *this* line) + // // ::: $DIR/other_file.rs:15:5 + // // | + // // LL | code + // // | ---- + // draw_col_separator_no_space(renderer, + // buffer, + // buffer_msg_line_offset, + // max_line_num_len + 1, + // ); + // + // buffer_msg_line_offset += 1; + // } + // Then, the secondary file indicator + buffer.append( + buffer_msg_line_offset, + renderer.decor_style.secondary_file_start(), + ElementStyle::LineNumber, + ); + } + + let str = match (&origin.line, &origin.char_column) { + (Some(line), Some(col)) => { + format!("{}:{}:{}", origin.path, line, col) + } + (Some(line), None) => format!("{}:{}", origin.path, line), + _ => origin.path.to_string(), + }; + buffer.append(buffer_msg_line_offset, &str, ElementStyle::LineAndColumn); +} + +#[allow(clippy::too_many_arguments)] +fn render_snippet_annotations( + renderer: &Renderer, + buffer: &mut StyledBuffer, + max_line_num_len: usize, + snippet: &Snippet<'_, Annotation<'_>>, + is_primary: bool, + sm: &SourceMap<'_>, + annotated_lines: &[AnnotatedLineInfo<'_>], + multiline_depth: usize, + is_cont: bool, + is_first: bool, +) { + if let Some(path) = &snippet.path { + let mut origin = Origin::path(path.as_ref()); + // print out the span location and spacer before we print the annotated source + // to do this, we need to know if this span will be primary + //let is_primary = primary_path == Some(&origin.path); + + if is_primary { + if let Some(primary_line) = annotated_lines + .iter() + .find(|l| l.annotations.iter().any(LineAnnotation::is_primary)) + .or(annotated_lines.iter().find(|l| !l.annotations.is_empty())) + { + origin.line = Some(primary_line.line_index); + if let Some(first_annotation) = primary_line + .annotations + .iter() + .min_by_key(|a| (Reverse(a.is_primary()), a.start.char)) + { + origin.char_column = Some(first_annotation.start.char + 1); + } + } + } else { + let buffer_msg_line_offset = buffer.num_lines(); + // Add spacing line, as shown: + // --> $DIR/file:54:15 + // | + // LL | code + // | ^^^^ + // | (<- It prints *this* line) + // ::: $DIR/other_file.rs:15:5 + // | + // LL | code + // | ---- + draw_col_separator_no_space( + renderer, + buffer, + buffer_msg_line_offset, + max_line_num_len + 1, + ); + if let Some(first_line) = annotated_lines + .iter() + .find(|l| !l.annotations.is_empty()) + .or(annotated_lines.first()) + { + origin.line = Some(first_line.line_index); + if let Some(first_annotation) = first_line.annotations.first() { + origin.char_column = Some(first_annotation.start.char + 1); + } + } + } + let buffer_msg_line_offset = buffer.num_lines(); + render_origin( + renderer, + buffer, + max_line_num_len, + &origin, + is_primary, + is_first, + false, + buffer_msg_line_offset, + ); + // Put in the spacer between the location and annotated source + draw_col_separator_no_space( + renderer, + buffer, + buffer_msg_line_offset + 1, + max_line_num_len + 1, + ); + } else { + let buffer_msg_line_offset = buffer.num_lines(); + if is_primary { + if renderer.decor_style == DecorStyle::Unicode { + buffer.puts( + buffer_msg_line_offset, + max_line_num_len, + renderer.decor_style.file_start(is_first, false), + ElementStyle::LineNumber, + ); + } else { + draw_col_separator_no_space( + renderer, + buffer, + buffer_msg_line_offset, + max_line_num_len + 1, + ); + } + } else { + // Add spacing line, as shown: + // --> $DIR/file:54:15 + // | + // LL | code + // | ^^^^ + // | (<- It prints *this* line) + // ::: $DIR/other_file.rs:15:5 + // | + // LL | code + // | ---- + draw_col_separator_no_space( + renderer, + buffer, + buffer_msg_line_offset, + max_line_num_len + 1, + ); + + buffer.puts( + buffer_msg_line_offset + 1, + max_line_num_len, + renderer.decor_style.secondary_file_start(), + ElementStyle::LineNumber, + ); + } + } + + // Contains the vertical lines' positions for active multiline annotations + let mut multilines = Vec::new(); + + // Get the left-side margin to remove it + let mut whitespace_margin = usize::MAX; + for line_info in annotated_lines { + let leading_whitespace = line_info + .line + .chars() + .take_while(|c| c.is_whitespace()) + .map(|c| { + match c { + // Tabs are displayed as 4 spaces + '\t' => 4, + _ => 1, + } + }) + .sum(); + if line_info.line.chars().any(|c| !c.is_whitespace()) { + whitespace_margin = min(whitespace_margin, leading_whitespace); + } + } + if whitespace_margin == usize::MAX { + whitespace_margin = 0; + } + + // Left-most column any visible span points at. + let mut span_left_margin = usize::MAX; + for line_info in annotated_lines { + for ann in &line_info.annotations { + span_left_margin = min(span_left_margin, ann.start.display); + span_left_margin = min(span_left_margin, ann.end.display); + } + } + if span_left_margin == usize::MAX { + span_left_margin = 0; + } + + // Right-most column any visible span points at. + let mut span_right_margin = 0; + let mut label_right_margin = 0; + let mut max_line_len = 0; + for line_info in annotated_lines { + max_line_len = max(max_line_len, str_width(line_info.line)); + for ann in &line_info.annotations { + span_right_margin = max(span_right_margin, ann.start.display); + span_right_margin = max(span_right_margin, ann.end.display); + // FIXME: account for labels not in the same line + let label_right = ann.label.as_ref().map_or(0, |l| str_width(l) + 1); + label_right_margin = max(label_right_margin, ann.end.display + label_right); + } + } + let width_offset = 3 + max_line_num_len; + let code_offset = if multiline_depth == 0 { + width_offset + } else { + width_offset + multiline_depth + 1 + }; + + let column_width = renderer.term_width.saturating_sub(code_offset); + + let margin = Margin::new( + whitespace_margin, + span_left_margin, + span_right_margin, + label_right_margin, + column_width, + max_line_len, + ); + + // Next, output the annotate source for this file + for annotated_line_idx in 0..annotated_lines.len() { + let previous_buffer_line = buffer.num_lines(); + + let depths = render_source_line( + renderer, + &annotated_lines[annotated_line_idx], + buffer, + width_offset, + code_offset, + max_line_num_len, + margin, + !is_cont && annotated_line_idx + 1 == annotated_lines.len(), + ); + + let mut to_add = BTreeMap::new(); + + for (depth, style) in depths { + if let Some(index) = multilines.iter().position(|(d, _)| d == &depth) { + multilines.swap_remove(index); + } else { + to_add.insert(depth, style); + } + } + + // Set the multiline annotation vertical lines to the left of + // the code in this line. + for (depth, style) in &multilines { + for line in previous_buffer_line..buffer.num_lines() { + draw_multiline_line(renderer, buffer, line, width_offset, *depth, *style, false); + } + } + // check to see if we need to print out or elide lines that come between + // this annotated line and the next one. + if annotated_line_idx < (annotated_lines.len() - 1) { + let line_idx_delta = annotated_lines[annotated_line_idx + 1].line_index + - annotated_lines[annotated_line_idx].line_index; + match line_idx_delta.cmp(&2) { + Ordering::Greater => { + let last_buffer_line_num = buffer.num_lines(); + + draw_line_separator(renderer, buffer, last_buffer_line_num, width_offset); + + // Set the multiline annotation vertical lines on `...` bridging line. + for (depth, style) in &multilines { + draw_multiline_line( + renderer, + buffer, + last_buffer_line_num, + width_offset, + *depth, + *style, + true, + ); + } + if let Some(line) = annotated_lines.get(annotated_line_idx) { + for ann in &line.annotations { + if let LineAnnotationType::MultilineStart(pos) = ann.annotation_type { + // In the case where we have elided the entire start of the + // multispan because those lines were empty, we still need + // to draw the `|`s across the `...`. + draw_multiline_line( + renderer, + buffer, + last_buffer_line_num, + width_offset, + pos, + if ann.is_primary() { + ElementStyle::UnderlinePrimary + } else { + ElementStyle::UnderlineSecondary + }, + true, + ); + } + } + } + } + + Ordering::Equal => { + let unannotated_line = sm + .get_line(annotated_lines[annotated_line_idx].line_index + 1) + .unwrap_or(""); + + let last_buffer_line_num = buffer.num_lines(); + + draw_line( + renderer, + buffer, + &normalize_whitespace(unannotated_line), + annotated_lines[annotated_line_idx + 1].line_index - 1, + last_buffer_line_num, + width_offset, + code_offset, + max_line_num_len, + margin, + ); + + for (depth, style) in &multilines { + draw_multiline_line( + renderer, + buffer, + last_buffer_line_num, + width_offset, + *depth, + *style, + false, + ); + } + if let Some(line) = annotated_lines.get(annotated_line_idx) { + for ann in &line.annotations { + if let LineAnnotationType::MultilineStart(pos) = ann.annotation_type { + draw_multiline_line( + renderer, + buffer, + last_buffer_line_num, + width_offset, + pos, + if ann.is_primary() { + ElementStyle::UnderlinePrimary + } else { + ElementStyle::UnderlineSecondary + }, + false, + ); + } + } + } + } + Ordering::Less => {} + } + } + + multilines.extend(to_add); + } +} + +#[allow(clippy::too_many_arguments)] +fn render_source_line( + renderer: &Renderer, + line_info: &AnnotatedLineInfo<'_>, + buffer: &mut StyledBuffer, + width_offset: usize, + code_offset: usize, + max_line_num_len: usize, + margin: Margin, + close_window: bool, +) -> Vec<(usize, ElementStyle)> { + // Draw: + // + // LL | ... code ... + // | ^^-^ span label + // | | + // | secondary span label + // + // ^^ ^ ^^^ ^^^^ ^^^ we don't care about code too far to the right of a span, we trim it + // | | | | + // | | | actual code found in your source code and the spans we use to mark it + // | | when there's too much wasted space to the left, trim it + // | vertical divider between the column number and the code + // column number + + let source_string = normalize_whitespace(line_info.line); + + let line_offset = buffer.num_lines(); + + let left = draw_line( + renderer, + buffer, + &source_string, + line_info.line_index, + line_offset, + width_offset, + code_offset, + max_line_num_len, + margin, + ); + + // If there are no annotations, we are done + if line_info.annotations.is_empty() { + // `close_window` normally gets handled later, but we are early + // returning, so it needs to be handled here + if close_window { + draw_col_separator_end(renderer, buffer, line_offset + 1, width_offset - 2); + } + return vec![]; + } + + // Special case when there's only one annotation involved, it is the start of a multiline + // span and there's no text at the beginning of the code line. Instead of doing the whole + // graph: + // + // 2 | fn foo() { + // | _^ + // 3 | | + // 4 | | } + // | |_^ test + // + // we simplify the output to: + // + // 2 | / fn foo() { + // 3 | | + // 4 | | } + // | |_^ test + let mut buffer_ops = vec![]; + let mut annotations = vec![]; + let mut short_start = true; + for ann in &line_info.annotations { + if let LineAnnotationType::MultilineStart(depth) = ann.annotation_type { + if source_string + .chars() + .take(ann.start.display) + .all(char::is_whitespace) + { + let uline = renderer.decor_style.underline(ann.is_primary()); + let chr = uline.multiline_whole_line; + annotations.push((depth, uline.style)); + buffer_ops.push((line_offset, width_offset + depth - 1, chr, uline.style)); + } else { + short_start = false; + break; + } + } else if let LineAnnotationType::MultilineLine(_) = ann.annotation_type { + } else { + short_start = false; + break; + } + } + if short_start { + for (y, x, c, s) in buffer_ops { + buffer.putc(y, x, c, s); + } + return annotations; + } + + // We want to display like this: + // + // vec.push(vec.pop().unwrap()); + // --- ^^^ - previous borrow ends here + // | | + // | error occurs here + // previous borrow of `vec` occurs here + // + // But there are some weird edge cases to be aware of: + // + // vec.push(vec.pop().unwrap()); + // -------- - previous borrow ends here + // || + // |this makes no sense + // previous borrow of `vec` occurs here + // + // For this reason, we group the lines into "highlight lines" + // and "annotations lines", where the highlight lines have the `^`. + + // Sort the annotations by (start, end col) + // The labels are reversed, sort and then reversed again. + // Consider a list of annotations (A1, A2, C1, C2, B1, B2) where + // the letter signifies the span. Here we are only sorting by the + // span and hence, the order of the elements with the same span will + // not change. On reversing the ordering (|a, b| but b.cmp(a)), you get + // (C1, C2, B1, B2, A1, A2). All the elements with the same span are + // still ordered first to last, but all the elements with different + // spans are ordered by their spans in last to first order. Last to + // first order is important, because the jiggly lines and | are on + // the left, so the rightmost span needs to be rendered first, + // otherwise the lines would end up needing to go over a message. + + let mut annotations = line_info.annotations.clone(); + annotations.sort_by_key(|a| Reverse((a.start.display, a.start.char))); + + // First, figure out where each label will be positioned. + // + // In the case where you have the following annotations: + // + // vec.push(vec.pop().unwrap()); + // -------- - previous borrow ends here [C] + // || + // |this makes no sense [B] + // previous borrow of `vec` occurs here [A] + // + // `annotations_position` will hold [(2, A), (1, B), (0, C)]. + // + // We try, when possible, to stick the rightmost annotation at the end + // of the highlight line: + // + // vec.push(vec.pop().unwrap()); + // --- --- - previous borrow ends here + // + // But sometimes that's not possible because one of the other + // annotations overlaps it. For example, from the test + // `span_overlap_label`, we have the following annotations + // (written on distinct lines for clarity): + // + // fn foo(x: u32) { + // -------------- + // - + // + // In this case, we can't stick the rightmost-most label on + // the highlight line, or we would get: + // + // fn foo(x: u32) { + // -------- x_span + // | + // fn_span + // + // which is totally weird. Instead we want: + // + // fn foo(x: u32) { + // -------------- + // | | + // | x_span + // fn_span + // + // which is...less weird, at least. In fact, in general, if + // the rightmost span overlaps with any other span, we should + // use the "hang below" version, so we can at least make it + // clear where the span *starts*. There's an exception for this + // logic, when the labels do not have a message: + // + // fn foo(x: u32) { + // -------------- + // | + // x_span + // + // instead of: + // + // fn foo(x: u32) { + // -------------- + // | | + // | x_span + // + // + let mut overlap = vec![false; annotations.len()]; + let mut annotations_position = vec![]; + let mut line_len: usize = 0; + let mut p = 0; + for (i, annotation) in annotations.iter().enumerate() { + for (j, next) in annotations.iter().enumerate() { + if overlaps(next, annotation, 0) && j > 1 { + overlap[i] = true; + overlap[j] = true; + } + if overlaps(next, annotation, 0) // This label overlaps with another one and both + && annotation.has_label() // take space (they have text and are not + && j > i // multiline lines). + && p == 0 + // We're currently on the first line, move the label one line down + { + // If we're overlapping with an un-labelled annotation with the same span + // we can just merge them in the output + if next.start.display == annotation.start.display + && next.start.char == annotation.start.char + && next.end.display == annotation.end.display + && next.end.char == annotation.end.char + && !next.has_label() + { + continue; + } + + // This annotation needs a new line in the output. + p += 1; + break; + } + } + annotations_position.push((p, annotation)); + for (j, next) in annotations.iter().enumerate() { + if j > i { + let l = next.label.as_ref().map_or(0, |label| label.len() + 2); + if (overlaps(next, annotation, l) // Do not allow two labels to be in the same + // line if they overlap including padding, to + // avoid situations like: + // + // fn foo(x: u32) { + // -------^------ + // | | + // fn_spanx_span + // + && annotation.has_label() // Both labels must have some text, otherwise + && next.has_label()) // they are not overlapping. + // Do not add a new line if this annotation + // or the next are vertical line placeholders. + || (annotation.takes_space() // If either this or the next annotation is + && next.has_label()) // multiline start/end, move it to a new line + || (annotation.has_label() // so as not to overlap the horizontal lines. + && next.takes_space()) + || (annotation.takes_space() && next.takes_space()) + || (overlaps(next, annotation, l) + && (next.end.display, next.end.char) <= (annotation.end.display, annotation.end.char) + && next.has_label() + && p == 0) + // Avoid #42595. + { + // This annotation needs a new line in the output. + p += 1; + break; + } + } + } + line_len = max(line_len, p); + } + + if line_len != 0 { + line_len += 1; + } + + // If there are no annotations or the only annotations on this line are + // MultilineLine, then there's only code being shown, stop processing. + if line_info.annotations.iter().all(LineAnnotation::is_line) { + return vec![]; + } + + if annotations_position + .iter() + .all(|(_, ann)| matches!(ann.annotation_type, LineAnnotationType::MultilineStart(_))) + && let Some(max_pos) = annotations_position.iter().map(|(pos, _)| *pos).max() + { + // Special case the following, so that we minimize overlapping multiline spans. + // + // 3 │ X0 Y0 Z0 + // │ ┏━━━━━┛ │ │ < We are writing these lines + // │ ┃┌───────┘ │ < by reverting the "depth" of + // │ ┃│┌─────────┘ < their multiline spans. + // 4 │ ┃││ X1 Y1 Z1 + // 5 │ ┃││ X2 Y2 Z2 + // │ ┃│└────╿──│──┘ `Z` label + // │ ┃└─────│──┤ + // │ ┗━━━━━━┥ `Y` is a good letter too + // ╰╴ `X` is a good letter + for (pos, _) in &mut annotations_position { + *pos = max_pos - *pos; + } + // We know then that we don't need an additional line for the span label, saving us + // one line of vertical space. + line_len = line_len.saturating_sub(1); + } + + // Write the column separator. + // + // After this we will have: + // + // 2 | fn foo() { + // | + // | + // | + // 3 | + // 4 | } + // | + for pos in 0..=line_len { + draw_col_separator_no_space(renderer, buffer, line_offset + pos + 1, width_offset - 2); + } + if close_window { + draw_col_separator_end( + renderer, + buffer, + line_offset + line_len + 1, + width_offset - 2, + ); + } + // Write the horizontal lines for multiline annotations + // (only the first and last lines need this). + // + // After this we will have: + // + // 2 | fn foo() { + // | __________ + // | + // | + // 3 | + // 4 | } + // | _ + for &(pos, annotation) in &annotations_position { + let underline = renderer.decor_style.underline(annotation.is_primary()); + let pos = pos + 1; + match annotation.annotation_type { + LineAnnotationType::MultilineStart(depth) | LineAnnotationType::MultilineEnd(depth) => { + draw_range( + buffer, + underline.multiline_horizontal, + line_offset + pos, + width_offset + depth, + (code_offset + annotation.start.display).saturating_sub(left), + underline.style, + ); + } + _ if annotation.highlight_source => { + buffer.set_style_range( + line_offset, + (code_offset + annotation.start.char).saturating_sub(left), + (code_offset + annotation.end.char).saturating_sub(left), + underline.style, + annotation.is_primary(), + ); + } + _ => {} + } + } + + // Write the vertical lines for labels that are on a different line as the underline. + // + // After this we will have: + // + // 2 | fn foo() { + // | __________ + // | | | + // | | + // 3 | | + // 4 | | } + // | |_ + for &(pos, annotation) in &annotations_position { + let underline = renderer.decor_style.underline(annotation.is_primary()); + let pos = pos + 1; + + if pos > 1 && (annotation.has_label() || annotation.takes_space()) { + for p in line_offset + 1..=line_offset + pos { + buffer.putc( + p, + (code_offset + annotation.start.display).saturating_sub(left), + match annotation.annotation_type { + LineAnnotationType::MultilineLine(_) => underline.multiline_vertical, + _ => underline.vertical_text_line, + }, + underline.style, + ); + } + if let LineAnnotationType::MultilineStart(_) = annotation.annotation_type { + buffer.putc( + line_offset + pos, + (code_offset + annotation.start.display).saturating_sub(left), + underline.bottom_right, + underline.style, + ); + } + if matches!( + annotation.annotation_type, + LineAnnotationType::MultilineEnd(_) + ) && annotation.has_label() + { + buffer.putc( + line_offset + pos, + (code_offset + annotation.start.display).saturating_sub(left), + underline.multiline_bottom_right_with_text, + underline.style, + ); + } + } + match annotation.annotation_type { + LineAnnotationType::MultilineStart(depth) => { + buffer.putc( + line_offset + pos, + width_offset + depth - 1, + underline.top_left, + underline.style, + ); + for p in line_offset + pos + 1..line_offset + line_len + 2 { + buffer.putc( + p, + width_offset + depth - 1, + underline.multiline_vertical, + underline.style, + ); + } + } + LineAnnotationType::MultilineEnd(depth) => { + for p in line_offset..line_offset + pos { + buffer.putc( + p, + width_offset + depth - 1, + underline.multiline_vertical, + underline.style, + ); + } + buffer.putc( + line_offset + pos, + width_offset + depth - 1, + underline.bottom_left, + underline.style, + ); + } + _ => (), + } + } + + // Write the labels on the annotations that actually have a label. + // + // After this we will have: + // + // 2 | fn foo() { + // | __________ + // | | + // | something about `foo` + // 3 | + // 4 | } + // | _ test + for &(pos, annotation) in &annotations_position { + let style = if annotation.is_primary() { + ElementStyle::LabelPrimary + } else { + ElementStyle::LabelSecondary + }; + let (pos, col) = if pos == 0 { + if annotation.end.display == 0 { + (pos + 1, (annotation.end.display + 2).saturating_sub(left)) + } else { + (pos + 1, (annotation.end.display + 1).saturating_sub(left)) + } + } else { + (pos + 2, annotation.start.display.saturating_sub(left)) + }; + if let Some(label) = &annotation.label { + buffer.puts(line_offset + pos, code_offset + col, label, style); + } + } + + // Sort from biggest span to smallest span so that smaller spans are + // represented in the output: + // + // x | fn foo() + // | ^^^---^^ + // | | | + // | | something about `foo` + // | something about `fn foo()` + annotations_position.sort_by_key(|(_, ann)| { + // Decreasing order. When annotations share the same length, prefer `Primary`. + (Reverse(ann.len()), ann.is_primary()) + }); + + // Write the underlines. + // + // After this we will have: + // + // 2 | fn foo() { + // | ____-_____^ + // | | + // | something about `foo` + // 3 | + // 4 | } + // | _^ test + for &(pos, annotation) in &annotations_position { + let uline = renderer.decor_style.underline(annotation.is_primary()); + for p in annotation.start.display..annotation.end.display { + // The default span label underline. + buffer.putc( + line_offset + 1, + (code_offset + p).saturating_sub(left), + uline.underline, + uline.style, + ); + } + + if pos == 0 + && matches!( + annotation.annotation_type, + LineAnnotationType::MultilineStart(_) | LineAnnotationType::MultilineEnd(_) + ) + { + // The beginning of a multiline span with its leftward moving line on the same line. + buffer.putc( + line_offset + 1, + (code_offset + annotation.start.display).saturating_sub(left), + match annotation.annotation_type { + LineAnnotationType::MultilineStart(_) => uline.top_right_flat, + LineAnnotationType::MultilineEnd(_) => uline.multiline_end_same_line, + _ => panic!("unexpected annotation type: {annotation:?}"), + }, + uline.style, + ); + } else if pos != 0 + && matches!( + annotation.annotation_type, + LineAnnotationType::MultilineStart(_) | LineAnnotationType::MultilineEnd(_) + ) + { + // The beginning of a multiline span with its leftward moving line on another line, + // so we start going down first. + buffer.putc( + line_offset + 1, + (code_offset + annotation.start.display).saturating_sub(left), + match annotation.annotation_type { + LineAnnotationType::MultilineStart(_) => uline.multiline_start_down, + LineAnnotationType::MultilineEnd(_) => uline.multiline_end_up, + _ => panic!("unexpected annotation type: {annotation:?}"), + }, + uline.style, + ); + } else if pos != 0 && annotation.has_label() { + // The beginning of a span label with an actual label, we'll point down. + buffer.putc( + line_offset + 1, + (code_offset + annotation.start.display).saturating_sub(left), + uline.label_start, + uline.style, + ); + } + } + + // We look for individual *long* spans, and we trim the *middle*, so that we render + // LL | ...= [0, 0, 0, ..., 0, 0]; + // | ^^^^^^^^^^...^^^^^^^ expected `&[u8]`, found `[{integer}; 1680]` + for (i, (_pos, annotation)) in annotations_position.iter().enumerate() { + // Skip cases where multiple spans overlap eachother. + if overlap[i] { + continue; + }; + let LineAnnotationType::Singleline = annotation.annotation_type else { + continue; + }; + let width = annotation.end.display - annotation.start.display; + + static MIN_PAD: usize = 5; + let margin_width = str_width(renderer.decor_style.margin()); + if width > margin.term_width * 2 && width > (MIN_PAD * 2 + margin_width) { + // If the terminal is *too* small, we keep at least a tiny bit of the span for + // display. + let pad = max(margin.term_width / 3, MIN_PAD); + // Code line + buffer.replace( + line_offset, + code_offset + (annotation.start.display + pad).saturating_sub(left), + code_offset + (annotation.end.display - pad).saturating_sub(left), + renderer.decor_style.margin(), + ); + // Underline line + buffer.replace( + line_offset + 1, + code_offset + (annotation.start.display + pad).saturating_sub(left), + code_offset + (annotation.end.display - pad).saturating_sub(left), + renderer.decor_style.margin(), + ); + } + } + annotations_position + .iter() + .filter_map(|&(_, annotation)| match annotation.annotation_type { + LineAnnotationType::MultilineStart(p) | LineAnnotationType::MultilineEnd(p) => { + let style = if annotation.is_primary() { + ElementStyle::LabelPrimary + } else { + ElementStyle::LabelSecondary + }; + Some((p, style)) + } + _ => None, + }) + .collect::>() +} + +#[allow(clippy::too_many_arguments)] +fn emit_suggestion_default( + renderer: &Renderer, + buffer: &mut StyledBuffer, + suggestion: &Snippet<'_, Patch<'_>>, + spliced_lines: SplicedLines<'_>, + show_code_change: DisplaySuggestion, + max_line_num_len: usize, + sm: &SourceMap<'_>, + primary_path: Option<&Cow<'_, str>>, + matches_previous_suggestion: bool, + is_first: bool, + is_cont: bool, +) { + let buffer_offset = buffer.num_lines(); + let mut row_num = buffer_offset + usize::from(!matches_previous_suggestion); + let (complete, parts, highlights, replaced_highlights) = spliced_lines; + let is_multiline = complete.lines().count() > 1; + + if suggestion.path.as_ref() != primary_path + && let Some(path) = suggestion.path.as_ref() + && !matches_previous_suggestion + { + let (loc, _) = sm.span_to_locations(parts[0].span.clone()); + // --> file.rs:line:col + // | + for _ in 0..max_line_num_len { + buffer.append(row_num - 1, " ", ElementStyle::NoStyle); + } + let arrow = renderer.decor_style.file_start(is_first, false); + buffer.append(row_num - 1, arrow, ElementStyle::LineNumber); + let message = format!("{}:{}:{}", path, loc.line, loc.char + 1); + buffer.append(row_num - 1, &message, ElementStyle::LineAndColumn); + + draw_col_separator_no_space(renderer, buffer, row_num, max_line_num_len + 1); + row_num += 1; + } else if matches_previous_suggestion { + buffer.puts( + row_num - 1, + max_line_num_len + 1, + renderer.decor_style.multi_suggestion_separator(), + ElementStyle::LineNumber, + ); + } else { + draw_col_separator_start(renderer, buffer, row_num - 1, max_line_num_len + 1); + } + + if let DisplaySuggestion::Diff = show_code_change { + row_num += 1; + } + + let lo = parts.iter().map(|p| p.span.start).min().unwrap(); + let hi = parts.iter().map(|p| p.span.end).max().unwrap(); + + let file_lines = sm.span_to_lines(lo..hi); + let (line_start, line_end) = if suggestion.fold { + // We use the original span to get original line_start + sm.span_to_locations(parts[0].original_span.clone()) + } else { + sm.span_to_locations(0..sm.source.len()) + }; + let mut lines = complete.lines(); + if lines.clone().next().is_none() { + // Account for a suggestion to completely remove a line(s) with whitespace (#94192). + for line in line_start.line..=line_end.line { + buffer.puts( + row_num - 1 + line - line_start.line, + 0, + &maybe_anonymized(renderer, line, max_line_num_len), + ElementStyle::LineNumber, + ); + buffer.puts( + row_num - 1 + line - line_start.line, + max_line_num_len + 1, + "- ", + ElementStyle::Removal, + ); + buffer.puts( + row_num - 1 + line - line_start.line, + max_line_num_len + 3, + &normalize_whitespace(sm.get_line(line).unwrap()), + ElementStyle::Removal, + ); + } + row_num += line_end.line - line_start.line; + } + let mut unhighlighted_lines = Vec::new(); + for (line_pos, (line, highlight_parts)) in lines.by_ref().zip(highlights).enumerate() { + // Remember lines that are not highlighted to hide them if needed + if highlight_parts.is_empty() && suggestion.fold { + unhighlighted_lines.push((line_pos, line)); + continue; + } + + match unhighlighted_lines.len() { + 0 => (), + // Since we show first line, "..." line and last line, + // There is no reason to hide if there are 3 or less lines + // (because then we just replace a line with ... which is + // not helpful) + n if n <= 3 => unhighlighted_lines.drain(..).for_each(|(p, l)| { + draw_code_line( + renderer, + buffer, + &mut row_num, + &[], + &[], + p + line_start.line, + l, + show_code_change, + max_line_num_len, + &file_lines, + is_multiline, + ); + }), + // Print first unhighlighted line, "..." and last unhighlighted line, like so: + // + // LL | this line was highlighted + // LL | this line is just for context + // ... + // LL | this line is just for context + // LL | this line was highlighted + _ => { + let last_line = unhighlighted_lines.pop(); + let first_line = unhighlighted_lines.drain(..).next(); + + if let Some((p, l)) = first_line { + draw_code_line( + renderer, + buffer, + &mut row_num, + &[], + &[], + p + line_start.line, + l, + show_code_change, + max_line_num_len, + &file_lines, + is_multiline, + ); + } + + let placeholder = renderer.decor_style.margin(); + let padding = str_width(placeholder); + buffer.puts( + row_num, + max_line_num_len.saturating_sub(padding), + placeholder, + ElementStyle::LineNumber, + ); + row_num += 1; + + if let Some((p, l)) = last_line { + draw_code_line( + renderer, + buffer, + &mut row_num, + &[], + &[], + p + line_start.line, + l, + show_code_change, + max_line_num_len, + &file_lines, + is_multiline, + ); + } + } + } + draw_code_line( + renderer, + buffer, + &mut row_num, + &highlight_parts, + &replaced_highlights, + line_pos + line_start.line, + line, + show_code_change, + max_line_num_len, + &file_lines, + is_multiline, + ); + } + + // This offset and the ones below need to be signed to account for replacement code + // that is shorter than the original code. + let mut offsets: Vec<(usize, isize)> = Vec::new(); + // Only show an underline in the suggestions if the suggestion is not the + // entirety of the code being shown and the displayed code is not multiline. + if let DisplaySuggestion::Diff | DisplaySuggestion::Underline | DisplaySuggestion::Add = + show_code_change + { + for part in parts { + let (span_start, span_end) = sm.span_to_locations(part.span.clone()); + let span_start_pos = span_start.display; + let span_end_pos = span_end.display; + + // If this addition is _only_ whitespace, then don't trim it, + // or else we're just not rendering anything. + let is_whitespace_addition = part.replacement.trim().is_empty(); + + // Do not underline the leading... + let start = if is_whitespace_addition { + 0 + } else { + part.replacement + .len() + .saturating_sub(part.replacement.trim_start().len()) + }; + // ...or trailing spaces. Account for substitutions containing unicode + // characters. + let sub_len: usize = str_width(if is_whitespace_addition { + &part.replacement + } else { + part.replacement.trim() + }); + + let offset: isize = offsets + .iter() + .filter_map(|(start, v)| { + if span_start_pos < *start { + None + } else { + Some(v) + } + }) + .sum(); + let underline_start = (span_start_pos + start) as isize + offset; + let underline_end = (span_start_pos + start + sub_len) as isize + offset; + assert!(underline_start >= 0 && underline_end >= 0); + let padding: usize = max_line_num_len + 3; + for p in underline_start..underline_end { + if matches!(show_code_change, DisplaySuggestion::Underline) { + // If this is a replacement, underline with `~`, if this is an addition + // underline with `+`. + buffer.putc( + row_num, + (padding as isize + p) as usize, + if part.is_addition(sm) { + '+' + } else { + renderer.decor_style.diff() + }, + ElementStyle::Addition, + ); + } + } + + // length of the code after substitution + let full_sub_len = str_width(&part.replacement) as isize; + + // length of the code to be substituted + let snippet_len = span_end_pos as isize - span_start_pos as isize; + // For multiple substitutions, use the position *after* the previous + // substitutions have happened, only when further substitutions are + // located strictly after. + offsets.push((span_end_pos, full_sub_len - snippet_len)); + } + row_num += 1; + } + + // if we elided some lines, add an ellipsis + if lines.next().is_some() { + let placeholder = renderer.decor_style.margin(); + let padding = str_width(placeholder); + buffer.puts( + row_num, + max_line_num_len.saturating_sub(padding), + placeholder, + ElementStyle::LineNumber, + ); + } else { + let row = match show_code_change { + DisplaySuggestion::Diff | DisplaySuggestion::Add | DisplaySuggestion::Underline => { + row_num - 1 + } + DisplaySuggestion::None => row_num, + }; + if is_cont { + draw_col_separator_no_space(renderer, buffer, row, max_line_num_len + 1); + } else { + draw_col_separator_end(renderer, buffer, row, max_line_num_len + 1); + } + } +} + +#[allow(clippy::too_many_arguments)] +fn draw_code_line( + renderer: &Renderer, + buffer: &mut StyledBuffer, + row_num: &mut usize, + highlight_parts: &[SubstitutionHighlight], + replaced_parts: &[Vec], + line_num: usize, + line_to_add: &str, + show_code_change: DisplaySuggestion, + max_line_num_len: usize, + file_lines: &[&LineInfo<'_>], + is_multiline: bool, +) { + if let DisplaySuggestion::Diff = show_code_change { + // We need to print more than one line if the span we need to remove is multiline. + // For more info: https://github.com/rust-lang/rust/issues/92741 + let lines_to_remove = file_lines.iter().take(file_lines.len() - 1); + for (index, (line_to_remove, parts)) in lines_to_remove.zip(replaced_parts).enumerate() { + buffer.puts( + *row_num - 1, + 0, + &maybe_anonymized(renderer, line_num + index, max_line_num_len), + ElementStyle::LineNumber, + ); + buffer.puts( + *row_num - 1, + max_line_num_len + 1, + "- ", + ElementStyle::Removal, + ); + let line = normalize_whitespace(line_to_remove.line); + buffer.puts( + *row_num - 1, + max_line_num_len + 3, + &line, + ElementStyle::NoStyle, + ); + style_substitution_highlights( + parts, + ElementStyle::Removal, + *row_num - 1, + line_to_remove.line, + max_line_num_len, + buffer, + ); + *row_num += 1; + } + // If the last line is exactly equal to the line we need to add, we can skip both of + // them. This allows us to avoid output like the following: + // 2 - & + // 2 + if true { true } else { false } + // 3 - if true { true } else { false } + // If those lines aren't equal, we print their diff + let last_line = &file_lines.last().unwrap(); + if last_line.line == line_to_add { + *row_num -= 2; + // The last original line collapses into the previous drawn row, so + // fold its replaced-code highlights onto that row too. + style_substitution_highlights( + replaced_parts.last().unwrap(), + ElementStyle::Removal, + *row_num, + last_line.line, + max_line_num_len, + buffer, + ); + } else { + buffer.puts( + *row_num - 1, + 0, + &maybe_anonymized(renderer, line_num + file_lines.len() - 1, max_line_num_len), + ElementStyle::LineNumber, + ); + buffer.puts( + *row_num - 1, + max_line_num_len + 1, + "- ", + ElementStyle::Removal, + ); + buffer.puts( + *row_num - 1, + max_line_num_len + 3, + &normalize_whitespace(last_line.line), + ElementStyle::NoStyle, + ); + style_substitution_highlights( + replaced_parts.last().unwrap(), + ElementStyle::Removal, + *row_num - 1, + last_line.line, + max_line_num_len, + buffer, + ); + + if line_to_add.trim().is_empty() { + *row_num -= 1; + } else { + // Check if after the removal, the line is left with only whitespace. If so, we + // will not show an "addition" line, as removing the whole line is what the user + // would really want. + // For example, for the following: + // | + // 2 - .await + // 2 + (note the left over whitespace) + // | + // We really want + // | + // 2 - .await + // | + // *row_num -= 1; + buffer.puts( + *row_num, + 0, + &maybe_anonymized(renderer, line_num, max_line_num_len), + ElementStyle::LineNumber, + ); + buffer.puts(*row_num, max_line_num_len + 1, "+ ", ElementStyle::Addition); + buffer.append( + *row_num, + &normalize_whitespace(line_to_add), + ElementStyle::NoStyle, + ); + } + } + } else if is_multiline { + buffer.puts( + *row_num, + 0, + &maybe_anonymized(renderer, line_num, max_line_num_len), + ElementStyle::LineNumber, + ); + match &highlight_parts { + [SubstitutionHighlight { start: 0, end }] if *end == line_to_add.len() => { + buffer.puts(*row_num, max_line_num_len + 1, "+ ", ElementStyle::Addition); + } + [] | [SubstitutionHighlight { start: 0, end: 0 }] => { + // FIXME: needed? Doesn't get exercised in any test. + draw_col_separator_no_space(renderer, buffer, *row_num, max_line_num_len + 1); + } + _ => { + let diff = renderer.decor_style.diff(); + buffer.puts( + *row_num, + max_line_num_len + 1, + &format!("{diff} "), + ElementStyle::Addition, + ); + } + } + // LL | line_to_add + // ++^^^ + // | | + // | magic `3` + // `max_line_num_len` + buffer.puts( + *row_num, + max_line_num_len + 3, + &normalize_whitespace(line_to_add), + ElementStyle::NoStyle, + ); + } else if let DisplaySuggestion::Add = show_code_change { + buffer.puts( + *row_num, + 0, + &maybe_anonymized(renderer, line_num, max_line_num_len), + ElementStyle::LineNumber, + ); + buffer.puts(*row_num, max_line_num_len + 1, "+ ", ElementStyle::Addition); + buffer.append( + *row_num, + &normalize_whitespace(line_to_add), + ElementStyle::NoStyle, + ); + } else { + buffer.puts( + *row_num, + 0, + &maybe_anonymized(renderer, line_num, max_line_num_len), + ElementStyle::LineNumber, + ); + draw_col_separator(renderer, buffer, *row_num, max_line_num_len + 1); + buffer.append( + *row_num, + &normalize_whitespace(line_to_add), + ElementStyle::NoStyle, + ); + } + + style_substitution_highlights( + highlight_parts, + ElementStyle::Addition, + *row_num, + line_to_add, + max_line_num_len, + buffer, + ); + + *row_num += 1; +} + +fn style_substitution_highlights( + highlight_parts: &[SubstitutionHighlight], + style: ElementStyle, + row_num: usize, + unnormalized_line: &str, + max_line_num_len: usize, + buffer: &mut StyledBuffer, +) { + for &SubstitutionHighlight { start, end } in highlight_parts { + // This is a no-op for empty ranges + if start != end { + // We calculate the extra width from tabs for both the start and end + // of the span, as tabs could be present in the middle of the span + let extra_width_start: usize = extra_width_from_tabs(unnormalized_line, start); + let extra_width_end: usize = extra_width_from_tabs(unnormalized_line, end); + buffer.set_style_range( + row_num, + max_line_num_len + 3 + start + extra_width_start, + max_line_num_len + 3 + end + extra_width_end, + style, + true, + ); + } + } +} + +#[allow(clippy::too_many_arguments)] +fn draw_line( + renderer: &Renderer, + buffer: &mut StyledBuffer, + source_string: &str, + line_index: usize, + line_offset: usize, + width_offset: usize, + code_offset: usize, + max_line_num_len: usize, + margin: Margin, +) -> usize { + // Tabs are assumed to have been replaced by spaces in calling code. + debug_assert!(!source_string.contains('\t')); + let line_len = str_width(source_string); + // Create the source line we will highlight. + let mut left = margin.left(line_len); + let right = margin.right(line_len); + + let mut taken = 0; + let mut skipped = 0; + let code: String = source_string + .chars() + .skip_while(|ch| { + let w = char_width(*ch); + // If `skipped` is less than `left`, always skip the next `ch`, + // even if `ch` is a multi-width char that would make `skipped` + // exceed `left`. This ensures that we do not exceed term width on + // source lines. + if skipped < left { + skipped += w; + true + } else { + false + } + }) + .take_while(|ch| { + // Make sure that the trimming on the right will fall within the terminal width. + taken += char_width(*ch); + taken <= (right - left) + }) + .collect(); + // If we skipped more than `left`, adjust `left` to account for it. + if skipped > left { + left += skipped - left; + } + let placeholder = renderer.decor_style.margin(); + let padding = str_width(placeholder); + let (width_taken, bytes_taken) = if margin.was_cut_left() { + // We have stripped some code/whitespace from the beginning, make it clear. + let mut bytes_taken = 0; + let mut width_taken = 0; + for ch in code.chars() { + width_taken += char_width(ch); + bytes_taken += ch.len_utf8(); + + if width_taken >= padding { + break; + } + } + + buffer.puts( + line_offset, + code_offset, + placeholder, + ElementStyle::LineNumber, + ); + (width_taken, bytes_taken) + } else { + (0, 0) + }; + + buffer.puts( + line_offset, + code_offset + width_taken, + &code[bytes_taken..], + ElementStyle::Quotation, + ); + + if line_len > right { + // We have stripped some code/whitespace from the beginning, make it clear. + let mut char_taken = 0; + let mut width_taken_inner = 0; + for ch in code.chars().rev() { + width_taken_inner += char_width(ch); + char_taken += 1; + + if width_taken_inner >= padding { + break; + } + } + + buffer.puts( + line_offset, + code_offset + width_taken + code[bytes_taken..].chars().count() - char_taken, + placeholder, + ElementStyle::LineNumber, + ); + } + + buffer.puts( + line_offset, + 0, + &maybe_anonymized(renderer, line_index, max_line_num_len), + ElementStyle::LineNumber, + ); + + draw_col_separator_no_space(renderer, buffer, line_offset, width_offset - 2); + + left +} + +fn draw_range( + buffer: &mut StyledBuffer, + symbol: char, + line: usize, + col_from: usize, + col_to: usize, + style: ElementStyle, +) { + for col in col_from..col_to { + buffer.putc(line, col, symbol, style); + } +} + +fn draw_multiline_line( + renderer: &Renderer, + buffer: &mut StyledBuffer, + line: usize, + offset: usize, + depth: usize, + style: ElementStyle, + elided: bool, +) { + let chr = match (style, renderer.decor_style) { + (ElementStyle::UnderlinePrimary | ElementStyle::LabelPrimary, DecorStyle::Ascii) => '|', + (_, DecorStyle::Ascii) => '|', + (ElementStyle::UnderlinePrimary | ElementStyle::LabelPrimary, DecorStyle::Unicode) => { + if elided { + '┇' + } else { + '┃' + } + } + (_, DecorStyle::Unicode) => { + if elided { + '┆' + } else { + '│' + } + } + }; + buffer.putc(line, offset + depth - 1, chr, style); +} + +fn draw_col_separator(renderer: &Renderer, buffer: &mut StyledBuffer, line: usize, col: usize) { + let chr = renderer.decor_style.col_separator(); + buffer.puts(line, col, &format!("{chr} "), ElementStyle::LineNumber); +} + +fn draw_col_separator_no_space( + renderer: &Renderer, + buffer: &mut StyledBuffer, + line: usize, + col: usize, +) { + let chr = renderer.decor_style.col_separator(); + draw_col_separator_no_space_with_style(buffer, chr, line, col, ElementStyle::LineNumber); +} + +fn draw_col_separator_start( + renderer: &Renderer, + buffer: &mut StyledBuffer, + line: usize, + col: usize, +) { + match renderer.decor_style { + DecorStyle::Ascii => { + draw_col_separator_no_space_with_style( + buffer, + '|', + line, + col, + ElementStyle::LineNumber, + ); + } + DecorStyle::Unicode => { + draw_col_separator_no_space_with_style( + buffer, + '╭', + line, + col, + ElementStyle::LineNumber, + ); + draw_col_separator_no_space_with_style( + buffer, + '╴', + line, + col + 1, + ElementStyle::LineNumber, + ); + } + } +} + +fn draw_col_separator_end(renderer: &Renderer, buffer: &mut StyledBuffer, line: usize, col: usize) { + match renderer.decor_style { + DecorStyle::Ascii => { + draw_col_separator_no_space_with_style( + buffer, + '|', + line, + col, + ElementStyle::LineNumber, + ); + } + DecorStyle::Unicode => { + draw_col_separator_no_space_with_style( + buffer, + '╰', + line, + col, + ElementStyle::LineNumber, + ); + draw_col_separator_no_space_with_style( + buffer, + '╴', + line, + col + 1, + ElementStyle::LineNumber, + ); + } + } +} + +fn draw_col_separator_no_space_with_style( + buffer: &mut StyledBuffer, + chr: char, + line: usize, + col: usize, + style: ElementStyle, +) { + buffer.putc(line, col, chr, style); +} + +fn maybe_anonymized(renderer: &Renderer, line_num: usize, max_line_num_len: usize) -> String { + format!( + "{:>max_line_num_len$}", + if renderer.anonymized_line_numbers { + Cow::Borrowed(ANONYMIZED_LINE_NUM) + } else { + Cow::Owned(line_num.to_string()) + } + ) +} + +fn draw_note_separator( + renderer: &Renderer, + buffer: &mut StyledBuffer, + line: usize, + col: usize, + is_cont: bool, +) { + let chr = renderer.decor_style.note_separator(is_cont); + buffer.puts(line, col, chr, ElementStyle::LineNumber); +} + +fn draw_line_separator(renderer: &Renderer, buffer: &mut StyledBuffer, line: usize, col: usize) { + let (column, dots) = match renderer.decor_style { + DecorStyle::Ascii => (0, "..."), + DecorStyle::Unicode => (col - 2, "┆"), + }; + buffer.puts(line, column, dots, ElementStyle::LineNumber); +} + +trait MessageOrTitle { + fn level(&self) -> &Level<'_>; + fn id(&self) -> Option<&Id<'_>>; + fn text(&self) -> &str; + fn allows_styling(&self) -> bool; +} + +impl MessageOrTitle for Title<'_> { + fn level(&self) -> &Level<'_> { + &self.level + } + fn id(&self) -> Option<&Id<'_>> { + self.id.as_ref() + } + fn text(&self) -> &str { + self.text.as_ref() + } + fn allows_styling(&self) -> bool { + self.allows_styling + } +} + +impl MessageOrTitle for Message<'_> { + fn level(&self) -> &Level<'_> { + &self.level + } + fn id(&self) -> Option<&Id<'_>> { + None + } + fn text(&self) -> &str { + self.text.as_ref() + } + fn allows_styling(&self) -> bool { + true + } +} + +/// Count extra display columns from tabs in the first `n` chars of `s`. +/// Each tab is displayed as 4 spaces, so the extra width per tab is 3. +fn extra_width_from_tabs(s: &str, n: usize) -> usize { + s.chars().take(n).filter(|&ch| ch == '\t').count() * 3 +} + +// instead of taking the String length or dividing by 10 while > 0, we multiply a limit by 10 until +// we're higher. If the loop isn't exited by the `return`, the last multiplication will wrap, which +// is OK, because while we cannot fit a higher power of 10 in a usize, the loop will end anyway. +// This is also why we need the max number of decimal digits within a `usize`. +fn num_decimal_digits(num: usize) -> usize { + #[cfg(target_pointer_width = "64")] + const MAX_DIGITS: usize = 20; + + #[cfg(target_pointer_width = "32")] + const MAX_DIGITS: usize = 10; + + #[cfg(target_pointer_width = "16")] + const MAX_DIGITS: usize = 5; + + let mut lim = 10; + for num_digits in 1..MAX_DIGITS { + if num < lim { + return num_digits; + } + lim = lim.wrapping_mul(10); + } + MAX_DIGITS +} + +fn str_width(s: &str) -> usize { + s.chars().map(char_width).sum() +} + +pub(crate) fn char_width(ch: char) -> usize { + // FIXME: `unicode_width` sometimes disagrees with terminals on how wide a `char` is. For now, + // just accept that sometimes the code line will be longer than desired. + match ch { + '\t' => 4, + // Keep the following list in sync with `rustc_errors::emitter::OUTPUT_REPLACEMENTS`. These + // are control points that we replace before printing with a visible codepoint for the sake + // of being able to point at them with underlines. + '\u{0000}' | '\u{0001}' | '\u{0002}' | '\u{0003}' | '\u{0004}' | '\u{0005}' + | '\u{0006}' | '\u{0007}' | '\u{0008}' | '\u{000B}' | '\u{000C}' | '\u{000D}' + | '\u{000E}' | '\u{000F}' | '\u{0010}' | '\u{0011}' | '\u{0012}' | '\u{0013}' + | '\u{0014}' | '\u{0015}' | '\u{0016}' | '\u{0017}' | '\u{0018}' | '\u{0019}' + | '\u{001A}' | '\u{001B}' | '\u{001C}' | '\u{001D}' | '\u{001E}' | '\u{001F}' + | '\u{007F}' | '\u{202A}' | '\u{202B}' | '\u{202D}' | '\u{202E}' | '\u{2066}' + | '\u{2067}' | '\u{2068}' | '\u{202C}' | '\u{2069}' => 1, + _ => unicode_width::UnicodeWidthChar::width(ch).unwrap_or(1), + } +} + +pub(crate) fn num_overlap( + a_start: usize, + a_end: usize, + b_start: usize, + b_end: usize, + inclusive: bool, +) -> bool { + let extra = usize::from(inclusive); + (b_start..b_end + extra).contains(&a_start) || (a_start..a_end + extra).contains(&b_start) +} + +fn overlaps(a1: &LineAnnotation<'_>, a2: &LineAnnotation<'_>, padding: usize) -> bool { + num_overlap( + a1.start.display, + a1.end.display + padding, + a2.start.display, + a2.end.display, + false, + ) +} + +#[derive(Clone, Debug, PartialOrd, Ord, PartialEq, Eq)] +pub(crate) enum LineAnnotationType { + /// Annotation under a single line of code + Singleline, + + // The Multiline type above is replaced with the following three in order + // to reuse the current label drawing code. + // + // Each of these corresponds to one part of the following diagram: + // + // x | foo(1 + bar(x, + // | _________^ < MultilineStart + // x | | y), < MultilineLine + // | |______________^ label < MultilineEnd + // x | z); + /// Annotation marking the first character of a fully shown multiline span + MultilineStart(usize), + /// Annotation marking the last character of a fully shown multiline span + MultilineEnd(usize), + /// Line at the left enclosing the lines of a fully shown multiline span + // Just a placeholder for the drawing algorithm, to know that it shouldn't skip the first 4 + // and last 2 lines of code. The actual line is drawn in `emit_message_default` and not in + // `draw_multiline_line`. + MultilineLine(usize), +} + +#[derive(Clone, Debug, PartialOrd, Ord, PartialEq, Eq)] +pub(crate) struct LineAnnotation<'a> { + /// Start column. + /// Note that it is important that this field goes + /// first, so that when we sort, we sort orderings by start + /// column. + pub start: Loc, + + /// End column within the line (exclusive) + pub end: Loc, + + /// level + pub kind: AnnotationKind, + + /// Optional label to display adjacent to the annotation. + pub label: Option>, + + /// Is this a single line, multiline or multiline span minimized down to a + /// smaller span. + pub annotation_type: LineAnnotationType, + + /// Whether the source code should be highlighted + pub highlight_source: bool, +} + +impl LineAnnotation<'_> { + pub(crate) fn is_primary(&self) -> bool { + self.kind == AnnotationKind::Primary + } + + /// Whether this annotation is a vertical line placeholder. + pub(crate) fn is_line(&self) -> bool { + matches!(self.annotation_type, LineAnnotationType::MultilineLine(_)) + } + + /// Length of this annotation as displayed in the stderr output + pub(crate) fn len(&self) -> usize { + // Account for usize underflows + self.end.display.abs_diff(self.start.display) + } + + pub(crate) fn has_label(&self) -> bool { + if let Some(label) = &self.label { + // Consider labels with no text as effectively not being there + // to avoid weird output with unnecessary vertical lines, like: + // + // X | fn foo(x: u32) { + // | -------^------ + // | | | + // | | + // | + // + // Note that this would be the complete output users would see. + !label.is_empty() + } else { + false + } + } + + pub(crate) fn takes_space(&self) -> bool { + // Multiline annotations always have to keep vertical space. + matches!( + self.annotation_type, + LineAnnotationType::MultilineStart(_) | LineAnnotationType::MultilineEnd(_) + ) + } +} + +#[derive(Clone, Copy, Debug)] +pub(crate) enum DisplaySuggestion { + Underline, + Diff, + None, + Add, +} + +impl DisplaySuggestion { + fn new(complete: &str, patches: &[TrimmedPatch<'_>], sm: &SourceMap<'_>) -> Self { + let has_deletion = patches + .iter() + .any(|p| p.is_deletion(sm) || p.is_destructive_replacement(sm)); + let is_multiline = complete.lines().count() > 1; + if has_deletion && !is_multiline { + DisplaySuggestion::Diff + } else if patches.len() == 1 + && patches.first().is_some_and(|p| { + p.replacement.ends_with('\n') && p.replacement.trim() == complete.trim() + }) + { + // We are adding a line(s) of code before code that was already there. + DisplaySuggestion::Add + } else if (patches.len() != 1 || patches[0].replacement.trim() != complete.trim()) + && !is_multiline + { + DisplaySuggestion::Underline + } else { + DisplaySuggestion::None + } + } +} + +// We replace some characters so the CLI output is always consistent and underlines aligned. +// Keep the following list in sync with `rustc_span::char_width`. +const OUTPUT_REPLACEMENTS: &[(char, &str)] = &[ + // In terminals without Unicode support the following will be garbled, but in *all* terminals + // the underlying codepoint will be as well. We could gate this replacement behind a "unicode + // support" gate. + ('\0', "␀"), + ('\u{0001}', "␁"), + ('\u{0002}', "␂"), + ('\u{0003}', "␃"), + ('\u{0004}', "␄"), + ('\u{0005}', "␅"), + ('\u{0006}', "␆"), + ('\u{0007}', "␇"), + ('\u{0008}', "␈"), + ('\t', " "), // We do our own tab replacement + ('\u{000b}', "␋"), + ('\u{000c}', "␌"), + ('\u{000d}', "␍"), + ('\u{000e}', "␎"), + ('\u{000f}', "␏"), + ('\u{0010}', "␐"), + ('\u{0011}', "␑"), + ('\u{0012}', "␒"), + ('\u{0013}', "␓"), + ('\u{0014}', "␔"), + ('\u{0015}', "␕"), + ('\u{0016}', "␖"), + ('\u{0017}', "␗"), + ('\u{0018}', "␘"), + ('\u{0019}', "␙"), + ('\u{001a}', "␚"), + ('\u{001b}', "␛"), + ('\u{001c}', "␜"), + ('\u{001d}', "␝"), + ('\u{001e}', "␞"), + ('\u{001f}', "␟"), + ('\u{007f}', "␡"), + ('\u{200d}', ""), // Replace ZWJ for consistent terminal output of grapheme clusters. + ('\u{202a}', "�"), // The following unicode text flow control characters are inconsistently + ('\u{202b}', "�"), // supported across CLIs and can cause confusion due to the bytes on disk + ('\u{202c}', "�"), // not corresponding to the visible source code, so we replace them always. + ('\u{202d}', "�"), + ('\u{202e}', "�"), + ('\u{2066}', "�"), + ('\u{2067}', "�"), + ('\u{2068}', "�"), + ('\u{2069}', "�"), +]; + +pub(crate) fn normalize_whitespace(s: &str) -> Cow<'_, str> { + if !s + .chars() + .any(|user| OUTPUT_REPLACEMENTS.iter().any(|(bad, _)| user == *bad)) + { + return Cow::Borrowed(s); + } + + // Scan the input string for a character in the ordered table above. + // If it's present, replace it with its alternative string (it can be more than 1 char!). + // Otherwise, retain the input char. + let normalized = s.chars().fold(String::with_capacity(s.len()), |mut s, c| { + match OUTPUT_REPLACEMENTS.binary_search_by_key(&c, |(k, _)| *k) { + Ok(i) => s.push_str(OUTPUT_REPLACEMENTS[i].1), + _ => s.push(c), + } + s + }); + Cow::Owned(normalized) +} + +#[derive(Clone, Copy, Debug, PartialOrd, Ord, PartialEq, Eq)] +pub(crate) enum ElementStyle { + MainHeaderMsg, + HeaderMsg, + LineAndColumn, + LineNumber, + Quotation, + UnderlinePrimary, + UnderlineSecondary, + LabelPrimary, + LabelSecondary, + NoStyle, + Level(LevelInner), + Addition, + Removal, +} + +impl ElementStyle { + pub(crate) fn color_spec(&self, level: &Level<'_>, stylesheet: &Stylesheet) -> Style { + match self { + ElementStyle::Addition => stylesheet.addition, + ElementStyle::Removal => stylesheet.removal, + ElementStyle::LineAndColumn => stylesheet.none, + ElementStyle::LineNumber => stylesheet.line_num, + ElementStyle::Quotation => stylesheet.none, + ElementStyle::MainHeaderMsg => stylesheet.emphasis, + ElementStyle::UnderlinePrimary | ElementStyle::LabelPrimary => level.style(stylesheet), + ElementStyle::UnderlineSecondary | ElementStyle::LabelSecondary => stylesheet.context, + ElementStyle::HeaderMsg | ElementStyle::NoStyle => stylesheet.none, + ElementStyle::Level(lvl) => lvl.style(stylesheet), + } + } +} + +#[derive(Debug, Clone, Copy)] +pub(crate) struct UnderlineParts { + pub(crate) style: ElementStyle, + pub(crate) underline: char, + pub(crate) label_start: char, + pub(crate) vertical_text_line: char, + pub(crate) multiline_vertical: char, + pub(crate) multiline_horizontal: char, + pub(crate) multiline_whole_line: char, + pub(crate) multiline_start_down: char, + pub(crate) bottom_right: char, + pub(crate) top_left: char, + pub(crate) top_right_flat: char, + pub(crate) bottom_left: char, + pub(crate) multiline_end_up: char, + pub(crate) multiline_end_same_line: char, + pub(crate) multiline_bottom_right_with_text: char, +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +enum TitleStyle { + MainHeader, + Header, + Secondary, +} + +struct PreProcessedGroup<'a> { + group: &'a Group<'a>, + elements: Vec>, + primary_path: Option<&'a Cow<'a, str>>, + max_depth: usize, +} + +enum PreProcessedElement<'a> { + Message(&'a Message<'a>), + Cause( + ( + &'a Snippet<'a, Annotation<'a>>, + SourceMap<'a>, + Vec>, + ), + ), + Suggestion( + ( + &'a Snippet<'a, Patch<'a>>, + SourceMap<'a>, + SplicedLines<'a>, + DisplaySuggestion, + ), + ), + Origin(&'a Origin<'a>), + Padding(Padding), +} + +fn pre_process<'a>( + groups: &'a [Group<'a>], +) -> (usize, Option<&'a Cow<'a, str>>, Vec>) { + let mut max_line_num = 0; + let mut og_primary_path = None; + let mut out = Vec::with_capacity(groups.len()); + for group in groups { + let mut elements = Vec::with_capacity(group.elements.len()); + let mut primary_path = None; + let mut max_depth = 0; + for element in &group.elements { + match element { + Element::Message(message) => { + elements.push(PreProcessedElement::Message(message)); + } + Element::Cause(cause) => { + let sm = SourceMap::new(&cause.source, cause.line_start); + let (depth, annotated_lines) = + sm.annotated_lines(cause.markers.clone(), cause.fold); + + if cause.fold { + let end = cause + .markers + .iter() + .map(|a| a.span.end) + .max() + .unwrap_or(cause.source.len()) + .min(cause.source.len()); + + max_line_num = max( + cause.line_start + newline_count(&cause.source[..end]), + max_line_num, + ); + } else { + max_line_num = max( + cause.line_start + newline_count(&cause.source), + max_line_num, + ); + } + + if primary_path.is_none() { + primary_path = Some(cause.path.as_ref()); + } + max_depth = max(depth, max_depth); + elements.push(PreProcessedElement::Cause((cause, sm, annotated_lines))); + } + Element::Suggestion(suggestion) => { + let sm = SourceMap::new(&suggestion.source, suggestion.line_start); + if let Some((complete, patches, highlights, replaced_highlights)) = + sm.splice_lines(suggestion.markers.clone(), suggestion.fold) + { + let display_suggestion = DisplaySuggestion::new(&complete, &patches, &sm); + + if suggestion.fold { + if let Some(first) = patches.first() { + let (l_start, _) = + sm.span_to_locations(first.original_span.clone()); + let nc = newline_count(&complete); + let sugg_max_line_num = match display_suggestion { + DisplaySuggestion::Underline => l_start.line, + DisplaySuggestion::Diff => { + let file_lines = sm.span_to_lines(first.span.clone()); + file_lines + .last() + .map_or(l_start.line + nc, |line| line.line_index) + } + DisplaySuggestion::None => l_start.line + nc, + DisplaySuggestion::Add => l_start.line + nc, + }; + max_line_num = max(sugg_max_line_num, max_line_num); + } + } else { + max_line_num = max( + suggestion.line_start + newline_count(&complete), + max_line_num, + ); + } + + elements.push(PreProcessedElement::Suggestion(( + suggestion, + sm, + (complete, patches, highlights, replaced_highlights), + display_suggestion, + ))); + } + } + Element::Origin(origin) => { + if primary_path.is_none() { + primary_path = Some(Some(&origin.path)); + } + elements.push(PreProcessedElement::Origin(origin)); + } + Element::Padding(padding) => { + elements.push(PreProcessedElement::Padding(padding.clone())); + } + } + } + let group = PreProcessedGroup { + group, + elements, + primary_path: primary_path.unwrap_or_default(), + max_depth, + }; + if og_primary_path.is_none() && group.primary_path.is_some() { + og_primary_path = group.primary_path; + } + out.push(group); + } + + (max_line_num, og_primary_path, out) +} + +fn newline_count(body: &str) -> usize { + #[cfg(feature = "simd")] + { + // Trailing newlines do not count towards the number of lines + // (this is based into `str::lines`) + let trailing_newline = body.ends_with('\n'); + memchr::memchr_iter(b'\n', body.as_bytes()).count() - usize::from(trailing_newline) + } + #[cfg(not(feature = "simd"))] + { + body.lines().count().saturating_sub(1) + } +} + +#[cfg(test)] +mod test { + use super::{OUTPUT_REPLACEMENTS, newline_count}; + use snapbox::IntoData; + + fn format_replacements(replacements: Vec<(char, &str)>) -> String { + replacements + .into_iter() + .map(|r| format!(" {r:?}")) + .collect::>() + .join("\n") + } + + #[test] + /// The [`OUTPUT_REPLACEMENTS`] array must be sorted (for binary search to + /// work) and must contain no duplicate entries + fn ensure_output_replacements_is_sorted() { + let mut expected = OUTPUT_REPLACEMENTS.to_owned(); + expected.sort_by_key(|r| r.0); + expected.dedup_by_key(|r| r.0); + let expected = format_replacements(expected); + let actual = format_replacements(OUTPUT_REPLACEMENTS.to_owned()); + snapbox::assert_data_eq!(actual, expected.into_data().raw()); + } + + #[test] + fn ensure_newline_count_correct() { + let source = r#" + cargo-features = ["path-bases"] + + [package] + name = "foo" + version = "0.5.0" + authors = ["wycats@example.com"] + + [dependencies] + bar = { base = '^^not-valid^^', path = 'bar' } + "#; + assert_eq!(newline_count(source), 10); + + assert_eq!(newline_count(""), 0); + + assert_eq!(newline_count("one"), 0); + + assert_eq!(newline_count("one\n"), 0); + + assert_eq!(newline_count("one\ntwo"), 1); + + assert_eq!(newline_count("one\ntwo\n"), 1); + + assert_eq!(newline_count("one\n\n"), 1); + + assert_eq!(newline_count("one\r\ntwo\r\n"), 1); + } +} diff --git a/crates/ruff_annotate_snippets/src/renderer/source_map.rs b/crates/ruff_annotate_snippets/src/renderer/source_map.rs new file mode 100644 index 00000000000000..7b3f5c1810d700 --- /dev/null +++ b/crates/ruff_annotate_snippets/src/renderer/source_map.rs @@ -0,0 +1,800 @@ +use alloc::borrow::Cow; +use alloc::string::String; +use alloc::{vec, vec::Vec}; +use core::cmp::{max, min}; +use core::ops::Range; + +use crate::renderer::{LineAnnotation, LineAnnotationType, char_width, num_overlap}; +use crate::{Annotation, AnnotationKind, Patch}; + +#[derive(Debug)] +pub(crate) struct SourceMap<'a> { + lines: Vec>, + pub(crate) source: &'a str, +} + +impl<'a> SourceMap<'a> { + pub(crate) fn new(source: &'a str, line_start: usize) -> Self { + // Empty sources do have a "line", but it is empty, so we need to add + // a line with an empty string to the source map. + if source.is_empty() { + return Self { + lines: vec![LineInfo { + line: "", + line_index: line_start, + start_byte: 0, + end_byte: 0, + end_line_size: 0, + }], + source, + }; + } + + let mut current_index = 0; + + let mut mapping = vec![]; + for (idx, (line, end_line)) in CursorLines::new(source).enumerate() { + let line_length = line.len(); + let line_range = current_index..current_index + line_length; + let end_line_size = end_line.len(); + + mapping.push(LineInfo { + line, + line_index: line_start + idx, + start_byte: line_range.start, + end_byte: line_range.end + end_line_size, + end_line_size, + }); + + current_index += line_length + end_line_size; + } + Self { + lines: mapping, + source, + } + } + + pub(crate) fn get_line(&self, idx: usize) -> Option<&'a str> { + self.lines + .iter() + .find(|l| l.line_index == idx) + .map(|info| info.line) + } + + pub(crate) fn span_to_locations(&self, span: Range) -> (Loc, Loc) { + let start_info = self + .lines + .iter() + .find(|info| span.start >= info.start_byte && span.start < info.end_byte) + .unwrap_or(self.lines.last().unwrap()); + let (mut start_char_pos, start_display_pos) = start_info.line + [0..(span.start - start_info.start_byte).min(start_info.line.len())] + .chars() + .fold((0, 0), |(char_pos, byte_pos), c| { + let display = char_width(c); + (char_pos + 1, byte_pos + display) + }); + // correct the char pos if we are highlighting the end of a line + if (span.start - start_info.start_byte).saturating_sub(start_info.line.len()) > 0 { + start_char_pos += 1; + } + let start = Loc { + line: start_info.line_index, + char: start_char_pos, + display: start_display_pos, + byte: span.start, + }; + + if span.start == span.end { + return (start, start); + } + + let end_info = self + .lines + .iter() + .find(|info| span.end >= info.start_byte && span.end < info.end_byte) + .unwrap_or(self.lines.last().unwrap()); + let (end_char_pos, end_display_pos) = end_info.line + [0..(span.end - end_info.start_byte).min(end_info.line.len())] + .chars() + .fold((0, 0), |(char_pos, byte_pos), c| { + let display = char_width(c); + (char_pos + 1, byte_pos + display) + }); + + let mut end = Loc { + line: end_info.line_index, + char: end_char_pos, + display: end_display_pos, + byte: span.end, + }; + if start.line != end.line && end.byte > end_info.end_byte - end_info.end_line_size { + end.char += 1; + end.display += 1; + } + + (start, end) + } + + pub(crate) fn span_to_snippet(&self, span: Range) -> Option<&str> { + self.source.get(span) + } + + pub(crate) fn span_to_lines(&self, span: Range) -> Vec<&LineInfo<'a>> { + let mut lines = vec![]; + let start = span.start; + let end = span.end; + for line_info in &self.lines { + if start >= line_info.end_byte { + continue; + } + if end < line_info.start_byte { + break; + } + lines.push(line_info); + } + + if lines.is_empty() && !self.lines.is_empty() { + lines.push(self.lines.last().unwrap()); + } + + lines + } + + pub(crate) fn annotated_lines( + &self, + annotations: Vec>, + fold: bool, + ) -> (usize, Vec>) { + let source_len = self.source.len(); + if let Some(bigger) = annotations.iter().find_map(|x| { + // Allow highlighting one past the last character in the source. + if source_len + 1 < x.span.end { + Some(&x.span) + } else { + None + } + }) { + panic!("Annotation range `{bigger:?}` is beyond the end of buffer `{source_len}`") + } + + let mut annotated_line_infos = self + .lines + .iter() + .map(|info| AnnotatedLineInfo { + line: info.line, + line_index: info.line_index, + annotations: vec![], + keep: false, + }) + .collect::>(); + let mut multiline_annotations = vec![]; + + for Annotation { + span, + label, + kind, + highlight_source, + } in annotations + { + let (lo, mut hi) = self.span_to_locations(span.clone()); + if kind == AnnotationKind::Visible { + for line_idx in lo.line..=hi.line { + self.keep_line(&mut annotated_line_infos, line_idx); + } + continue; + } + // Watch out for "empty spans". If we get a span like 6..6, we + // want to just display a `^` at 6, so convert that to + // 6..7. This is degenerate input, but it's best to degrade + // gracefully -- and the parser likes to supply a span like + // that for EOF, in particular. + + if lo.display == hi.display && lo.line == hi.line { + hi.display += 1; + } + + if lo.line == hi.line { + let line_ann = LineAnnotation { + start: lo, + end: hi, + kind, + label, + annotation_type: LineAnnotationType::Singleline, + highlight_source, + }; + self.add_annotation_to_file(&mut annotated_line_infos, lo.line, line_ann); + } else { + multiline_annotations.push(MultilineAnnotation { + depth: 1, + start: lo, + end: hi, + kind, + label, + overlaps_exactly: false, + highlight_source, + }); + } + } + + let mut primary_spans = vec![]; + + // Find overlapping multiline annotations, put them at different depths + multiline_annotations.sort_by_key(|ml| (ml.start.line, usize::MAX - ml.end.line)); + for (outer_i, ann) in multiline_annotations.clone().into_iter().enumerate() { + if ann.kind.is_primary() { + primary_spans.push((ann.start, ann.end)); + } + for (inner_i, a) in &mut multiline_annotations.iter_mut().enumerate() { + // Move all other multiline annotations overlapping with this one + // one level to the right. + if !ann.same_span(a) + && num_overlap(ann.start.line, ann.end.line, a.start.line, a.end.line, true) + { + a.increase_depth(); + } else if ann.same_span(a) && outer_i != inner_i { + a.overlaps_exactly = true; + } else { + if primary_spans + .iter() + .any(|(s, e)| a.start == *s && a.end == *e) + { + a.kind = AnnotationKind::Primary; + } + break; + } + } + } + + let mut max_depth = 0; // max overlapping multiline spans + for ann in &multiline_annotations { + max_depth = max(max_depth, ann.depth); + } + // Change order of multispan depth to minimize the number of overlaps in the ASCII art. + for a in &mut multiline_annotations { + a.depth = max_depth - a.depth + 1; + } + for ann in multiline_annotations { + let mut end_ann = ann.as_end(); + if ann.overlaps_exactly { + end_ann.annotation_type = LineAnnotationType::Singleline; + } else { + // avoid output like + // + // | foo( + // | _____^ + // | |_____| + // | || bar, + // | || ); + // | || ^ + // | ||______| + // | |______foo + // | baz + // + // and instead get + // + // | foo( + // | _____^ + // | | bar, + // | | ); + // | | ^ + // | | | + // | |______foo + // | baz + self.add_annotation_to_file( + &mut annotated_line_infos, + ann.start.line, + ann.as_start(), + ); + // 4 is the minimum vertical length of a multiline span when presented: two lines + // of code and two lines of underline. This is not true for the special case where + // the beginning doesn't have an underline, but the current logic seems to be + // working correctly. + let middle = min(ann.start.line + 4, ann.end.line); + // We'll show up to 4 lines past the beginning of the multispan start. + // We will *not* include the tail of lines that are only whitespace, a comment or + // a bare delimiter. + let filter = |s: &str| { + let s = s.trim(); + // Consider comments as empty, but don't consider docstrings to be empty. + !(s.starts_with("//") && !(s.starts_with("///") || s.starts_with("//!"))) + // Consider lines with nothing but whitespace, a single delimiter as empty. + && !["", "{", "}", "(", ")", "[", "]"].contains(&s) + }; + let until = (ann.start.line..middle) + .rev() + .filter_map(|line| self.get_line(line).map(|s| (line + 1, s))) + .find(|(_, s)| filter(s)) + .map_or(ann.start.line, |(line, _)| line); + for line in ann.start.line + 1..until { + // Every `|` that joins the beginning of the span (`___^`) to the end (`|__^`). + self.add_annotation_to_file(&mut annotated_line_infos, line, ann.as_line()); + } + let line_end = ann.end.line - 1; + let end_is_empty = self.get_line(line_end).is_some_and(|s| !filter(s)); + if middle < line_end && !end_is_empty { + self.add_annotation_to_file(&mut annotated_line_infos, line_end, ann.as_line()); + } + } + self.add_annotation_to_file(&mut annotated_line_infos, end_ann.end.line, end_ann); + } + + if fold { + annotated_line_infos.retain(|l| !l.annotations.is_empty() || l.keep); + } + + (max_depth, annotated_line_infos) + } + + fn add_annotation_to_file( + &self, + annotated_line_infos: &mut Vec>, + line_index: usize, + line_ann: LineAnnotation<'a>, + ) { + if let Some(line_info) = annotated_line_infos + .iter_mut() + .find(|line_info| line_info.line_index == line_index) + { + line_info.annotations.push(line_ann); + } else { + let info = self + .lines + .iter() + .find(|l| l.line_index == line_index) + .unwrap(); + annotated_line_infos.push(AnnotatedLineInfo { + line: info.line, + line_index, + annotations: vec![line_ann], + keep: false, + }); + annotated_line_infos.sort_by_key(|l| l.line_index); + } + } + + fn keep_line(&self, annotated_line_infos: &mut Vec>, line_index: usize) { + if let Some(line_info) = annotated_line_infos + .iter_mut() + .find(|line_info| line_info.line_index == line_index) + { + line_info.keep = true; + } else { + let info = self + .lines + .iter() + .find(|l| l.line_index == line_index) + .unwrap(); + annotated_line_infos.push(AnnotatedLineInfo { + line: info.line, + line_index, + annotations: vec![], + keep: true, + }); + annotated_line_infos.sort_by_key(|l| l.line_index); + } + } + + pub(crate) fn splice_lines<'b>( + &'a self, + mut patches: Vec>, + fold: bool, + ) -> Option> { + fn push_trailing(buf: &mut String, line_opt: Option<&str>, lo: &Loc, hi_opt: Option<&Loc>) { + // Convert CharPos to Usize, as CharPose is character offset + // Extract low index and high index + let (lo, hi_opt) = (lo.char, hi_opt.map(|hi| hi.char)); + if let Some(line) = line_opt { + if let Some(lo) = line.char_indices().map(|(i, _)| i).nth(lo) { + // Get high index while account for rare unicode and emoji with char_indices + let hi_opt = hi_opt.and_then(|hi| line.char_indices().map(|(i, _)| i).nth(hi)); + match hi_opt { + // If high index exist, take string from low to high index + Some(hi) if hi > lo => buf.push_str(&line[lo..hi]), + Some(_) => (), + // If high index absence, take string from low index till end string.len + None => buf.push_str(&line[lo..]), + } + } + // If high index is None + if hi_opt.is_none() { + buf.push('\n'); + } + } + } + + let source_len = self.source.len(); + if let Some(bigger) = patches.iter().find_map(|x| { + // Allow patching one past the last character in the source. + if source_len + 1 < x.span.end { + Some(&x.span) + } else { + None + } + }) { + panic!("Patch span `{bigger:?}` is beyond the end of buffer `{source_len}`") + } + + // Assumption: all spans are in the same file, and all spans + // are disjoint. Sort in ascending order. + patches.sort_by_key(|p| p.span.start); + + // Find the bounding span. + let (lo, hi) = if fold { + let lo = patches.iter().map(|p| p.span.start).min()?; + let hi = patches.iter().map(|p| p.span.end).max()?; + (lo, hi) + } else { + (0, source_len) + }; + + let lines = self.span_to_lines(lo..hi); + + let mut highlights = vec![]; + // To build up the result, we do this for each span: + // - push the line segment trailing the previous span + // (at the beginning a "phantom" span pointing at the start of the line) + // - push lines between the previous and current span (if any) + // - if the previous and current span are not on the same line + // push the line segment leading up to the current span + // - splice in the span substitution + // + // Finally push the trailing line segment of the last span + let (mut prev_hi, _) = self.span_to_locations(lo..hi); + prev_hi.char = 0; + let mut prev_line = lines.first().map(|line| line.line); + let mut buf = String::new(); + + let trimmed_patches = patches + .into_iter() + // If this is a replacement of, e.g. `"a"` into `"ab"`, adjust the + // suggestion and snippet to look as if we just suggested to add + // `"b"`, which is typically much easier for the user to understand. + .map(|part| part.trim_trivial_replacements(self.source)) + .collect::>(); + let mut line_highlight = vec![]; + // We need to keep track of the difference between the existing code and the added + // or deleted code in order to point at the correct column *after* substitution. + let mut acc = 0; + for part in &trimmed_patches { + let (cur_lo, cur_hi) = self.span_to_locations(part.span.clone()); + if prev_hi.line == cur_lo.line { + push_trailing(&mut buf, prev_line, &prev_hi, Some(&cur_lo)); + } else { + acc = 0; + highlights.push(core::mem::take(&mut line_highlight)); + push_trailing(&mut buf, prev_line, &prev_hi, None); + // push lines between the previous and current span (if any) + for idx in prev_hi.line + 1..(cur_lo.line) { + if let Some(line) = self.get_line(idx) { + buf.push_str(line.as_ref()); + buf.push('\n'); + highlights.push(core::mem::take(&mut line_highlight)); + } + } + if let Some(cur_line) = self.get_line(cur_lo.line) { + let end = match cur_line.char_indices().nth(cur_lo.char) { + Some((i, _)) => i, + None => cur_line.len(), + }; + buf.push_str(&cur_line[..end]); + } + } + // Add a whole line highlight per line in the snippet. + let len: isize = part + .replacement + .split('\n') + .next() + .unwrap_or(&part.replacement) + .chars() + .map(|c| match c { + '\t' => 4, + _ => 1, + }) + .sum(); + line_highlight.push(SubstitutionHighlight { + start: (cur_lo.char as isize + acc) as usize, + end: (cur_lo.char as isize + acc + len) as usize, + }); + buf.push_str(&part.replacement); + // Account for the difference between the width of the current code and the + // snippet being suggested, so that the *later* suggestions are correctly + // aligned on the screen. Note that cur_hi and cur_lo can be on different + // lines, so cur_hi.col can be smaller than cur_lo.col + acc += len - (cur_hi.char as isize - cur_lo.char as isize); + prev_hi = cur_hi; + prev_line = self.get_line(prev_hi.line); + for line in part.replacement.split('\n').skip(1) { + acc = 0; + highlights.push(core::mem::take(&mut line_highlight)); + let end: usize = line + .chars() + .map(|c| match c { + '\t' => 4, + _ => 1, + }) + .sum(); + line_highlight.push(SubstitutionHighlight { start: 0, end }); + } + } + highlights.push(core::mem::take(&mut line_highlight)); + if fold { + // if the replacement already ends with a newline, don't print the next line + if !buf.ends_with('\n') { + push_trailing(&mut buf, prev_line, &prev_hi, None); + } + } else { + // Add the trailing part of the source after the last patch + if let Some(snippet) = self.span_to_snippet(prev_hi.byte..source_len) { + buf.push_str(snippet); + for _ in snippet.matches('\n') { + highlights.push(core::mem::take(&mut line_highlight)); + } + } + } + // remove trailing newlines + while buf.ends_with('\n') { + buf.pop(); + } + + let (bounding_lo, bounding_hi) = self.span_to_locations(lo..hi); + let line_count = bounding_hi.line.saturating_sub(bounding_lo.line) + 1; + let mut replaced_highlights: Vec> = vec![Vec::new(); line_count]; + for part in &trimmed_patches { + let (cur_lo, cur_hi) = self.span_to_locations(part.span.clone()); + for line in cur_lo.line..=cur_hi.line { + let start = if line == cur_lo.line { cur_lo.char } else { 0 }; + let end = if line == cur_hi.line { + cur_hi.char + } else { + self.get_line(line).unwrap_or_default().chars().count() + }; + replaced_highlights[line - bounding_lo.line] + .push(SubstitutionHighlight { start, end }); + } + } + + if highlights.iter().all(|parts| parts.is_empty()) { + None + } else { + Some((buf, trimmed_patches, highlights, replaced_highlights)) + } + } +} + +#[derive(Clone, Debug, PartialOrd, Ord, PartialEq, Eq)] +pub(crate) struct MultilineAnnotation<'a> { + pub depth: usize, + pub start: Loc, + pub end: Loc, + pub kind: AnnotationKind, + pub label: Option>, + pub overlaps_exactly: bool, + pub highlight_source: bool, +} + +impl<'a> MultilineAnnotation<'a> { + pub(crate) fn increase_depth(&mut self) { + self.depth += 1; + } + + /// Compare two `MultilineAnnotation`s considering only the `Span` they cover. + pub(crate) fn same_span(&self, other: &MultilineAnnotation<'_>) -> bool { + self.start == other.start && self.end == other.end + } + + pub(crate) fn as_start(&self) -> LineAnnotation<'a> { + LineAnnotation { + start: self.start, + end: Loc { + line: self.start.line, + char: self.start.char + 1, + display: self.start.display + 1, + byte: self.start.byte + 1, + }, + kind: self.kind, + label: None, + annotation_type: LineAnnotationType::MultilineStart(self.depth), + highlight_source: self.highlight_source, + } + } + + pub(crate) fn as_end(&self) -> LineAnnotation<'a> { + LineAnnotation { + start: Loc { + line: self.end.line, + char: self.end.char.saturating_sub(1), + display: self.end.display.saturating_sub(1), + byte: self.end.byte.saturating_sub(1), + }, + end: self.end, + kind: self.kind, + label: self.label.clone(), + annotation_type: LineAnnotationType::MultilineEnd(self.depth), + highlight_source: self.highlight_source, + } + } + + pub(crate) fn as_line(&self) -> LineAnnotation<'a> { + LineAnnotation { + start: Loc::default(), + end: Loc::default(), + kind: self.kind, + label: None, + annotation_type: LineAnnotationType::MultilineLine(self.depth), + highlight_source: self.highlight_source, + } + } +} + +#[derive(Debug)] +pub(crate) struct LineInfo<'a> { + pub(crate) line: &'a str, + pub(crate) line_index: usize, + pub(crate) start_byte: usize, + pub(crate) end_byte: usize, + end_line_size: usize, +} + +#[derive(Debug)] +pub(crate) struct AnnotatedLineInfo<'a> { + pub(crate) line: &'a str, + pub(crate) line_index: usize, + pub(crate) annotations: Vec>, + pub(crate) keep: bool, +} + +/// A source code location used for error reporting. +#[derive(Clone, Copy, Debug, Default, PartialOrd, Ord, PartialEq, Eq)] +pub(crate) struct Loc { + /// The (1-based) line number. + pub(crate) line: usize, + /// The (0-based) column offset. + pub(crate) char: usize, + /// The (0-based) column offset when displayed. + pub(crate) display: usize, + /// The (0-based) byte offset. + pub(crate) byte: usize, +} + +struct CursorLines<'a>(&'a str); + +impl CursorLines<'_> { + fn new(src: &str) -> CursorLines<'_> { + CursorLines(src) + } +} + +#[derive(Copy, Clone, Debug, PartialEq)] +enum EndLine { + Eof, + Lf, + Crlf, +} + +impl EndLine { + /// The number of characters this line ending occupies in bytes. + pub(crate) fn len(self) -> usize { + match self { + EndLine::Eof => 0, + EndLine::Lf => 1, + EndLine::Crlf => 2, + } + } +} + +impl<'a> Iterator for CursorLines<'a> { + type Item = (&'a str, EndLine); + + fn next(&mut self) -> Option { + if self.0.is_empty() { + None + } else { + self.0 + .find('\n') + .map(|x| { + let ret = if 0 < x { + if self.0.as_bytes()[x - 1] == b'\r' { + (&self.0[..x - 1], EndLine::Crlf) + } else { + (&self.0[..x], EndLine::Lf) + } + } else { + ("", EndLine::Lf) + }; + self.0 = &self.0[x + 1..]; + ret + }) + .or_else(|| { + let ret = Some((self.0, EndLine::Eof)); + self.0 = ""; + ret + }) + } + } +} + +pub(crate) type SplicedLines<'a> = ( + String, + Vec>, + // Char spans to highlight per line of the post-substitution output. + Vec>, + // Char spans of the replaced (original) code, per original line in the + // bounding range covered by the splice. + Vec>, +); + +/// Used to translate between `Span`s and byte positions within a single output line in highlighted +/// code of structured suggestions. +#[derive(Debug, Clone, Copy)] +pub(crate) struct SubstitutionHighlight { + pub(crate) start: usize, + pub(crate) end: usize, +} + +#[derive(Clone, Debug)] +pub(crate) struct TrimmedPatch<'a> { + pub(crate) original_span: Range, + pub(crate) span: Range, + pub(crate) replacement: Cow<'a, str>, +} + +impl<'a> TrimmedPatch<'a> { + pub(crate) fn is_addition(&self, sm: &SourceMap<'_>) -> bool { + !self.replacement.is_empty() && !self.replaces_meaningful_content(sm) + } + + pub(crate) fn is_deletion(&self, sm: &SourceMap<'_>) -> bool { + self.replacement.trim().is_empty() && self.replaces_meaningful_content(sm) + } + + pub(crate) fn is_replacement(&self, sm: &SourceMap<'_>) -> bool { + !self.replacement.is_empty() && self.replaces_meaningful_content(sm) + } + + /// Whether this is a replacement that overwrites source with a snippet + /// in a way that isn't a superset of the original string. For example, + /// replacing "abc" with "abcde" is not destructive, but replacing it + /// it with "abx" is, since the "c" character is lost. + pub(crate) fn is_destructive_replacement(&self, sm: &SourceMap<'_>) -> bool { + self.is_replacement(sm) + && sm + .span_to_snippet(self.span.clone()) + .is_none_or(|s| as_substr(s.trim(), self.replacement.trim()).is_none()) + } + + fn replaces_meaningful_content(&self, sm: &SourceMap<'_>) -> bool { + sm.span_to_snippet(self.span.clone()) + .map_or(!self.span.is_empty(), |snippet| !snippet.trim().is_empty()) + } +} + +/// Given an original string like `AACC`, and a suggestion like `AABBCC`, try to detect +/// the case where a substring of the suggestion is "sandwiched" in the original, like +/// `BB` is. Return the length of the prefix, the "trimmed" suggestion, and the length +/// of the suffix. +pub(crate) fn as_substr<'a>( + original: &'a str, + suggestion: &'a str, +) -> Option<(usize, &'a str, usize)> { + if let Some(stripped) = suggestion.strip_prefix(original) { + Some((original.len(), stripped, 0)) + } else if let Some(stripped) = suggestion.strip_suffix(original) { + Some((0, stripped, original.len())) + } else { + let common_prefix = original + .chars() + .zip(suggestion.chars()) + .take_while(|(c1, c2)| c1 == c2) + .map(|(c, _)| c.len_utf8()) + .sum(); + let original = &original[common_prefix..]; + let suggestion = &suggestion[common_prefix..]; + if let Some(stripped) = suggestion.strip_suffix(original) { + let common_suffix = original.len(); + Some((common_prefix, stripped, common_suffix)) + } else { + None + } + } +} diff --git a/crates/ruff_annotate_snippets/src/renderer/styled_buffer.rs b/crates/ruff_annotate_snippets/src/renderer/styled_buffer.rs index 73b30cefca10d5..ff51aa41ff04f1 100644 --- a/crates/ruff_annotate_snippets/src/renderer/styled_buffer.rs +++ b/crates/ruff_annotate_snippets/src/renderer/styled_buffer.rs @@ -2,10 +2,13 @@ //! //! [styled_buffer]: https://github.com/rust-lang/rust/blob/894f7a4ba6554d3797404bbf550d9919df060b97/compiler/rustc_errors/src/styled_buffer.rs +use alloc::string::String; +use alloc::{vec, vec::Vec}; +use core::fmt::{self, Write}; + +use crate::Level; +use crate::renderer::ElementStyle; use crate::renderer::stylesheet::Stylesheet; -use anstyle::Style; -use std::fmt; -use std::fmt::Write; #[derive(Debug)] pub(crate) struct StyledBuffer { @@ -15,13 +18,13 @@ pub(crate) struct StyledBuffer { #[derive(Clone, Copy, Debug, PartialEq)] pub(crate) struct StyledChar { ch: char, - style: Style, + style: ElementStyle, } impl StyledChar { - pub(crate) const SPACE: Self = StyledChar::new(' ', Style::new()); + pub(crate) const SPACE: Self = StyledChar::new(' ', ElementStyle::NoStyle); - pub(crate) const fn new(ch: char, style: Style) -> StyledChar { + pub(crate) const fn new(ch: char, style: ElementStyle) -> StyledChar { StyledChar { ch, style } } } @@ -37,33 +40,40 @@ impl StyledBuffer { } } - pub(crate) fn render(&self, stylesheet: &Stylesheet) -> Result { + pub(crate) fn render( + &self, + level: &Level<'_>, + stylesheet: &Stylesheet, + str: &mut String, + ) -> Result<(), fmt::Error> { let capacity = self.lines.iter().map(|line| line.len()).sum(); - let mut str = String::with_capacity(capacity); + str.reserve(capacity); + for (i, line) in self.lines.iter().enumerate() { let mut current_style = stylesheet.none; - for ch in line { - if ch.style != current_style { + for StyledChar { ch, style } in line { + let ch_style = style.color_spec(level, stylesheet); + if ch_style != current_style { if !line.is_empty() { - write!(str, "{}", current_style.render_reset())?; + write!(str, "{current_style:#}")?; } - current_style = ch.style; - write!(str, "{}", current_style.render())?; + current_style = ch_style; + write!(str, "{current_style}")?; } - str.push(ch.ch); + str.push(*ch); } - write!(str, "{}", current_style.render_reset())?; + write!(str, "{current_style:#}")?; if i != self.lines.len() - 1 { str.push('\n'); } } - Ok(str) + Ok(()) } /// Sets `chr` with `style` for given `line`, `col`. /// If `line` does not exist in our buffer, adds empty lines up to the given /// and fills the last line with unstyled whitespace. - pub(crate) fn putc(&mut self, line: usize, col: usize, chr: char, style: Style) { + pub(crate) fn putc(&mut self, line: usize, col: usize, chr: char, style: ElementStyle) { self.ensure_lines(line); if col >= self.lines[line].len() { self.lines[line].resize(col + 1, StyledChar::SPACE); @@ -74,24 +84,29 @@ impl StyledBuffer { /// Sets `string` with `style` for given `line`, starting from `col`. /// If `line` does not exist in our buffer, adds empty lines up to the given /// and fills the last line with unstyled whitespace. - pub(crate) fn puts(&mut self, line: usize, col: usize, string: &str, style: Style) { + pub(crate) fn puts(&mut self, line: usize, col: usize, string: &str, style: ElementStyle) { if string.is_empty() { + // don't add trailing whitespace (from column offset) for blank strings return; } + self.ensure_lines(line); - let char_count = string.chars().count(); - let needed = col + char_count; - if needed > self.lines[line].len() { - self.lines[line].resize(needed, StyledChar::SPACE); - } let line = &mut self.lines[line]; - for (i, c) in string.chars().enumerate() { - line[col + i] = StyledChar::new(c, style); + + let new_len = col + string.chars().count(); + if new_len > line.len() { + line.resize(new_len, StyledChar::SPACE); + } + + for (offset, chr) in string.chars().enumerate() { + let col = col + offset; + line[col] = StyledChar::new(chr, style); } } + /// For given `line` inserts `string` with `style` after old content of that line, /// adding lines if needed - pub(crate) fn append(&mut self, line: usize, string: &str, style: Style) { + pub(crate) fn append(&mut self, line: usize, string: &str, style: ElementStyle) { if line >= self.lines.len() { self.puts(line, 0, string, style); } else { @@ -100,7 +115,58 @@ impl StyledBuffer { } } + pub(crate) fn replace(&mut self, line: usize, start: usize, end: usize, string: &str) { + if start == end { + return; + } + // If the replacement range would be out of bounds, do nothing, as we + // can't replace things that don't exist. + if start > self.lines[line].len() || end > self.lines[line].len() { + return; + }; + self.lines[line].splice( + start..end, + string + .chars() + .map(|c| StyledChar::new(c, ElementStyle::LineNumber)), + ); + } + pub(crate) fn num_lines(&self) -> usize { self.lines.len() } + + /// Set `style` for `line`, `col_start..col_end` range if: + /// 1. That line and column range exist in `StyledBuffer` + /// 2. `overwrite` is `true` or existing style is `Style::NoStyle` or `Style::Quotation` + pub(crate) fn set_style_range( + &mut self, + line: usize, + col_start: usize, + col_end: usize, + style: ElementStyle, + overwrite: bool, + ) { + for col in col_start..col_end { + self.set_style(line, col, style, overwrite); + } + } + + /// Set `style` for `line`, `col` if: + /// 1. That line and column exist in `StyledBuffer` + /// 2. `overwrite` is `true` or existing style is `Style::NoStyle` or `Style::Quotation` + pub(crate) fn set_style( + &mut self, + line: usize, + col: usize, + style: ElementStyle, + overwrite: bool, + ) { + if let Some(ref mut line) = self.lines.get_mut(line) + && let Some(StyledChar { style: s, .. }) = line.get_mut(col) + && (overwrite || matches!(s, ElementStyle::NoStyle | ElementStyle::Quotation)) + { + *s = style; + } + } } diff --git a/crates/ruff_annotate_snippets/src/renderer/stylesheet.rs b/crates/ruff_annotate_snippets/src/renderer/stylesheet.rs index d9ec70d6d07daa..075cad42a96329 100644 --- a/crates/ruff_annotate_snippets/src/renderer/stylesheet.rs +++ b/crates/ruff_annotate_snippets/src/renderer/stylesheet.rs @@ -7,10 +7,12 @@ pub(crate) struct Stylesheet { pub(crate) info: Style, pub(crate) note: Style, pub(crate) help: Style, - pub(crate) line_no: Style, + pub(crate) line_num: Style, pub(crate) emphasis: Style, pub(crate) none: Style, - pub(crate) hyperlink: bool, + pub(crate) context: Style, + pub(crate) addition: Style, + pub(crate) removal: Style, } impl Default for Stylesheet { @@ -27,44 +29,12 @@ impl Stylesheet { info: Style::new(), note: Style::new(), help: Style::new(), - line_no: Style::new(), + line_num: Style::new(), emphasis: Style::new(), none: Style::new(), - hyperlink: false, + context: Style::new(), + addition: Style::new(), + removal: Style::new(), } } } - -impl Stylesheet { - pub(crate) fn error(&self) -> &Style { - &self.error - } - - pub(crate) fn warning(&self) -> &Style { - &self.warning - } - - pub(crate) fn info(&self) -> &Style { - &self.info - } - - pub(crate) fn note(&self) -> &Style { - &self.note - } - - pub(crate) fn help(&self) -> &Style { - &self.help - } - - pub(crate) fn line_no(&self) -> &Style { - &self.line_no - } - - pub(crate) fn emphasis(&self) -> &Style { - &self.emphasis - } - - pub(crate) fn none(&self) -> &Style { - &self.none - } -} diff --git a/crates/ruff_annotate_snippets/src/snippet.rs b/crates/ruff_annotate_snippets/src/snippet.rs index 363f8b255813ff..24ecffe8057894 100644 --- a/crates/ruff_annotate_snippets/src/snippet.rs +++ b/crates/ruff_annotate_snippets/src/snippet.rs @@ -1,211 +1,569 @@ //! Structures used as an input for the library. -//! -//! Example: -//! -//! ``` -//! use ruff_annotate_snippets::*; -//! -//! Level::Error.title("mismatched types") -//! .snippet(Snippet::source("Foo").line_start(51).origin("src/format.rs")) -//! .snippet(Snippet::source("Faa").line_start(129).origin("src/display.rs")); -//! ``` - -use std::ops::Range; - -#[derive(Copy, Clone, Debug, Default, PartialEq)] + +use alloc::borrow::{Cow, ToOwned}; +use alloc::string::String; +use alloc::{vec, vec::Vec}; +use core::ops::Range; + +use crate::Level; +use crate::renderer::source_map::{TrimmedPatch, as_substr}; + +pub(crate) const ERROR_TXT: &str = "error"; +pub(crate) const HELP_TXT: &str = "help"; +pub(crate) const INFO_TXT: &str = "info"; +pub(crate) const NOTE_TXT: &str = "note"; +pub(crate) const WARNING_TXT: &str = "warning"; + +/// A [diagnostic message][Title] and any associated [context][Element] to help users +/// understand it +/// +/// The first [`Group`] is the ["primary" group][Level::primary_title], ie it contains the diagnostic +/// message. +/// +/// All subsequent [`Group`]s are for distinct pieces of [context][Level::secondary_title]. +/// The primary group will be visually distinguished to help tell them apart. +pub type Report<'a> = &'a [Group<'a>]; + +#[derive(Clone, Debug, Default)] pub(crate) struct Id<'a> { - pub(crate) id: &'a str, - pub(crate) url: Option<&'a str>, + pub(crate) id: Option>, + pub(crate) url: Option>, } -/// Primary structure provided for formatting +/// A [`Title`] with supporting [context][Element] within a [`Report`] /// -/// See [`Level::title`] to create a [`Message`] -#[derive(Debug)] -pub struct Message<'a> { - pub(crate) level: Level, - pub(crate) id: Option>, - pub(crate) title: &'a str, - pub(crate) snippets: Vec>, - pub(crate) footer: Vec>, - pub(crate) is_fixable: bool, - pub(crate) lineno_offset: usize, +/// [Decor][crate::renderer::DecorStyle] is used to visually connect [`Element`]s of a `Group`. +/// +/// Generally, you will create separate group's for: +/// - New [`Snippet`]s, especially if they need their own [`AnnotationKind::Primary`] +/// - Each logically distinct set of [suggestions][Patch`] +/// +/// # Example +/// +/// ```rust +/// # #[allow(clippy::needless_doctest_main)] +#[doc = include_str!("../examples/highlight_message.rs")] +/// ``` +#[doc = include_str!("../examples/highlight_message.svg")] +#[derive(Clone, Debug)] +pub struct Group<'a> { + pub(crate) primary_level: Level<'a>, + pub(crate) title: Option>, + pub(crate) elements: Vec>, } -impl<'a> Message<'a> { - pub fn id(mut self, id: &'a str) -> Self { - self.id = Some(Id { id, url: None }); - self +impl<'a> Group<'a> { + /// Create group with a [`Title`], deriving [`AnnotationKind::Primary`] from its [`Level`] + pub fn with_title(title: Title<'a>) -> Self { + let level = title.level.clone(); + let mut x = Self::with_level(level); + x.title = Some(title); + x } - pub fn id_with_url(mut self, id: &'a str, url: Option<&'a str>) -> Self { - self.id = Some(Id { id, url }); - self + /// Create a title-less group with a primary [`Level`] for [`AnnotationKind::Primary`] + /// + /// # Example + /// + /// ```rust + /// # #[allow(clippy::needless_doctest_main)] + #[doc = include_str!("../examples/elide_header.rs")] + /// ``` + #[doc = include_str!("../examples/elide_header.svg")] + pub fn with_level(level: Level<'a>) -> Self { + Self { + primary_level: level, + title: None, + elements: vec![], + } } - pub fn snippet(mut self, slice: Snippet<'a>) -> Self { - self.snippets.push(slice); + /// Append an [`Element`] that adds context to the [`Title`] + pub fn element(mut self, section: impl Into>) -> Self { + self.elements.push(section.into()); self } - pub fn snippets(mut self, slice: impl IntoIterator>) -> Self { - self.snippets.extend(slice); + /// Append [`Element`]s that adds context to the [`Title`] + pub fn elements(mut self, sections: impl IntoIterator>>) -> Self { + self.elements.extend(sections.into_iter().map(Into::into)); self } - pub fn footer(mut self, footer: Message<'a>) -> Self { - self.footer.push(footer); - self + pub fn is_empty(&self) -> bool { + self.elements.is_empty() && self.title.is_none() } +} - pub fn footers(mut self, footer: impl IntoIterator>) -> Self { - self.footer.extend(footer); - self +/// A section of content within a [`Group`] +#[derive(Clone, Debug)] +#[non_exhaustive] +pub enum Element<'a> { + Message(Message<'a>), + Cause(Snippet<'a, Annotation<'a>>), + Suggestion(Snippet<'a, Patch<'a>>), + Origin(Origin<'a>), + Padding(Padding), +} + +impl<'a> From> for Element<'a> { + fn from(value: Message<'a>) -> Self { + Element::Message(value) + } +} + +impl<'a> From>> for Element<'a> { + fn from(value: Snippet<'a, Annotation<'a>>) -> Self { + Element::Cause(value) + } +} + +impl<'a> From>> for Element<'a> { + fn from(value: Snippet<'a, Patch<'a>>) -> Self { + Element::Suggestion(value) + } +} + +impl<'a> From> for Element<'a> { + fn from(value: Origin<'a>) -> Self { + Element::Origin(value) + } +} + +impl From for Element<'_> { + fn from(value: Padding) -> Self { + Self::Padding(value) } +} + +/// A whitespace [`Element`] in a [`Group`] +#[derive(Clone, Debug)] +pub struct Padding; + +/// A title that introduces a [`Group`], describing the main point +/// +/// To create a `Title`, see [`Level::primary_title`] or [`Level::secondary_title`]. +/// +/// # Example +/// +/// ```rust +/// # use annotate_snippets::*; +/// let report = &[ +/// Group::with_title( +/// Level::ERROR.primary_title("mismatched types").id("E0308") +/// ), +/// Group::with_title( +/// Level::HELP.secondary_title("function defined here") +/// ), +/// ]; +/// ``` +#[derive(Clone, Debug)] +pub struct Title<'a> { + pub(crate) level: Level<'a>, + pub(crate) id: Option>, + pub(crate) text: Cow<'a, str>, + pub(crate) allows_styling: bool, +} - /// Whether or not the diagnostic for this message is fixable. +impl<'a> Title<'a> { + /// The category for this [`Report`] + /// + /// Useful for looking searching for more information to resolve the diagnostic. + /// + ///
+ /// + /// Text passed to this function is considered "untrusted input", as such + /// all text is passed through a normalization function. Styled text is + /// not allowed to be passed to this function. /// - /// This is rendered as a `[*]` indicator after the `id` in an annotation header, if the - /// annotation also has `Level::None`. - pub fn is_fixable(mut self, yes: bool) -> Self { - self.is_fixable = yes; + ///
+ pub fn id(mut self, id: impl Into>) -> Self { + self.id.get_or_insert(Id::default()).id = Some(id.into()); self } - /// Add an offset used for aligning the header sigil (`-->`) with the line number separators. + /// Provide a URL for [`Title::id`] for more information on this diagnostic /// - /// For normal diagnostics this is computed automatically based on the lines to be rendered. - /// This is intended only for use in the formatter, where we don't render a snippet directly but - /// still want the header to align with the diff. - pub fn lineno_offset(mut self, offset: usize) -> Self { - self.lineno_offset = offset; + ///
+ /// + /// This is only relevant if `id` is present + /// + ///
+ pub fn id_url(mut self, url: impl Into>) -> Self { + self.id.get_or_insert(Id::default()).url = Some(url.into()); self } + + /// Append an [`Element`] that adds context to the [`Title`] + pub fn element(self, section: impl Into>) -> Group<'a> { + Group::with_title(self).element(section) + } + + /// Append [`Element`]s that adds context to the [`Title`] + pub fn elements(self, sections: impl IntoIterator>>) -> Group<'a> { + Group::with_title(self).elements(sections) + } } -/// Structure containing the slice of text to be annotated and -/// basic information about the location of the slice. +/// A text [`Element`] in a [`Group`] /// -/// One `Snippet` is meant to represent a single, continuous, -/// slice of source code that you want to annotate. -#[derive(Debug)] -pub struct Snippet<'a> { - pub(crate) origin: Option<&'a str>, - pub(crate) line_start: usize, - - pub(crate) source: &'a str, - pub(crate) annotations: Vec>, +/// See [`Level::message`] to create this. +#[derive(Clone, Debug)] +pub struct Message<'a> { + pub(crate) level: Level<'a>, + pub(crate) text: Cow<'a, str>, +} +/// A source view [`Element`] in a [`Group`] +/// +/// If you do not have [source][Snippet::source] available, see instead [`Origin`] +/// +/// `Snippet`s come in the following styles (`T`): +/// - With [`Annotation`]s, see [`Snippet::annotation`] +/// - With [`Patch`]s, see [`Snippet::patch`] +#[derive(Clone, Debug)] +pub struct Snippet<'a, T> { + pub(crate) path: Option>, + pub(crate) line_start: usize, + pub(crate) source: Cow<'a, str>, + pub(crate) markers: Vec, pub(crate) fold: bool, - - /// The optional cell index in a Jupyter notebook, used for reporting source locations along - /// with the ranges on `annotations`. - pub(crate) cell_index: Option, } -impl<'a> Snippet<'a> { - pub fn source(source: &'a str) -> Self { +impl<'a, T: Clone> Snippet<'a, T> { + /// The source code to be rendered + /// + ///
+ /// + /// Text passed to this function is considered "untrusted input", as such + /// all text is passed through a normalization function. Pre-styled text is + /// not allowed to be passed to this function. + /// + ///
+ pub fn source(source: impl Into>) -> Self { Self { - origin: None, + path: None, line_start: 1, - source, - annotations: vec![], - fold: false, - cell_index: None, + source: source.into(), + markers: vec![], + fold: true, } } + /// When manually [`fold`][Self::fold]ing, + /// the [`source`][Self::source]s line offset from the original start pub fn line_start(mut self, line_start: usize) -> Self { self.line_start = line_start; self } - pub fn origin(mut self, origin: &'a str) -> Self { - self.origin = Some(origin); + /// The location of the [`source`][Self::source] (e.g. a path) + /// + ///
+ /// + /// Text passed to this function is considered "untrusted input", as such + /// all text is passed through a normalization function. Pre-styled text is + /// not allowed to be passed to this function. + /// + ///
+ pub fn path(mut self, path: impl Into>) -> Self { + self.path = path.into().0; + self + } + + /// Control whether lines without [`Annotation`]s are shown + /// + /// The default is `fold(true)`, collapsing uninteresting lines. + /// + /// See [`AnnotationKind::Visible`] to force specific spans to be shown. + pub fn fold(mut self, fold: bool) -> Self { + self.fold = fold; self } +} - pub fn annotation(mut self, annotation: Annotation<'a>) -> Self { - self.annotations.push(annotation); +impl<'a> Snippet<'a, Annotation<'a>> { + /// Highlight and describe a span of text within the [`source`][Self::source] + pub fn annotation(mut self, annotation: Annotation<'a>) -> Snippet<'a, Annotation<'a>> { + self.markers.push(annotation); self } + /// Highlight and describe spans of text within the [`source`][Self::source] pub fn annotations(mut self, annotation: impl IntoIterator>) -> Self { - self.annotations.extend(annotation); + self.markers.extend(annotation); self } +} - /// Hide lines without [`Annotation`]s - pub fn fold(mut self, fold: bool) -> Self { - self.fold = fold; +impl<'a> Snippet<'a, Patch<'a>> { + /// Suggest to the user an edit to the [`source`][Self::source] + pub fn patch(mut self, patch: Patch<'a>) -> Snippet<'a, Patch<'a>> { + self.markers.push(patch); self } - /// Attach a Jupyter notebook cell index. - pub fn cell_index(mut self, index: Option) -> Self { - self.cell_index = index; + /// Suggest to the user edits to the [`source`][Self::source] + pub fn patches(mut self, patches: impl IntoIterator>) -> Self { + self.markers.extend(patches); self } } -/// An annotation for a [`Snippet`]. +/// Highlight and describe a span of text within a [`Snippet`] /// -/// See [`Level::span`] to create a [`Annotation`] -#[derive(Debug)] +/// See [`AnnotationKind`] to create an annotation. +/// +/// # Example +/// +/// ```rust +/// # #[allow(clippy::needless_doctest_main)] +#[doc = include_str!("../examples/expected_type.rs")] +/// ``` +/// +#[doc = include_str!("../examples/expected_type.svg")] +#[derive(Clone, Debug)] pub struct Annotation<'a> { - /// The byte range of the annotation in the `source` string - pub(crate) range: Range, - pub(crate) label: Option<&'a str>, - pub(crate) level: Level, - pub(crate) is_file_level: bool, + pub(crate) span: Range, + pub(crate) label: Option>, + pub(crate) kind: AnnotationKind, + pub(crate) highlight_source: bool, } impl<'a> Annotation<'a> { - pub fn label(mut self, label: &'a str) -> Self { - self.label = Some(label); + /// Describe the reason the span is highlighted + /// + /// This will be styled according to the [`AnnotationKind`] + /// + ///
+ /// + /// Text passed to this function is considered "untrusted input", as such + /// all text is passed through a normalization function. Pre-styled text is + /// not allowed to be passed to this function. + /// + ///
+ pub fn label(mut self, label: impl Into>) -> Self { + self.label = label.into().0; self } - pub fn hide_snippet(mut self, yes: bool) -> Self { - self.is_file_level = yes; + /// Style the source according to the [`AnnotationKind`] + /// + /// This gives extra emphasis to this annotation + pub fn highlight_source(mut self, highlight_source: bool) -> Self { + self.highlight_source = highlight_source; self } } -/// Types of annotations. -#[derive(Debug, Clone, Copy, PartialEq)] -pub enum Level { - /// Do not attach any annotation. - None, - /// Error annotations are displayed using red color and "^" character. - Error, - /// Warning annotations are displayed using blue color and "-" character. - Warning, - Info, - Note, - Help, -} - -impl Level { - pub fn title(self, title: &str) -> Message<'_> { - Message { - level: self, - id: None, - title, - snippets: vec![], - footer: vec![], - is_fixable: false, - lineno_offset: 0, - } - } +/// The type of [`Annotation`] being applied to a [`Snippet`] +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)] +#[non_exhaustive] +pub enum AnnotationKind { + /// For showing the source that the [Group's Title][Group::with_title] references + /// + /// For [`Title`]-less groups, see [`Group::with_level`] + Primary, + /// Additional context to better understand the [`Primary`][Self::Primary] + /// [`Annotation`] + /// + /// See also [`Renderer::context`]. + /// + /// [`Renderer::context`]: crate::renderer::Renderer + Context, + /// Prevents the annotated text from getting [folded][Snippet::fold] + /// + /// By default, [`Snippet`]s will [fold][`Snippet::fold`] (remove) lines + /// that do not contain any annotations. [`Visible`][Self::Visible] makes + /// it possible to selectively prevent this behavior for specific text, + /// allowing context to be preserved without adding any annotation + /// characters. + /// + /// # Example + /// + /// ```rust + /// # #[allow(clippy::needless_doctest_main)] + #[doc = include_str!("../examples/struct_name_as_context.rs")] + /// ``` + /// + #[doc = include_str!("../examples/struct_name_as_context.svg")] + /// + Visible, +} - /// Create a [`Annotation`] with the given span for a [`Snippet`] +impl AnnotationKind { + /// Annotate a byte span within [`Snippet`] pub fn span<'a>(self, span: Range) -> Annotation<'a> { Annotation { - range: span, + span, label: None, - level: self, - is_file_level: false, + kind: self, + highlight_source: false, + } + } + + pub(crate) fn is_primary(&self) -> bool { + matches!(self, AnnotationKind::Primary) + } +} + +/// Suggested edit to the [`Snippet`] +/// +/// See [`Snippet::patch`] +/// +/// # Example +/// +/// ```rust +/// # #[allow(clippy::needless_doctest_main)] +#[doc = include_str!("../examples/multi_suggestion.rs")] +/// ``` +/// +#[doc = include_str!("../examples/multi_suggestion.svg")] +#[derive(Clone, Debug)] +pub struct Patch<'a> { + pub(crate) span: Range, + pub(crate) replacement: Cow<'a, str>, +} + +impl<'a> Patch<'a> { + /// Splice `replacement` into the [`Snippet`] at the specified byte span + /// + ///
+ /// + /// Text passed to this function is considered "untrusted input", as such + /// all text is passed through a normalization function. Pre-styled text is + /// not allowed to be passed to this function. + /// + ///
+ pub fn new(span: Range, replacement: impl Into>) -> Self { + Self { + span, + replacement: replacement.into(), + } + } + + /// Try to turn a replacement into an addition when the span that is being + /// overwritten matches either the prefix or suffix of the replacement. + pub(crate) fn trim_trivial_replacements(self, source: &str) -> TrimmedPatch<'a> { + let mut trimmed = TrimmedPatch { + original_span: self.span.clone(), + span: self.span, + replacement: self.replacement, + }; + + if trimmed.replacement.is_empty() { + return trimmed; + } + let Some(snippet) = source.get(trimmed.original_span.clone()) else { + return trimmed; + }; + + if let Some((prefix, substr, suffix)) = as_substr(snippet, &trimmed.replacement) { + trimmed.span = trimmed.original_span.start + prefix + ..trimmed.original_span.end.saturating_sub(suffix); + trimmed.replacement = Cow::Owned(substr.to_owned()); + } + trimmed + } +} + +/// A source location [`Element`] in a [`Group`] +/// +/// If you have source available, see instead [`Snippet`] +/// +/// # Example +/// +/// ```rust +/// # use annotate_snippets::{Group, Snippet, AnnotationKind, Level, Origin}; +/// let report = &[ +/// Level::ERROR.primary_title("mismatched types").id("E0308") +/// .element( +/// Origin::path("$DIR/mismatched-types.rs") +/// ) +/// ]; +/// ``` +#[derive(Clone, Debug)] +pub struct Origin<'a> { + pub(crate) path: Cow<'a, str>, + pub(crate) line: Option, + pub(crate) char_column: Option, +} + +impl<'a> Origin<'a> { + ///
+ /// + /// Text passed to this function is considered "untrusted input", as such + /// all text is passed through a normalization function. Pre-styled text is + /// not allowed to be passed to this function. + /// + ///
+ pub fn path(path: impl Into>) -> Self { + Self { + path: path.into(), + line: None, + char_column: None, } } + + /// Set the default line number to display + pub fn line(mut self, line: usize) -> Self { + self.line = Some(line); + self + } + + /// Set the default column to display + /// + ///
+ /// + /// `char_column` is only be respected if [`Origin::line`] is also set. + /// + ///
+ pub fn char_column(mut self, char_column: usize) -> Self { + self.char_column = Some(char_column); + self + } +} + +impl<'a> From> for Origin<'a> { + fn from(origin: Cow<'a, str>) -> Self { + Self::path(origin) + } +} + +#[derive(Debug)] +pub struct OptionCow<'a>(pub(crate) Option>); + +impl<'a, T: Into>> From> for OptionCow<'a> { + fn from(value: Option) -> Self { + Self(value.map(Into::into)) + } +} + +impl<'a> From<&'a Cow<'a, str>> for OptionCow<'a> { + fn from(value: &'a Cow<'a, str>) -> Self { + Self(Some(Cow::Borrowed(value))) + } +} + +impl<'a> From> for OptionCow<'a> { + fn from(value: Cow<'a, str>) -> Self { + Self(Some(value)) + } +} + +impl<'a> From<&'a str> for OptionCow<'a> { + fn from(value: &'a str) -> Self { + Self(Some(Cow::Borrowed(value))) + } +} +impl<'a> From for OptionCow<'a> { + fn from(value: String) -> Self { + Self(Some(Cow::Owned(value))) + } +} + +impl<'a> From<&'a String> for OptionCow<'a> { + fn from(value: &'a String) -> Self { + Self(Some(Cow::Borrowed(value.as_str()))) + } } diff --git a/crates/ruff_annotate_snippets/tests/fixtures/color/ann_removed_nl.svg b/crates/ruff_annotate_snippets/tests/color/ann_eof.ascii.term.svg similarity index 75% rename from crates/ruff_annotate_snippets/tests/fixtures/color/ann_removed_nl.svg rename to crates/ruff_annotate_snippets/tests/color/ann_eof.ascii.term.svg index 045b0ef413bdd8..dfc0c58739509c 100644 --- a/crates/ruff_annotate_snippets/tests/fixtures/color/ann_removed_nl.svg +++ b/crates/ruff_annotate_snippets/tests/color/ann_eof.ascii.term.svg @@ -1,4 +1,4 @@ - + ?Lc`=vc4H*oLH0#FaJfef-IM3B%OOekahM?S4zjmR_T`jC63ORO zMB?>vNK9VK`5bKhR4#t7^^+IyYEC}KtppbQ$lb`u2ehubL>=fF^;#gDe4bko?Dz$| OI+Gu91@cQ*kzDJ3fUL&z~vt`bWiqUmlHx3;8IXfs8N{g#-W3vt8MaM4p}4- zc}_)a+I%?=f*r}v<;((ffYRhTZq3PkoSc)jc|s=N;>rd~x^e4(=*`9435;NY3w-*M ggSZvIg37%05J9M_$rt!^nH1tC*K?>$R_C7v0Qm)TyZ`_I delta 213 zcmaDUzgK?43FgUjS$HRN@+xfp!JNp*C^b2TwPx}}4vo#fSuGiPr5;U~&G4w9n@d4K zp=PohyEZFWWO6S@+awMdC`Xk;5z6xC5S^ULArDuy7|OEbL{?GBxdmvC0hcoqgVN*) z97dC0v4l+i%auLZoQHSvT|R}$(tJXb6L>W@U*T3`1PTgH7T}keti`JYlGvQUn+Fnv SsRT*NGR6VT(VQI2KMeq_Uqf5~ diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE2514_invalid_characters.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE2514_invalid_characters.py.snap index d2e39983d962c07d501724d769b27832bd908919..880cbc8ef3bf745ce9113ca960af360c72e5020e 100644 GIT binary patch delta 186 zcmcb>^OI-7cIHPD8Yb@008grs^778^Ad8IiDwhC!rz9p0ol;8Y-(Ug(% z(S%u#Cd>wMC(E%&PBvneK@y2zX_eP zprBAQS)W;l1117iKY_V~6)Z5Bmqigxu>*@Py5fk*zgT3U8WdR3H3YL>1zN7n<_7?r CK{LYu diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE2515_invalid_characters.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE2515_invalid_characters.py.snap index 8f5b94d9459dcb618d60eef3e37c796753ca0aa6..6d3205f333b41af2062c3233eed1463277217f7a 100644 GIT binary patch delta 164 zcmexiw8(hFHUZ{G6J~9GB^=DSnM>$CBb2Ai#0eCBG-39m2@R9&B*Z4Gi76n7B#KX+ z{6I_wNrX{c5s3%VVT~e^D87jYZsMbc?#XuIa%dWYB({NUpUf%g!UD8bX>z=TCIBr^ BO=JK7 delta 137 zcmZ2v{KII&HUUPd&F_SR88`C?-Dd=|m6>>@9!;3d@Tj4iOF==QX0nQy4l7t>a;^B( s$?wEupgdu5MKqP};<|8^o1iQU33OFC5{DS2CL2n+Ffk}iZV=Z502#q9&;S4c diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF054_RUF054.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF054_RUF054.py.snap index 26ed4fcb975eff..317a7a13421c36 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF054_RUF054.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF054_RUF054.py.snap @@ -6,15 +6,14 @@ RUF054 Indented form feed | 6 | # Errors 7 | -8 | +8 | ␌ | ^ - | help: Remove form feed RUF054 Indented form feed --> RUF054.py:10:3 | -10 | +10 | ␌ | ^ 11 | 12 | def _(): @@ -25,7 +24,7 @@ RUF054 Indented form feed --> RUF054.py:13:2 | 12 | def _(): -13 | pass +13 | ␌ pass | ^ 14 | 15 | if False: @@ -37,7 +36,7 @@ RUF054 Indented form feed | 15 | if False: 16 | print('F') -17 | print('T') +17 | ␌print('T') | ^ | help: Remove form feed diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF072_RUF072.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF072_RUF072.py.snap index 65b54304a880f3..c4c73661d338f3 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF072_RUF072.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF072_RUF072.py.snap @@ -314,7 +314,7 @@ help: Remove the `finally` clause RUF072 [*] Empty `finally` clause --> RUF072.py:178:1 | -176 | 1 +176 | ␌ 1 177 | 2 178 | / finally: 179 | | pass @@ -336,7 +336,7 @@ help: Remove the `finally` clause RUF072 [*] Empty `finally` clause --> RUF072.py:186:1 | -184 | try: +184 | ␌try: 185 | 1 186 | / finally: 187 | | pass diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lex_logical_token_mac_eol.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lex_logical_token_mac_eol.py.snap index 2eb95158483a50..11e80e4bd94e61 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lex_logical_token_mac_eol.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lex_logical_token_mac_eol.py.snap @@ -112,12 +112,10 @@ Module( ## Errors | -1 | if call(foo, [a, b def bar(): pass - | ^^^ Syntax Error: Expected `]`, found `def` - | +1 | if call(foo, [a, b␍ def bar():␍ pass + | ^^^ Syntax Error: Expected `]`, found `def` | -1 | if call(foo, [a, b def bar(): pass +1 | if call(foo, [a, b␍ def bar():␍ pass | ^ Syntax Error: Expected `)`, found newline - | From 4b62395b225ead77c34aa5f3208e29295e3179d1 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 10 Jul 2026 10:47:13 -0500 Subject: [PATCH 25/34] Bless removed pipes I believe the new rendered is collapsing the trailing padding line with the annotation line. --- crates/ruff/src/commands/format.rs | 1 - crates/ruff/tests/cli/format.rs | 2 - crates/ruff/tests/cli/lint.rs | 2 - crates/ruff/tests/integration_test.rs | 23 - crates/ruff_db/src/diagnostic/render.rs | 8 - crates/ruff_db/src/diagnostic/render/full.rs | 18 - ...ull__tests__notebook_output_with_diff.snap | 2 - ...ebook_output_with_diff_spanning_cells.snap | 1 - .../mdtest/flake8-bandit/unsafe-markup-use.md | 1 - .../pytest-parametrize-names-wrong-type.md | 1 - .../mdtest/notebook/cell-boundaries.md | 1 - ...g-dot-format-extra-positional-arguments.md | 2 - .../pylint/invalid-character-backspace.md | 8 - .../mdtest/pylint/redefined-loop-name.md | 5 - .../too-many-statements-in-try-clause.md | 1 - .../pyupgrade/deprecated-abc-decorator.md | 3 - .../resources/mdtest/pyupgrade/f-string.md | 6 - .../resources/mdtest/pyupgrade/pep-695.md | 3 - .../mdtest/ruff/fallible-context-manager.md | 1 - .../mdtest/ruff/invalid-pyproject-toml.md | 1 - .../mdtest/ruff/logging-eager-conversion.md | 2 - .../resources/mdtest/ruff/noqa-comments.md | 13 - .../mdtest/ruff/rule-codes-in-selectors.md | 6 - .../rule-codes-in-suppression-comments.md | 12 - .../resources/mdtest/suppression/ignore.md | 20 - ...les__airflow__tests__AIR003_AIR003.py.snap | 1 - ...tests__AIR003_AIR003_dag_decorator.py.snap | 1 - ...les__airflow__tests__AIR004_AIR004.py.snap | 7 - ..._airflow__tests__AIR004_AIR004_sdk.py.snap | 1 - ...airflow__tests__AIR301_AIR301_args.py.snap | 1 - ...sts__AIR301_AIR301_class_attribute.py.snap | 1 - ...flow__tests__AIR301_AIR301_context.py.snap | 8 - ...irflow__tests__AIR301_AIR301_names.py.snap | 7 - ...ow__tests__AIR301_AIR301_names_fix.py.snap | 4 - ...__AIR301_AIR301_provider_names_fix.py.snap | 1 - ...rflow__tests__AIR302_AIR302_amazon.py.snap | 1 - ...rflow__tests__AIR302_AIR302_celery.py.snap | 1 - ...w__tests__AIR302_AIR302_common_sql.py.snap | 13 - ..._tests__AIR302_AIR302_daskexecutor.py.snap | 1 - ...irflow__tests__AIR302_AIR302_druid.py.snap | 1 - ..._airflow__tests__AIR302_AIR302_fab.py.snap | 1 - ...airflow__tests__AIR302_AIR302_hdfs.py.snap | 1 - ...airflow__tests__AIR302_AIR302_hive.py.snap | 2 - ...airflow__tests__AIR302_AIR302_http.py.snap | 1 - ...airflow__tests__AIR302_AIR302_jdbc.py.snap | 1 - ...w__tests__AIR302_AIR302_kubernetes.py.snap | 2 - ...irflow__tests__AIR302_AIR302_mysql.py.snap | 1 - ...rflow__tests__AIR302_AIR302_oracle.py.snap | 1 - ...ow__tests__AIR302_AIR302_papermill.py.snap | 1 - ..._airflow__tests__AIR302_AIR302_pig.py.snap | 1 - ...rflow__tests__AIR302_AIR302_presto.py.snap | 1 - ...irflow__tests__AIR302_AIR302_samba.py.snap | 1 - ...irflow__tests__AIR302_AIR302_slack.py.snap | 1 - ...airflow__tests__AIR302_AIR302_smtp.py.snap | 1 - ...rflow__tests__AIR302_AIR302_sqlite.py.snap | 1 - ...low__tests__AIR302_AIR302_standard.py.snap | 2 - ...flow__tests__AIR302_AIR302_zendesk.py.snap | 1 - ...les__airflow__tests__AIR304_AIR304.py.snap | 2 - ...airflow__tests__AIR311_AIR311_args.py.snap | 2 - ...irflow__tests__AIR311_AIR311_names.py.snap | 4 - ...les__airflow__tests__AIR312_AIR312.py.snap | 1 - ...irflow__tests__AIR321_AIR321_names.py.snap | 1 - ...s__eradicate__tests__ERA001_ERA001.py.snap | 2 - ..._flake8_2020__tests__YTT102_YTT102.py.snap | 1 - ..._flake8_2020__tests__YTT103_YTT103.py.snap | 1 - ..._flake8_2020__tests__YTT201_YTT201.py.snap | 1 - ..._flake8_2020__tests__YTT203_YTT203.py.snap | 1 - ..._flake8_2020__tests__YTT204_YTT204.py.snap | 1 - ..._flake8_2020__tests__YTT301_YTT301.py.snap | 1 - ..._flake8_2020__tests__YTT302_YTT302.py.snap | 1 - ..._flake8_2020__tests__YTT303_YTT303.py.snap | 1 - ...__flake8_annotations__tests__defaults.snap | 3 - ...e8_async__tests__ASYNC100_ASYNC100.py.snap | 11 - ...e8_async__tests__ASYNC105_ASYNC105.py.snap | 1 - ...s__flake8_async__tests__ASYNC109_0.py.snap | 1 - ..._async__tests__ASYNC109_ASYNC109_0.py.snap | 1 - ...e8_async__tests__ASYNC110_ASYNC110.py.snap | 5 - ...e8_async__tests__ASYNC115_ASYNC115.py.snap | 5 - ...e8_async__tests__ASYNC116_ASYNC116.py.snap | 5 - ...e8_async__tests__ASYNC119_ASYNC119.py.snap | 5 - ...e8_async__tests__ASYNC210_ASYNC210.py.snap | 5 - ...e8_async__tests__ASYNC221_ASYNC22x.py.snap | 2 - ...e8_async__tests__ASYNC222_ASYNC22x.py.snap | 2 - ...e8_async__tests__ASYNC230_ASYNC230.py.snap | 5 - ...e8_async__tests__ASYNC240_ASYNC240.py.snap | 1 - ...e8_async__tests__ASYNC250_ASYNC250.py.snap | 1 - ...e8_async__tests__ASYNC251_ASYNC251.py.snap | 1 - ...s__flake8_bandit__tests__S101_S101.py.snap | 2 - ...s__flake8_bandit__tests__S102_S102.py.snap | 1 - ...s__flake8_bandit__tests__S103_S103.py.snap | 1 - ...s__flake8_bandit__tests__S104_S104.py.snap | 2 - ...s__flake8_bandit__tests__S105_S105.py.snap | 1 - ...s__flake8_bandit__tests__S106_S106.py.snap | 1 - ...les__flake8_bandit__tests__S110_typed.snap | 1 - ...s__flake8_bandit__tests__S301_S301.py.snap | 1 - ...s__flake8_bandit__tests__S307_S307.py.snap | 1 - ...s__flake8_bandit__tests__S310_S310.py.snap | 2 - ...s__flake8_bandit__tests__S312_S312.py.snap | 1 - ...s__flake8_bandit__tests__S401_S401.py.snap | 1 - ...s__flake8_bandit__tests__S402_S402.py.snap | 1 - ...s__flake8_bandit__tests__S403_S403.py.snap | 1 - ...s__flake8_bandit__tests__S404_S404.py.snap | 1 - ...s__flake8_bandit__tests__S405_S405.py.snap | 1 - ...s__flake8_bandit__tests__S406_S406.py.snap | 1 - ...s__flake8_bandit__tests__S407_S407.py.snap | 1 - ...s__flake8_bandit__tests__S408_S408.py.snap | 1 - ...s__flake8_bandit__tests__S409_S409.py.snap | 1 - ...s__flake8_bandit__tests__S410_S410.py.snap | 1 - ...s__flake8_bandit__tests__S411_S411.py.snap | 1 - ...s__flake8_bandit__tests__S412_S412.py.snap | 1 - ...s__flake8_bandit__tests__S413_S413.py.snap | 1 - ...s__flake8_bandit__tests__S415_S415.py.snap | 1 - ...s__flake8_bandit__tests__S501_S501.py.snap | 1 - ...s__flake8_bandit__tests__S506_S506.py.snap | 1 - ...s__flake8_bandit__tests__S601_S601.py.snap | 1 - ...s__flake8_bandit__tests__S602_S602.py.snap | 1 - ...s__flake8_bandit__tests__S603_S603.py.snap | 1 - ...s__flake8_bandit__tests__S604_S604.py.snap | 1 - ...s__flake8_bandit__tests__S605_S605.py.snap | 2 - ...s__flake8_bandit__tests__S606_S606.py.snap | 1 - ...s__flake8_bandit__tests__S607_S607.py.snap | 1 - ...s__flake8_bandit__tests__S609_S609.py.snap | 1 - ...s__flake8_bandit__tests__S611_S611.py.snap | 1 - ...s__flake8_bandit__tests__S701_S701.py.snap | 1 - ...s__flake8_bandit__tests__S702_S702.py.snap | 1 - ..._bandit__tests__preview__S301_S301.py.snap | 1 - ..._bandit__tests__preview__S307_S307.py.snap | 1 - ..._bandit__tests__preview__S308_S308.py.snap | 1 - ..._bandit__tests__preview__S311_S311.py.snap | 1 - ..._bandit__tests__preview__S506_S506.py.snap | 1 - ...e8_boolean_trap__tests__FBT003_FBT.py.snap | 2 - ..._trap__tests__extend_allowed_callable.snap | 1 - ...__flake8_bugbear__tests__B002_B002.py.snap | 2 - ...flake8_bugbear__tests__B006_B006_5.py.snap | 2 - ...ke8_bugbear__tests__B006_B006_B008.py.snap | 1 - ...ke8_bugbear__tests__B009_B009_B010.py.snap | 2 - ...ke8_bugbear__tests__B010_B009_B010.py.snap | 1 - ...__flake8_bugbear__tests__B011_B011.py.snap | 1 - ...__flake8_bugbear__tests__B012_B012.py.snap | 5 - ...__flake8_bugbear__tests__B015_B015.py.snap | 3 - ...flake8_bugbear__tests__B017_B017_1.py.snap | 1 - ...__flake8_bugbear__tests__B018_B018.py.snap | 5 - ...__flake8_bugbear__tests__B021_B021.py.snap | 8 - ...__flake8_bugbear__tests__B023_B023.py.snap | 6 - ...__flake8_bugbear__tests__B026_B026.py.snap | 1 - ...__flake8_bugbear__tests__B029_B029.py.snap | 1 - ...__flake8_bugbear__tests__B031_B031.py.snap | 1 - ...__flake8_bugbear__tests__B035_B035.py.snap | 1 - ...__flake8_bugbear__tests__B039_B039.py.snap | 1 - ...__flake8_bugbear__tests__B043_B043.py.snap | 1 - ...__flake8_bugbear__tests__B901_B901.py.snap | 8 - ...ests__B903_class_as_data_structure.py.snap | 4 - ..._B903_py39_class_as_data_structure.py.snap | 4 - ...__flake8_bugbear__tests__B904_B904.py.snap | 1 - ...rules__flake8_bugbear__tests__B905.py.snap | 1 - ...__flake8_bugbear__tests__B909_B909.py.snap | 2 - ...__flake8_bugbear__tests__B912_B912.py.snap | 1 - ...s__extend_immutable_calls_arg_default.snap | 1 - ...ts__extend_mutable_contextvar_default.snap | 1 - ...gbear__tests__preview__B006_B006_5.py.snap | 2 - ...ar__tests__preview__B006_B006_B008.py.snap | 1 - ..._flake8_builtins__tests__A001_A001.py.snap | 1 - ...sts__A001_A001.py_builtins_ignorelist.snap | 1 - ..._flake8_builtins__tests__A003_A003.py.snap | 1 - ...sts__A003_A003.py_builtins_ignorelist.snap | 1 - ..._flake8_builtins__tests__A004_A004.py.snap | 2 - ...sts__A004_A004.py_builtins_ignorelist.snap | 2 - ...rules__flake8_commas__tests__COM81.py.snap | 1 - ...8_comprehensions__tests__C400_C400.py.snap | 2 - ...rehensions__tests__C400_C400_py315.py.snap | 1 - ...8_comprehensions__tests__C401_C401.py.snap | 3 - ...rehensions__tests__C401_C401_py315.py.snap | 1 - ...8_comprehensions__tests__C403_C403.py.snap | 2 - ...rehensions__tests__C403_C403_py315.py.snap | 1 - ...8_comprehensions__tests__C404_C404.py.snap | 1 - ...8_comprehensions__tests__C405_C405.py.snap | 2 - ...8_comprehensions__tests__C408_C408.py.snap | 1 - ...8_comprehensions__tests__C409_C409.py.snap | 1 - ...8_comprehensions__tests__C410_C410.py.snap | 1 - ...rehensions__tests__C411_C411_py315.py.snap | 1 - ...8_comprehensions__tests__C413_C413.py.snap | 1 - ...8_comprehensions__tests__C414_C414.py.snap | 1 - ...8_comprehensions__tests__C417_C417.py.snap | 2 - ...comprehensions__tests__C417_C417_1.py.snap | 1 - ...rehensions__tests__C418_C418_py315.py.snap | 1 - ...rehensions__tests__C419_C419_py315.py.snap | 1 - ...8_comprehensions__tests__C420_C420.py.snap | 11 - ...comprehensions__tests__C420_C420_1.py.snap | 1 - ...comprehensions__tests__C420_C420_2.py.snap | 1 - ...e8_datetimez__tests__DTZ011_DTZ011.py.snap | 1 - ...e8_datetimez__tests__DTZ012_DTZ012.py.snap | 1 - ...e8_datetimez__tests__DTZ901_DTZ901.py.snap | 2 - ..._flake8_debugger__tests__T100_T100.py.snap | 2 - ..._flake8_django__tests__DJ001_DJ001.py.snap | 4 - ..._flake8_django__tests__DJ003_DJ003.py.snap | 2 - ..._flake8_django__tests__DJ006_DJ006.py.snap | 1 - ..._flake8_django__tests__DJ007_DJ007.py.snap | 2 - ..._flake8_django__tests__DJ012_DJ012.py.snap | 6 - ...__rules__flake8_errmsg__tests__custom.snap | 9 - ...rules__flake8_errmsg__tests__defaults.snap | 11 - ...lake8_errmsg__tests__string_exception.snap | 2 - ...flake8_executable__tests__EXE004_1.py.snap | 1 - ...flake8_executable__tests__EXE004_4.py.snap | 1 - ...flake8_executable__tests__EXE005_1.py.snap | 1 - ...flake8_executable__tests__EXE005_2.py.snap | 1 - ...flake8_executable__tests__EXE005_3.py.snap | 1 - ...xme__tests__line-contains-todo_T00.py.snap | 1 - ...tring-in-get-text-func-call_INT001.py.snap | 3 - ...ormat-in-get-text-func-call_INT002.py.snap | 3 - ...tring-in-get-text-func-call_INT001.py.snap | 5 - ...ormat-in-get-text-func-call_INT002.py.snap | 5 - ...rintf-in-get-text-func-call_INT003.py.snap | 5 - ...rintf-in-get-text-func-call_INT003.py.snap | 3 - ...icit_str_concat__tests__ISC001_ISC.py.snap | 1 - ...at__tests__ISC001_ISC_syntax_error.py.snap | 2 - ...__tests__ISC001_ISC_syntax_error_2.py.snap | 2 - ...icit_str_concat__tests__ISC002_ISC.py.snap | 1 - ...at__tests__ISC002_ISC_syntax_error.py.snap | 2 - ...__tests__ISC002_ISC_syntax_error_2.py.snap | 1 - ...icit_str_concat__tests__ISC003_ISC.py.snap | 1 - ...oncat__tests__multiline_ISC001_ISC.py.snap | 1 - ...oncat__tests__multiline_ISC002_ISC.py.snap | 1 - ...8_import_conventions__tests__defaults.snap | 2 - ..._import_conventions__tests__same_name.snap | 1 - ...ake8_logging__tests__LOG002_LOG002.py.snap | 1 - ...e8_logging__tests__LOG004_LOG004_0.py.snap | 2 - ...e8_logging__tests__LOG004_LOG004_1.py.snap | 1 - ...e8_logging__tests__LOG014_LOG014_0.py.snap | 3 - ...e8_logging__tests__LOG014_LOG014_1.py.snap | 1 - ...ake8_logging__tests__LOG015_LOG015.py.snap | 2 - ...flake8_logging_format__tests__G001.py.snap | 1 - ...flake8_logging_format__tests__G002.py.snap | 1 - ...flake8_logging_format__tests__G003.py.snap | 1 - ...flake8_logging_format__tests__G004.py.snap | 3 - ...ging_format__tests__G004_arg_order.py.snap | 1 - ...ormat__tests__G004_implicit_concat.py.snap | 1 - ..._format__tests__preview__G004_G004.py.snap | 3 - ...ests__preview__G004_G004_arg_order.py.snap | 1 - ...preview__G004_G004_implicit_concat.py.snap | 1 - ...__flake8_pie__tests__PIE790_PIE790.py.snap | 19 - ...__flake8_pie__tests__PIE794_PIE794.py.snap | 5 - ...__flake8_pie__tests__PIE796_PIE796.py.snap | 9 - ...__flake8_pie__tests__PIE800_PIE800.py.snap | 1 - ...__flake8_pie__tests__PIE807_PIE807.py.snap | 3 - ...__flake8_pie__tests__PIE808_PIE808.py.snap | 2 - ..._flake8_pyi__tests__PYI002_PYI002.pyi.snap | 1 - ..._flake8_pyi__tests__PYI005_PYI005.pyi.snap | 1 - ...__flake8_pyi__tests__PYI006_PYI006.py.snap | 1 - ..._flake8_pyi__tests__PYI006_PYI006.pyi.snap | 1 - ..._flake8_pyi__tests__PYI007_PYI007.pyi.snap | 1 - ..._flake8_pyi__tests__PYI009_PYI009.pyi.snap | 1 - ...__flake8_pyi__tests__PYI013_PYI013.py.snap | 5 - ...__flake8_pyi__tests__PYI016_PYI016.py.snap | 1 - ..._flake8_pyi__tests__PYI016_PYI016.pyi.snap | 2 - ...flake8_pyi__tests__PYI019_PYI019_0.py.snap | 14 - ...lake8_pyi__tests__PYI019_PYI019_0.pyi.snap | 17 - ...lake8_pyi__tests__PYI019_PYI019_1.pyi.snap | 1 - ...flake8_pyi__tests__PYI025_PYI025_1.py.snap | 1 - ...flake8_pyi__tests__PYI025_PYI025_3.py.snap | 1 - ...lake8_pyi__tests__PYI025_PYI025_3.pyi.snap | 1 - ...__flake8_pyi__tests__PYI032_PYI032.py.snap | 2 - ..._flake8_pyi__tests__PYI032_PYI032.pyi.snap | 2 - ...__flake8_pyi__tests__PYI034_PYI034.py.snap | 3 - ..._flake8_pyi__tests__PYI034_PYI034.pyi.snap | 2 - ..._flake8_pyi__tests__PYI036_PYI036.pyi.snap | 2 - ...lake8_pyi__tests__PYI041_PYI041_1.pyi.snap | 10 - ..._flake8_pyi__tests__PYI045_PYI045.pyi.snap | 1 - ..._flake8_pyi__tests__PYI052_PYI052.pyi.snap | 1 - ..._flake8_pyi__tests__PYI054_PYI054.pyi.snap | 1 - ...__flake8_pyi__tests__PYI055_PYI055.py.snap | 4 - ..._flake8_pyi__tests__PYI055_PYI055.pyi.snap | 1 - ...__flake8_pyi__tests__PYI059_PYI059.py.snap | 1 - ..._flake8_pyi__tests__PYI059_PYI059.pyi.snap | 2 - ...__flake8_pyi__tests__PYI061_PYI061.py.snap | 3 - ..._flake8_pyi__tests__PYI061_PYI061.pyi.snap | 10 - ...__flake8_pyi__tests__PYI062_PYI062.py.snap | 1 - ..._flake8_pyi__tests__PYI062_PYI062.pyi.snap | 1 - ...yi__tests__preview_PYI041_PYI041_4.py.snap | 1 - ...ke8_pyi__tests__py38_PYI061_PYI061.py.snap | 3 - ...e8_pyi__tests__py38_PYI061_PYI061.pyi.snap | 10 - ..._tests__pyi021_pie790_isolation_check.snap | 1 - ...es__flake8_pytest_style__tests__PT008.snap | 1 - ...es__flake8_pytest_style__tests__PT009.snap | 1 - ...es__flake8_pytest_style__tests__PT012.snap | 4 - ...es__flake8_pytest_style__tests__PT013.snap | 1 - ...es__flake8_pytest_style__tests__PT017.snap | 1 - ...es__flake8_pytest_style__tests__PT018.snap | 4 - ...es__flake8_pytest_style__tests__PT022.snap | 3 - ...es__flake8_pytest_style__tests__PT028.snap | 3 - ...es__flake8_pytest_style__tests__PT031.snap | 4 - ...8_pytest_style__tests__is_pytest_test.snap | 1 - ...style__tests__preview__PT018_PT018.py.snap | 2 - ..._tests__only_multiline_doubles_all.py.snap | 1 - ...docstring_doubles_module_multiline.py.snap | 1 - ...ocstring_doubles_module_singleline.py.snap | 1 - ...ubles_over_docstring_singles_class.py.snap | 1 - ...es_over_docstring_singles_function.py.snap | 1 - ...g_singles_mixed_quotes_class_var_1.py.snap | 2 - ...g_singles_mixed_quotes_class_var_2.py.snap | 2 - ...xed_quotes_module_singleline_var_1.py.snap | 1 - ...xed_quotes_module_singleline_var_2.py.snap | 1 - ...ngles_over_docstring_doubles_class.py.snap | 1 - ...es_over_docstring_doubles_function.py.snap | 1 - ...g_doubles_mixed_quotes_class_var_1.py.snap | 1 - ...g_doubles_mixed_quotes_class_var_2.py.snap | 1 - ...docstring_singles_module_multiline.py.snap | 1 - ...ocstring_singles_module_singleline.py.snap | 1 - ...quire_doubles_over_singles_escaped.py.snap | 2 - ...re_doubles_over_singles_escaped_py311.snap | 1 - ...s_over_singles_escaped_unnecessary.py.snap | 1 - ...uire_doubles_over_singles_implicit.py.snap | 1 - ...ver_singles_would_be_triple_quotes.py.snap | 2 - ...quire_singles_over_doubles_escaped.py.snap | 2 - ...re_singles_over_doubles_escaped_py311.snap | 1 - ...s_over_doubles_escaped_unnecessary.py.snap | 1 - ...uire_singles_over_doubles_implicit.py.snap | 1 - ...ver_doubles_would_be_triple_quotes.py.snap | 1 - ...ry-paren-on-raise-exception_RSE102.py.snap | 2 - ...lake8_return__tests__RET501_RET501.py.snap | 2 - ...lake8_return__tests__RET503_RET503.py.snap | 19 - ...lake8_return__tests__RET504_RET504.py.snap | 14 - ...lake8_return__tests__RET505_RET505.py.snap | 2 - ...self__tests__custom_method_decorators.snap | 1 - ...les__flake8_self__tests__ignore_names.snap | 2 - ...ts__private-member-access_SLF001_1.py.snap | 1 - ...ke8_simplify__tests__SIM101_SIM101.py.snap | 1 - ...ke8_simplify__tests__SIM103_SIM103.py.snap | 17 - ...8_simplify__tests__SIM105_SIM105_0.py.snap | 4 - ...8_simplify__tests__SIM105_SIM105_1.py.snap | 1 - ...8_simplify__tests__SIM105_SIM105_2.py.snap | 1 - ...8_simplify__tests__SIM105_SIM105_3.py.snap | 1 - ...8_simplify__tests__SIM105_SIM105_4.py.snap | 1 - ...ke8_simplify__tests__SIM107_SIM107.py.snap | 1 - ...ke8_simplify__tests__SIM108_SIM108.py.snap | 8 - ...ke8_simplify__tests__SIM110_SIM110.py.snap | 10 - ...ke8_simplify__tests__SIM110_SIM111.py.snap | 12 - ...ke8_simplify__tests__SIM113_SIM113.py.snap | 4 - ...ke8_simplify__tests__SIM114_SIM114.py.snap | 6 - ...ke8_simplify__tests__SIM118_SIM118.py.snap | 1 - ...ke8_simplify__tests__SIM210_SIM210.py.snap | 2 - ...ke8_simplify__tests__SIM222_SIM222.py.snap | 2 - ...ke8_simplify__tests__SIM223_SIM223.py.snap | 1 - ...ke8_simplify__tests__SIM905_SIM905.py.snap | 2 - ...ke8_simplify__tests__SIM910_SIM910.py.snap | 3 - ...ify__tests__preview__SIM113_SIM113.py.snap | 4 - ..._tidy_imports__tests__ban_all_imports.snap | 1 - ...dy_imports__tests__ban_parent_imports.snap | 1 - ...ts__tests__ban_parent_imports_package.snap | 1 - ...dy_imports__tests__banned_api_package.snap | 1 - ...__tests__preview_lazy_import_mismatch.snap | 1 - ...sts__preview_lazy_import_mismatch_all.snap | 1 - ..._invalid-todo-capitalization_TD006.py.snap | 1 - ...dos__tests__invalid-todo-tag_TD001.py.snap | 1 - ...__tests__missing-todo-author_TD002.py.snap | 1 - ...s__tests__missing-todo-colon_TD004.py.snap | 1 - ...ts__missing-todo-description_TD005.py.snap | 1 - ...os__tests__missing-todo-link_TD003.py.snap | 1 - ...__TC001-TC002-TC003_TC001-3_future.py.snap | 1 - ...import__TC001_TC001_future_present.py.snap | 1 - ...s__empty-type-checking-block_TC005.py.snap | 1 - ...mport-in-type-checking-block_quote.py.snap | 1 - ...ng__tests__quoted-type-alias_TC008.py.snap | 2 - ...ias_TC008_typing_execution_context.py.snap | 1 - ...g__tests__runtime-cast-value_TC006.py.snap | 10 - ...ort-in-type-checking-block_TC004_1.py.snap | 1 - ...rt-in-type-checking-block_TC004_11.py.snap | 1 - ...rt-in-type-checking-block_TC004_12.py.snap | 1 - ...rt-in-type-checking-block_TC004_17.py.snap | 1 - ...ort-in-type-checking-block_TC004_2.py.snap | 1 - ...mport-in-type-checking-block_quote.py.snap | 1 - ...k_runtime_evaluated_base_classes_1.py.snap | 3 - ...ock_runtime_evaluated_decorators_1.py.snap | 3 - ...-in-type-checking-block_whitespace.py.snap | 1 - ...ests__runtime-string-union_TC010_1.py.snap | 1 - ...ests__runtime-string-union_TC010_2.py.snap | 1 - ...y-standard-library-import_init_var.py.snap | 1 - ...ly-standard-library-import_kw_only.py.snap | 1 - ...g__tests__tc004_precedence_over_tc007.snap | 1 - ...g__tests__tc010_precedence_over_tc008.snap | 1 - ...y-standard-library-import_init_var.py.snap | 1 - ...d-library-import_module__undefined.py.snap | 1 - ...ort_runtime_evaluated_decorators_2.py.snap | 1 - ...e_pathlib__tests__PTH124_py_path_1.py.snap | 1 - ...e_pathlib__tests__PTH124_py_path_2.py.snap | 1 - ..._use_pathlib__tests__PTH202_PTH202.py.snap | 2 - ...se_pathlib__tests__PTH202_PTH202_2.py.snap | 1 - ..._use_pathlib__tests__PTH203_PTH203.py.snap | 3 - ..._use_pathlib__tests__PTH204_PTH204.py.snap | 2 - ..._use_pathlib__tests__PTH205_PTH205.py.snap | 1 - ..._use_pathlib__tests__PTH208_PTH208.py.snap | 2 - ..._use_pathlib__tests__PTH211_PTH211.py.snap | 1 - ...ake8_use_pathlib__tests__full_name.py.snap | 1 - ...ake8_use_pathlib__tests__import_as.py.snap | 1 - ...e8_use_pathlib__tests__import_from.py.snap | 2 - ...use_pathlib__tests__import_from_as.py.snap | 1 - ...lib__tests__preview__PTH201_PTH201.py.snap | 1 - ...lib__tests__preview__PTH202_PTH202.py.snap | 2 - ...b__tests__preview__PTH202_PTH202_2.py.snap | 1 - ...lib__tests__preview__PTH203_PTH203.py.snap | 3 - ...lib__tests__preview__PTH204_PTH204.py.snap | 2 - ...lib__tests__preview__PTH205_PTH205.py.snap | 1 - ..._pathlib__tests__preview_full_name.py.snap | 1 - ..._pathlib__tests__preview_import_as.py.snap | 1 - ...athlib__tests__preview_import_from.py.snap | 2 - ...lib__tests__preview_import_from_as.py.snap | 1 - ...kage_first_and_third_party_imports.py.snap | 1 - ...kage_first_and_third_party_imports.py.snap | 1 - ...tests__add_newline_before_comments.py.snap | 1 - ..._isort__tests__as_imports_comments.py.snap | 1 - ..._rules__isort__tests__bom_unsorted.py.snap | 1 - ...sts__case_sensitive_case_sensitive.py.snap | 1 - ...to_furthest_relative_imports_order.py.snap | 1 - ...__isort__tests__combine_as_imports.py.snap | 1 - ...bine_as_imports_combine_as_imports.py.snap | 1 - ..._isort__tests__combine_import_from.py.snap | 1 - ...ter__rules__isort__tests__comments.py.snap | 1 - ..._isort__tests__deduplicate_imports.py.snap | 1 - ...es__isort__tests__detect_same_package.snap | 1 - ...les__isort__tests__fit_line_length.py.snap | 1 - ...rt__tests__fit_line_length_comment.py.snap | 1 - ...orce_single_line_force_single_line.py.snap | 1 - ..._tests__force_sort_within_sections.py.snap | 1 - ...ections_force_sort_within_sections.py.snap | 1 - ..._force_sort_within_sections_future.py.snap | 1 - ...sort_within_sections_with_as_names.py.snap | 1 - ...ns_lazy_force_sort_within_sections.py.snap | 1 - ..._rules__isort__tests__force_to_top.py.snap | 1 - ...__tests__force_to_top_force_to_top.py.snap | 1 - ...__isort__tests__force_wrap_aliases.py.snap | 1 - ...ce_wrap_aliases_force_wrap_aliases.py.snap | 1 - ...les__isort__tests__forced_separate.py.snap | 1 - ..._tests__from_first_lazy_from_first.py.snap | 1 - ...__rules__isort__tests__future_from.py.snap | 1 - ...kage_first_and_third_party_imports.py.snap | 1 - ..._rules__isort__tests__if_elif_else.py.snap | 1 - ...t__tests__import_from_after_import.py.snap | 1 - ...heading_force_sort_within_sections.py.snap | 1 - ...sts__import_heading_import_heading.py.snap | 1 - ...ing_import_heading_already_present.py.snap | 1 - ...t_heading_import_heading_duplicate.py.snap | 1 - ...rt_heading_import_heading_unsorted.py.snap | 1 - ...ing_partial_import_heading_partial.py.snap | 1 - ...tion_import_heading_single_section.py.snap | 1 - ...mport_heading_with_no_lines_before.py.snap | 1 - ...ading_import_heading_wrong_heading.py.snap | 1 - ...les__isort__tests__inline_comments.py.snap | 1 - ...sest_separate_local_folder_imports.py.snap | 1 - ...lder_separate_local_folder_imports.py.snap | 1 - ..._rules__isort__tests__lazy_imports.py.snap | 1 - ...ules__isort__tests__leading_prefix.py.snap | 1 - ...gth_sort__length_sort_from_imports.py.snap | 1 - ...ort__length_sort_non_ascii_members.py.snap | 1 - ...ort__length_sort_non_ascii_modules.py.snap | 1 - ...gth_sort_straight_and_from_imports.py.snap | 1 - ...sort__length_sort_straight_imports.py.snap | 1 - ..._length_sort_with_relative_imports.py.snap | 1 - ...straight__length_sort_from_imports.py.snap | 1 - ...gth_sort_straight_and_from_imports.py.snap | 1 - ...ight__length_sort_straight_imports.py.snap | 1 - ...es__isort__tests__line_ending_crlf.py.snap | 1 - ...ules__isort__tests__line_ending_lf.py.snap | 1 - ...isort__tests__lines_after_imports.pyi.snap | 1 - ...ts__lines_after_imports_func_after.py.snap | 1 - ...after_imports_lines_after_imports.pyi.snap | 1 - ...rts_lines_after_imports_func_after.py.snap | 1 - ..._lines_after_imports_nothing_after.py.snap | 1 - ...s_between_typeslines_between_types.py.snap | 1 - ...isort__tests__magic_trailing_comma.py.snap | 1 - ...r__rules__isort__tests__match_case.py.snap | 1 - ...rules__isort__tests__natural_order.py.snap | 1 - ..._isort__tests__no_detect_same_package.snap | 1 - ...les__isort__tests__no_lines_before.py.snap | 1 - ...no_lines_before.py_no_lines_before.py.snap | 1 - ...o_lines_before_with_empty_sections.py.snap | 1 - ...andard_library_no_standard_library.py.snap | 1 - ..._rules__isort__tests__no_wrap_star.py.snap | 1 - ...rules__isort__tests__order_by_type.py.snap | 1 - ..._order_by_type_false_order_by_type.py.snap | 1 - ..._order_by_type_with_custom_classes.py.snap | 1 - ..._order_by_type_with_custom_classes.py.snap | 1 - ...rder_by_type_with_custom_constants.py.snap | 1 - ...rder_by_type_with_custom_constants.py.snap | 1 - ...rder_by_type_with_custom_variables.py.snap | 1 - ...rder_by_type_with_custom_variables.py.snap | 1 - ...s__order_relative_imports_by_level.py.snap | 1 - ...ort__tests__preserve_comment_order.py.snap | 1 - ...isort__tests__preserve_import_star.py.snap | 1 - ...isort__tests__preserve_indentation.py.snap | 1 - ...comments_propagate_inline_comments.py.snap | 1 - ...ort__tests__reorder_within_section.py.snap | 1 - ...mport_with_useless_alias_this_this.py.snap | 1 - ..._with_useless_alias_this_this_from.py.snap | 1 - ...ort__tests__section_order_sections.py.snap | 1 - ...s__isort__tests__sections_sections.py.snap | 1 - ...ests__separate_first_party_imports.py.snap | 1 - ...rt__tests__separate_future_imports.py.snap | 1 - ...sts__separate_local_folder_imports.py.snap | 1 - ...ests__separate_third_party_imports.py.snap | 1 - ..._linter__rules__isort__tests__skip.py.snap | 3 - ...isort__tests__sort_similar_imports.py.snap | 1 - ...linter__rules__isort__tests__split.py.snap | 2 - ...railing_comma_magic_trailing_comma.py.snap | 1 - ...__isort__tests__star_before_others.py.snap | 1 - ...es__isort__tests__trailing_comment.py.snap | 1 - ...les__isort__tests__trailing_suffix.py.snap | 1 - ...__numpy-deprecated-function_NPY003.py.snap | 2 - ...numpy-deprecated-type-alias_NPY001.py.snap | 1 - ..._tests__numpy-legacy-random_NPY002.py.snap | 1 - ...tests__numpy2-deprecation_NPY201_3.py.snap | 1 - ..._rules__pandas_vet__tests__PD002_fail.snap | 1 - ..._rules__pandas_vet__tests__PD003_fail.snap | 1 - ..._rules__pandas_vet__tests__PD004_fail.snap | 1 - ..._rules__pandas_vet__tests__PD007_fail.snap | 1 - ..._rules__pandas_vet__tests__PD008_fail.snap | 1 - ..._rules__pandas_vet__tests__PD009_fail.snap | 1 - ..._pandas_vet__tests__PD011_fail_values.snap | 1 - ...__pandas_vet__tests__PD013_fail_stack.snap | 1 - ...ts__PD015_fail_merge_on_pandas_object.snap | 1 - ..._pandas_vet__tests__PD901_fail_df_var.snap | 1 - ...les__pep8_naming__tests__N803_N803.py.snap | 3 - ...les__pep8_naming__tests__N806_N806.py.snap | 1 - ...les__pep8_naming__tests__N812_N812.py.snap | 1 - ...les__pep8_naming__tests__N813_N813.py.snap | 1 - ...les__pep8_naming__tests__N817_N817.py.snap | 2 - ...case_imported_as_incorrect_convention.snap | 2 - ...ing__tests__ignore_names_N806_N806.py.snap | 1 - ...ing__tests__ignore_names_N811_N811.py.snap | 1 - ...ing__tests__ignore_names_N812_N812.py.snap | 1 - ...ing__tests__ignore_names_N813_N813.py.snap | 1 - ...ing__tests__ignore_names_N814_N814.py.snap | 1 - ...ing__tests__ignore_names_N815_N815.py.snap | 1 - ...ing__tests__ignore_names_N816_N816.py.snap | 1 - ...ing__tests__ignore_names_N817_N817.py.snap | 1 - ...__perflint__tests__PERF401_PERF401.py.snap | 18 - ...__perflint__tests__PERF402_PERF402.py.snap | 1 - ...__perflint__tests__PERF403_PERF403.py.snap | 16 - ...t__tests__preview__PERF401_PERF401.py.snap | 18 - ...t__tests__preview__PERF403_PERF403.py.snap | 16 - ...les__pycodestyle__tests__E101_E101.py.snap | 1 - ...ules__pycodestyle__tests__E203_E20.py.snap | 1 - ...ules__pycodestyle__tests__E231_E23.py.snap | 1 - ...ules__pycodestyle__tests__E241_E24.py.snap | 1 - ...ules__pycodestyle__tests__E262_E26.py.snap | 1 - ...tyle__tests__E301_E30_syntax_error.py.snap | 1 - ...tyle__tests__E302_E30_syntax_error.py.snap | 1 - ...ules__pycodestyle__tests__E303_E30.py.snap | 2 - ...tyle__tests__E303_E30_syntax_error.py.snap | 1 - ...tyle__tests__E305_E30_syntax_error.py.snap | 2 - ...tyle__tests__E306_E30_syntax_error.py.snap | 1 - ...ules__pycodestyle__tests__E401_E40.py.snap | 2 - ...ules__pycodestyle__tests__E402_E40.py.snap | 1 - ...s__pycodestyle__tests__E402_E402_0.py.snap | 3 - ...s__pycodestyle__tests__E402_E402_1.py.snap | 1 - ...les__pycodestyle__tests__E501_E501.py.snap | 1 - ...s__pycodestyle__tests__E501_E501_3.py.snap | 1 - ...les__pycodestyle__tests__E713_E713.py.snap | 1 - ...les__pycodestyle__tests__E714_E714.py.snap | 1 - ...les__pycodestyle__tests__E731_E731.py.snap | 16 - ...les__pycodestyle__tests__E741_E741.py.snap | 1 - ...ules__pycodestyle__tests__W191_W19.py.snap | 2 - ...s__pycodestyle__tests__W292_W292_0.py.snap | 1 - ...les__pycodestyle__tests__W293_W293.py.snap | 1 - ...s__pycodestyle__tests__W605_W605_0.py.snap | 2 - ...s__pycodestyle__tests__W605_W605_1.py.snap | 4 - ...__tests__blank_lines_E304_typing_stub.snap | 1 - ...patibility-lines-after(-1)-between(0).snap | 3 - ...mpatibility-lines-after(0)-between(0).snap | 2 - ...mpatibility-lines-after(1)-between(1).snap | 2 - ...mpatibility-lines-after(4)-between(4).snap | 4 - ..._tests__blank_lines_typing_stub_isort.snap | 10 - ...s__pycodestyle__tests__max_doc_length.snap | 3 - ...yle__tests__max_doc_length_with_utf_8.snap | 3 - ...odestyle__tests__preview__E402_E40.py.snap | 1 - ...style__tests__preview__E402_E402_0.py.snap | 3 - ...style__tests__preview__E402_E402_1.py.snap | 1 - ...tests__preview__E402_E402_comments.py.snap | 1 - ...ests__preview__E402_E402_docstring.py.snap | 1 - ...__tests__preview__E402_E402_future.py.snap | 1 - ..._tests__preview__E402_E402_shebang.py.snap | 1 - ..._E402_shebang_docstring_and_future.py.snap | 1 - ...style__tests__preview__E501_E501_5.py.snap | 1 - ...tyle__tests__preview__W391_W391.ipynb.snap | 1 - ...style__tests__preview__W391_W391_0.py.snap | 1 - ...style__tests__preview__W391_W391_2.py.snap | 1 - ...rules__pycodestyle__tests__tab_size_1.snap | 1 - ...rules__pycodestyle__tests__tab_size_2.snap | 1 - ...rules__pycodestyle__tests__tab_size_4.snap | 1 - ...rules__pycodestyle__tests__tab_size_8.snap | 1 - ...__pycodestyle__tests__task_tags_false.snap | 1 - ...patibility-lines-after(-1)-between(0).snap | 4 - ...mpatibility-lines-after(0)-between(0).snap | 6 - ...mpatibility-lines-after(1)-between(1).snap | 5 - ...mpatibility-lines-after(4)-between(4).snap | 2 - ...er__rules__pycodestyle__tests__w292_4.snap | 1 - ...hite_space_syntax_error_compatibility.snap | 1 - ...__rules__pydocstyle__tests__D103_D.py.snap | 1 - ...__rules__pydocstyle__tests__D200_D.py.snap | 5 - ...ules__pydocstyle__tests__D200_D200.py.snap | 3 - ...__rules__pydocstyle__tests__D201_D.py.snap | 2 - ...ules__pydocstyle__tests__D202_D202.py.snap | 2 - ...__rules__pydocstyle__tests__D203_D.py.snap | 2 - ...__rules__pydocstyle__tests__D204_D.py.snap | 1 - ...__rules__pydocstyle__tests__D205_D.py.snap | 2 - ...__rules__pydocstyle__tests__D207_D.py.snap | 2 - ...__rules__pydocstyle__tests__D208_D.py.snap | 1 - ...ules__pydocstyle__tests__D208_D208.py.snap | 2 - ...__rules__pydocstyle__tests__D209_D.py.snap | 2 - ...__rules__pydocstyle__tests__D210_D.py.snap | 4 - ...__rules__pydocstyle__tests__D211_D.py.snap | 1 - ...__rules__pydocstyle__tests__D212_D.py.snap | 3 - ...__rules__pydocstyle__tests__D213_D.py.snap | 23 - ...__rules__pydocstyle__tests__D300_D.py.snap | 7 - ...ules__pydocstyle__tests__D300_D300.py.snap | 2 - ...__rules__pydocstyle__tests__D301_D.py.snap | 1 - ...ules__pydocstyle__tests__D301_D301.py.snap | 4 - ...__rules__pydocstyle__tests__D400_D.py.snap | 10 - ...ules__pydocstyle__tests__D400_D400.py.snap | 1 - ...ules__pydocstyle__tests__D401_D401.py.snap | 4 - ...__rules__pydocstyle__tests__D402_D.py.snap | 1 - ...ules__pydocstyle__tests__D402_D402.py.snap | 1 - ...ules__pydocstyle__tests__D403_D403.py.snap | 1 - ...__rules__pydocstyle__tests__D404_D.py.snap | 3 - ...__pydocstyle__tests__D407_sections.py.snap | 1 - ...es__pydocstyle__tests__D412_sphinx.py.snap | 2 - ...__pydocstyle__tests__D413_sections.py.snap | 1 - ...__pydocstyle__tests__D414_sections.py.snap | 1 - ...__rules__pydocstyle__tests__D415_D.py.snap | 9 - ...__rules__pydocstyle__tests__D419_D.py.snap | 1 - ...linter__rules__pydocstyle__tests__bom.snap | 1 - ...__rules__pydocstyle__tests__d209_d400.snap | 2 - ...ules__pyflakes__tests__F401_F401_0.py.snap | 5 - ...les__pyflakes__tests__F401_F401_11.py.snap | 1 - ...les__pyflakes__tests__F401_F401_15.py.snap | 1 - ...les__pyflakes__tests__F401_F401_18.py.snap | 1 - ...ules__pyflakes__tests__F401_F401_5.py.snap | 1 - ...ules__pyflakes__tests__F401_F401_6.py.snap | 1 - ...ules__pyflakes__tests__F401_F401_7.py.snap | 2 - ...ules__pyflakes__tests__F401_F401_9.py.snap | 1 - ...eprecated_option_F401_24____init__.py.snap | 3 - ...on_F401_25__all_nonempty____init__.py.snap | 3 - ...ption_F401_26__all_empty____init__.py.snap | 2 - ...on_F401_27__all_mistyped____init__.py.snap | 2 - ...on_F401_28__all_multiple____init__.py.snap | 2 - ...ts__F401_deprecated_option_F401_30.py.snap | 1 - ...sts__F401_stable_F401_24____init__.py.snap | 3 - ...le_F401_25__all_nonempty____init__.py.snap | 3 - ...table_F401_26__all_empty____init__.py.snap | 2 - ...le_F401_27__all_mistyped____init__.py.snap | 2 - ...le_F401_28__all_multiple____init__.py.snap | 2 - ...ules__pyflakes__tests__F404_F404_1.py.snap | 1 - ..._rules__pyflakes__tests__F405_F405.py.snap | 2 - ..._rules__pyflakes__tests__F406_F406.py.snap | 2 - ..._rules__pyflakes__tests__F407_F407.py.snap | 1 - ..._rules__pyflakes__tests__F502_F502.py.snap | 1 - ..._rules__pyflakes__tests__F504_F504.py.snap | 1 - ..._rules__pyflakes__tests__F522_F522.py.snap | 1 - ..._rules__pyflakes__tests__F523_F523.py.snap | 1 - ..._rules__pyflakes__tests__F524_F524.py.snap | 1 - ..._rules__pyflakes__tests__F525_F525.py.snap | 1 - ..._rules__pyflakes__tests__F541_F541.py.snap | 1 - ..._rules__pyflakes__tests__F601_F601.py.snap | 1 - ..._rules__pyflakes__tests__F602_F602.py.snap | 1 - ..._rules__pyflakes__tests__F632_F632.py.snap | 1 - ..._rules__pyflakes__tests__F633_F633.py.snap | 1 - ..._rules__pyflakes__tests__F701_F701.py.snap | 3 - ..._rules__pyflakes__tests__F702_F702.py.snap | 3 - ..._rules__pyflakes__tests__F704_F704.py.snap | 1 - ..._rules__pyflakes__tests__F706_F706.py.snap | 2 - ..._rules__pyflakes__tests__F722_F722.py.snap | 1 - ...ules__pyflakes__tests__F722_F722_1.py.snap | 1 - ...ules__pyflakes__tests__F811_F811_1.py.snap | 1 - ...les__pyflakes__tests__F811_F811_15.py.snap | 1 - ...les__pyflakes__tests__F811_F811_16.py.snap | 1 - ...les__pyflakes__tests__F811_F811_17.py.snap | 1 - ...ules__pyflakes__tests__F811_F811_2.py.snap | 1 - ...les__pyflakes__tests__F811_F811_23.py.snap | 1 - ...es__pyflakes__tests__F811_F811_29.pyi.snap | 1 - ...ules__pyflakes__tests__F811_F811_3.py.snap | 1 - ...les__pyflakes__tests__F811_F811_30.py.snap | 2 - ...les__pyflakes__tests__F811_F811_35.py.snap | 2 - ...ules__pyflakes__tests__F811_F811_4.py.snap | 1 - ...ules__pyflakes__tests__F811_F811_5.py.snap | 1 - ...ules__pyflakes__tests__F821_F821_0.py.snap | 4 - ...ules__pyflakes__tests__F821_F821_1.py.snap | 4 - ...les__pyflakes__tests__F821_F821_11.py.snap | 1 - ...les__pyflakes__tests__F821_F821_12.py.snap | 1 - ...les__pyflakes__tests__F821_F821_13.py.snap | 1 - ...les__pyflakes__tests__F821_F821_17.py.snap | 1 - ...les__pyflakes__tests__F821_F821_18.py.snap | 1 - ...les__pyflakes__tests__F821_F821_19.py.snap | 1 - ...les__pyflakes__tests__F821_F821_21.py.snap | 1 - ...les__pyflakes__tests__F821_F821_28.py.snap | 1 - ...les__pyflakes__tests__F821_F821_31.py.snap | 2 - ...les__pyflakes__tests__F821_F821_34.py.snap | 1 - ...es__pyflakes__tests__F821_F821_34.pyi.snap | 1 - ...ules__pyflakes__tests__F821_F821_4.py.snap | 5 - ...ules__pyflakes__tests__F821_F821_7.py.snap | 1 - ...ules__pyflakes__tests__F821_F821_9.py.snap | 1 - ...ules__pyflakes__tests__F822_F822_0.py.snap | 1 - ...les__pyflakes__tests__F822_F822_0.pyi.snap | 1 - ...ules__pyflakes__tests__F822_F822_1.py.snap | 1 - ...les__pyflakes__tests__F822_F822_1b.py.snap | 1 - ..._rules__pyflakes__tests__F823_F823.py.snap | 1 - ...ules__pyflakes__tests__F841_F841_0.py.snap | 5 - ...ules__pyflakes__tests__F841_F841_1.py.snap | 8 - ...ules__pyflakes__tests__F841_F841_3.py.snap | 10 - ..._rules__pyflakes__tests__F842_F842.py.snap | 1 - ..._rules__pyflakes__tests__F901_F901.py.snap | 3 - ...tests__augmented_assignment_after_del.snap | 2 - ...es__pyflakes__tests__default_builtins.snap | 1 - ...r__rules__pyflakes__tests__double_del.snap | 1 - ...pyflakes__tests__extra_typing_modules.snap | 1 - ...s__f401_allowed_unused_imports_option.snap | 1 - ...ests__f401_multiple_unused_submodules.snap | 1 - ...w_first_party_submodule_no_dunder_all.snap | 1 - ...__pyflakes__tests__f401_type_checking.snap | 1 - ...__f821_frozendict_pre_py315_undefined.snap | 1 - ...sion_but_old_target_version_specified.snap | 1 - ...lakes__tests__f841_dummy_variable_rgx.snap | 5 - ...s__load_after_unbind_from_class_scope.snap | 1 - ...yflakes__tests__multi_statement_lines.snap | 3 - ..._tests__nested_relative_typing_module.snap | 2 - ...s__preview__F401_F401_24____init__.py.snap | 3 - ...01_F401_25__all_nonempty____init__.py.snap | 3 - ..._F401_F401_26__all_empty____init__.py.snap | 2 - ...01_F401_27__all_mistyped____init__.py.snap | 2 - ...01_F401_28__all_multiple____init__.py.snap | 2 - ...s__preview__F401_F401_33____init__.py.snap | 1 - ...kes__tests__preview__F822___init__.py.snap | 3 - ...flakes__tests__relative_typing_module.snap | 1 - ...grep_hooks__tests__PGH004_PGH004_1.py.snap | 1 - ...ests__PLC0207_missing_maxsplit_arg.py.snap | 5 - ...__PLC0415_import_outside_top_level.py.snap | 2 - ...t__tests__PLC1802_len_as_condition.py.snap | 1 - ...int__tests__PLC2401_non_ascii_name.py.snap | 1 - ..._private_name__submodule____main__.py.snap | 1 - ...s__PLC2801_unnecessary_dunder_call.py.snap | 2 - ...002_unnecessary_direct_lambda_call.py.snap | 2 - ...lint__tests__PLE0100_yield_in_init.py.snap | 1 - ...tests__PLE0115_nonlocal_and_global.py.snap | 1 - ...__PLE0117_nonlocal_without_binding.py.snap | 3 - ...PLE0303_invalid_return_type_length.py.snap | 4 - ...__PLE0304_invalid_return_type_bool.py.snap | 1 - ..._PLE0305_invalid_return_type_index.py.snap | 4 - ...s__PLE0307_invalid_return_type_str.py.snap | 4 - ..._PLE0308_invalid_return_type_bytes.py.snap | 3 - ...__PLE0309_invalid_return_type_hash.py.snap | 3 - ..._tests__PLE0604_invalid_all_object.py.snap | 1 - ...ests__PLE0704_misplaced_bare_raise.py.snap | 1 - ..._PLE1132_repeated_keyword_argument.py.snap | 1 - ...ts__PLE1142_await_outside_async.ipynb.snap | 1 - ...tests__PLE1142_await_outside_async.py.snap | 11 - ..._tests__PLE1310_bad_str_strip_call.py.snap | 1 - ...E1700_yield_from_in_async_function.py.snap | 1 - ...10_invalid_characters_syntax_error.py.snap | 4 - ...sts__PLR1708_stop_iteration_return.py.snap | 7 - ...int__tests__PLR1711_useless_return.py.snap | 6 - ...R1712_swap_with_temporary_variable.py.snap | 3 - ...R1714_repeated_equality_comparison.py.snap | 1 - ...PLR1716_boolean_chained_comparison.py.snap | 1 - ...t__tests__PLR1722_sys_exit_alias_0.py.snap | 2 - ...t__tests__PLR1722_sys_exit_alias_1.py.snap | 3 - ...__tests__PLR1722_sys_exit_alias_10.py.snap | 1 - ...__tests__PLR1722_sys_exit_alias_11.py.snap | 1 - ...__tests__PLR1722_sys_exit_alias_12.py.snap | 1 - ...__tests__PLR1722_sys_exit_alias_13.py.snap | 1 - ...__tests__PLR1722_sys_exit_alias_14.py.snap | 1 - ...__tests__PLR1722_sys_exit_alias_15.py.snap | 1 - ...__tests__PLR1722_sys_exit_alias_16.py.snap | 2 - ...t__tests__PLR1722_sys_exit_alias_2.py.snap | 2 - ...t__tests__PLR1722_sys_exit_alias_3.py.snap | 3 - ...t__tests__PLR1722_sys_exit_alias_4.py.snap | 2 - ...t__tests__PLR1722_sys_exit_alias_5.py.snap | 2 - ...t__tests__PLR1722_sys_exit_alias_6.py.snap | 1 - ...t__tests__PLR1722_sys_exit_alias_7.py.snap | 1 - ...t__tests__PLR1722_sys_exit_alias_8.py.snap | 1 - ...t__tests__PLR1722_sys_exit_alias_9.py.snap | 1 - ...nt__tests__PLR1730_if_stmt_min_max.py.snap | 5 - ...1733_unnecessary_dict_index_lookup.py.snap | 1 - ...1736_unnecessary_list_index_lookup.py.snap | 3 - ...lint__tests__PLR2044_empty_comment.py.snap | 2 - ...__PLR6104_non_augmented_assignment.py.snap | 4 - ...pylint__tests__PLW0101_unreachable.py.snap | 1 - ..._tests__PLW0108_unnecessary_lambda.py.snap | 1 - ...__PLW0129_assert_on_string_literal.py.snap | 1 - ...PLW0131_named_expr_without_context.py.snap | 2 - ...int__tests__PLW0177_nan_comparison.py.snap | 1 - ...LW0244_redefined_slots_in_subclass.py.snap | 2 - ...tests__PLW0406_import_self__module.py.snap | 1 - ...W0602_global_variable_not_assigned.py.snap | 1 - ...ts__PLW0642_self_or_cls_assignment.py.snap | 1 - ...lint__tests__PLW1501_bad_open_mode.py.snap | 1 - ...ests__PLW1507_shallow_copy_environ.py.snap | 1 - ...tests__PLW2901_redefined_loop_name.py.snap | 1 - ...int__tests__PLW3301_nested_min_max.py.snap | 1 - ...tests__conflict_with_definition_rules.snap | 1 - ...s__pylint__tests__continue_in_finally.snap | 2 - ..._import_outside_top_level_with_banned.snap | 1 - ...LW0133_useless_exception_statement.py.snap | 10 - ...ylint__tests__too_many_public_methods.snap | 1 - crates/ruff_linter/src/rules/pyupgrade/mod.rs | 1 - ...er__rules__pyupgrade__tests__UP001.py.snap | 1 - ...er__rules__pyupgrade__tests__UP003.py.snap | 1 - ...er__rules__pyupgrade__tests__UP005.py.snap | 1 - ...__rules__pyupgrade__tests__UP007_1.py.snap | 2 - ...er__rules__pyupgrade__tests__UP008.py.snap | 11 - ...__rules__pyupgrade__tests__UP010_0.py.snap | 1 - ...er__rules__pyupgrade__tests__UP012.py.snap | 2 - ...er__rules__pyupgrade__tests__UP014.py.snap | 1 - ...__rules__pyupgrade__tests__UP015_1.py.snap | 1 - ...er__rules__pyupgrade__tests__UP018.py.snap | 5 - ..._rules__pyupgrade__tests__UP018_CR.py.snap | 1 - ..._rules__pyupgrade__tests__UP018_LF.py.snap | 1 - ...__rules__pyupgrade__tests__UP024_2.py.snap | 1 - ...er__rules__pyupgrade__tests__UP025.py.snap | 1 - ...er__rules__pyupgrade__tests__UP026.py.snap | 2 - ...__rules__pyupgrade__tests__UP028_0.py.snap | 11 - ...sts__UP029_1.py_skip_required_imports.snap | 1 - ...__rules__pyupgrade__tests__UP030_0.py.snap | 1 - ...__rules__pyupgrade__tests__UP031_0.py.snap | 3 - ...__rules__pyupgrade__tests__UP032_0.py.snap | 9 - ...__rules__pyupgrade__tests__UP032_1.py.snap | 1 - ...__rules__pyupgrade__tests__UP032_2.py.snap | 1 - ...er__rules__pyupgrade__tests__UP035.py.snap | 1 - ...__rules__pyupgrade__tests__UP037_0.py.snap | 6 - ...__rules__pyupgrade__tests__UP037_1.py.snap | 1 - ..._rules__pyupgrade__tests__UP037_2.pyi.snap | 10 - ...__rules__pyupgrade__tests__UP037_3.py.snap | 1 - ...er__rules__pyupgrade__tests__UP039.py.snap | 1 - ...er__rules__pyupgrade__tests__UP040.py.snap | 2 - ...pgrade__tests__UP040.py__preview_diff.snap | 1 - ...r__rules__pyupgrade__tests__UP040.pyi.snap | 2 - ...er__rules__pyupgrade__tests__UP042.py.snap | 4 - ...__rules__pyupgrade__tests__UP045_1.py.snap | 9 - ...__rules__pyupgrade__tests__UP046_0.py.snap | 1 - ...__rules__pyupgrade__tests__UP049_1.py.snap | 3 - ...sts__add_future_annotation_UP037_0.py.snap | 6 - ...sts__add_future_annotation_UP037_1.py.snap | 1 - ...ts__add_future_annotation_UP037_2.pyi.snap | 10 - ...rade__tests__datetime_utc_alias_py311.snap | 4 - ..._annotations_keep_runtime_typing_p310.snap | 2 - ...sts__future_annotations_pep_585_py310.snap | 2 - ...sts__future_annotations_pep_604_py310.snap | 1 - ...es__refurb__tests__FURB105_FURB105.py.snap | 1 - ...es__refurb__tests__FURB113_FURB113.py.snap | 10 - ...es__refurb__tests__FURB116_FURB116.py.snap | 1 - ...es__refurb__tests__FURB118_FURB118.py.snap | 2 - ...es__refurb__tests__FURB122_FURB122.py.snap | 18 - ...es__refurb__tests__FURB129_FURB129.py.snap | 1 - ...es__refurb__tests__FURB131_FURB131.py.snap | 8 - ...es__refurb__tests__FURB132_FURB132.py.snap | 4 - ...es__refurb__tests__FURB136_FURB136.py.snap | 1 - ...es__refurb__tests__FURB140_FURB140.py.snap | 1 - ...es__refurb__tests__FURB142_FURB142.py.snap | 2 - ...es__refurb__tests__FURB145_FURB145.py.snap | 1 - ...es__refurb__tests__FURB152_FURB152.py.snap | 1 - ...es__refurb__tests__FURB154_FURB154.py.snap | 6 - ...es__refurb__tests__FURB157_FURB157.py.snap | 1 - ...es__refurb__tests__FURB162_FURB162.py.snap | 1 - ...es__refurb__tests__FURB163_FURB163.py.snap | 2 - ...es__refurb__tests__FURB164_FURB164.py.snap | 1 - ...es__refurb__tests__FURB166_FURB166.py.snap | 1 - ...es__refurb__tests__FURB169_FURB169.py.snap | 1 - ...es__refurb__tests__FURB187_FURB187.py.snap | 3 - ...es__refurb__tests__FURB188_FURB188.py.snap | 5 - ...__refurb__tests__FURB192_FURB192_1.py.snap | 1 - ...sts__fstring_number_format_python_311.snap | 1 - ...__tests__PY315_RUF015_RUF015_py315.py.snap | 1 - ...ruff__tests__PY315_RUF017_RUF017_0.py.snap | 2 - ..._rules__ruff__tests__RUF005_RUF005.py.snap | 1 - ..._rules__ruff__tests__RUF006_RUF006.py.snap | 5 - ..._rules__ruff__tests__RUF007_RUF007.py.snap | 1 - ..._rules__ruff__tests__RUF008_RUF008.py.snap | 1 - ...__ruff__tests__RUF009_RUF009_attrs.py.snap | 5 - ..._rules__ruff__tests__RUF010_RUF010.py.snap | 1 - ..._rules__ruff__tests__RUF012_RUF012.py.snap | 1 - ...ules__ruff__tests__RUF013_RUF013_4.py.snap | 1 - ..._rules__ruff__tests__RUF015_RUF015.py.snap | 1 - ..._rules__ruff__tests__RUF016_RUF016.py.snap | 1 - ...ules__ruff__tests__RUF017_RUF017_0.py.snap | 2 - ...ules__ruff__tests__RUF017_RUF017_1.py.snap | 1 - ..._rules__ruff__tests__RUF020_RUF020.py.snap | 3 - ..._rules__ruff__tests__RUF023_RUF023.py.snap | 1 - ..._rules__ruff__tests__RUF024_RUF024.py.snap | 1 - ..._rules__ruff__tests__RUF026_RUF026.py.snap | 14 - ...ules__ruff__tests__RUF027_RUF027_0.py.snap | 9 - ..._rules__ruff__tests__RUF028_RUF028.py.snap | 1 - ..._rules__ruff__tests__RUF030_RUF030.py.snap | 1 - ..._rules__ruff__tests__RUF032_RUF032.py.snap | 1 - ..._rules__ruff__tests__RUF033_RUF033.py.snap | 10 - ..._rules__ruff__tests__RUF034_RUF034.py.snap | 1 - ..._rules__ruff__tests__RUF037_RUF037.py.snap | 11 - ..._rules__ruff__tests__RUF043_RUF043.py.snap | 3 - ..._rules__ruff__tests__RUF046_RUF046.py.snap | 3 - ...les__ruff__tests__RUF046_RUF046_CR.py.snap | 1 - ...les__ruff__tests__RUF046_RUF046_LF.py.snap | 1 - ...es__ruff__tests__RUF047_RUF047_for.py.snap | 2 - ...les__ruff__tests__RUF047_RUF047_if.py.snap | 7 - ...es__ruff__tests__RUF047_RUF047_try.py.snap | 2 - ...__ruff__tests__RUF047_RUF047_while.py.snap | 2 - ..._rules__ruff__tests__RUF050_RUF050.py.snap | 2 - ..._rules__ruff__tests__RUF051_RUF051.py.snap | 1 - ..._rules__ruff__tests__RUF053_RUF053.py.snap | 13 - ..._rules__ruff__tests__RUF056_RUF056.py.snap | 1 - ...ules__ruff__tests__RUF058_RUF058_0.py.snap | 3 - ...ules__ruff__tests__RUF059_RUF059_0.py.snap | 2 - ...ules__ruff__tests__RUF059_RUF059_1.py.snap | 6 - ...ules__ruff__tests__RUF059_RUF059_2.py.snap | 6 - ...ules__ruff__tests__RUF059_RUF059_3.py.snap | 2 - ...sts__RUF061_RUF061_deprecated_call.py.snap | 2 - ..._ruff__tests__RUF061_RUF061_raises.py.snap | 5 - ...__ruff__tests__RUF061_RUF061_warns.py.snap | 2 - ...ules__ruff__tests__RUF065_RUF065_0.py.snap | 2 - ...ules__ruff__tests__RUF065_RUF065_1.py.snap | 1 - ...__RUF067_RUF067__modules____init__.py.snap | 1 - ...ules__ruff__tests__RUF101_RUF101_0.py.snap | 2 - ..._rules__ruff__tests__RUF102_RUF102.py.snap | 1 - ...er__rules__ruff__tests__RUF200_bleach.snap | 1 - ...s__ruff__tests__RUF200_invalid_author.snap | 1 - ..._tests__add_future_import_RUF013_4.py.snap | 1 - ...confusables_deferred_annotations_diff.snap | 1 - ...e_code_external_rules_ruff__RUF102.py.snap | 1 - ...issing_fstring_syntax_backslash_py311.snap | 2 - ...ruff_linter__rules__ruff__tests__noqa.snap | 2 - ...uff__tests__preview__RUF008_RUF008.py.snap | 1 - ...uff__tests__preview__RUF039_RUF039.py.snap | 2 - ...sts__preview__RUF039_RUF039_concat.py.snap | 4 - ...uff__tests__preview__RUF054_RUF054.py.snap | 1 - ...f__tests__preview__RUF055_RUF055_0.py.snap | 1 - ...f__tests__preview__RUF055_RUF055_1.py.snap | 1 - ...f__tests__preview__RUF055_RUF055_2.py.snap | 6 - ...uff__tests__preview__RUF069_RUF069.py.snap | 2 - ...uff__tests__preview__RUF070_RUF070.py.snap | 1 - ...uff__tests__preview__RUF072_RUF072.py.snap | 2 - ...RUF039_RUF039_py_version_sensitive.py.snap | 1 - ...RUF039_RUF039_py_version_sensitive.py.snap | 1 - ...uff__tests__py314__RUF058_RUF058_2.py.snap | 1 - ...ules__ruff__tests__range_suppressions.snap | 7 - ..._linter__rules__ruff__tests__ruf100_0.snap | 4 - ...__rules__ruff__tests__ruf100_0_prefix.snap | 4 - ..._linter__rules__ruff__tests__ruf100_1.snap | 3 - ..._linter__rules__ruff__tests__ruf100_2.snap | 1 - ..._linter__rules__ruff__tests__ruf100_3.snap | 1 - ..._linter__rules__ruff__tests__ruf100_5.snap | 1 - ...__rules__ruff__tests__ruff_noqa_codes.snap | 1 - ...tests__ruff_noqa_filedirective_unused.snap | 1 - ...oqa_filedirective_unused_last_of_many.snap | 1 - ...rules__ruff__tests__ruff_noqa_invalid.snap | 2 - ...s__strictly_empty_init_modules_ruf067.snap | 3 - ...sts__unnecessary_if_and_needless_else.snap | 1 - ...ts__useless_finally_and_needless_else.snap | 1 - ...dless_else_and_suppressible_exception.snap | 1 - ...ss_finally_and_suppressible_exception.snap | 1 - ..._error-instead-of-exception_TRY400.py.snap | 6 - ...__tests__raise-vanilla-args_TRY003.py.snap | 3 - ..._tests__raise-vanilla-class_TRY002.py.snap | 2 - ...pe-check-without-type-error_TRY004.py.snap | 34 - ..._tests__verbose-log-message_TRY401.py.snap | 12 - ...atops__tests__verbose-raise_TRY201.py.snap | 3 - ...linter__tests__async_comprehension.py.snap | 1 - ...n_in_sync_comprehension_notebook_3.10.snap | 1 - ...__linter__tests__await_scope_notebook.snap | 1 - ...linter__linter__tests__import_sorting.snap | 2 - ...er__linter__tests__ipy_escape_command.snap | 1 - ..._linter__tests__late_future_import.py.snap | 1 - ...linter__tests__return_in_generator.py.snap | 1 - ...er__tests__return_outside_function.py.snap | 3 - ...syntax_error_annotated_global.py_3.14.snap | 1 - ...rror_duplicate_type_parameter.py_3.12.snap | 1 - ...error_invalid_star_expression.py_3.10.snap | 1 - ...x_error_rebound_comprehension.py_3.10.snap | 1 - ...ror_single_starred_assignment.py_3.10.snap | 1 - ...linter__linter__tests__undefined_name.snap | 1 - ...inter__linter__tests__unused_variable.snap | 2 - ...ests__yield_from_in_async_function.py.snap | 1 - ...linter__linter__tests__yield_scope.py.snap | 3 - ...ann_assign_stmt_invalid_annotation.py.snap | 1 - ...tax@ann_assign_stmt_invalid_target.py.snap | 1 - ...ntax@ann_assign_stmt_invalid_value.py.snap | 1 - ...syntax@ann_assign_stmt_missing_rhs.py.snap | 1 - ..._assign_stmt_type_alias_annotation.py.snap | 1 - ...tax@args_unparenthesized_generator.py.snap | 1 - .../invalid_syntax@assert_empty_msg.py.snap | 1 - .../invalid_syntax@assert_empty_test.py.snap | 1 - ...lid_syntax@assert_invalid_msg_expr.py.snap | 1 - ...id_syntax@assert_invalid_test_expr.py.snap | 1 - ..._syntax@assign_stmt_invalid_target.py.snap | 2 - ...tax@assign_stmt_invalid_value_expr.py.snap | 1 - ...tax@assign_stmt_starred_expr_value.py.snap | 1 - ...tax@aug_assign_stmt_invalid_target.py.snap | 1 - ...ntax@aug_assign_stmt_invalid_value.py.snap | 1 - ...ash_continuation_indentation_error.py.snap | 1 - ..._syntax@case_expect_indented_block.py.snap | 1 - ...nvalid_syntax@class_def_empty_body.py.snap | 1 - ...alid_syntax@class_def_missing_name.py.snap | 1 - ...unparenthesized_generator_argument.py.snap | 1 - ...lid_syntax@class_type_params_py311.py.snap | 2 - ...yntax@clause_expect_indented_block.py.snap | 1 - ...tax@clause_expect_single_statement.py.snap | 1 - ...ntax@comma_separated_missing_comma.py.snap | 2 - ...ted_missing_comma_between_elements.py.snap | 1 - ...ted_missing_element_between_commas.py.snap | 1 - ...ma_separated_missing_first_element.py.snap | 1 - ...prehension_missing_for_after_async.py.snap | 1 - .../invalid_syntax@debug_shadow_class.py.snap | 1 - ...valid_syntax@debug_shadow_function.py.snap | 1 - ...invalid_syntax@debug_shadow_import.py.snap | 1 - .../invalid_syntax@debug_shadow_match.py.snap | 1 - .../invalid_syntax@debug_shadow_try.py.snap | 1 - ...lid_syntax@debug_shadow_type_alias.py.snap | 1 - .../invalid_syntax@debug_shadow_with.py.snap | 1 - ...yntax@decorator_missing_expression.py.snap | 1 - ...d_syntax@decorator_missing_newline.py.snap | 1 - ..._syntax@decorator_unexpected_token.py.snap | 1 - .../invalid_syntax@del_debug_py39.py.snap | 1 - ...valid_syntax@del_incomplete_target.py.snap | 1 - .../invalid_syntax@del_stmt_empty.py.snap | 1 - ...x@different_match_pattern_bindings.py.snap | 1 - ...d_syntax@dotted_name_multiple_dots.py.snap | 2 - ..._syntax@duplicate_match_class_attr.py.snap | 2 - ...tax@duplicate_type_parameter_names.py.snap | 1 - .../invalid_syntax@except_star_py310.py.snap | 1 - ...essions__arguments__double_starred.py.snap | 2 - ...ments__duplicate_keyword_arguments.py.snap | 2 - ...ons__arguments__invalid_expression.py.snap | 1 - ...uments__invalid_keyword_expression.py.snap | 1 - ...ressions__arguments__invalid_order.py.snap | 1 - ...sions__arguments__missing_argument.py.snap | 1 - ...ressions__arguments__missing_comma.py.snap | 1 - ...ax@expressions__arguments__starred.py.snap | 1 - ...essions__attribute__invalid_member.py.snap | 1 - ...ressions__attribute__multiple_dots.py.snap | 2 - ...@expressions__attribute__no_member.py.snap | 1 - ...syntax@expressions__await__recover.py.snap | 1 - ...ns__bin_op__invalid_rhs_expression.py.snap | 1 - ...ressions__bin_op__named_expression.py.snap | 1 - ...ssions__bin_op__starred_expression.py.snap | 1 - ...s__bool_op__invalid_rhs_expression.py.snap | 1 - ...@expressions__bool_op__missing_lhs.py.snap | 1 - ...essions__bool_op__named_expression.py.snap | 1 - ...sions__bool_op__starred_expression.py.snap | 1 - ...xpressions__compare__invalid_order.py.snap | 3 - ...s__compare__invalid_rhs_expression.py.snap | 1 - ...ressions__compare__multiple_equals.py.snap | 2 - ...essions__compare__named_expression.py.snap | 1 - ...sions__compare__starred_expression.py.snap | 1 - ...x@expressions__dict__comprehension.py.snap | 1 - ...tax@expressions__dict__double_star.py.snap | 1 - ...ons__dict__missing_closing_brace_0.py.snap | 2 - ...ons__dict__missing_closing_brace_1.py.snap | 1 - ..._syntax@expressions__dict__recover.py.snap | 2 - ...tax@expressions__emoji_identifiers.py.snap | 3 - ...yntax@expressions__emoji_statement.py.snap | 1 - ...id_syntax@expressions__if__recover.py.snap | 1 - ...essions__lambda_default_parameters.py.snap | 1 - ...sions__lambda_duplicate_parameters.py.snap | 2 - ...x@expressions__list__comprehension.py.snap | 1 - ...s__list__missing_closing_bracket_0.py.snap | 1 - ...s__list__missing_closing_bracket_1.py.snap | 1 - ...s__list__missing_closing_bracket_2.py.snap | 1 - ..._syntax@expressions__list__recover.py.snap | 1 - ...__list__star_expression_precedence.py.snap | 1 - ...expressions__named__invalid_target.py.snap | 1 - ...sions__named__missing_expression_0.py.snap | 2 - ...sions__named__missing_expression_1.py.snap | 1 - ...sions__named__missing_expression_2.py.snap | 2 - ...sions__named__missing_expression_3.py.snap | 1 - ...ressions__parenthesized__generator.py.snap | 3 - ...nthesized__missing_closing_paren_0.py.snap | 1 - ...nthesized__missing_closing_paren_1.py.snap | 1 - ...nthesized__missing_closing_paren_2.py.snap | 1 - ...ions__parenthesized__parenthesized.py.snap | 1 - ...@expressions__parenthesized__tuple.py.snap | 1 - ..._parenthesized__tuple_starred_expr.py.snap | 4 - ...ax@expressions__set__comprehension.py.snap | 1 - ...set__missing_closing_curly_brace_0.py.snap | 1 - ...set__missing_closing_curly_brace_1.py.snap | 1 - ...set__missing_closing_curly_brace_2.py.snap | 1 - ...d_syntax@expressions__set__recover.py.snap | 1 - ...s__set__star_expression_precedence.py.snap | 1 - ...__subscript__invalid_slice_element.py.snap | 1 - ...sions__subscript__unclosed_slice_0.py.snap | 1 - ...sions__subscript__unclosed_slice_1.py.snap | 2 - .../invalid_syntax@expressions__unary.py.snap | 1 - ...pressions__unary__named_expression.py.snap | 1 - ...pressions__yield__named_expression.py.snap | 1 - ...xpressions__yield__star_expression.py.snap | 1 - ...ns__yield_from__starred_expression.py.snap | 1 - ...sions__yield_from__unparenthesized.py.snap | 1 - ...ing_conversion_follows_exclamation.py.snap | 2 - ...d_syntax@f_string_empty_expression.py.snap | 1 - ...g_invalid_conversion_flag_name_tok.py.snap | 1 - ..._invalid_conversion_flag_other_tok.py.snap | 1 - ...ntax@f_string_invalid_starred_expr.py.snap | 1 - ..._string_lambda_without_parentheses.py.snap | 4 - ...id_syntax@f_string_unclosed_lbrace.py.snap | 1 - ...ing_unclosed_lbrace_in_format_spec.py.snap | 1 - ...nvalid_syntax@for_iter_unpack_py38.py.snap | 2 - ..._syntax@for_stmt_invalid_iter_expr.py.snap | 2 - ...lid_syntax@for_stmt_invalid_target.py.snap | 2 - ...or_stmt_invalid_target_binary_expr.py.snap | 1 - ...for_stmt_invalid_target_in_keyword.py.snap | 1 - ...syntax@for_stmt_missing_in_keyword.py.snap | 1 - ...lid_syntax@for_stmt_missing_target.py.snap | 1 - ...id_syntax@from_import_dotted_names.py.snap | 2 - ...lid_syntax@from_import_empty_names.py.snap | 3 - ..._syntax@from_import_missing_module.py.snap | 1 - ...tax@from_import_parenthesized_star.py.snap | 1 - ...@from_import_star_with_other_names.py.snap | 1 - ...ort_unparenthesized_trailing_comma.py.snap | 1 - ...lid_syntax@function_def_empty_body.py.snap | 1 - ...x@function_def_invalid_return_expr.py.snap | 2 - ...ax@function_def_missing_identifier.py.snap | 1 - ...x@function_def_missing_return_type.py.snap | 1 - ...nction_def_unclosed_parameter_list.py.snap | 2 - ...n_def_unparenthesized_return_types.py.snap | 1 - ..._syntax@function_type_params_py311.py.snap | 2 - .../invalid_syntax@global_stmt_empty.py.snap | 1 - ...alid_syntax@global_stmt_expression.py.snap | 1 - ..._syntax@global_stmt_trailing_comma.py.snap | 1 - .../invalid_syntax@if_stmt_empty_body.py.snap | 1 - ...d_syntax@if_stmt_invalid_test_expr.py.snap | 1 - ...nvalid_syntax@if_stmt_missing_test.py.snap | 1 - ...lid_syntax@if_stmt_misspelled_elif.py.snap | 1 - ...syntax@import_alias_missing_asname.py.snap | 1 - .../invalid_syntax@import_from_star.py.snap | 2 - .../invalid_syntax@import_stmt_empty.py.snap | 1 - ...ax@import_stmt_parenthesized_names.py.snap | 1 - ...lid_syntax@import_stmt_star_import.py.snap | 3 - ..._syntax@import_stmt_trailing_comma.py.snap | 1 - ..._attribute_before_for_in_delimiter.py.snap | 1 - ...id_syntax@invalid_annotation_class.py.snap | 1 - ...syntax@invalid_annotation_function.py.snap | 1 - ...@invalid_annotation_function_py314.py.snap | 1 - ...id_syntax@invalid_annotation_py314.py.snap | 1 - ...ntax@invalid_annotation_type_alias.py.snap | 1 - ...nvalid_syntax@invalid_byte_literal.py.snap | 1 - .../invalid_syntax@invalid_del_target.py.snap | 6 - ...ax@invalid_fstring_literal_element.py.snap | 1 - ...alid_syntax@invalid_future_feature.py.snap | 2 - ...alid_syntax@invalid_string_literal.py.snap | 1 - ...lp_escape_command_error_recovery_1.py.snap | 1 - ...lp_escape_command_error_recovery_2.py.snap | 2 - ...lid_syntax@iter_unpack_return_py37.py.snap | 1 - ...alid_syntax@iter_unpack_yield_py37.py.snap | 1 - ...ntax@lambda_body_with_starred_expr.py.snap | 1 - ...syntax@lambda_body_with_yield_expr.py.snap | 1 - ...@lazy_import_invalid_context_py315.py.snap | 1 - ...tax@lazy_import_invalid_from_py315.py.snap | 2 - ...alid_syntax@lazy_import_stmt_py314.py.snap | 1 - ...x@match_stmt_expect_indented_block.py.snap | 2 - ...tax@match_stmt_expected_case_block.py.snap | 1 - ...ntax@match_stmt_invalid_guard_expr.py.snap | 1 - ...ntax@match_stmt_missing_guard_expr.py.snap | 1 - ..._syntax@match_stmt_missing_pattern.py.snap | 1 - ...@match_stmt_no_newline_before_case.py.snap | 2 - ...mixed_bytes_and_non_bytes_literals.py.snap | 1 - ...ultiple_assignment_in_case_pattern.py.snap | 1 - ...ntax@multiple_clauses_on_same_line.py.snap | 3 - ...multiple_starred_assignment_target.py.snap | 2 - ..._starred_names_in_sequence_pattern.py.snap | 2 - .../invalid_syntax@named_expr_slice.py.snap | 3 - ...yntax@named_expr_slice_parse_error.py.snap | 1 - ...x@nested_async_comprehension_py310.py.snap | 1 - ...@nested_quote_in_format_spec_py312.py.snap | 1 - ...nvalid_syntax@node_range_with_gaps.py.snap | 2 - ...nlocal_declaration_at_module_level.py.snap | 1 - ...invalid_syntax@nonlocal_stmt_empty.py.snap | 1 - ...id_syntax@nonlocal_stmt_expression.py.snap | 1 - ...yntax@nonlocal_stmt_trailing_comma.py.snap | 1 - ...id_syntax@param_missing_annotation.py.snap | 1 - ...valid_syntax@param_missing_default.py.snap | 1 - ...ntax@param_with_invalid_annotation.py.snap | 1 - ..._syntax@param_with_invalid_default.py.snap | 1 - ...x@param_with_star_annotation_py310.py.snap | 1 - ...alid_syntax@params_duplicate_names.py.snap | 5 - ...rams_expected_after_star_separator.py.snap | 1 - ...x@params_follows_var_keyword_param.py.snap | 5 - ...@params_kwarg_after_star_separator.py.snap | 1 - ...alid_syntax@params_multiple_kwargs.py.snap | 1 - ...ax@params_multiple_slash_separator.py.snap | 1 - ...tax@params_multiple_star_separator.py.snap | 1 - ...lid_syntax@params_multiple_varargs.py.snap | 1 - ..._syntax@params_no_arg_before_slash.py.snap | 1 - ...x@params_non_default_after_default.py.snap | 2 - ...lid_syntax@params_star_after_slash.py.snap | 1 - ...ms_star_separator_after_star_param.py.snap | 1 - ...ax@params_var_keyword_with_default.py.snap | 4 - ...params_var_positional_with_default.py.snap | 4 - ...parenthesized_context_manager_py38.py.snap | 1 - ...id_syntax@parenthesized_kwarg_py38.py.snap | 1 - ...valid_syntax@pep701_f_string_py311.py.snap | 4 - ...@pep701_nested_interpolation_py311.py.snap | 1 - ...ict_unpacking_comprehensions_py315.py.snap | 1 - ...798_unpacking_comprehensions_py314.py.snap | 1 - .../invalid_syntax@pos_only_py37.py.snap | 1 - ...syntax@raise_stmt_from_without_exc.py.snap | 1 - ...id_syntax@raise_stmt_invalid_cause.py.snap | 1 - ...alid_syntax@raise_stmt_invalid_exc.py.snap | 1 - ...e_stmt_unparenthesized_tuple_cause.py.snap | 1 - ...ise_stmt_unparenthesized_tuple_exc.py.snap | 1 - ...nvalid_syntax@re_lex_logical_token.py.snap | 1 - ...x@re_lexing__fstring_format_spec_1.py.snap | 4 - ...re_lexing__triple_quoted_fstring_1.py.snap | 4 - ...re_lexing__triple_quoted_fstring_2.py.snap | 1 - .../invalid_syntax@re_lexing__ty_1828.py.snap | 3 - ...tax@rebound_comprehension_variable.py.snap | 2 - ...id_syntax@return_stmt_invalid_expr.py.snap | 2 - ...ple_and_compound_stmt_on_same_line.py.snap | 1 - ...ompound_stmt_on_same_line_in_block.py.snap | 1 - ...d_syntax@simple_stmts_on_same_line.py.snap | 2 - ...simple_stmts_on_same_line_in_block.py.snap | 2 - .../invalid_syntax@single_star_for.py.snap | 1 - .../invalid_syntax@single_star_return.py.snap | 1 - .../invalid_syntax@single_star_yield.py.snap | 1 - ...x@single_starred_assignment_target.py.snap | 1 - .../invalid_syntax@star_index_py310.py.snap | 1 - .../invalid_syntax@star_slices.py.snap | 2 - ...yntax@starred_comprehension_target.py.snap | 1 - ...lid_syntax@starred_list_comp_py314.py.snap | 1 - ..._syntax@starred_starred_expression.py.snap | 1 - ...atements__function_type_parameters.py.snap | 4 - ...ents__if_extra_closing_parentheses.py.snap | 1 - ...syntax@statements__if_extra_indent.py.snap | 1 - ...ements__invalid_assignment_targets.py.snap | 1 - ...nvalid_augmented_assignment_target.py.snap | 1 - ...ax@statements__match__as_pattern_2.py.snap | 2 - ...ax@statements__match__as_pattern_3.py.snap | 2 - ...ts__match__invalid_mapping_pattern.py.snap | 1 - ...s__with__ambiguous_lpar_with_items.py.snap | 1 - ...nts__with__unclosed_ambiguous_lpar.py.snap | 1 - ..._with__unclosed_ambiguous_lpar_eof.py.snap | 1 - ...__with__unparenthesized_with_items.py.snap | 1 - ...d_syntax@t_string_empty_expression.py.snap | 1 - ...g_invalid_conversion_flag_name_tok.py.snap | 1 - ..._invalid_conversion_flag_other_tok.py.snap | 1 - ...ntax@t_string_invalid_starred_expr.py.snap | 1 - ..._string_lambda_without_parentheses.py.snap | 4 - ...id_syntax@t_string_unclosed_lbrace.py.snap | 1 - ...ing_unclosed_lbrace_in_format_spec.py.snap | 1 - ...alid_syntax@template_strings_py313.py.snap | 1 - ...alid_syntax@try_stmt_invalid_order.py.snap | 1 - ...ax@try_stmt_missing_except_finally.py.snap | 1 - ..._syntax@try_stmt_mixed_except_kind.py.snap | 1 - ..._syntax@tuple_context_manager_py38.py.snap | 1 - ..._syntax@type_alias_incomplete_stmt.py.snap | 1 - ...ntax@type_alias_invalid_value_expr.py.snap | 1 - ...id_syntax@type_param_default_py312.py.snap | 2 - ...ntax@type_param_invalid_bound_expr.py.snap | 1 - ...id_syntax@type_param_missing_bound.py.snap | 1 - ...syntax@type_param_param_spec_bound.py.snap | 3 - ...am_param_spec_invalid_default_expr.py.snap | 1 - ...e_param_param_spec_missing_default.py.snap | 1 - ...aram_type_var_invalid_default_expr.py.snap | 1 - ...ype_param_type_var_missing_default.py.snap | 1 - ...ax@type_param_type_var_tuple_bound.py.snap | 3 - ...ype_var_tuple_invalid_default_expr.py.snap | 2 - ...ram_type_var_tuple_missing_default.py.snap | 1 - ...yntax@type_parameter_default_order.py.snap | 1 - .../invalid_syntax@type_params_empty.py.snap | 1 - .../invalid_syntax@type_stmt_py311.py.snap | 1 - ...arenthesized_named_expr_index_py38.py.snap | 1 - ...nthesized_named_expr_set_comp_py38.py.snap | 1 - ...esized_named_expr_set_literal_py38.py.snap | 1 - .../invalid_syntax@walrus_py37.py.snap | 1 - ...yntax@while_stmt_invalid_test_expr.py.snap | 1 - ..._items_parenthesized_missing_comma.py.snap | 1 - ...invalid_syntax@write_to_debug_expr.py.snap | 1 - .../invalid_syntax@yield_after_comma.py.snap | 1 - ...yntax@yield_from_in_async_function.py.snap | 1 - crates/ty/tests/cli/analysis_options.rs | 5 - crates/ty/tests/cli/config_option.rs | 7 - crates/ty/tests/cli/exit_code.rs | 11 - crates/ty/tests/cli/file_selection.rs | 42 -- crates/ty/tests/cli/fixes.rs | 5 - crates/ty/tests/cli/main.rs | 17 - crates/ty/tests/cli/python_environment.rs | 70 -- crates/ty/tests/cli/rule_selection.rs | 38 -- crates/ty/tests/cli/scripts.rs | 10 - crates/ty_ide/src/all_symbols.rs | 22 - crates/ty_ide/src/call_hierarchy.rs | 10 - .../src/call_hierarchy/incoming_calls.rs | 40 -- .../src/call_hierarchy/outgoing_calls.rs | 36 - crates/ty_ide/src/code_action.rs | 36 - crates/ty_ide/src/doc_highlights.rs | 15 - crates/ty_ide/src/document_symbols.rs | 23 - crates/ty_ide/src/find_references.rs | 67 -- crates/ty_ide/src/folding_range.rs | 123 ---- crates/ty_ide/src/goto_declaration.rs | 162 ----- crates/ty_ide/src/goto_definition.rs | 142 ---- crates/ty_ide/src/goto_implementation.rs | 94 --- crates/ty_ide/src/goto_type_definition.rs | 136 ---- crates/ty_ide/src/hover.rs | 162 ----- crates/ty_ide/src/inlay_hints.rs | 624 ------------------ crates/ty_ide/src/rename.rs | 79 --- crates/ty_ide/src/selection_range.rs | 34 - ...tests__add_ignore_trailing_whitespace.snap | 1 - ...over_subscript_literal_index_variants.snap | 9 - ...ts__hover_subscript_non_literal_index.snap | 1 - ...pt_slice_literal_bounds_list_variants.snap | 6 - ..._slice_literal_bounds_string_variants.snap | 3 - crates/ty_ide/src/workspace_symbols.rs | 6 - .../resources/mdtest/annotations/any.md | 1 - .../mdtest/annotations/literal_string.md | 2 - .../resources/mdtest/annotations/new_types.md | 5 - .../resources/mdtest/annotations/string.md | 9 - .../mdtest/assignment/annotations.md | 1 - .../resources/mdtest/assignment/augmented.md | 1 - .../resources/mdtest/attributes.md | 19 - .../resources/mdtest/binary/custom.md | 4 - .../resources/mdtest/binary/instances.md | 1 - .../resources/mdtest/call/abstract_method.md | 1 - .../resources/mdtest/call/builtins.md | 2 - .../resources/mdtest/call/function.md | 4 - .../resources/mdtest/call/methods.md | 9 - .../resources/mdtest/call/overloads.md | 2 - .../resources/mdtest/call/type.md | 7 - .../resources/mdtest/call/union.md | 6 - .../comparison/instances/membership_test.md | 2 - .../comparison/instances/rich_comparison.md | 2 - .../mdtest/comparison/intersections.md | 2 - .../resources/mdtest/comparison/unions.md | 5 - .../mdtest/comparison/unsupported.md | 7 - .../mdtest/dataclasses/dataclasses.md | 4 - .../resources/mdtest/del.md | 5 - .../resources/mdtest/descriptor_protocol.md | 1 - .../diagnostics/attribute_assignment.md | 19 - .../mdtest/diagnostics/error_context.md | 72 -- .../diagnostics/invalid_argument_type.md | 48 -- .../invalid_assignment_syntactic_variants.md | 6 - .../mdtest/diagnostics/missing_argument.md | 8 - .../diagnostics/semantic_syntax_errors.md | 13 - .../resources/mdtest/diagnostics/shadowing.md | 3 - .../diagnostics/too_many_positionals.md | 6 - .../resources/mdtest/diagnostics/unpacking.md | 4 - .../mdtest/directives/assert_never.md | 7 - .../mdtest/directives/assert_type.md | 5 - .../resources/mdtest/directives/cast.md | 5 - .../resources/mdtest/enums.md | 2 - .../mdtest/expression/yield_and_yield_from.md | 3 - .../mdtest/generics/legacy/classes.md | 1 - .../mdtest/generics/legacy/functions.md | 4 - .../mdtest/generics/legacy/variables.md | 1 - .../mdtest/generics/legacy/variance.md | 4 - .../mdtest/generics/pep695/aliases.md | 6 - .../mdtest/generics/pep695/functions.md | 4 - .../resources/mdtest/generics/scoping.md | 1 - .../resources/mdtest/implicit_type_aliases.md | 3 - .../resources/mdtest/liskov.md | 34 - .../resources/mdtest/loops/async_for.md | 7 - .../resources/mdtest/loops/for.md | 24 - .../resources/mdtest/metaclass.md | 1 - .../resources/mdtest/narrow/isinstance.md | 6 - .../resources/mdtest/narrow/issubclass.md | 4 - .../resources/mdtest/notebook.md | 1 - .../resources/mdtest/overloads.md | 3 - .../resources/mdtest/override.md | 2 - .../paramspec_subcall_error_location.md | 15 - .../resources/mdtest/pep613_type_aliases.md | 1 - .../resources/mdtest/pep695_type_aliases.md | 1 - .../resources/mdtest/properties.md | 3 - .../resources/mdtest/protocols.md | 3 - .../3525_character_split_notebook.md | 1 - ...ript_\342\200\246_(98082f2161ea366f).snap" | 2 - ...pe_-_For_a_`dict`_(4aa9d1d82d07fcf1).snap" | 1 - ...ype_-_For_a_`list`_(752cfa73fb34c1c).snap" | 1 - ...e_for\342\200\246_(815dae276e2fd2b7).snap" | 1 - ...pe_-_For_a_`dict`_(177872afa1956fef).snap" | 1 - ...pe_-_For_a_`list`_(e7ebbd4af387837c).snap" | 1 - ...ype_f\342\200\246_(155d53762388f9ad).snap" | 2 - ...for_`\342\200\246_(7cf0fa634e2a2d59).snap" | 1 - ...`_met\342\200\246_(468f62a3bdd1d60c).snap" | 1 - ...g_`__\342\200\246_(efd3f0c02e9b89e9).snap" | 1 - ..._all_\342\200\246_(8a0f0e8ceccc51b2).snap" | 2 - ..._one_\342\200\246_(b515711c0a451a86).snap" | 1 - ...e_for\342\200\246_(57372b65e30392a8).snap" | 1 - ...e_for\342\200\246_(ffe39a3bae68cfe4).snap" | 2 - ...ion_w\342\200\246_(28ef812089a32e6a).snap" | 1 - ...on_ha\342\200\246_(d394c561bdd35078).snap" | 6 - ...iagno\342\200\246_(a97274530a7f61c1).snap" | 4 - ...mport\342\200\246_(2fcfcf567587a056).snap" | 3 - ...mport\342\200\246_(c14954eefd15211f).snap" | 2 - ...mport\342\200\246_(dba22bd97137ee38).snap" | 4 - ...s_imp\342\200\246_(cbfbf5ff94e6e104).snap" | 1 - ...dule_\342\200\246_(846453deaca1071c).snap" | 1 - ...bmodu\342\200\246_(4fad4be9778578b7).snap" | 2 - ..._bad_\342\200\246_(2ceba7b720e21b8b).snap" | 2 - ...nsist\342\200\246_(557742f3cd2464b2).snap" | 17 - ...neric\342\200\246_(5a066394f338af48).snap" | 8 - ...aramet\342\200\246_(6bb09b09c131074).snap" | 8 - ..._bad_\342\200\246_(cf706b07cf0ec31f).snap" | 2 - ...o_back-references_(9051beb16a623d36).snap" | 5 - ...ust_b\342\200\246_(dc429fc3e8c18eaf).snap" | 6 - ...ted_`Concatenate`_(86093b62e6e6874c).snap" | 3 - ...otatio\342\200\246_(bb5fe70ded875e4).snap" | 8 - ...Too_few_arguments_(efcf77cdbde3ff86).snap" | 17 - ...46_-_Introduction_(cff2724f4c9d28c4).snap" | 4 - ...\200\246_-_Syntax_(142fa2948c3c6cf1).snap" | 9 - ..._in_g\342\200\246_(6d8b024dda7ced11).snap" | 1 - ...sic_case_with_ABC_(21e412599c45972a).snap" | 1 - ..._ther\342\200\246_(ecae0f4510696c95).snap" | 1 - ..._ther\342\200\246_(f807ff3716d8ab0d).snap" | 1 - ...ct_me\342\200\246_(feafee9a4abbe8d1).snap" | 2 - ...mplic\342\200\246_(e373f31c7a7d88e7).snap" | 32 - ...fined\342\200\246_(fc7b496fd1986deb).snap" | 16 - ..._a_me\342\200\246_(338615109711a91b).snap" | 25 - ..._case\342\200\246_(2389d52c5ecfa2bd).snap" | 2 - ...`@fin\342\200\246_(9863b583f4c651c5).snap" | 4 - ...ods_d\342\200\246_(861757f48340ed92).snap" | 24 - ...atica\342\200\246_(29a698d9deaf7318).snap" | 2 - ...final\342\200\246_(c004aaab38745318).snap" | 2 - ...ion_f\342\200\246_(ee99fadd6476677e).snap" | 12 - ..._unio\342\200\246_(5396a8f9e7f88f71).snap" | 8 - ...mplic\342\200\246_(4c3d127986a58f11).snap" | 14 - ...compa\342\200\246_(98b54233987eb654).snap" | 2 - ...are_o\342\200\246_(58a3839a9bc7026d).snap" | 4 - ..._set-\342\200\246_(15737b0beb194b0e).snap" | 2 - ...ed_wh\342\200\246_(ba5cb09eaa3715d8).snap" | 4 - ...used_\342\200\246_(652fec4fd4a6c63a).snap" | 2 - ...iagno\342\200\246_(a4b698196d337a3f).snap" | 2 - ...sed_w\342\200\246_(f61204fc81905069).snap" | 6 - ...d_exp\342\200\246_(3fbab22ead236138).snap" | 6 - ...2\200\246_-_Basic_(f15db7dc447d0795).snap" | 1 - ...h_mis\342\200\246_(9ce1ee3cd1c9c8d1).snap" | 1 - ...th_pos\342\200\246_(a028edbafe180ca).snap" | 1 - ...eturn\342\200\246_(fedf62ffaca0f2d7).snap" | 1 - ..._awai\342\200\246_(9db6c457a98cde25).snap" | 1 - ..._awai\342\200\246_(d78580fb6720e4ea).snap" | 3 - ...re_one\342\200\246_(ef7c2c0c8d9b1f0).snap" | 1 - ...initi\342\200\246_(15b05c126b6ae968).snap" | 1 - ...initi\342\200\246_(ccb69f512135dd61).snap" | 1 - ...f_Leg\342\200\246_(eaa359e8d6b3031d).snap" | 6 - ...ers_m\342\200\246_(3edf97b20f58fa11).snap" | 3 - ...covar\342\200\246_(b7b0976739681470).snap" | 1 - ...h_bou\342\200\246_(4ca5f13621915554).snap" | 1 - ...y_one\342\200\246_(8b0258f5188209c6).snap" | 1 - ..._for_\342\200\246_(72827c64b5c73d05).snap" | 1 - ..._argu\342\200\246_(39164266ada3dc2f).snap" | 1 - ...y_ass\342\200\246_(c2e3e46852bb268f).snap" | 2 - ..._Must_have_a_name_(79a4ce09338e666b).snap" | 1 - ...efine\342\200\246_(b1be57970f924722).snap" | 1 - ...iven_\342\200\246_(8f6aed0dba79e995).snap" | 1 - ...ument\342\200\246_(9d57505425233fd8).snap" | 2 - ...eter_\342\200\246_(8424f2b8bc4351f9).snap" | 1 - ...t_for\342\200\246_(b632d61c1d75f9fb).snap" | 3 - ...teral\342\200\246_(4ee237f49e7ac736).snap" | 2 - ...Os_in\342\200\246_(e2b355c09a967862).snap" | 1 - ...ludes\342\200\246_(d2532518c44112c8).snap" | 2 - ...ts_th\342\200\246_(6f8d0bf648c4b305).snap" | 5 - ...ts_wi\342\200\246_(ea7ebc83ec359b54).snap" | 7 - ...iple_\342\200\246_(f30babd05c89dce9).snap" | 3 - ...not_h\342\200\246_(e2ed186fe2b2fc35).snap" | 5 - ...uple`_-_Definition_(bbf79630502e65e9).snap | 6 - ...ltiple_Inheritance_(82ed33d1b3b433d8).snap | 3 - ...iagno\342\200\246_(8ca723b970e370d0).snap" | 1 - ...uctor_\342\200\246_(dd9f8a8f736a329).snap" | 1 - ...ith_u\342\200\246_(31cb5f881221158e).snap" | 3 - ...get__\342\200\246_(9ecd21d0927ee1ff).snap" | 3 - ...n_wit\342\200\246_(dd80c593d9136f35).snap" | 3 - ...n_wit\342\200\246_(f66e3a8a3977c472).snap" | 3 - ...aded_\342\200\246_(3553d085684e16a0).snap" | 3 - ...aded_\342\200\246_(36814b28492c01d2).snap" | 3 - ...verloa\342\200\246_(84dadf8abd8f2f2).snap" | 2 - ..._-_`@classmethod`_(aaa04d4cfa3adaba).snap" | 5 - ...00\246_-_`@final`_(f8e529ec23a61665).snap" | 5 - ...246_-_`@override`_(2df210735ca532f9).snap" | 3 - ...-_Regular_modules_(5c8e81664d1c7470).snap" | 2 - ...orate\342\200\246_(d17a1580f99a6402).snap" | 2 - ...override`_-_Basics_(b7c220f8171f11f0).snap | 12 - ...amSpe\342\200\246_(648be2a43987ffd8).snap" | 18 - ...not_s\342\200\246_(c9dbdc7b13b704a4).snap" | 2 - ...ramSpe\342\200\246_(327594c6dacd8ad).snap" | 17 - ...not_s\342\200\246_(8243f67799c93e3c).snap" | 3 - ...ol_cl\342\200\246_(288988036f34ddcf).snap" | 5 - ..._auto\342\200\246_(310665856cfe2424).snap" | 4 - ..._prot\342\200\246_(585a3e9545d41b64).snap" | 8 - ...o_`ge\342\200\246_(3d0c4ee818c4d8d5).snap" | 4 - ...tterns\342\200\246_(8ae0e231033b78e).snap" | 4 - ...rotoco\342\200\246_(98257e7c2300373).snap" | 26 - ...s_in_\342\200\246_(21be5d9bdab1c844).snap" | 2 - ..._`emp\342\200\246_(f44e56404a51ca26).snap" | 2 - ...ons_-_Asynchronous_(408134055c24a538).snap | 2 - ...ions_-_Synchronous_(6a32ec69d15117b8).snap | 5 - ...onal_\342\200\246_(94c036c5d3803ab2).snap" | 3 - ...t_ret\342\200\246_(393cb38bf7119649).snap" | 3 - ...t_ret\342\200\246_(3d2d19aa49b28f1c).snap" | 1 - ...nvalid_return_type_(a91e0c67519cd77f).snap | 6 - ...type_\342\200\246_(c3a523878447af6b).snap" | 3 - ...ithin\342\200\246_(3259718bf20b45a2).snap" | 2 - ...ithin\342\200\246_(711fb86287c4d87b).snap" | 2 - ...n_wit\342\200\246_(f58a51442a16371e).snap" | 1 - ...withi\342\200\246_(c19e9277cf9fafb5).snap" | 1 - ..._in_c\342\200\246_(1a50b4ccb10b95dd).snap" | 1 - ...in_me\342\200\246_(2ed4c18a38ed9090).snap" | 1 - ...in_ne\342\200\246_(a1aca17ea750ffdd).snap" | 1 - ...order\342\200\246_(d075a45828c9dbc5).snap" | 3 - ...with_\342\200\246_(ce8defbeaf54e06c).snap" | 1 - ..._Nested_functions_(3f2ee9fa81da0177).snap" | 1 - ...ed_in\342\200\246_(de027dcc5360f252).snap" | 1 - ...erloa\342\200\246_(39e892ccb644ee63).snap" | 3 - ...n_wit\342\200\246_(8fdf5a06afc7d4fe).snap" | 2 - ...of_ov\342\200\246_(93e9a157fdca3ab2).snap" | 2 - ..._inva\342\200\246_(249d635e74a41c9e).snap" | 4 - ...n_3.1\342\200\246_(5e6477d05ddea33f).snap" | 10 - ...Objec\342\200\246_(b753048091f275c0).snap" | 9 - ...Objec\342\200\246_(f9e5e48e3a4a4c12).snap" | 5 - ...sage_-_Metaclasses_(faeb52a8cd1533b3).snap | 2 - ..._the_\342\200\246_(93e8ab913ead83b2).snap" | 1 - ...ion_w\342\200\246_(3d4f2229d00f8d86).snap" | 1 - ...ion_w\342\200\246_(718dcfd7e6ed9829).snap" | 1 - ...sion_w\342\200\246_(8686e7748a7c975).snap" | 1 - ...sons_\342\200\246_(f45f1da2f8ca693d).snap" | 1 - ...lemen\342\200\246_(39b614d4707c0661).snap" | 4 - ...pport\342\200\246_(966dd82bd3668d0e).snap" | 6 - ...fixes\342\200\246_(c25079c01f6d8eb3).snap" | 1 - ...paris\342\200\246_(400a427b33d53e00).snap" | 7 - ...lidat\342\200\246_(25381f371caa1401).snap" | 11 - ...ict`_-_Diagnostics_(e5289abf5c570c29).snap | 17 - ...ct`_i\342\200\246_(9df67eb93e3df341).snap" | 1 - ..._with\342\200\246_(4b18755412dfaff1).snap" | 32 - ...decla\342\200\246_(bef70731cae5b8af).snap" | 4 - ...warni\342\200\246_(75ac240a2d1f7108).snap" | 2 - ..._exam\342\200\246_(c24ecd8582e5eb2f).snap" | 3 - ...ts_bu\342\200\246_(d840ac443ca8ec7f).snap" | 2 - ...s_on_\342\200\246_(7bdb97302c27c412).snap" | 4 - ...rgume\342\200\246_(ad1d489710ee2a34).snap" | 2 - ...rd_re\342\200\246_(707b284610419a54).snap" | 13 - ...long_\342\200\246_(ec94b5e857284ef3).snap" | 2 - ...loade\342\200\246_(4408ade1316b97c0).snap" | 3 - ...t_dia\342\200\246_(f419c2a8e2ce2412).snap" | 6 - ..._impo\342\200\246_(72d090df51ea97b8).snap" | 1 - ...th_a_\342\200\246_(12d4a70b7fc67cc6).snap" | 1 - ...th_an\342\200\246_(6cff507dc64a1bff).snap" | 1 - ...th_an\342\200\246_(9da56616d6332a83).snap" | 1 - ...th_an\342\200\246_(9fa713dfa17cc404).snap" | 1 - ...th_to\342\200\246_(4b8ba6ee48180cdd).snap" | 1 - ...d_on_\342\200\246_(51edda0b1aebc2bf).snap" | 1 - ...t_bef\342\200\246_(41702a6f6d20b082).snap" | 2 - ..._Pyth\342\200\246_(1028a80959504fc9).snap" | 2 - ...00\246_-_Enum_base_(4873196c8b48364).snap" | 1 - ...Enum_with_members_(81bef9a8e1230854).snap" | 1 - ..._-_`@final`_class_(ea69d237256b3762).snap" | 1 - ..._-_`Generic`_base_(d455f46a27cec685).snap" | 1 - ...-_`Protocol`_base_(99c9bde73664dd51).snap" | 1 - ..._`TypedDict`_base_(6f76171c88fc8760).snap" | 1 - ...`_att\342\200\246_(2721d40bf12fe8b7).snap" | 1 - ...`_met\342\200\246_(15636dc4074e5335).snap" | 2 - ...`_met\342\200\246_(ce8b8da49eaf4cda).snap" | 2 - ...n_wher\342\200\246_(7cca8063ea43c1a).snap" | 1 - ...defaul\342\200\246_(b62ed1f409042cc).snap" | 1 - ...efaul\342\200\246_(d9ffda7fd9cdf840).snap" | 1 - ...ned_de\342\200\246_(ff24930259abfb3).snap" | 2 - ...fault\342\200\246_(a2759fd9d2731a7d).snap" | 1 - ...t_wit\342\200\246_(30284a6490652e58).snap" | 2 - ...t_wit\342\200\246_(37f9b6583c0633f5).snap" | 1 - ...'s_bo\342\200\246_(fcd7ad5416c91629).snap" | 1 - ...s_use\342\200\246_(7e6bb178099059fe).snap" | 3 - ...ent_-_Before_3.10_(2545eaa83b635b8b).snap" | 1 - .../resources/mdtest/subscript/instance.md | 1 - .../mdtest/suppressions/ty_ignore.md | 10 - .../mdtest/suppressions/type_ignore.md | 5 - .../resources/mdtest/ty_extensions.md | 4 - .../resources/mdtest/type_qualifiers/final.md | 3 - .../resources/mdtest/unary/custom.md | 3 - .../resources/mdtest/unary/not.md | 1 - .../resources/mdtest/unreachable.md | 1 - .../resources/mdtest/with/async.md | 1 - .../resources/mdtest/with/sync.md | 1 - crates/ty_python_semantic/src/fixes.rs | 5 - .../src/types/ide_support/unreachable_code.rs | 34 - 1570 files changed, 5928 deletions(-) diff --git a/crates/ruff/src/commands/format.rs b/crates/ruff/src/commands/format.rs index 57f6351a0cc52b..27d045291a02b3 100644 --- a/crates/ruff/src/commands/format.rs +++ b/crates/ruff/src/commands/format.rs @@ -1354,7 +1354,6 @@ mod tests { | 1 | 1 | ^ - | panic: Panicked at when checking `test.py`: `Test panic for FormatCommandError` --> test.py:1:1 diff --git a/crates/ruff/tests/cli/format.rs b/crates/ruff/tests/cli/format.rs index 842f45b1a09111..6d0c3ad0b1cac6 100644 --- a/crates/ruff/tests/cli/format.rs +++ b/crates/ruff/tests/cli/format.rs @@ -584,7 +584,6 @@ from module import = | 2 | from module import = | ^ - | ----- stderr ----- @@ -2052,7 +2051,6 @@ fn syntax_error_in_notebooks_check() -> Result<()> { 2 | # выберите случайный индекс в диапазон от 0 до len(X)-1 включительно при помощи функции random.randint 3 | j = # ваш код здесь | ^ - | ----- stderr ----- diff --git a/crates/ruff/tests/cli/lint.rs b/crates/ruff/tests/cli/lint.rs index 3f57bc14a7d114..09559179928bdd 100644 --- a/crates/ruff/tests/cli/lint.rs +++ b/crates/ruff/tests/cli/lint.rs @@ -4475,7 +4475,6 @@ fn show_fixes_in_full_output_with_preview_enabled() { | 1 | import math | ^^^^ - | help: Remove unused import: `math` | - import math @@ -5195,7 +5194,6 @@ fn ruff_toml_is_linted() -> Result<()> { | 1 | lint.select = ["F401"] | ^^^^ - | help: Replace rule code with `unused-import` | - lint.select = ["F401"] diff --git a/crates/ruff/tests/integration_test.rs b/crates/ruff/tests/integration_test.rs index 90e03379046140..08d53501db43af 100644 --- a/crates/ruff/tests/integration_test.rs +++ b/crates/ruff/tests/integration_test.rs @@ -120,7 +120,6 @@ fn stdin_error() { | 1 | import os | ^^ - | help: Remove unused import: `os` | - import os @@ -148,7 +147,6 @@ fn stdin_filename() { | 1 | import os | ^^ - | help: Remove unused import: `os` | - import os @@ -187,7 +185,6 @@ import bar # unused import | 2 | import bar # unused import | ^^^ - | help: Remove unused import: `bar` | 1 | @@ -199,7 +196,6 @@ import bar # unused import | 2 | import foo # unused import | ^^^ - | help: Remove unused import: `foo` | 1 | @@ -231,7 +227,6 @@ fn check_warn_stdin_filename_with_files() { | 1 | import os | ^^ - | help: Remove unused import: `os` | - import os @@ -261,7 +256,6 @@ fn stdin_source_type_py() { | 1 | import os | ^^ - | help: Remove unused import: `os` | - import os @@ -502,7 +496,6 @@ fn stdin_fix_jupyter() { | 1 | print(x) | ^ - | Found 3 errors (2 fixed, 1 remaining). "#); @@ -601,7 +594,6 @@ fn stdin_override_parser_ipynb() { | 1 | import os | ^^ - | help: Remove unused import: `os` ::: cell 1 | @@ -613,7 +605,6 @@ fn stdin_override_parser_ipynb() { | 1 | import sys | ^^^ - | help: Remove unused import: `sys` ::: cell 3 | @@ -647,7 +638,6 @@ fn stdin_override_parser_py() { | 1 | import os | ^^ - | help: Remove unused import: `os` | - import os @@ -685,7 +675,6 @@ extension = {ipynb="python"} | 1 | import os | ^^ - | help: Remove unused import: `os` | - import os @@ -884,7 +873,6 @@ fn stdin_parse_error() { | 1 | from foo import | ^ - | Found 1 error. @@ -914,7 +902,6 @@ fn stdin_multiple_parse_error() { 1 | from foo import 2 | bar = | ^ - | Found 2 errors. @@ -936,7 +923,6 @@ fn parse_error_not_included() { | 1 | foo = | ^ - | Found 1 error. @@ -959,7 +945,6 @@ fn full_output_preview() { | 1 | l = 1 | ^ - | Found 1 error. @@ -988,7 +973,6 @@ preview = true | 1 | l = 1 | ^ - | Found 1 error. @@ -1013,7 +997,6 @@ fn full_output_format() { | 1 | l = 1 | ^ - | Found 1 error. @@ -1870,7 +1853,6 @@ fn check_input_from_argfile() -> Result<()> { | 1 | import os | ^^ - | help: Remove unused import: `os` | - import os @@ -2502,7 +2484,6 @@ select = ["RUF017"] 2 | y = [4, 5, 6] 3 | sum([x, y], []) | ^^^^^^^^^^^^^^^ - | help: Replace with `functools.reduce` Found 1 error. @@ -2543,7 +2524,6 @@ unfixable = ["RUF"] 2 | y = [4, 5, 6] 3 | sum([x, y], []) | ^^^^^^^^^^^^^^^ - | help: Replace with `functools.reduce` Found 1 error. @@ -2571,7 +2551,6 @@ fn pyproject_toml_stdin_syntax_error() { | 1 | [project | ^ - | Found 1 error. @@ -2598,7 +2577,6 @@ fn pyproject_toml_stdin_schema_error() { 1 | [project] 2 | name = 1 | ^ - | Found 1 error. @@ -2691,7 +2669,6 @@ fn pyproject_toml_stdin_schema_error_fix() { 1 | [project] 2 | name = 1 | ^ - | Found 1 error. " diff --git a/crates/ruff_db/src/diagnostic/render.rs b/crates/ruff_db/src/diagnostic/render.rs index 6dd675106db752..f4015573bf1d62 100644 --- a/crates/ruff_db/src/diagnostic/render.rs +++ b/crates/ruff_db/src/diagnostic/render.rs @@ -1392,7 +1392,6 @@ watermelon | 5 | elephant | ^^^^^^^^ - | ", ); @@ -1426,7 +1425,6 @@ watermelon 10 | jackrabbit 11 | kangaroo | ^^^^^^^^ - | ", ); @@ -1483,7 +1481,6 @@ watermelon 10 | jackrabbit 11 | kangaroo | ^^^^^^^^ - | ", ); } @@ -1773,7 +1770,6 @@ watermelon | 5 | canary | ^^^^^^ - | ", ); } @@ -1957,7 +1953,6 @@ watermelon 10 | jackrabbit 11 | kangaroo | ^^^^^^^^ - | ", ); @@ -1986,7 +1981,6 @@ watermelon 10 | jackrabbit 11 | kangaroo | ^^^^^^^^ - | warning: sub-diagnostic message --> fruits:3:1 | @@ -2445,7 +2439,6 @@ watermelon | 7 | gorilla | ------- secondary 7 - | ", ); } @@ -2529,7 +2522,6 @@ watermelon | 2 | banana | ------ secondary fruits 2 - | ", ); } diff --git a/crates/ruff_db/src/diagnostic/render/full.rs b/crates/ruff_db/src/diagnostic/render/full.rs index 24a55d5b303141..f101972d4e1489 100644 --- a/crates/ruff_db/src/diagnostic/render/full.rs +++ b/crates/ruff_db/src/diagnostic/render/full.rs @@ -395,7 +395,6 @@ mod tests { | 1 | import os | ^^ - | help: Remove unused import: `os` error[F841]: Local variable `x` is assigned to but never used @@ -415,7 +414,6 @@ mod tests { | 1 | if a == 1: pass | ^ - | error[F821]: Undefined name `fibonaccii` --> fib.py:12:16 @@ -424,7 +422,6 @@ mod tests { 11 | else: 12 | return fibonaccii(n - 1) + fibonacci(n - 2) | ^^^^^^^^^^ - - | info: Did you mean to import it from `/some/path/def.py`? --> fib.py:4:5 | @@ -477,7 +474,6 @@ mod tests { | 1 | import os | ^^ - | help: Remove unused import: `os` | - import os @@ -509,7 +505,6 @@ mod tests { | 1 | if a == 1: pass | ^ - | F821 Undefined name `fibonaccii` --> fib.py:12:16 @@ -518,7 +513,6 @@ mod tests { 11 | else: 12 | return fibonaccii(n - 1) + fibonacci(n - 2) | ^^^^^^^^^^ - - | info: Did you mean to import it from `/some/path/def.py`? --> fib.py:4:5 | @@ -603,7 +597,6 @@ print() 2 | if False: 3 | print() | ^ - | "); } @@ -643,7 +636,6 @@ print() | 1 | nested_fstrings = f'␈{f'␚{f'␛'}'}' | ^ - | "#); } @@ -668,7 +660,6 @@ print() | 1 | ␈␚␛ | ^ - | "#); Ok(()) @@ -691,7 +682,6 @@ print() 1 | def foo(): 2 | return 1 | ^^^^^^^^ - | "); } @@ -727,7 +717,6 @@ print() 1 | # cell 1 2 | import os | ^^ - | help: Remove unused import: `os` ::: cell 1 | @@ -759,7 +748,6 @@ print() 3 | print() 4 | x = 1 | ^ - | help: Remove assignment to unused variable `x` "); } @@ -822,7 +810,6 @@ print() 3 | print() 4 | x = 1 | - second cell - | help: Remove unused import: `os` error[test-diagnostic]: main diagnostic message @@ -834,7 +821,6 @@ print() 3 | 4 | print('hello world') | ----- print statement - | help: Remove `print` statement "); } @@ -919,7 +905,6 @@ print() | 1 | import foo | ^ - | "); } @@ -940,7 +925,6 @@ print() | 1 | import foo | ^ - | "); } @@ -967,7 +951,6 @@ print() | 1 | unexpected eof | ^ - | "); } @@ -1083,7 +1066,6 @@ line 13 | 2 | line 2 | ^^^^^^ - | help: Replace three lines | 1 | line 1 diff --git a/crates/ruff_db/src/diagnostic/render/snapshots/ruff_db__diagnostic__render__full__tests__notebook_output_with_diff.snap b/crates/ruff_db/src/diagnostic/render/snapshots/ruff_db__diagnostic__render__full__tests__notebook_output_with_diff.snap index 603070421dbe6b..2e28d0dfd61385 100644 --- a/crates/ruff_db/src/diagnostic/render/snapshots/ruff_db__diagnostic__render__full__tests__notebook_output_with_diff.snap +++ b/crates/ruff_db/src/diagnostic/render/snapshots/ruff_db__diagnostic__render__full__tests__notebook_output_with_diff.snap @@ -8,7 +8,6 @@ error[F401][*]: `os` imported but unused 1 | # cell 1 2 | import os | ^^ - | help: Remove unused import: `os` ::: cell 1 | @@ -40,7 +39,6 @@ error[F841][*]: Local variable `x` is assigned to but never used 3 | print() 4 | x = 1 | ^ - | help: Remove assignment to unused variable `x` ::: cell 3 | diff --git a/crates/ruff_db/src/diagnostic/render/snapshots/ruff_db__diagnostic__render__full__tests__notebook_output_with_diff_spanning_cells.snap b/crates/ruff_db/src/diagnostic/render/snapshots/ruff_db__diagnostic__render__full__tests__notebook_output_with_diff_spanning_cells.snap index 818a3fca8ad7e5..4168390a2eeccc 100644 --- a/crates/ruff_db/src/diagnostic/render/snapshots/ruff_db__diagnostic__render__full__tests__notebook_output_with_diff_spanning_cells.snap +++ b/crates/ruff_db/src/diagnostic/render/snapshots/ruff_db__diagnostic__render__full__tests__notebook_output_with_diff_spanning_cells.snap @@ -8,7 +8,6 @@ error[F401][*]: `os` imported but unused 1 | # cell 1 2 | import os | ^^ - | help: Remove unused import: `os` ::: cell 1 | diff --git a/crates/ruff_linter/resources/mdtest/flake8-bandit/unsafe-markup-use.md b/crates/ruff_linter/resources/mdtest/flake8-bandit/unsafe-markup-use.md index ea1400b6b962a6..f395224b7e9acd 100644 --- a/crates/ruff_linter/resources/mdtest/flake8-bandit/unsafe-markup-use.md +++ b/crates/ruff_linter/resources/mdtest/flake8-bandit/unsafe-markup-use.md @@ -22,7 +22,6 @@ error[S704]: Unsafe use of `markupsafe.Markup` detected | 5 | Markup(f"unsafe {content}") # snapshot: unsafe-markup-use | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | ``` ```py diff --git a/crates/ruff_linter/resources/mdtest/flake8-pytest-style/pytest-parametrize-names-wrong-type.md b/crates/ruff_linter/resources/mdtest/flake8-pytest-style/pytest-parametrize-names-wrong-type.md index 49b7c6f1be4d7d..01aa0f0b35832e 100644 --- a/crates/ruff_linter/resources/mdtest/flake8-pytest-style/pytest-parametrize-names-wrong-type.md +++ b/crates/ruff_linter/resources/mdtest/flake8-pytest-style/pytest-parametrize-names-wrong-type.md @@ -27,7 +27,6 @@ error[PT006]: Wrong type passed to first argument of `pytest.mark.parametrize`; | 5 | @pytest.mark.parametrize(("param",), [(1,), variable]) # snapshot: pytest-parametrize-names-wrong-type | ^^^^^^^^^^ - | help: Use a string for the first argument ``` diff --git a/crates/ruff_linter/resources/mdtest/notebook/cell-boundaries.md b/crates/ruff_linter/resources/mdtest/notebook/cell-boundaries.md index c504a4b86fa97c..1f7726f2d23324 100644 --- a/crates/ruff_linter/resources/mdtest/notebook/cell-boundaries.md +++ b/crates/ruff_linter/resources/mdtest/notebook/cell-boundaries.md @@ -41,7 +41,6 @@ error[invalid-syntax]: Expected class, function definition or async function def | 2 | @deco | ^ - | ``` ## Notebooks without Python cells diff --git a/crates/ruff_linter/resources/mdtest/pyflakes/string-dot-format-extra-positional-arguments.md b/crates/ruff_linter/resources/mdtest/pyflakes/string-dot-format-extra-positional-arguments.md index a0c233d6924750..6ade98d90f368f 100644 --- a/crates/ruff_linter/resources/mdtest/pyflakes/string-dot-format-extra-positional-arguments.md +++ b/crates/ruff_linter/resources/mdtest/pyflakes/string-dot-format-extra-positional-arguments.md @@ -22,7 +22,6 @@ error[F523]: `.format` call has unused arguments at position(s): 0 | 1 | print("{{".format("!")) # snapshot: string-dot-format-extra-positional-arguments | ^^^^^^^^^^^^^^^^ - | help: Remove extra positional arguments at position(s): 0 | - print("{{".format("!")) # snapshot: string-dot-format-extra-positional-arguments @@ -36,7 +35,6 @@ error[F523]: `.format` call has unused arguments at position(s): 0 | 2 | print("{x}".format("!")) # snapshot: string-dot-format-extra-positional-arguments | ^^^^^^^^^^^^^^^^^ - | help: Remove extra positional arguments at position(s): 0 | 1 | print("{{".format("!")) # snapshot: string-dot-format-extra-positional-arguments diff --git a/crates/ruff_linter/resources/mdtest/pylint/invalid-character-backspace.md b/crates/ruff_linter/resources/mdtest/pylint/invalid-character-backspace.md index c0df57a3852dd0..fdf7b66cd93b4f 100644 --- a/crates/ruff_linter/resources/mdtest/pylint/invalid-character-backspace.md +++ b/crates/ruff_linter/resources/mdtest/pylint/invalid-character-backspace.md @@ -26,7 +26,6 @@ error[PLE2510]: Invalid unescaped character backspace, use "\b" instead | 1 | replacement_field = f"{'␈'}" # snapshot: invalid-character-backspace | ^ - | help: Replace with escape sequence @@ -35,7 +34,6 @@ error[PLE2510]: Invalid unescaped character backspace, use "\b" instead | 2 | nested_f_string = f"{f'hello␈'}" # snapshot: invalid-character-backspace | ^ - | help: Replace with escape sequence ``` @@ -54,7 +52,6 @@ error[PLE2510]: Invalid unescaped character backspace, use "\b" instead | 1 | format_spec = f"{value:␈}" # snapshot: invalid-character-backspace | ^ - | help: Replace with escape sequence | - format_spec = f"{value:␈}" # snapshot: invalid-character-backspace @@ -68,7 +65,6 @@ error[PLE2510]: Invalid unescaped character backspace, use "\b" instead | 2 | f_string_literal = f"hello␈" # snapshot: invalid-character-backspace | ^ - | help: Replace with escape sequence | 1 | format_spec = f"{value:␈}" # snapshot: invalid-character-backspace @@ -101,7 +97,6 @@ error[PLE2510]: Invalid unescaped character backspace, use "\b" instead | 1 | replacement_field = f"{'␈'}" # snapshot: invalid-character-backspace | ^ - | help: Replace with escape sequence | - replacement_field = f"{'␈'}" # snapshot: invalid-character-backspace @@ -115,7 +110,6 @@ error[PLE2510]: Invalid unescaped character backspace, use "\b" instead | 2 | format_spec = f"{value:␈}" # snapshot: invalid-character-backspace | ^ - | help: Replace with escape sequence | 1 | replacement_field = f"{'␈'}" # snapshot: invalid-character-backspace @@ -130,7 +124,6 @@ error[PLE2510]: Invalid unescaped character backspace, use "\b" instead | 3 | f_string_literal = f"hello␈" # snapshot: invalid-character-backspace | ^ - | help: Replace with escape sequence | 2 | format_spec = f"{value:␈}" # snapshot: invalid-character-backspace @@ -145,7 +138,6 @@ error[PLE2510]: Invalid unescaped character backspace, use "\b" instead | 4 | nested_f_string = f"{f'hello␈'}" # snapshot: invalid-character-backspace | ^ - | help: Replace with escape sequence | 3 | f_string_literal = f"hello␈" # snapshot: invalid-character-backspace diff --git a/crates/ruff_linter/resources/mdtest/pylint/redefined-loop-name.md b/crates/ruff_linter/resources/mdtest/pylint/redefined-loop-name.md index 6b360389cee554..b2d80b0f66b15b 100644 --- a/crates/ruff_linter/resources/mdtest/pylint/redefined-loop-name.md +++ b/crates/ruff_linter/resources/mdtest/pylint/redefined-loop-name.md @@ -50,7 +50,6 @@ error[PLW2901]: `for` loop variable `i` overwritten by assignment target | 5 | i = [1] # snapshot: redefined-loop-name | ^ - | error[PLW2901]: `for` loop variable `i` overwritten by assignment target @@ -58,7 +57,6 @@ error[PLW2901]: `for` loop variable `i` overwritten by assignment target | 11 | i = {"b": 2} # snapshot: redefined-loop-name | ^ - | error[PLW2901]: `for` loop variable `i` overwritten by assignment target @@ -66,7 +64,6 @@ error[PLW2901]: `for` loop variable `i` overwritten by assignment target | 26 | i = {1} # snapshot: redefined-loop-name | ^ - | error[PLW2901]: `for` loop variable `i` overwritten by assignment target @@ -74,7 +71,6 @@ error[PLW2901]: `for` loop variable `i` overwritten by assignment target | 29 | i += (1,) # snapshot: redefined-loop-name | ^ - | error[PLW2901]: `for` loop variable `i` overwritten by assignment target @@ -82,5 +78,4 @@ error[PLW2901]: `for` loop variable `i` overwritten by assignment target | 32 | i += "a" # snapshot: redefined-loop-name | ^ - | ``` diff --git a/crates/ruff_linter/resources/mdtest/pylint/too-many-statements-in-try-clause.md b/crates/ruff_linter/resources/mdtest/pylint/too-many-statements-in-try-clause.md index bca4bb944de682..1aa80ab9a173fe 100644 --- a/crates/ruff_linter/resources/mdtest/pylint/too-many-statements-in-try-clause.md +++ b/crates/ruff_linter/resources/mdtest/pylint/too-many-statements-in-try-clause.md @@ -29,7 +29,6 @@ error[PLW0717]: Try clause contains too many statements (6 > 5) | 2 | try: | ^^^ - | ``` ## Context managers diff --git a/crates/ruff_linter/resources/mdtest/pyupgrade/deprecated-abc-decorator.md b/crates/ruff_linter/resources/mdtest/pyupgrade/deprecated-abc-decorator.md index a63affba19dab5..328b7ce5639771 100644 --- a/crates/ruff_linter/resources/mdtest/pyupgrade/deprecated-abc-decorator.md +++ b/crates/ruff_linter/resources/mdtest/pyupgrade/deprecated-abc-decorator.md @@ -31,7 +31,6 @@ error[UP051]: Use `@classmethod` and `@abstractmethod` instead of `abstractclass | 4 | @abc.abstractclassmethod # snapshot: deprecated-abc-decorator | ^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `@classmethod` and `abstractmethod` | 3 | class Foo(abc.ABC): @@ -47,7 +46,6 @@ error[UP051]: Use `@staticmethod` and `@abstractmethod` instead of `abstractstat | 7 | @abc.abstractstaticmethod # snapshot: deprecated-abc-decorator | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `@staticmethod` and `abstractmethod` | 6 | @@ -63,7 +61,6 @@ error[UP051]: Use `@property` and `@abstractmethod` instead of `abstractproperty | 10 | @abc.abstractproperty # snapshot: deprecated-abc-decorator | ^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `@property` and `abstractmethod` | 9 | diff --git a/crates/ruff_linter/resources/mdtest/pyupgrade/f-string.md b/crates/ruff_linter/resources/mdtest/pyupgrade/f-string.md index eb2e8a6b48a93b..da0347d60eabf3 100644 --- a/crates/ruff_linter/resources/mdtest/pyupgrade/f-string.md +++ b/crates/ruff_linter/resources/mdtest/pyupgrade/f-string.md @@ -41,7 +41,6 @@ error[UP032]: Use f-string instead of `format` call | 4 | "{x}".format(x=foo()) # snapshot: f-string | ^^^^^^^^^^^^^^^^^^^^^ - | help: Convert to f-string | 3 | @@ -66,7 +65,6 @@ error[UP032]: Use f-string instead of `format` call | 1 | "" "{}".format(x) # snapshot: f-string | ^^^^^^^^^^^^^^^^^ - | help: Convert to f-string | - "" "{}".format(x) # snapshot: f-string @@ -85,7 +83,6 @@ error[UP032]: Use f-string instead of `format` call | 2 | "a" "" "{}".format(x) # snapshot: f-string | ^^^^^^^^^^^^^^^^^^^^^ - | help: Convert to f-string | 1 | "" "{}".format(x) # snapshot: f-string @@ -108,7 +105,6 @@ error[UP032]: Use f-string instead of `format` call | 3 | x = ("" "{}").format(value) # snapshot: f-string | ^^^^^^^^^^^^^^^^^^^^^^^ - | help: Convert to f-string | 2 | "a" "" "{}".format(x) # snapshot: f-string @@ -136,7 +132,6 @@ error[UP032]: Use f-string instead of `format` call 6 | | # comment 7 | | "{}".format(value) | |______________________^ - | help: Convert to f-string | 6 | # comment @@ -159,7 +154,6 @@ error[UP032]: Use f-string instead of `format` call | 9 | y = ("" "").format(value) # snapshot: f-string | ^^^^^^^^^^^^^^^^^^^^^ - | help: Convert to f-string | 8 | ) diff --git a/crates/ruff_linter/resources/mdtest/pyupgrade/pep-695.md b/crates/ruff_linter/resources/mdtest/pyupgrade/pep-695.md index e39472a989dd0a..6eece28c0e2550 100644 --- a/crates/ruff_linter/resources/mdtest/pyupgrade/pep-695.md +++ b/crates/ruff_linter/resources/mdtest/pyupgrade/pep-695.md @@ -60,7 +60,6 @@ error[UP040]: Type alias `Pair` uses `TypeAlias` annotation instead of the `type | 6 | Pair: TypeAlias = tuple[S, T] # snapshot: non-pep695-type-alias | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use the `type` keyword | 5 | @@ -115,7 +114,6 @@ error[UP046]: Generic class `Pair` uses `Generic` subclass instead of type param | 6 | class Pair(Generic[S, T]): # snapshot: non-pep695-generic-class | ^^^^^^^^^^^^^ - | help: Use type parameters | 5 | @@ -158,7 +156,6 @@ error[UP047]: Generic function `pair` should use type parameters | 6 | def pair(s: S, t: T) -> tuple[S, T]: # snapshot: non-pep695-generic-function | ^^^^^^^^^^^^^^^^ - | help: Use type parameters | 5 | diff --git a/crates/ruff_linter/resources/mdtest/ruff/fallible-context-manager.md b/crates/ruff_linter/resources/mdtest/ruff/fallible-context-manager.md index b7a4f2043aa564..72dd2d3a46cf55 100644 --- a/crates/ruff_linter/resources/mdtest/ruff/fallible-context-manager.md +++ b/crates/ruff_linter/resources/mdtest/ruff/fallible-context-manager.md @@ -27,7 +27,6 @@ error[RUF075]: Context manager does not catch exceptions | 7 | yield # snapshot: fallible-context-manager | ^^^^^ - | ``` ## Yield inside a nested `with`, not last diff --git a/crates/ruff_linter/resources/mdtest/ruff/invalid-pyproject-toml.md b/crates/ruff_linter/resources/mdtest/ruff/invalid-pyproject-toml.md index 033ca832e92a1c..b4d1bc421a28b2 100644 --- a/crates/ruff_linter/resources/mdtest/ruff/invalid-pyproject-toml.md +++ b/crates/ruff_linter/resources/mdtest/ruff/invalid-pyproject-toml.md @@ -20,7 +20,6 @@ error[RUF200]: Failed to parse pyproject.toml: invalid type: integer `1`, expect | 2 | name = 1 # snapshot: invalid-pyproject-toml | ^ - | ``` ## Respects per-file ignores diff --git a/crates/ruff_linter/resources/mdtest/ruff/logging-eager-conversion.md b/crates/ruff_linter/resources/mdtest/ruff/logging-eager-conversion.md index 800d2776e64e79..898c6e82e24dbb 100644 --- a/crates/ruff_linter/resources/mdtest/ruff/logging-eager-conversion.md +++ b/crates/ruff_linter/resources/mdtest/ruff/logging-eager-conversion.md @@ -31,7 +31,6 @@ error[RUF065]: Unnecessary `repr()` conversion when formatting with `%s`. Use `% | 7 | logging.warning("%s %s", repr("1"), *["1234"]) # snapshot: logging-eager-conversion | ^^^^^^^^^ - | error[RUF065]: Unnecessary `repr()` conversion when formatting with `%s`. Use `%r` instead of `%s` @@ -39,5 +38,4 @@ error[RUF065]: Unnecessary `repr()` conversion when formatting with `%s`. Use `% | 13 | logging.warning("%s %s %s", repr("1"), *["2", "3"]) # snapshot: logging-eager-conversion | ^^^^^^^^^ - | ``` diff --git a/crates/ruff_linter/resources/mdtest/ruff/noqa-comments.md b/crates/ruff_linter/resources/mdtest/ruff/noqa-comments.md index 6b9635b336913f..5c339fc7ad6182 100644 --- a/crates/ruff_linter/resources/mdtest/ruff/noqa-comments.md +++ b/crates/ruff_linter/resources/mdtest/ruff/noqa-comments.md @@ -22,7 +22,6 @@ error[RUF105]: `ruff: noqa` comment used instead of `ruff: file-ignore` | 2 | # ruff: noqa: F401 | ^^^^^^^^^^^^^^^^^^ - | help: Use `ruff: file-ignore` instead | 1 | # snapshot: noqa-comments @@ -50,7 +49,6 @@ error[RUF105]: `ruff: noqa` comment used instead of `ruff: file-ignore` | 2 | # ruff: noqa: F401, F402, F403 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `ruff: file-ignore` instead | 1 | # snapshot: noqa-comments @@ -78,7 +76,6 @@ error[RUF105]: `ruff: noqa` comment used instead of `ruff: file-ignore` | 2 | # ruff: noqa: F401, F402, F403 for some reason | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `ruff: file-ignore` instead | 1 | # snapshot: noqa-comments @@ -106,7 +103,6 @@ error[RUF105]: `ruff: noqa` comment used instead of `ruff: file-ignore` | 2 | # ruff: noqa: F401, F402, F403 # fmt:skip | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `ruff: file-ignore` instead | 1 | # snapshot: noqa-comments @@ -139,7 +135,6 @@ error[RUF105]: `noqa` comment used instead of `ruff: ignore` | 3 | import math # noqa: F401, UNK001 | ^^^^^^^^^^^^^^^^^^^^ - | help: Use `ruff: ignore` instead | 2 | # snapshot: noqa-comments @@ -179,7 +174,6 @@ error[RUF105]: `noqa` comment used instead of `ruff: ignore` | 4 | import math # noqa: F401, EXT001 | ^^^^^^^^^^^^^^^^^^^^ - | help: Use `ruff: ignore` instead ``` @@ -201,7 +195,6 @@ error[RUF105]: `ruff: noqa` comment used instead of `ruff: file-ignore` | 2 | # ruff: noqa: F401, F402 | ^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `ruff: file-ignore` instead ``` @@ -227,7 +220,6 @@ error[RUF105]: `noqa` comment used instead of `ruff: ignore` | 2 | import math # noqa: F401 | ^^^^^^^^^^^^ - | help: Use `ruff: ignore` instead | 1 | # snapshot: noqa-comments @@ -251,7 +243,6 @@ error[RUF105]: `noqa` comment used instead of `ruff: ignore` | 2 | import os # noqa: F401, F402 | ^^^^^^^^^^^^^^^^^^ - | help: Use `ruff: ignore` instead ``` @@ -268,7 +259,6 @@ error[RUF105]: `noqa` comment used instead of `ruff: ignore` | 2 | import math # fmt:skip # noqa: F401 | ^^^^^^^^^^^^ - | help: Use `ruff: ignore` instead | 1 | # snapshot: noqa-comments @@ -295,7 +285,6 @@ error[RUF105]: `noqa` comment used instead of `ruff: ignore` | 2 | import math # noqa | ^^^^^^ - | help: Use `ruff: ignore` instead | 1 | # snapshot: noqa-comments @@ -318,7 +307,6 @@ error[RUF105]: `noqa` comment used instead of `ruff: ignore` | 4 | import foo, bar # noqa | ^^^^^^ - | help: Use `ruff: ignore` instead | 3 | # snapshot: noqa-comments @@ -343,7 +331,6 @@ error[RUF105]: `ruff: noqa` comment used instead of `ruff: file-ignore` | 2 | # ruff: noqa | ^^^^^^^^^^^^ - | help: Use `ruff: file-ignore` instead ``` diff --git a/crates/ruff_linter/resources/mdtest/ruff/rule-codes-in-selectors.md b/crates/ruff_linter/resources/mdtest/ruff/rule-codes-in-selectors.md index cd9bada1049057..8c9729f43ccedb 100644 --- a/crates/ruff_linter/resources/mdtest/ruff/rule-codes-in-selectors.md +++ b/crates/ruff_linter/resources/mdtest/ruff/rule-codes-in-selectors.md @@ -26,7 +26,6 @@ error[RUF201]: Rule code used instead of name in `lint.select` | 3 | "F401", # snapshot: rule-codes-in-selectors | ^^^^ - | help: Replace rule code with `unused-import` | 2 | select = [ @@ -41,7 +40,6 @@ error[RUF201]: Rule code used instead of name in `lint.select` | 4 | 'F402', # snapshot: rule-codes-in-selectors | ^^^^ - | help: Replace rule code with `import-shadowed-by-loop-var` | 3 | "F401", # snapshot: rule-codes-in-selectors @@ -56,7 +54,6 @@ error[RUF201]: Rule code used instead of name in `lint.select` | 5 | """F403""", # snapshot: rule-codes-in-selectors | ^^^^ - | help: Replace rule code with `undefined-local-with-import-star` | 4 | 'F402', # snapshot: rule-codes-in-selectors @@ -71,7 +68,6 @@ error[RUF201]: Rule code used instead of name in `lint.select` | 6 | '''F404''', # snapshot: rule-codes-in-selectors | ^^^^ - | help: Replace rule code with `late-future-import` | 5 | """F403""", # snapshot: rule-codes-in-selectors @@ -100,7 +96,6 @@ error[RUF201]: Rule code used instead of name in `lint.select` | 3 | select = ["'F401'", "F402"] | ^^^^ - | help: Replace rule code with `import-shadowed-by-loop-var` | 2 | # snapshot: rule-codes-in-selectors @@ -205,7 +200,6 @@ error[RUF201]: Rule code used instead of name in `lint.select` | 2 | lint.select = ["F401"] | ^^^^ - | help: Replace rule code with `unused-import` ``` diff --git a/crates/ruff_linter/resources/mdtest/ruff/rule-codes-in-suppression-comments.md b/crates/ruff_linter/resources/mdtest/ruff/rule-codes-in-suppression-comments.md index e2023004319ef7..8f5d43dbc29d5e 100644 --- a/crates/ruff_linter/resources/mdtest/ruff/rule-codes-in-suppression-comments.md +++ b/crates/ruff_linter/resources/mdtest/ruff/rule-codes-in-suppression-comments.md @@ -25,7 +25,6 @@ error[RUF106]: Rule code used instead of name in suppression comment | 3 | # ruff:ignore[F401, undefined-name, EXT001, UNKNOWN, F841] | ^^^^ - | help: Replace rule code with name | 2 | # snapshot: rule-codes-in-suppression-comments @@ -40,7 +39,6 @@ error[RUF106]: Rule code used instead of name in suppression comment | 3 | # ruff:ignore[F401, undefined-name, EXT001, UNKNOWN, F841] | ^^^^ - | help: Replace rule code with name | 2 | # snapshot: rule-codes-in-suppression-comments @@ -65,7 +63,6 @@ error[RUF106]: Rule code used instead of name in suppression comment | 7 | # ruff:ignore[F401, undefined-name, F841] | ^^^^ - | help: Replace rule code with name | 6 | # snapshot: rule-codes-in-suppression-comments @@ -80,7 +77,6 @@ error[RUF106]: Rule code used instead of name in suppression comment | 7 | # ruff:ignore[F401, undefined-name, F841] | ^^^^ - | help: Replace rule code with name | 6 | # snapshot: rule-codes-in-suppression-comments @@ -104,7 +100,6 @@ error[RUF106]: Rule code used instead of name in suppression comment | 3 | # ruff:file-ignore[F401, F841] | ^^^^ - | help: Replace rule code with name | 2 | # snapshot: rule-codes-in-suppression-comments @@ -118,7 +113,6 @@ error[RUF106]: Rule code used instead of name in suppression comment | 3 | # ruff:file-ignore[F401, F841] | ^^^^ - | help: Replace rule code with name | 2 | # snapshot: rule-codes-in-suppression-comments @@ -148,7 +142,6 @@ error[RUF106]: Rule code used instead of name in suppression comment 4 | value = 1 5 | # ruff:enable[F401, undefined-name, F841] | ---- - | help: Replace rule code with name | 2 | # snapshot: rule-codes-in-suppression-comments @@ -168,7 +161,6 @@ error[RUF106]: Rule code used instead of name in suppression comment 4 | value = 1 5 | # ruff:enable[F401, undefined-name, F841] | ---- - | help: Replace rule code with name | 2 | # snapshot: rule-codes-in-suppression-comments @@ -196,7 +188,6 @@ error[RUF106]: Rule code used instead of name in suppression comment | 2 | # ruff:disable[F401] | ^^^^ - | help: Replace rule code with name | 1 | # snapshot: rule-codes-in-suppression-comments @@ -229,7 +220,6 @@ error[RUF106]: Rule code used instead of name in suppression comment | 2 | # ruff:ignore[PGH001] | ^^^^^^ - | help: Replace rule code with name | 1 | # snapshot: rule-codes-in-suppression-comments @@ -255,7 +245,6 @@ error[RUF106]: Rule code used instead of name in suppression comment | 3 | value = 1 # explanation # ruff:ignore[F401, F841] reason # another | ^^^^ - | help: Replace rule code with name | 2 | # snapshot: rule-codes-in-suppression-comments @@ -269,7 +258,6 @@ error[RUF106]: Rule code used instead of name in suppression comment | 3 | value = 1 # explanation # ruff:ignore[F401, F841] reason # another | ^^^^ - | help: Replace rule code with name | 2 | # snapshot: rule-codes-in-suppression-comments diff --git a/crates/ruff_linter/resources/mdtest/suppression/ignore.md b/crates/ruff_linter/resources/mdtest/suppression/ignore.md index 2f9443e583e1ec..dca3a68ddfc159 100644 --- a/crates/ruff_linter/resources/mdtest/suppression/ignore.md +++ b/crates/ruff_linter/resources/mdtest/suppression/ignore.md @@ -261,7 +261,6 @@ error[RUF100]: Unused suppression (unused: `F401`) | 21 | import sys # start # ruff:ignore[F401] # end | ^^^^^^^^^^^^^^^^^^^^ - | help: Remove unused suppression | 20 | # snapshot: unused-noqa @@ -337,7 +336,6 @@ error[RUF102]: Invalid rule code in suppression: unused-import 4 | import math 5 | # ruff:enable[unused-import] | ------------- - | help: Enable `lint.preview` to use rule names help: Remove the suppression comment | @@ -370,7 +368,6 @@ error[RUF102]: Invalid rule code in suppression: unknown-rule, unused-import 9 | import sys 10 | # ruff:enable[unused-import, unknown-rule] | ------------------------------------------ - | help: Add non-Ruff rule codes to the `lint.external` configuration option help: Enable `lint.preview` to use rule names help: Remove the suppression comment @@ -445,7 +442,6 @@ error[RUF103]: Invalid suppression comment: no matching 'disable' comment | 12 | # ruff:enable[F401] | ^^^^^^^^^^^^^^^^^^^ - | help: Remove suppression comment | 11 | # snapshot: invalid-suppression-comment @@ -485,7 +481,6 @@ error[RUF102]: Invalid rule code in suppression: not-a-rule | 2 | # ruff:ignore[unused-import, not-a-rule] | ^^^^^^^^^^ - | help: Add non-Ruff rule codes to the `lint.external` configuration option help: Remove the rule code `not-a-rule` | @@ -519,7 +514,6 @@ error[RUF100]: Unused suppression (unused: `unused-import`) | 8 | import math # ruff:ignore[unused-import] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove unused suppression | 7 | # snapshot: unused-noqa @@ -544,7 +538,6 @@ error[RUF100]: Unused suppression (unused: `unused-import`) | 12 | # ruff:ignore[F401, unused-import] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove unused suppression | 11 | # snapshot: unused-noqa @@ -581,7 +574,6 @@ error[RUF103]: Invalid suppression comment: missing suppression codes like `[E50 | 4 | import sys # explanation # ruff:ignore # another | ^^^^^^^^^^^^^^ - | help: Remove suppression comment | 3 | # error: [unused-import] @@ -631,7 +623,6 @@ error[RUF103]: Invalid suppression comment: trailing comments are only supported | 2 | # explanation # ruff:disable[F401] | ^^^^^^^^^^^^^^^^^^^^ - | help: Remove suppression comment | 1 | # snapshot: invalid-suppression-comment @@ -708,7 +699,6 @@ error[RUF100]: Unused suppression (unused: `E501`) | 3 | # ruff:ignore[E501] # ruff:file-ignore[F821] | ^^^^^^^^^^^^^^^^^^^^ - | help: Remove unused suppression | 2 | # error: [invalid-suppression-comment] @@ -743,7 +733,6 @@ error[RUF100]: Unused suppression (unused: `E501`) 10 | undefined_name 11 | # ruff:enable[E501] | ------------------- - | help: Remove unused suppression | 7 | # error: [unused-noqa] "F821" @@ -781,7 +770,6 @@ error[RUF100]: Unused suppression (unused: `E501`) 3 | value = 1 4 | # ruff:enable[E501] # TODO # ruff:ignore[FIX002] | -------------------- - | help: Remove unused suppression | 1 | # snapshot: unused-noqa @@ -816,7 +804,6 @@ error[RUF100]: Unused suppression (unused: `E501`) | 3 | # ruff:ignore[E501, F821] # ruff:file-ignore[F401] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove unused suppression | 2 | # error: [invalid-suppression-comment] @@ -849,7 +836,6 @@ error[RUF102]: Invalid rule code in suppression: XYZ | 3 | # ruff:ignore[XYZ] # ruff:file-ignore[F821] | ^^^ - | help: Add non-Ruff rule codes to the `lint.external` configuration option help: Remove the suppression comment | @@ -885,7 +871,6 @@ error[RUF103]: Invalid suppression comment: trailing comments are only supported | 4 | # explanation # ruff:file-ignore[F401] # ruff:ignore[F401] | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove suppression comment | 3 | # error: [unused-noqa] @@ -912,7 +897,6 @@ error[RUF103]: Invalid suppression comment: missing suppression codes like `[E50 | 9 | # explanation # ruff:ignore # ruff:ignore[F821] | ^^^^^^^^^^^^^^ - | help: Remove suppression comment | 8 | # error: [unused-noqa] @@ -945,7 +929,6 @@ error[RUF103]: Invalid suppression comment: unknown ruff directive | 2 | import os # explanation # ruff:unknown[F401] # another | ^^^^^^^^^^^^^^^^^^^^^ - | help: Remove suppression comment | 1 | # snapshot: invalid-suppression-comment @@ -961,7 +944,6 @@ error[RUF103]: Invalid suppression comment: missing comma between codes | 4 | import sys # explanation # ruff:ignore[F401 F841] # another | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove suppression comment | 3 | # snapshot: invalid-suppression-comment @@ -1008,7 +990,6 @@ error[RUF100]: Unused suppression (non-enabled: `F401`) | 2 | value = 1 # before # ruff:ignore[F401] # after | ^^^^^^^^^^^^^^^^^^^^ - | help: Remove unused suppression | 1 | # snapshot: unused-noqa @@ -1024,7 +1005,6 @@ error[RUF100]: Unused suppression (non-enabled: `F401`) | 5 | value = 1 # before # ruff:ignore[F401] | ^^^^^^^^^^^^^^^^^^^ - | help: Remove unused suppression | 4 | # snapshot: unused-noqa diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR003_AIR003.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR003_AIR003.py.snap index 20e25fad0f3bd7..b8321a380ac299 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR003_AIR003.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR003_AIR003.py.snap @@ -52,5 +52,4 @@ AIR003 `Variable.get()` outside of a task 28 | def helper(): 29 | return Variable.get("foo") # AIR003 | ^^^^^^^^^^^^^^^^^^^ - | help: Move into a `@task`-decorated function diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR003_AIR003_dag_decorator.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR003_AIR003_dag_decorator.py.snap index a58f3e2330fc7b..4c0280bddda8cf 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR003_AIR003_dag_decorator.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR003_AIR003_dag_decorator.py.snap @@ -8,5 +8,4 @@ AIR003 `Variable.get()` outside of a task 3 | 4 | var = Variable.get("foo") # AIR003 | ^^^^^^^^^^^^^^^^^^^ - | help: Use Jinja templates instead diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR004_AIR004.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR004_AIR004.py.snap index 0fe49748fc2208..1523e673a539a0 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR004_AIR004.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR004_AIR004.py.snap @@ -12,7 +12,6 @@ AIR004 `@task.branch` can be replaced with `@task.short_circuit` 17 | | return ["my_downstream_task"] 18 | | return [] | |_____________^ - | AIR004 `@task.branch` can be replaced with `@task.short_circuit` --> AIR004.py:21:1 @@ -25,7 +24,6 @@ AIR004 `@task.branch` can be replaced with `@task.short_circuit` 26 | | return ["another_downstream_task"] 27 | | return [] | |_____________^ - | AIR004 `@task.branch` can be replaced with `@task.short_circuit` --> AIR004.py:30:1 @@ -38,7 +36,6 @@ AIR004 `@task.branch` can be replaced with `@task.short_circuit` 35 | | return ["downstream_task"] 36 | | return [] | |_____________^ - | AIR004 `@task.branch` can be replaced with `@task.short_circuit` --> AIR004.py:39:1 @@ -49,7 +46,6 @@ AIR004 `@task.branch` can be replaced with `@task.short_circuit` 42 | | return ["downstream_task"] 43 | | return [] | |_____________^ - | AIR004 `@task.branch` can be replaced with `@task.short_circuit` --> AIR004.py:46:1 @@ -60,7 +56,6 @@ AIR004 `@task.branch` can be replaced with `@task.short_circuit` 49 | | return ["downstream_task"] 50 | | return | |__________^ - | AIR004 `@task.branch` can be replaced with `@task.short_circuit` --> AIR004.py:53:1 @@ -71,14 +66,12 @@ AIR004 `@task.branch` can be replaced with `@task.short_circuit` 56 | | return ["downstream_task"] 57 | | return None | |_______________^ - | AIR004 `BranchPythonOperator` can be replaced with `ShortCircuitOperator` --> AIR004.py:107:1 | 107 | BranchPythonOperator(task_id="task", python_callable=operator_short_circuit_candidate) # AIR004 | ^^^^^^^^^^^^^^^^^^^^ - | AIR004 `BranchPythonOperator` can be replaced with `ShortCircuitOperator` --> AIR004.py:116:1 diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR004_AIR004_sdk.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR004_AIR004_sdk.py.snap index c70514b6677b50..f22558042d7084 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR004_AIR004_sdk.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR004_AIR004_sdk.py.snap @@ -12,4 +12,3 @@ AIR004 `@task.branch` can be replaced with `@task.short_circuit` 12 | | return ["my_downstream_task"] 13 | | return [] | |_____________^ - | diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_args.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_args.py.snap index 81fc67e2b068e4..ec4d7fd6f73ab1 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_args.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_args.py.snap @@ -280,7 +280,6 @@ AIR301 `appbuilder` is removed in Airflow 3.0 107 | 108 | FabAuthManager(None) | ^^^^^^ - | help: The constructor takes no parameter now AIR301 [*] `default_var` is removed in Airflow 3.0 diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_class_attribute.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_class_attribute.py.snap index c7a454240074ce..512903692da775 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_class_attribute.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_class_attribute.py.snap @@ -599,4 +599,3 @@ AIR301 `create_dagrun` is removed in Airflow 3.0 115 | test_dag = DAG(dag_id="test_dag") 116 | test_dag.create_dagrun() | ^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_context.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_context.py.snap index ffa9195f21c2ac..ade9431e79c741 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_context.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_context.py.snap @@ -18,7 +18,6 @@ AIR301 `conf` is removed in Airflow 3.0 22 | print("access invalid key", context["conf"]) 23 | print("access invalid key", context.get("conf")) | ^^^^^^ - | AIR301 `execution_date` is removed in Airflow 3.0 --> AIR301_context.py:28:5 @@ -49,7 +48,6 @@ AIR301 `conf` is removed in Airflow 3.0 30 | print("execution date", execution_date) 31 | print("access invalid key", context.get("conf")) | ^^^^^^ - | AIR301 `execution_date` is removed in Airflow 3.0 --> AIR301_context.py:40:30 @@ -177,7 +175,6 @@ AIR301 [*] `triggering_dataset_events` is removed in Airflow 3.0 50 | yesterday_ds_nodash = context["yesterday_ds_nodash"] 51 | events = context["triggering_dataset_events"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `triggering_asset_events` instead | 50 | yesterday_ds_nodash = context["yesterday_ds_nodash"] @@ -313,7 +310,6 @@ AIR301 [*] `triggering_dataset_events` is removed in Airflow 3.0 67 | yesterday_ds_nodash = context["yesterday_ds_nodash"] 68 | events = context["triggering_dataset_events"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `triggering_asset_events` instead | 67 | yesterday_ds_nodash = context["yesterday_ds_nodash"] @@ -340,7 +336,6 @@ AIR301 `execution_date` is removed in Airflow 3.0 76 | c = get_current_context() 77 | c.get("execution_date") | ^^^^^^^^^^^^^^^^ - | AIR301 `conf` is removed in Airflow 3.0 --> AIR301_context.py:89:49 @@ -492,7 +487,6 @@ AIR301 `inlet_events[""]` is removed in Airflow 3.0 190 | print(context["inlet_events"].get("this://is-url")) 191 | print(context.get("inlet_events").get("this://is-url")) | ^^^^^^^^^^^^^^^ - | help: Accessing `inlet_events` via a string key is deprecated; use `context["inlet_events"][Asset(uri="this://is-url")]` instead of `context["inlet_events"]["this://is-url"]`. AIR301 `inlet_events[""]` is removed in Airflow 3.0 @@ -513,7 +507,6 @@ AIR301 `inlet_events[""]` is removed in Airflow 3.0 197 | print(inlet_events["this://is-url"]) 198 | print(inlet_events.get("this://is-url")) | ^^^^^^^^^^^^^^^ - | help: Accessing `inlet_events` via a string key is deprecated; use `context["inlet_events"][Asset(uri="this://is-url")]` instead of `context["inlet_events"]["this://is-url"]`. AIR301 `execution_date` is removed in Airflow 3.0 @@ -533,7 +526,6 @@ AIR301 `next_ds` is removed in Airflow 3.0 216 | execution_date = context["execution_date"] 217 | next_ds = context["next_ds"] | ^^^^^^^^^ - | AIR301 `execution_date` is removed in Airflow 3.0 --> AIR301_context.py:228:30 diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_names.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_names.py.snap index 9f0bbd9a01194a..98efab280f8a54 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_names.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_names.py.snap @@ -95,7 +95,6 @@ AIR301 `airflow.contrib.aws_athena_hook.AWSAthenaHook` is removed in Airflow 3.0 43 | # airflow.contrib.* 44 | AWSAthenaHook() | ^^^^^^^^^^^^^ - | help: The whole `airflow.contrib` module has been removed. AIR301 `airflow.datasets.DatasetAliasEvent` is removed in Airflow 3.0 @@ -114,7 +113,6 @@ AIR301 `airflow.datasets.DatasetEvent` is removed in Airflow 3.0 48 | DatasetAliasEvent() 49 | DatasetEvent() | ^^^^^^^^^^^^ - | help: `DatasetEvent` has been made private in Airflow 3. Use `dict[str, Any]` for the time being. An `AssetEvent` type will be added to the apache-airflow-task-sdk in a future version. AIR301 `airflow.operators.subdag.SubDagOperator` is removed in Airflow 3.0 @@ -240,7 +238,6 @@ AIR301 `airflow.utils.dag_cycle_tester.test_cycle` is removed in Airflow 3.0 81 | # airflow.utils.dag_cycle_tester 82 | test_cycle | ^^^^^^^^^^ - | AIR301 `airflow.utils.db.create_session` is removed in Airflow 3.0 --> AIR301_names.py:86:1 @@ -248,7 +245,6 @@ AIR301 `airflow.utils.db.create_session` is removed in Airflow 3.0 85 | # airflow.utils.db 86 | create_session | ^^^^^^^^^^^^^^ - | AIR301 `airflow.utils.file.mkdirs` is removed in Airflow 3.0 --> AIR301_names.py:90:1 @@ -256,7 +252,6 @@ AIR301 `airflow.utils.file.mkdirs` is removed in Airflow 3.0 89 | # airflow.utils.file 90 | mkdirs | ^^^^^^ - | help: Use `pathlib.Path({path}).mkdir` instead AIR301 `airflow.utils.state.SHUTDOWN` is removed in Airflow 3.0 @@ -285,7 +280,6 @@ AIR301 `airflow.utils.trigger_rule.TriggerRule.DUMMY` is removed in Airflow 3.0 97 | # airflow.utils.trigger_rule 98 | TriggerRule.DUMMY | ^^^^^^^^^^^^^^^^^ - | AIR301 `airflow.www.auth.has_access` is removed in Airflow 3.0 --> AIR301_names.py:102:1 @@ -323,4 +317,3 @@ AIR301 `airflow.www.utils.should_hide_value_for_key` is removed in Airflow 3.0 106 | get_sensitive_variables_fields 107 | should_hide_value_for_key | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_names_fix.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_names_fix.py.snap index d30128fa170867..213b8d78301c4e 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_names_fix.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_names_fix.py.snap @@ -204,7 +204,6 @@ AIR301 [*] `airflow.security.permissions.RESOURCE_DATASET` is removed in Airflow 31 | 32 | RESOURCE_DATASET | ^^^^^^^^^^^^^^^^ - | help: Use `RESOURCE_ASSET` from `airflow.security.permissions` instead. | 14 | from airflow.secrets.local_filesystem import load_connections @@ -243,7 +242,6 @@ AIR301 [*] `airflow.listeners.spec.dataset.on_dataset_changed` is removed in Air 40 | on_dataset_created() 41 | on_dataset_changed() | ^^^^^^^^^^^^^^^^^^ - | help: Use `on_asset_changed` from `airflow.listeners.spec.asset` instead. | 38 | ) @@ -357,7 +355,6 @@ AIR301 [*] `airflow.auth.managers.base_auth_manager.BaseAuthManager` is removed 71 | 72 | BaseAuthManager() | ^^^^^^^^^^^^^^^ - | help: Use `BaseAuthManager` from `airflow.api_fastapi.auth.managers.base_auth_manager` instead. | 69 | # airflow.auth.manager @@ -650,7 +647,6 @@ AIR301 [*] `airflow.utils.log.secrets_masker` is removed in Airflow 3.0 113 | # airflow.utils.log 114 | secrets_masker | ^^^^^^^^^^^^^^ - | help: `secrets_masker` has been moved to `airflow.sdk.execution_time` since Airflow 3.0 (with apache-airflow-task-sdk>=1.0.0). | 110 | diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_provider_names_fix.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_provider_names_fix.py.snap index f671d0ce6e4420..48d2bd2658b451 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_provider_names_fix.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR301_AIR301_provider_names_fix.py.snap @@ -189,7 +189,6 @@ AIR301 [*] `airflow.providers.google.datasets.gcs.convert_dataset_to_openlineage 53 | gcs_create_dataset() 54 | gcs_convert_dataset_to_openlineage() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `convert_asset_to_openlineage` from `airflow.providers.google.assets.gcs` instead. | 51 | from airflow.providers.google.datasets.gcs import create_dataset as gcs_create_dataset diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_amazon.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_amazon.py.snap index b9245f82066093..b270328a92a80a 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_amazon.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_amazon.py.snap @@ -211,7 +211,6 @@ AIR302 [*] `airflow.operators.s3_to_redshift_operator.S3ToRedshiftTransfer` is m 33 | 34 | S3ToRedshiftTransfer() | ^^^^^^^^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-amazon>=1.0.0` and use `S3ToRedshiftOperator` from `airflow.providers.amazon.aws.transfers.s3_to_redshift` instead. | 32 | from airflow.operators.s3_to_redshift_operator import S3ToRedshiftTransfer diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_celery.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_celery.py.snap index 9e375bcf51efd9..5fa835ca2ea5c5 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_celery.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_celery.py.snap @@ -49,7 +49,6 @@ AIR302 [*] `airflow.executors.celery_executor.CeleryExecutor` is moved into `cel 11 | app 12 | CeleryExecutor() | ^^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-celery>=3.3.0` and use `CeleryExecutor` from `airflow.providers.celery.executors.celery_executor` instead. | 4 | from airflow.executors.celery_executor import ( diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_common_sql.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_common_sql.py.snap index 64d24f05a32ce3..1eb33784729ff7 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_common_sql.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_common_sql.py.snap @@ -65,7 +65,6 @@ AIR302 [*] `airflow.operators.check_operator.SQLCheckOperator` is moved into `co 14 | DbApiHook() 15 | SQLCheckOperator() | ^^^^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead. | 11 | from airflow.hooks.dbapi_hook import DbApiHook @@ -99,7 +98,6 @@ AIR302 [*] `airflow.operators.check_operator.CheckOperator` is moved into `commo 21 | SQLCheckOperator() 22 | CheckOperator() | ^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead. | 19 | from airflow.operators.sql import SQLCheckOperator @@ -115,7 +113,6 @@ AIR302 [*] `airflow.operators.druid_check_operator.CheckOperator` is moved into 26 | 27 | CheckOperator() | ^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead. | 25 | from airflow.operators.druid_check_operator import CheckOperator @@ -131,7 +128,6 @@ AIR302 [*] `airflow.operators.presto_check_operator.CheckOperator` is moved into 31 | 32 | CheckOperator() | ^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLCheckOperator` from `airflow.providers.common.sql.operators.sql` instead. | 30 | from airflow.operators.presto_check_operator import CheckOperator @@ -203,7 +199,6 @@ AIR302 [*] `airflow.operators.check_operator.SQLIntervalCheckOperator` is moved 44 | IntervalCheckOperator() 45 | SQLIntervalCheckOperator() | ^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLIntervalCheckOperator` from `airflow.providers.common.sql.operators.sql` instead. | 36 | IntervalCheckOperator, @@ -258,7 +253,6 @@ AIR302 [*] `airflow.operators.presto_check_operator.PrestoIntervalCheckOperator` 55 | SQLIntervalCheckOperator() 56 | PrestoIntervalCheckOperator() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLIntervalCheckOperator` from `airflow.providers.common.sql.operators.sql` instead. | 52 | from airflow.operators.sql import SQLIntervalCheckOperator @@ -293,7 +287,6 @@ AIR302 [*] `airflow.operators.check_operator.ThresholdCheckOperator` is moved in 64 | SQLThresholdCheckOperator() 65 | ThresholdCheckOperator() | ^^^^^^^^^^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLThresholdCheckOperator` from `airflow.providers.common.sql.operators.sql` instead. | 59 | from airflow.operators.check_operator import ( @@ -312,7 +305,6 @@ AIR302 [*] `airflow.operators.sql.SQLThresholdCheckOperator` is moved into `comm 69 | 70 | SQLThresholdCheckOperator() | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLThresholdCheckOperator` from `airflow.providers.common.sql.operators.sql` instead. | 67 | @@ -348,7 +340,6 @@ AIR302 [*] `airflow.operators.check_operator.ValueCheckOperator` is moved into ` 78 | SQLValueCheckOperator() 79 | ValueCheckOperator() | ^^^^^^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLValueCheckOperator` from `airflow.providers.common.sql.operators.sql` instead. | 73 | from airflow.operators.check_operator import ( @@ -402,7 +393,6 @@ AIR302 [*] `airflow.operators.presto_check_operator.PrestoValueCheckOperator` is 89 | ValueCheckOperator() 90 | PrestoValueCheckOperator() | ^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-common-sql>=1.1.0` and use `SQLValueCheckOperator` from `airflow.providers.common.sql.operators.sql` instead. | 86 | from airflow.operators.sql import SQLValueCheckOperator @@ -526,7 +516,6 @@ AIR302 [*] `airflow.operators.sql.parse_boolean` is moved into `common-sql` prov 106 | _convert_to_float_if_possible() 107 | parse_boolean() | ^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `parse_boolean` from `airflow.providers.common.sql.operators.sql` instead. | 98 | _convert_to_float_if_possible, @@ -544,7 +533,6 @@ AIR302 [*] `airflow.sensors.sql.SqlSensor` is moved into `common-sql` provider i 111 | 112 | SqlSensor() | ^^^^^^^^^ - | help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `SqlSensor` from `airflow.providers.common.sql.sensors.sql` instead. | 109 | @@ -561,7 +549,6 @@ AIR302 [*] `airflow.sensors.sql_sensor.SqlSensor` is moved into `common-sql` pro 116 | 117 | SqlSensor() | ^^^^^^^^^ - | help: Install `apache-airflow-providers-common-sql>=1.0.0` and use `SqlSensor` from `airflow.providers.common.sql.sensors.sql` instead. | 114 | diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_daskexecutor.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_daskexecutor.py.snap index 144db5f91f55ae..5c0ee422ed29be 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_daskexecutor.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_daskexecutor.py.snap @@ -8,7 +8,6 @@ AIR302 [*] `airflow.executors.dask_executor.DaskExecutor` is moved into `daskexe 4 | 5 | DaskExecutor() | ^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-daskexecutor>=1.0.0` and use `DaskExecutor` from `airflow.providers.daskexecutor.executors.dask_executor` instead. | 2 | diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_druid.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_druid.py.snap index d1690eaf83aced..9558e073361383 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_druid.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_druid.py.snap @@ -69,7 +69,6 @@ AIR302 [*] `airflow.operators.hive_to_druid.HiveToDruidTransfer` is moved into ` 15 | HiveToDruidOperator() 16 | HiveToDruidTransfer() | ^^^^^^^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-apache-druid>=1.0.0` and use `HiveToDruidOperator` from `airflow.providers.apache.druid.transfers.hive_to_druid` instead. | 7 | from airflow.operators.hive_to_druid import ( diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_fab.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_fab.py.snap index 6cbb31d7829a2c..77b7ae496e5824 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_fab.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_fab.py.snap @@ -366,7 +366,6 @@ AIR302 [*] `airflow.www.security.FabAirflowSecurityManagerOverride` is moved int 54 | 55 | FabAirflowSecurityManagerOverride() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-fab>=1.0.0` and use `FabAirflowSecurityManagerOverride` from `airflow.providers.fab.auth_manager.security_manager.override` instead. | 52 | diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_hdfs.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_hdfs.py.snap index 6c429ec90eda74..d0b17d61c46a20 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_hdfs.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_hdfs.py.snap @@ -26,7 +26,6 @@ AIR302 [*] `airflow.sensors.web_hdfs_sensor.WebHdfsSensor` is moved into `apache 6 | WebHDFSHook() 7 | WebHdfsSensor() | ^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-apache-hdfs>=1.0.0` and use `WebHdfsSensor` from `airflow.providers.apache.hdfs.sensors.web_hdfs` instead. | 3 | from airflow.hooks.webhdfs_hook import WebHDFSHook diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_hive.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_hive.py.snap index 9410bd64bcf1e9..9ea949fabf8287 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_hive.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_hive.py.snap @@ -197,7 +197,6 @@ AIR302 [*] `airflow.operators.hive_to_samba_operator.HiveToSambaOperator` is mov 28 | HiveToMySqlOperator() 29 | HiveToSambaOperator() | ^^^^^^^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `HiveToSambaOperator` from `airflow.providers.apache.hive.transfers.hive_to_samba` instead. | 15 | from airflow.operators.hive_to_mysql import HiveToMySqlOperator @@ -381,7 +380,6 @@ AIR302 [*] `airflow.sensors.named_hive_partition_sensor.NamedHivePartitionSensor 69 | 70 | NamedHivePartitionSensor() | ^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-apache-hive>=1.0.0` and use `NamedHivePartitionSensor` from `airflow.providers.apache.hive.sensors.named_hive_partition` instead. | 67 | diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_http.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_http.py.snap index 9498a928da3673..e14dae880c2046 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_http.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_http.py.snap @@ -48,7 +48,6 @@ AIR302 [*] `airflow.sensors.http_sensor.HttpSensor` is moved into `http` provide 8 | SimpleHttpOperator() 9 | HttpSensor() | ^^^^^^^^^^ - | help: Install `apache-airflow-providers-http>=1.0.0` and use `HttpSensor` from `airflow.providers.http.sensors.http` instead. | 4 | from airflow.operators.http_operator import SimpleHttpOperator diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_jdbc.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_jdbc.py.snap index 08e36e02b7dbbf..d488b793b5cd5d 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_jdbc.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_jdbc.py.snap @@ -27,7 +27,6 @@ AIR302 [*] `airflow.hooks.jdbc_hook.jaydebeapi` is moved into `jdbc` provider in 8 | JdbcHook() 9 | jaydebeapi() | ^^^^^^^^^^ - | help: Install `apache-airflow-providers-jdbc>=1.0.0` and use `jaydebeapi` from `airflow.providers.jdbc.hooks.jdbc` instead. | 4 | JdbcHook, diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_kubernetes.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_kubernetes.py.snap index d2d0d8696d1de3..749fc444ffc708 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_kubernetes.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_kubernetes.py.snap @@ -197,7 +197,6 @@ AIR302 [*] `airflow.kubernetes.kubernetes_helper_functions.create_pod_id` is mov 33 | annotations_for_logging_task_metadata() 34 | create_pod_id() | ^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-cncf-kubernetes>=10.0.0` and use `create_unique_id` from `airflow.providers.cncf.kubernetes.kubernetes_helper_functions` instead. | 20 | ) @@ -772,7 +771,6 @@ AIR302 [*] `airflow.kubernetes.pod_generator.PodGeneratorDeprecated` is moved in 112 | 113 | PodGeneratorDeprecated() | ^^^^^^^^^^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-cncf-kubernetes>=7.4.0` and use `PodGenerator` from `airflow.providers.cncf.kubernetes.pod_generator` instead. | 111 | from airflow.kubernetes.pod_generator import PodGeneratorDeprecated diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_mysql.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_mysql.py.snap index 1d5624472fc653..0e416009066fad 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_mysql.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_mysql.py.snap @@ -50,7 +50,6 @@ AIR302 [*] `airflow.operators.presto_to_mysql.PrestoToMySqlTransfer` is moved in 10 | PrestoToMySqlOperator() 11 | PrestoToMySqlTransfer() | ^^^^^^^^^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-mysql>=1.0.0` and use `PrestoToMySqlOperator` from `airflow.providers.mysql.transfers.presto_to_mysql` instead. | 4 | from airflow.operators.presto_to_mysql import ( diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_oracle.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_oracle.py.snap index 40cfc36f94472c..27249b48d95afc 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_oracle.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_oracle.py.snap @@ -8,7 +8,6 @@ AIR302 [*] `airflow.hooks.oracle_hook.OracleHook` is moved into `oracle` provide 4 | 5 | OracleHook() | ^^^^^^^^^^ - | help: Install `apache-airflow-providers-oracle>=1.0.0` and use `OracleHook` from `airflow.providers.oracle.hooks.oracle` instead. | 2 | diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_papermill.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_papermill.py.snap index 3cadf1edd57e18..6afd5f958b09d1 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_papermill.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_papermill.py.snap @@ -8,7 +8,6 @@ AIR302 [*] `airflow.operators.papermill_operator.PapermillOperator` is moved int 4 | 5 | PapermillOperator() | ^^^^^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-papermill>=1.0.0` and use `PapermillOperator` from `airflow.providers.papermill.operators.papermill` instead. | 2 | diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_pig.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_pig.py.snap index 9e0c48a9ed8c0f..d69d3f92232298 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_pig.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_pig.py.snap @@ -26,7 +26,6 @@ AIR302 [*] `airflow.operators.pig_operator.PigOperator` is moved into `apache-pi 6 | PigCliHook() 7 | PigOperator() | ^^^^^^^^^^^ - | help: Install `apache-airflow-providers-apache-pig>=1.0.0` and use `PigOperator` from `airflow.providers.apache.pig.operators.pig` instead. | 3 | from airflow.hooks.pig_hook import PigCliHook diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_presto.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_presto.py.snap index 8032b0cec697b1..15790d11dd8e16 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_presto.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_presto.py.snap @@ -8,7 +8,6 @@ AIR302 [*] `airflow.hooks.presto_hook.PrestoHook` is moved into `presto` provide 4 | 5 | PrestoHook() | ^^^^^^^^^^ - | help: Install `apache-airflow-providers-presto>=1.0.0` and use `PrestoHook` from `airflow.providers.presto.hooks.presto` instead. | 2 | diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_samba.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_samba.py.snap index 968db8e7f68052..57326616fc1eb3 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_samba.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_samba.py.snap @@ -8,7 +8,6 @@ AIR302 [*] `airflow.hooks.samba_hook.SambaHook` is moved into `samba` provider i 4 | 5 | SambaHook() | ^^^^^^^^^ - | help: Install `apache-airflow-providers-samba>=1.0.0` and use `SambaHook` from `airflow.providers.samba.hooks.samba` instead. | 2 | diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_slack.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_slack.py.snap index 84da9319a1e2a6..8ffef8eb4b8dd4 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_slack.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_slack.py.snap @@ -46,7 +46,6 @@ AIR302 [*] `airflow.operators.slack_operator.SlackAPIPostOperator` is moved into 7 | SlackAPIOperator() 8 | SlackAPIPostOperator() | ^^^^^^^^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-slack>=1.0.0` and use `SlackAPIPostOperator` from `airflow.providers.slack.operators.slack` instead. | 3 | from airflow.hooks.slack_hook import SlackHook diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_smtp.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_smtp.py.snap index 8ee9e7dddbfc92..dbb6eb29f67ce3 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_smtp.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_smtp.py.snap @@ -27,7 +27,6 @@ AIR302 [*] `airflow.operators.email.EmailOperator` is moved into `smtp` provider 8 | 9 | EmailOperator() | ^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-smtp>=1.0.0` and use `EmailOperator` from `airflow.providers.smtp.operators.smtp` instead. | 6 | diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_sqlite.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_sqlite.py.snap index 26af38354a0d62..9d054905dcd665 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_sqlite.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_sqlite.py.snap @@ -8,7 +8,6 @@ AIR302 [*] `airflow.hooks.sqlite_hook.SqliteHook` is moved into `sqlite` provide 4 | 5 | SqliteHook() | ^^^^^^^^^^ - | help: Install `apache-airflow-providers-sqlite>=1.0.0` and use `SqliteHook` from `airflow.providers.sqlite.hooks.sqlite` instead. | 2 | diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_standard.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_standard.py.snap index 0dc11bac45da14..6490009535ef4c 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_standard.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_standard.py.snap @@ -199,7 +199,6 @@ AIR302 [*] `airflow.sensors.external_task_sensor.ExternalTaskSensor` is moved in 32 | ExternalTaskMarker() 33 | ExternalTaskSensor() | ^^^^^^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-standard>=0.0.3` and use `ExternalTaskSensor` from `airflow.providers.standard.sensors.external_task` instead. | 16 | ExternalTaskMarker, @@ -408,7 +407,6 @@ AIR302 [*] `airflow.sensors.external_task_sensor.ExternalTaskSensorLink` is move 77 | 78 | ExternalTaskSensorLink() | ^^^^^^^^^^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-standard>=0.0.3` and use `ExternalDagLink` from `airflow.providers.standard.sensors.external_task` instead. | 76 | from airflow.sensors.external_task_sensor import ExternalTaskSensorLink diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_zendesk.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_zendesk.py.snap index 0000a16ccd7fdd..ebabfa0efbed22 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_zendesk.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR302_AIR302_zendesk.py.snap @@ -8,7 +8,6 @@ AIR302 [*] `airflow.hooks.zendesk_hook.ZendeskHook` is moved into `zendesk` prov 4 | 5 | ZendeskHook() | ^^^^^^^^^^^ - | help: Install `apache-airflow-providers-zendesk>=1.0.0` and use `ZendeskHook` from `airflow.providers.zendesk.hooks.zendesk` instead. | 2 | diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR304_AIR304.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR304_AIR304.py.snap index df8750b04da8ae..9385b6ab8e7976 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR304_AIR304.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR304_AIR304.py.snap @@ -198,7 +198,6 @@ AIR304 `datetime.now()` produces a value that changes at runtime; using it in a 42 | # Walrus operator 43 | DAG(dag_id="s", start_date=(x := datetime.now())) | ^^^^^^^^^^^^^^ - | AIR304 `pendulum.now()` produces a value that changes at runtime; using it in a Dag or task argument causes infinite Dag version creation --> AIR304.py:46:17 @@ -225,7 +224,6 @@ AIR304 `datetime.now()` produces a value that changes at runtime; using it in a 52 | 53 | PythonSensor(task_id="s", start_date=datetime.now()) | ^^^^^^^^^^^^^^ - | AIR304 `datetime.utcnow()` produces a value that changes at runtime; using it in a Dag or task argument causes infinite Dag version creation --> AIR304.py:56:18 diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR311_AIR311_args.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR311_AIR311_args.py.snap index 6d916e1516bcab..970495b1c08a54 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR311_AIR311_args.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR311_AIR311_args.py.snap @@ -6,7 +6,6 @@ AIR311 [*] `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3. | 13 | DAG(dag_id="class_sla_callback", sla_miss_callback=sla_callback) | ^^^ - | help: `DAG` has been moved to `airflow.sdk` since Airflow 3.0 (with apache-airflow-task-sdk>=1.0.0). | 4 | @@ -23,7 +22,6 @@ AIR311 `sla_miss_callback` is removed in Airflow 3.0; It still works in Airflow | 13 | DAG(dag_id="class_sla_callback", sla_miss_callback=sla_callback) | ^^^^^^^^^^^^^^^^^ - | AIR311 `sla_miss_callback` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version. --> AIR311_args.py:16:6 diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR311_AIR311_names.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR311_AIR311_names.py.snap index 54ebd0c1c8746d..fc73e40a2b2bd3 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR311_AIR311_names.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR311_AIR311_names.py.snap @@ -616,7 +616,6 @@ AIR311 [*] `airflow.decorators.base.task_decorator_factory` is removed in Airflo 90 | get_unique_task_id() 91 | task_decorator_factory() | ^^^^^^^^^^^^^^^^^^^^^^ - | help: `task_decorator_factory` has been moved to `airflow.sdk.bases.decorator` since Airflow 3.0 (with apache-airflow-task-sdk>=1.0.0). | 82 | get_unique_task_id, @@ -672,7 +671,6 @@ AIR311 [*] `airflow.models.ParamsDict` is removed in Airflow 3.0; It still works 98 | DagParam() 99 | ParamsDict() | ^^^^^^^^^^ - | help: `ParamsDict` has been moved to `airflow.sdk.definitions.param` since Airflow 3.0 (with apache-airflow-task-sdk>=1.0.0). | 93 | @@ -728,7 +726,6 @@ AIR311 [*] `airflow.models.param.ParamsDict` is removed in Airflow 3.0; It still 106 | DagParam() 107 | ParamsDict() | ^^^^^^^^^^ - | help: `ParamsDict` has been moved to `airflow.sdk.definitions.param` since Airflow 3.0 (with apache-airflow-task-sdk>=1.0.0). | 101 | @@ -787,7 +784,6 @@ AIR311 [*] `airflow.sensors.base.poke_mode_only` is removed in Airflow 3.0; It s 118 | PokeReturnValue() 119 | poke_mode_only() | ^^^^^^^^^^^^^^ - | help: `poke_mode_only` has been moved to `airflow.sdk.bases.sensor` since Airflow 3.0 (with apache-airflow-task-sdk>=1.0.0). | 112 | PokeReturnValue, diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR312_AIR312.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR312_AIR312.py.snap index c76077d3da7491..2fefab2699daf2 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR312_AIR312.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR312_AIR312.py.snap @@ -703,7 +703,6 @@ AIR312 [*] `airflow.triggers.temporal.TimeDeltaTrigger` is deprecated and moved 88 | DateTimeTrigger() 89 | TimeDeltaTrigger() | ^^^^^^^^^^^^^^^^ - | help: Install `apache-airflow-providers-standard>=0.0.3` and use `TimeDeltaTrigger` from `airflow.providers.standard.triggers.temporal` instead. | 78 | DateTimeTrigger, diff --git a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR321_AIR321_names.py.snap b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR321_AIR321_names.py.snap index 4b871cd6f24ad5..8f824539cb637f 100644 --- a/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR321_AIR321_names.py.snap +++ b/crates/ruff_linter/src/rules/airflow/snapshots/ruff_linter__rules__airflow__tests__AIR321_AIR321_names.py.snap @@ -451,7 +451,6 @@ AIR321 [*] `airflow.hooks.base.BaseHook` is moved in Airflow 3.1 101 | from airflow.hooks.base import BaseHook 102 | BaseHook() | ^^^^^^^^ - | help: `BaseHook` has been moved to `airflow.sdk` since Airflow 3.1 (with apache-airflow-task-sdk>=1.1.0). | 100 | # airflow.hooks diff --git a/crates/ruff_linter/src/rules/eradicate/snapshots/ruff_linter__rules__eradicate__tests__ERA001_ERA001.py.snap b/crates/ruff_linter/src/rules/eradicate/snapshots/ruff_linter__rules__eradicate__tests__ERA001_ERA001.py.snap index be3f2e5456cbf0..0bc73f1f9a49fd 100644 --- a/crates/ruff_linter/src/rules/eradicate/snapshots/ruff_linter__rules__eradicate__tests__ERA001_ERA001.py.snap +++ b/crates/ruff_linter/src/rules/eradicate/snapshots/ruff_linter__rules__eradicate__tests__ERA001_ERA001.py.snap @@ -93,7 +93,6 @@ ERA001 [*] Found commented-out code 20 | pass 21 | # b = c | ^^^^^^^ - | help: Remove commented-out code | 20 | pass @@ -250,7 +249,6 @@ ERA001 [*] Found commented-out code 37 | # except Foo: 38 | # except Exception as e: print(e) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove commented-out code | 37 | # except Foo: diff --git a/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT102_YTT102.py.snap b/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT102_YTT102.py.snap index 24afa44e3559df..89b34e0745ee85 100644 --- a/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT102_YTT102.py.snap +++ b/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT102_YTT102.py.snap @@ -17,4 +17,3 @@ YTT102 `sys.version[2]` referenced (python3.10), use `sys.version_info` 4 | py_minor = sys.version[2] 5 | py_minor = version[2] | ^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT103_YTT103.py.snap b/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT103_YTT103.py.snap index 356e19d247868e..5af38635a246e4 100644 --- a/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT103_YTT103.py.snap +++ b/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT103_YTT103.py.snap @@ -50,4 +50,3 @@ YTT103 `sys.version` compared to string (python3.10), use `sys.version_info` 7 | sys.version > "3.5" 8 | sys.version >= "3.5" | ^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT201_YTT201.py.snap b/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT201_YTT201.py.snap index 1bf91d93d876f5..6a3ecc6d8a0355 100644 --- a/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT201_YTT201.py.snap +++ b/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT201_YTT201.py.snap @@ -39,4 +39,3 @@ YTT201 `sys.version_info[0] != 3` referenced (python4), use `<` 9 | PY2 = sys.version_info[0] != 3 10 | PY2 = version_info[0] != 3 | ^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT203_YTT203.py.snap b/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT203_YTT203.py.snap index 564a40092fda9c..606aefb5395ed3 100644 --- a/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT203_YTT203.py.snap +++ b/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT203_YTT203.py.snap @@ -17,4 +17,3 @@ YTT203 `sys.version_info[1]` compared to integer (python4), compare `sys.version 4 | sys.version_info[1] >= 5 5 | version_info[1] < 6 | ^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT204_YTT204.py.snap b/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT204_YTT204.py.snap index 3d8deee9a683fd..cfba92d37836b2 100644 --- a/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT204_YTT204.py.snap +++ b/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT204_YTT204.py.snap @@ -17,4 +17,3 @@ YTT204 `sys.version_info.minor` compared to integer (python4), compare `sys.vers 4 | sys.version_info.minor <= 7 5 | version_info.minor > 8 | ^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT301_YTT301.py.snap b/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT301_YTT301.py.snap index d22cefefaab2f5..1f3681415e8207 100644 --- a/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT301_YTT301.py.snap +++ b/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT301_YTT301.py.snap @@ -17,4 +17,3 @@ YTT301 `sys.version[0]` referenced (python10), use `sys.version_info` 4 | py_major = sys.version[0] 5 | py_major = version[0] | ^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT302_YTT302.py.snap b/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT302_YTT302.py.snap index a6d0a052938208..17e39fdd93c9ed 100644 --- a/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT302_YTT302.py.snap +++ b/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT302_YTT302.py.snap @@ -50,4 +50,3 @@ YTT302 `sys.version` compared to string (python10), use `sys.version_info` 7 | sys.version > "3" 8 | sys.version >= "3" | ^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT303_YTT303.py.snap b/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT303_YTT303.py.snap index 187ac8f9feb3a5..c2a58a0035ffbe 100644 --- a/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT303_YTT303.py.snap +++ b/crates/ruff_linter/src/rules/flake8_2020/snapshots/ruff_linter__rules__flake8_2020__tests__YTT303_YTT303.py.snap @@ -17,4 +17,3 @@ YTT303 `sys.version[:1]` referenced (python10), use `sys.version_info` 4 | print(sys.version[:1]) 5 | print(version[:1]) | ^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_annotations/snapshots/ruff_linter__rules__flake8_annotations__tests__defaults.snap b/crates/ruff_linter/src/rules/flake8_annotations/snapshots/ruff_linter__rules__flake8_annotations__tests__defaults.snap index 58fce6fc829be5..d4d3b4e9bbefe4 100644 --- a/crates/ruff_linter/src/rules/flake8_annotations/snapshots/ruff_linter__rules__flake8_annotations__tests__defaults.snap +++ b/crates/ruff_linter/src/rules/flake8_annotations/snapshots/ruff_linter__rules__flake8_annotations__tests__defaults.snap @@ -273,7 +273,6 @@ ANN401 Dynamically typed expressions (typing.Any) are disallowed in `a` 153 | def f(a: Annotated[Any, ...]) -> None: ... 154 | def f(a: "Union[str, bytes, Any]") -> None: ... | ^^^^^^^^^^^^^^^^^^^^^^^^ - | ANN204 [*] Missing return type annotation for special method `__init__` --> annotation_presence.py:159:9 @@ -318,7 +317,6 @@ ANN201 [*] Missing return type annotation for public function `quoted_escape` 171 | # should not cause a stack overflow. 172 | def quoted_escape(x: "'in\x74'"): pass | ^^^^^^^^^^^^^ - | help: Add return type annotation: `None` | 171 | # should not cause a stack overflow. @@ -334,4 +332,3 @@ ANN401 Dynamically typed expressions (typing.Any) are disallowed in `x` 171 | # should not cause a stack overflow. 172 | def quoted_escape(x: "'in\x74'"): pass | ^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC100_ASYNC100.py.snap b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC100_ASYNC100.py.snap index 8f5fac5cbcb909..0a756ec575c3d5 100644 --- a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC100_ASYNC100.py.snap +++ b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC100_ASYNC100.py.snap @@ -8,7 +8,6 @@ ASYNC100 A `with trio.fail_after(...):` context does not contain any `await` sta 8 | / with trio.fail_after(): 9 | | ... | |___________^ - | ASYNC100 A `with trio.move_on_after(...):` context does not contain any `await` statements. This makes it pointless, as the timeout can only be triggered by a checkpoint. --> ASYNC100.py:18:5 @@ -17,7 +16,6 @@ ASYNC100 A `with trio.move_on_after(...):` context does not contain any `await` 18 | / with trio.move_on_after(): 19 | | ... | |___________^ - | ASYNC100 A `with anyio.move_on_after(...):` context does not contain any `await` statements. This makes it pointless, as the timeout can only be triggered by a checkpoint. --> ASYNC100.py:45:5 @@ -26,7 +24,6 @@ ASYNC100 A `with anyio.move_on_after(...):` context does not contain any `await` 45 | / with anyio.move_on_after(delay=0.2): 46 | | ... | |___________^ - | ASYNC100 A `with anyio.fail_after(...):` context does not contain any `await` statements. This makes it pointless, as the timeout can only be triggered by a checkpoint. --> ASYNC100.py:50:5 @@ -35,7 +32,6 @@ ASYNC100 A `with anyio.fail_after(...):` context does not contain any `await` st 50 | / with anyio.fail_after(): 51 | | ... | |___________^ - | ASYNC100 A `with anyio.CancelScope(...):` context does not contain any `await` statements. This makes it pointless, as the timeout can only be triggered by a checkpoint. --> ASYNC100.py:55:5 @@ -44,7 +40,6 @@ ASYNC100 A `with anyio.CancelScope(...):` context does not contain any `await` s 55 | / with anyio.CancelScope(): 56 | | ... | |___________^ - | ASYNC100 A `with anyio.CancelScope(...):` context does not contain any `await` statements. This makes it pointless, as the timeout can only be triggered by a checkpoint. --> ASYNC100.py:60:5 @@ -53,7 +48,6 @@ ASYNC100 A `with anyio.CancelScope(...):` context does not contain any `await` s 60 | / with anyio.CancelScope(), nullcontext(): 61 | | ... | |___________^ - | ASYNC100 A `with anyio.CancelScope(...):` context does not contain any `await` statements. This makes it pointless, as the timeout can only be triggered by a checkpoint. --> ASYNC100.py:65:5 @@ -62,7 +56,6 @@ ASYNC100 A `with anyio.CancelScope(...):` context does not contain any `await` s 65 | / with nullcontext(), anyio.CancelScope(): 66 | | ... | |___________^ - | ASYNC100 A `with asyncio.timeout(...):` context does not contain any `await` statements. This makes it pointless, as the timeout can only be triggered by a checkpoint. --> ASYNC100.py:70:5 @@ -71,7 +64,6 @@ ASYNC100 A `with asyncio.timeout(...):` context does not contain any `await` sta 70 | / async with asyncio.timeout(delay=0.2): 71 | | ... | |___________^ - | ASYNC100 A `with asyncio.timeout_at(...):` context does not contain any `await` statements. This makes it pointless, as the timeout can only be triggered by a checkpoint. --> ASYNC100.py:75:5 @@ -80,7 +72,6 @@ ASYNC100 A `with asyncio.timeout_at(...):` context does not contain any `await` 75 | / async with asyncio.timeout_at(when=0.2): 76 | | ... | |___________^ - | ASYNC100 A `with asyncio.timeout(...):` context does not contain any `await` statements. This makes it pointless, as the timeout can only be triggered by a checkpoint. --> ASYNC100.py:85:5 @@ -89,7 +80,6 @@ ASYNC100 A `with asyncio.timeout(...):` context does not contain any `await` sta 85 | / async with asyncio.timeout(delay=0.2), asyncio.TaskGroup(), asyncio.timeout(delay=0.2): 86 | | ... | |___________^ - | ASYNC100 A `with asyncio.timeout(...):` context does not contain any `await` statements. This makes it pointless, as the timeout can only be triggered by a checkpoint. --> ASYNC100.py:95:5 @@ -98,4 +88,3 @@ ASYNC100 A `with asyncio.timeout(...):` context does not contain any `await` sta 95 | / async with asyncio.timeout(delay=0.2), asyncio.timeout(delay=0.2): 96 | | ... | |___________^ - | diff --git a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC105_ASYNC105.py.snap b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC105_ASYNC105.py.snap index a0a9a20655892f..4e28a6e8bf883f 100644 --- a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC105_ASYNC105.py.snap +++ b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC105_ASYNC105.py.snap @@ -461,5 +461,4 @@ ASYNC105 Call to `trio.open_file` is not immediately awaited 63 | # ASYNC105 (without fix) 64 | trio.open_file(foo) | ^^^^^^^^^^^^^^^^^^^ - | help: Add `await` diff --git a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC109_0.py.snap b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC109_0.py.snap index 8b29154e502606..1c94fe23c08100 100644 --- a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC109_0.py.snap +++ b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC109_0.py.snap @@ -26,5 +26,4 @@ ASYNC109 Async function definition with a `timeout` parameter 19 | @abstractmethod 20 | async def foo(self, timeout: float): ... | ^^^^^^^^^^^^^^ - | help: Use `trio.fail_after` instead diff --git a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC109_ASYNC109_0.py.snap b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC109_ASYNC109_0.py.snap index 8b29154e502606..1c94fe23c08100 100644 --- a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC109_ASYNC109_0.py.snap +++ b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC109_ASYNC109_0.py.snap @@ -26,5 +26,4 @@ ASYNC109 Async function definition with a `timeout` parameter 19 | @abstractmethod 20 | async def foo(self, timeout: float): ... | ^^^^^^^^^^^^^^ - | help: Use `trio.fail_after` instead diff --git a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC110_ASYNC110.py.snap b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC110_ASYNC110.py.snap index 97f6df299d44db..061bbe300bc25b 100644 --- a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC110_ASYNC110.py.snap +++ b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC110_ASYNC110.py.snap @@ -8,7 +8,6 @@ ASYNC110 Use `trio.Event` instead of awaiting `trio.sleep` in a `while` loop 7 | / while True: 8 | | await trio.sleep(10) | |____________________________^ - | ASYNC110 Use `trio.Event` instead of awaiting `trio.sleep` in a `while` loop --> ASYNC110.py:12:5 @@ -17,7 +16,6 @@ ASYNC110 Use `trio.Event` instead of awaiting `trio.sleep` in a `while` loop 12 | / while True: 13 | | await trio.sleep_until(10) | |__________________________________^ - | ASYNC110 Use `anyio.Event` instead of awaiting `anyio.sleep` in a `while` loop --> ASYNC110.py:22:5 @@ -26,7 +24,6 @@ ASYNC110 Use `anyio.Event` instead of awaiting `anyio.sleep` in a `while` loop 22 | / while True: 23 | | await anyio.sleep(10) | |_____________________________^ - | ASYNC110 Use `anyio.Event` instead of awaiting `anyio.sleep` in a `while` loop --> ASYNC110.py:27:5 @@ -35,7 +32,6 @@ ASYNC110 Use `anyio.Event` instead of awaiting `anyio.sleep` in a `while` loop 27 | / while True: 28 | | await anyio.sleep_until(10) | |___________________________________^ - | ASYNC110 Use `asyncio.Event` instead of awaiting `asyncio.sleep` in a `while` loop --> ASYNC110.py:37:5 @@ -44,4 +40,3 @@ ASYNC110 Use `asyncio.Event` instead of awaiting `asyncio.sleep` in a `while` lo 37 | / while True: 38 | | await asyncio.sleep(10) | |_______________________________^ - | diff --git a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC115_ASYNC115.py.snap b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC115_ASYNC115.py.snap index 0ff58487866b37..539627b95dee7e 100644 --- a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC115_ASYNC115.py.snap +++ b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC115_ASYNC115.py.snap @@ -72,7 +72,6 @@ ASYNC115 [*] Use `trio.lowlevel.checkpoint()` instead of `trio.sleep(0)` 47 | 48 | trio.run(trio.sleep(0)) # ASYNC115 | ^^^^^^^^^^^^^ - | help: Replace with `trio.lowlevel.checkpoint()` | 1 + import trio.lowlevel @@ -90,7 +89,6 @@ ASYNC115 [*] Use `trio.lowlevel.checkpoint()` instead of `trio.sleep(0)` 54 | def func(): 55 | sleep(0) # ASYNC115 | ^^^^^^^^ - | help: Replace with `trio.lowlevel.checkpoint()` | 51 | from trio import Event, sleep @@ -109,7 +107,6 @@ ASYNC115 [*] Use `trio.lowlevel.checkpoint()` instead of `trio.sleep(0)` 58 | async def func(): 59 | await sleep(seconds=0) # ASYNC115 | ^^^^^^^^^^^^^^^^ - | help: Replace with `trio.lowlevel.checkpoint()` | 51 | from trio import Event, sleep @@ -195,7 +192,6 @@ ASYNC115 [*] Use `anyio.lowlevel.checkpoint()` instead of `anyio.sleep(0)` 127 | 128 | anyio.run(anyio.sleep(0)) # ASYNC115 | ^^^^^^^^^^^^^^ - | help: Replace with `anyio.lowlevel.checkpoint()` | 51 | from trio import Event, sleep @@ -284,7 +280,6 @@ ASYNC115 [*] Use `anyio.lowlevel.checkpoint()` instead of `anyio.sleep(0)` 187 | 188 | await anyio_sleep(0) # ASYNC115 | ^^^^^^^^^^^^^^ - | help: Replace with `anyio.lowlevel.checkpoint()` | 51 | from trio import Event, sleep diff --git a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC116_ASYNC116.py.snap b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC116_ASYNC116.py.snap index a0db966c62f51d..12ebd5ca0eeb23 100644 --- a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC116_ASYNC116.py.snap +++ b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC116_ASYNC116.py.snap @@ -99,7 +99,6 @@ ASYNC116 [*] `trio.sleep()` with >24 hour interval should usually be `trio.sleep 49 | # also checks that we don't break visit_Call 50 | trio.run(trio.sleep(86401)) # error: 116, "async" | ^^^^^^^^^^^^^^^^^ - | help: Replace with `trio.sleep_forever()` | 49 | # also checks that we don't break visit_Call @@ -115,7 +114,6 @@ ASYNC116 [*] `trio.sleep()` with >24 hour interval should usually be `trio.sleep 56 | # catch from import 57 | await sleep(86401) # error: 116, "async" | ^^^^^^^^^^^^ - | help: Replace with `trio.sleep_forever()` | 4 | from math import inf @@ -227,7 +225,6 @@ ASYNC116 [*] `anyio.sleep()` with >24 hour interval should usually be `anyio.sle 102 | # also checks that we don't break visit_Call 103 | anyio.run(anyio.sleep(86401)) # error: 116, "async" | ^^^^^^^^^^^^^^^^^^ - | help: Replace with `anyio.sleep_forever()` | 102 | # also checks that we don't break visit_Call @@ -243,7 +240,6 @@ ASYNC116 [*] `anyio.sleep()` with >24 hour interval should usually be `anyio.sle 109 | # catch from import 110 | await sleep(86401) # error: 116, "async" | ^^^^^^^^^^^^ - | help: Replace with `anyio.sleep_forever()` | 4 | from math import inf @@ -317,7 +313,6 @@ ASYNC116 [*] `trio.sleep()` with >24 hour interval should usually be `trio.sleep 137 | await sleep(18446744073709551616) 138 | await trio.sleep(99999999999999999999) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `trio.sleep_forever()` | 137 | await sleep(18446744073709551616) diff --git a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC119_ASYNC119.py.snap b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC119_ASYNC119.py.snap index 46652b36e73bb1..b1702f85540944 100644 --- a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC119_ASYNC119.py.snap +++ b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC119_ASYNC119.py.snap @@ -8,7 +8,6 @@ ASYNC119 Yield in context manager in async generator may not trigger cleanup 13 | with open(""): 14 | yield # ASYNC119 | ^^^^^ - | help: Use `@asynccontextmanager` if appropriate, or refactor ASYNC119 Yield in context manager in async generator may not trigger cleanup @@ -18,7 +17,6 @@ ASYNC119 Yield in context manager in async generator may not trigger cleanup 18 | async with open(""): 19 | yield # ASYNC119 | ^^^^^ - | help: Use `@asynccontextmanager` if appropriate, or refactor ASYNC119 Yield in context manager in async generator may not trigger cleanup @@ -63,7 +61,6 @@ ASYNC119 Yield in context manager in async generator may not trigger cleanup 27 | yield # ASYNC119 28 | yield # ASYNC119 | ^^^^^ - | help: Use `@asynccontextmanager` if appropriate, or refactor ASYNC119 Yield in context manager in async generator may not trigger cleanup @@ -73,7 +70,6 @@ ASYNC119 Yield in context manager in async generator may not trigger cleanup 33 | with open(""): 34 | yield # ASYNC119 | ^^^^^ - | help: Use `@asynccontextmanager` if appropriate, or refactor ASYNC119 Yield in context manager in async generator may not trigger cleanup @@ -83,5 +79,4 @@ ASYNC119 Yield in context manager in async generator may not trigger cleanup 61 | yield 62 | yield # ASYNC119 | ^^^^^ - | help: Use `@asynccontextmanager` if appropriate, or refactor diff --git a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC210_ASYNC210.py.snap b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC210_ASYNC210.py.snap index 6082f3dacac168..1ec055a0f46305 100644 --- a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC210_ASYNC210.py.snap +++ b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC210_ASYNC210.py.snap @@ -7,7 +7,6 @@ ASYNC210 Async functions should not call blocking HTTP methods 7 | async def foo(): 8 | urllib.request.urlopen("http://example.com/foo/bar").read() # ASYNC210 | ^^^^^^^^^^^^^^^^^^^^^^ - | ASYNC210 Async functions should not call blocking HTTP methods --> ASYNC210.py:12:5 @@ -15,7 +14,6 @@ ASYNC210 Async functions should not call blocking HTTP methods 11 | async def foo(): 12 | requests.get() # ASYNC210 | ^^^^^^^^^^^^ - | ASYNC210 Async functions should not call blocking HTTP methods --> ASYNC210.py:16:5 @@ -23,7 +21,6 @@ ASYNC210 Async functions should not call blocking HTTP methods 15 | async def foo(): 16 | httpx.get() # ASYNC210 | ^^^^^^^^^ - | ASYNC210 Async functions should not call blocking HTTP methods --> ASYNC210.py:20:5 @@ -31,7 +28,6 @@ ASYNC210 Async functions should not call blocking HTTP methods 19 | async def foo(): 20 | requests.post() # ASYNC210 | ^^^^^^^^^^^^^ - | ASYNC210 Async functions should not call blocking HTTP methods --> ASYNC210.py:24:5 @@ -39,7 +35,6 @@ ASYNC210 Async functions should not call blocking HTTP methods 23 | async def foo(): 24 | httpx.post() # ASYNC210 | ^^^^^^^^^^ - | ASYNC210 Async functions should not call blocking HTTP methods --> ASYNC210.py:28:5 diff --git a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC221_ASYNC22x.py.snap b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC221_ASYNC22x.py.snap index 1a3756bca5c959..8cd50a77e4f2ef 100644 --- a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC221_ASYNC22x.py.snap +++ b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC221_ASYNC22x.py.snap @@ -7,7 +7,6 @@ ASYNC221 Async functions should not run processes with blocking methods 7 | async def func(): 8 | subprocess.run("foo") # ASYNC221 | ^^^^^^^^^^^^^^ - | ASYNC221 Async functions should not run processes with blocking methods --> ASYNC22x.py:12:5 @@ -15,7 +14,6 @@ ASYNC221 Async functions should not run processes with blocking methods 11 | async def func(): 12 | subprocess.call("foo") # ASYNC221 | ^^^^^^^^^^^^^^^ - | ASYNC221 Async functions should not run processes with blocking methods --> ASYNC22x.py:29:9 diff --git a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC222_ASYNC22x.py.snap b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC222_ASYNC22x.py.snap index 13e4a52a623a91..235ff6f93c4e73 100644 --- a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC222_ASYNC22x.py.snap +++ b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC222_ASYNC22x.py.snap @@ -7,7 +7,6 @@ ASYNC222 Async functions should not wait on processes with blocking methods 19 | async def func(): 20 | os.wait4(10) # ASYNC222 | ^^^^^^^^ - | ASYNC222 Async functions should not wait on processes with blocking methods --> ASYNC22x.py:24:5 @@ -15,7 +14,6 @@ ASYNC222 Async functions should not wait on processes with blocking methods 23 | async def func(): 24 | os.wait(12) # ASYNC222 | ^^^^^^^ - | ASYNC222 Async functions should not wait on processes with blocking methods --> ASYNC22x.py:91:5 diff --git a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC230_ASYNC230.py.snap b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC230_ASYNC230.py.snap index 912a451a2bccf0..90fc269994c22c 100644 --- a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC230_ASYNC230.py.snap +++ b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC230_ASYNC230.py.snap @@ -67,7 +67,6 @@ ASYNC230 Async functions should not open files with blocking methods like `open` 28 | async def func(): 29 | open("foo") # ASYNC230 | ^^^^ - | ASYNC230 Async functions should not open files with blocking methods like `open` --> ASYNC230.py:36:5 @@ -75,7 +74,6 @@ ASYNC230 Async functions should not open files with blocking methods like `open` 35 | async def func(): 36 | Path("foo").open() # ASYNC230 | ^^^^^^^^^^^^^^^^ - | ASYNC230 Async functions should not open files with blocking methods like `open` --> ASYNC230.py:41:5 @@ -84,7 +82,6 @@ ASYNC230 Async functions should not open files with blocking methods like `open` 40 | p = Path("foo") 41 | p.open() # ASYNC230 | ^^^^^^ - | ASYNC230 Async functions should not open files with blocking methods like `open` --> ASYNC230.py:45:10 @@ -101,7 +98,6 @@ ASYNC230 Async functions should not open files with blocking methods like `open` 52 | async def bar(): 53 | p.open() # ASYNC230 | ^^^^^^ - | ASYNC230 Async functions should not open files with blocking methods like `open` --> ASYNC230.py:59:5 @@ -110,4 +106,3 @@ ASYNC230 Async functions should not open files with blocking methods like `open` 58 | 59 | p1.open() # ASYNC230 | ^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC240_ASYNC240.py.snap b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC240_ASYNC240.py.snap index 888905aed7f108..18bcfd35b2f4df 100644 --- a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC240_ASYNC240.py.snap +++ b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC240_ASYNC240.py.snap @@ -108,4 +108,3 @@ ASYNC240 Async functions should not use pathlib.Path methods, use trio.Path or a 101 | async def path_as_optional_parameter_type(path: Optional[Path]): 102 | path.exists() # ASYNC240 | ^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC250_ASYNC250.py.snap b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC250_ASYNC250.py.snap index 22deadaa6ce330..1056f3f9942fbf 100644 --- a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC250_ASYNC250.py.snap +++ b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC250_ASYNC250.py.snap @@ -17,7 +17,6 @@ ASYNC250 Blocking call to `input()` in async context 7 | k = input() # ASYNC250 8 | input("hello world") # ASYNC250 | ^^^^^ - | ASYNC250 Blocking call to `input()` in async context --> ASYNC250.py:21:5 diff --git a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC251_ASYNC251.py.snap b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC251_ASYNC251.py.snap index bc6ec0e246fe23..e76297dece40ae 100644 --- a/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC251_ASYNC251.py.snap +++ b/crates/ruff_linter/src/rules/flake8_async/snapshots/ruff_linter__rules__flake8_async__tests__ASYNC251_ASYNC251.py.snap @@ -7,4 +7,3 @@ ASYNC251 Async functions should not call `time.sleep` 5 | async def func(): 6 | time.sleep(1) # ASYNC251 | ^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S101_S101.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S101_S101.py.snap index 8a600103fdd167..0884d95a1ffb5a 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S101_S101.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S101_S101.py.snap @@ -6,7 +6,6 @@ S101 Use of `assert` detected | 1 | assert True # S101 | ^^^^^^ - | S101 Use of `assert` detected --> S101.py:6:5 @@ -25,4 +24,3 @@ S101 Use of `assert` detected 6 | assert x == 1 # S101 7 | assert x == 2 # S101 | ^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S102_S102.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S102_S102.py.snap index d424ab93571e50..9f4a931efc97ec 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S102_S102.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S102_S102.py.snap @@ -19,7 +19,6 @@ S102 Use of `exec` detected 4 | 5 | exec('y = 3') | ^^^^ - | S102 Use of `exec` detected --> S102.py:11:5 diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S103_S103.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S103_S103.py.snap index a217da9e19e491..731df200a5e806 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S103_S103.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S103_S103.py.snap @@ -160,7 +160,6 @@ S103 `os.chmod` setting a permissive mask `0o11` on file or directory 26 | os.chmod("/etc/secrets.txt", 0o21) # OK (stable); Error (preview, S_IWGRP) 27 | os.chmod("/etc/secrets.txt", 0o11) # Error (S_IXGRP) | ^^^^ - | S103 `os.chmod` setting a permissive mask `0o777` on file or directory --> S103.py:31:20 diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S104_S104.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S104_S104.py.snap index a34d2044229b82..cd1fd2a77fee2a 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S104_S104.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S104_S104.py.snap @@ -28,7 +28,6 @@ S104 Possible binding to all interfaces 10 | '0.0.0.0' 11 | f"0.0.0.0" | ^^^^^^^ - | S104 Possible binding to all interfaces --> S104.py:15:6 @@ -36,7 +35,6 @@ S104 Possible binding to all interfaces 14 | # Error 15 | func("0.0.0.0") | ^^^^^^^^^ - | S104 Possible binding to all interfaces --> S104.py:19:9 diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S105_S105.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S105_S105.py.snap index fe9c896f664aef..d6544fc3086b61 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S105_S105.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S105_S105.py.snap @@ -235,7 +235,6 @@ S105 Possible hardcoded password assigned to: "password" 34 | safe = d["password"] = "s3cr3t" 35 | d["password"] = safe = "s3cr3t" | ^^^^^^^^ - | S105 Possible hardcoded password assigned to: "password" --> S105.py:39:16 diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S106_S106.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S106_S106.py.snap index 3550dbb83a2e06..27cee818ca19bf 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S106_S106.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S106_S106.py.snap @@ -7,4 +7,3 @@ S106 Possible hardcoded password assigned to argument: "password" 13 | # Error 14 | func(1, password="s3cr3t") | ^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S110_typed.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S110_typed.snap index 948db1015bd8f6..3182e577b95396 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S110_typed.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S110_typed.snap @@ -33,4 +33,3 @@ S110 `try`-`except`-`pass` detected, consider logging the exception 13 | / except ValueError: 14 | | pass | |________^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S301_S301.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S301_S301.py.snap index c15dd78222f68d..dd86139e39de71 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S301_S301.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S301_S301.py.snap @@ -8,4 +8,3 @@ S301 `pickle` and modules that wrap it can be unsafe when used to deserialize un 2 | 3 | pickle.loads() | ^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S307_S307.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S307_S307.py.snap index 2c79297a12a900..068a011b320946 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S307_S307.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S307_S307.py.snap @@ -17,4 +17,3 @@ S307 Use of possibly insecure function; consider using `ast.literal_eval` 3 | print(eval("1+1")) # S307 4 | print(eval("os.getcwd()")) # S307 | ^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S310_S310.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S310_S310.py.snap index 4a4b61876e9167..7f379b537e9aee 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S310_S310.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S310_S310.py.snap @@ -244,7 +244,6 @@ S310 Audit URL open for permitted schemes. Allowing use of `file:` or custom sch 41 | urllib.request.urlopen(urllib.request.Request('file:///foo/bar/baz')) 42 | urllib.request.urlopen(urllib.request.Request(url)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | S310 Audit URL open for permitted schemes. Allowing use of `file:` or custom schemes is often unexpected. --> S310.py:42:24 @@ -253,4 +252,3 @@ S310 Audit URL open for permitted schemes. Allowing use of `file:` or custom sch 41 | urllib.request.urlopen(urllib.request.Request('file:///foo/bar/baz')) 42 | urllib.request.urlopen(urllib.request.Request(url)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S312_S312.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S312_S312.py.snap index f585796d40bca5..634487e36159f4 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S312_S312.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S312_S312.py.snap @@ -8,7 +8,6 @@ S312 Telnet is considered insecure. Use SSH or some other encrypted protocol. 2 | 3 | Telnet("localhost", 23) | ^^^^^^^^^^^^^^^^^^^^^^^ - | S312 Telnet is considered insecure. Use SSH or some other encrypted protocol. --> S312.py:14:24 diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S401_S401.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S401_S401.py.snap index ab44b4f7613cd0..d354574b27dd3a 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S401_S401.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S401_S401.py.snap @@ -15,4 +15,3 @@ S401 `telnetlib` and related modules are considered insecure. Use SSH or another 1 | import telnetlib # S401 2 | from telnetlib import Telnet # S401 | ^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S402_S402.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S402_S402.py.snap index a264f60e5f5dfa..713d42c33de2ac 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S402_S402.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S402_S402.py.snap @@ -15,4 +15,3 @@ S402 `ftplib` and related modules are considered insecure. Use SSH, SFTP, SCP, o 1 | import ftplib # S402 2 | from ftplib import FTP # S402 | ^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S403_S403.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S403_S403.py.snap index bb3e712c16a1f7..d4c3c18c09b77e 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S403_S403.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S403_S403.py.snap @@ -81,4 +81,3 @@ S403 `pickle`, `cPickle`, `dill`, and `shelve` modules are possibly insecure 7 | import pickle 8 | from pickle import load | ^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S404_S404.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S404_S404.py.snap index 26db33929dd821..7e82800657ddcb 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S404_S404.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S404_S404.py.snap @@ -26,4 +26,3 @@ S404 `subprocess` module is possibly insecure 2 | from subprocess import Popen # S404 3 | from subprocess import Popen as pop # S404 | ^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S405_S405.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S405_S405.py.snap index 8589ad87fe04fb..eb2aba7dfa1164 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S405_S405.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S405_S405.py.snap @@ -37,4 +37,3 @@ S405 `xml.etree` methods are vulnerable to XML attacks 3 | import xml.etree.ElementTree # S405 4 | from xml.etree import ElementTree # S405 | ^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S406_S406.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S406_S406.py.snap index 4935a4a3211d50..d14ac50f3dbe7a 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S406_S406.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S406_S406.py.snap @@ -26,4 +26,3 @@ S406 `xml.sax` methods are vulnerable to XML attacks 2 | import xml.sax as xmls # S406 3 | import xml.sax # S406 | ^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S407_S407.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S407_S407.py.snap index f9d67dfe4a0282..a260225e41b6ec 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S407_S407.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S407_S407.py.snap @@ -15,4 +15,3 @@ S407 `xml.dom.expatbuilder` is vulnerable to XML attacks 1 | from xml.dom import expatbuilder # S407 2 | import xml.dom.expatbuilder # S407 | ^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S408_S408.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S408_S408.py.snap index d88a35b98735e1..9fcdc20834d325 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S408_S408.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S408_S408.py.snap @@ -15,4 +15,3 @@ S408 `xml.dom.minidom` is vulnerable to XML attacks 1 | from xml.dom.minidom import parseString # S408 2 | import xml.dom.minidom # S408 | ^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S409_S409.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S409_S409.py.snap index f6333d760f9b9f..efac83bfe7be4e 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S409_S409.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S409_S409.py.snap @@ -15,4 +15,3 @@ S409 `xml.dom.pulldom` is vulnerable to XML attacks 1 | from xml.dom.pulldom import parseString # S409 2 | import xml.dom.pulldom # S409 | ^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S410_S410.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S410_S410.py.snap index f2bbac41cf63d1..1f7d208746d6b9 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S410_S410.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S410_S410.py.snap @@ -15,4 +15,3 @@ S410 `lxml` is vulnerable to XML attacks 1 | import lxml # S410 2 | from lxml import etree # S410 | ^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S411_S411.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S411_S411.py.snap index 117d693b21c01c..58bc452deafef1 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S411_S411.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S411_S411.py.snap @@ -15,4 +15,3 @@ S411 XMLRPC is vulnerable to remote XML attacks 1 | import xmlrpc # S411 2 | from xmlrpc import server # S411 | ^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S412_S412.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S412_S412.py.snap index 8fc83605573d61..82b2d894bce9be 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S412_S412.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S412_S412.py.snap @@ -6,4 +6,3 @@ S412 `httpoxy` is a set of vulnerabilities that affect application code running | 1 | from twisted.web.twcgi import CGIScript # S412 | ^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S413_S413.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S413_S413.py.snap index ace5f2b1b26da1..9c7b5e69618f6a 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S413_S413.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S413_S413.py.snap @@ -37,4 +37,3 @@ S413 `pycrypto` library is known to have publicly disclosed buffer overflow vuln 3 | import Crypto.PublicKey # S413 4 | from Crypto.PublicKey import RSA # S413 | ^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S415_S415.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S415_S415.py.snap index dd5ea30bb3a703..6f2c905efe50ef 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S415_S415.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S415_S415.py.snap @@ -15,4 +15,3 @@ S415 An IPMI-related module is being imported. Prefer an encrypted protocol over 1 | import pyghmi # S415 2 | from pyghmi import foo # S415 | ^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S501_S501.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S501_S501.py.snap index 52cd11ea34ff19..187c548702ffc8 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S501_S501.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S501_S501.py.snap @@ -204,4 +204,3 @@ S501 Probable use of `httpx` call with `verify=False` disabling SSL certificate 41 | httpx.AsyncClient() 42 | httpx.AsyncClient(verify=False) | ^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S506_S506.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S506_S506.py.snap index 302026e370c45d..7259e157c49bcf 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S506_S506.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S506_S506.py.snap @@ -93,4 +93,3 @@ S506 Probable use of unsafe loader `CBaseLoader` with `yaml.load`. Allows instan 49 | from yaml.cyaml import CBaseLoader 50 | yaml.load("{}", Loader=CBaseLoader) | ^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S601_S601.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S601_S601.py.snap index bd0d6b4e13f042..1da4d5f16a6aa3 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S601_S601.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S601_S601.py.snap @@ -8,4 +8,3 @@ S601 Possible shell injection via Paramiko call; check inputs are properly sanit 2 | 3 | paramiko.exec_command('something; really; unsafe') | ^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S602_S602.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S602_S602.py.snap index 4115627c2d4c61..0e362b25446e27 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S602_S602.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S602_S602.py.snap @@ -167,4 +167,3 @@ S602 `subprocess` call with truthy `shell` seems safe, but may be changed in the 41 | x = 1 42 | Popen("true", shell=f"{x=}") | ^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S603_S603.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S603_S603.py.snap index 586ccb21b9fe11..3a18d7ed5c1256 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S603_S603.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S603_S603.py.snap @@ -135,4 +135,3 @@ S603 `subprocess` call: check for execution of untrusted input 40 | (e := "echo") 41 | run(e) | ^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S604_S604.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S604_S604.py.snap index 798e916ba6bfa4..e31ad1885b32e5 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S604_S604.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S604_S604.py.snap @@ -90,4 +90,3 @@ S604 Function call with truthy `shell` parameter identified, security issue 23 | x = 1 24 | foo(shell=f"{x=}") | ^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S605_S605.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S605_S605.py.snap index 61d315bcbacf43..86caca420b207a 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S605_S605.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S605_S605.py.snap @@ -149,7 +149,6 @@ S605 Starting a process with a shell: seems safe, but may be changed in the futu 20 | subprocess.getoutput("true") 21 | subprocess.getstatusoutput("true") | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | S605 Starting a process with a shell, possible injection detected --> S605.py:26:1 @@ -179,4 +178,3 @@ S605 Starting a process with a shell, possible injection detected 27 | os.system([var_string]) 28 | os.system([var_string, ""]) | ^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S606_S606.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S606_S606.py.snap index 17361ece3fc240..37d7204219c061 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S606_S606.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S606_S606.py.snap @@ -182,4 +182,3 @@ S606 Starting a process without a shell 19 | os.spawnvpe("true") 20 | os.startfile("true") | ^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S607_S607.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S607_S607.py.snap index 07984c590e8a6a..81e9d495694649 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S607_S607.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S607_S607.py.snap @@ -249,4 +249,3 @@ S607 Starting a process with a partial executable path 48 | import subprocess 49 | subprocess.run(("echo", "foo")) | ^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S609_S609.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S609_S609.py.snap index 07c3f3b97005fa..d93f427178850e 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S609_S609.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S609_S609.py.snap @@ -83,4 +83,3 @@ S609 Possible wildcard injection in call due to `*` usage 17 | x = 1 18 | subprocess.Popen("chmod +w foo*", shell=f"{x=}") | ^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S611_S611.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S611_S611.py.snap index 8ef3a7c3e55938..a367ef79802155 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S611_S611.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S611_S611.py.snap @@ -61,4 +61,3 @@ S611 Use of `RawSQL` can lead to SQL injection vulnerabilities 12 | User.objects.annotate(val=RawSQL(sql='{}secure'.format('no'), params=[])) 13 | User.objects.annotate(val=RawSQL(params=[], sql='{}secure'.format('no'))) | ^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S701_S701.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S701_S701.py.snap index f441488f52f7cd..9b399e0259a79c 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S701_S701.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S701_S701.py.snap @@ -51,4 +51,3 @@ S701 Using jinja2 templates with `autoescape=False` is dangerous and can lead to 28 | return 'foobar' 29 | Environment(loader=templateLoader, autoescape=fake_func()) # S701 | ^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S702_S702.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S702_S702.py.snap index ac840f237c8405..c93ec1982e75f4 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S702_S702.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S702_S702.py.snap @@ -26,4 +26,3 @@ S702 Mako templates allow HTML and JavaScript rendering by default and are inher 8 | mako.template.Template("hern") 9 | template.Template("hern") | ^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__preview__S301_S301.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__preview__S301_S301.py.snap index 6718083b32d922..705fcbce4a6c6d 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__preview__S301_S301.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__preview__S301_S301.py.snap @@ -27,4 +27,3 @@ S301 `pickle` and modules that wrap it can be unsafe when used to deserialize un 7 | map(pickle.load, []) 8 | foo = pickle.load | ^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__preview__S307_S307.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__preview__S307_S307.py.snap index 3a040f9d231f1d..ccce35d6f49f74 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__preview__S307_S307.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__preview__S307_S307.py.snap @@ -27,4 +27,3 @@ S307 Use of possibly insecure function; consider using `ast.literal_eval` 16 | map(eval, []) 17 | foo = eval | ^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__preview__S308_S308.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__preview__S308_S308.py.snap index b224ea3431849a..be65c82c1e7bbb 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__preview__S308_S308.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__preview__S308_S308.py.snap @@ -69,4 +69,3 @@ S308 Use of `mark_safe` may expose cross-site scripting vulnerabilities 42 | map(mark_safe, []) 43 | foo = mark_safe | ^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__preview__S311_S311.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__preview__S311_S311.py.snap index 8904a2523a8c63..34952d3c03bce2 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__preview__S311_S311.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__preview__S311_S311.py.snap @@ -27,4 +27,3 @@ S311 Standard pseudo-random generators are not suitable for cryptographic purpos 26 | map(random.randrange, []) 27 | foo = random.randrange | ^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__preview__S506_S506.py.snap b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__preview__S506_S506.py.snap index 1437a7b6e3295a..ef68baafe81145 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__preview__S506_S506.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__preview__S506_S506.py.snap @@ -88,4 +88,3 @@ S506 Probable use of unsafe loader `CBaseLoader` with `yaml.load`. Allows instan 49 | from yaml.cyaml import CBaseLoader 50 | yaml.load("{}", Loader=CBaseLoader) | ^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_boolean_trap/snapshots/ruff_linter__rules__flake8_boolean_trap__tests__FBT003_FBT.py.snap b/crates/ruff_linter/src/rules/flake8_boolean_trap/snapshots/ruff_linter__rules__flake8_boolean_trap__tests__FBT003_FBT.py.snap index 667df5dbbbc8aa..cb13d4d41b60a7 100644 --- a/crates/ruff_linter/src/rules/flake8_boolean_trap/snapshots/ruff_linter__rules__flake8_boolean_trap__tests__FBT003_FBT.py.snap +++ b/crates/ruff_linter/src/rules/flake8_boolean_trap/snapshots/ruff_linter__rules__flake8_boolean_trap__tests__FBT003_FBT.py.snap @@ -36,7 +36,6 @@ FBT003 Boolean positional value in function call | 123 | settings(True) | ^^^^ - | FBT003 Boolean positional value in function call --> FBT.py:147:20 @@ -65,4 +64,3 @@ FBT003 Boolean positional value in function call 158 | class Settings(BaseSettings): 159 | foo: bool = Field(True, exclude=True) | ^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_boolean_trap/snapshots/ruff_linter__rules__flake8_boolean_trap__tests__extend_allowed_callable.snap b/crates/ruff_linter/src/rules/flake8_boolean_trap/snapshots/ruff_linter__rules__flake8_boolean_trap__tests__extend_allowed_callable.snap index 135c26367df0d5..8d7b271df08f14 100644 --- a/crates/ruff_linter/src/rules/flake8_boolean_trap/snapshots/ruff_linter__rules__flake8_boolean_trap__tests__extend_allowed_callable.snap +++ b/crates/ruff_linter/src/rules/flake8_boolean_trap/snapshots/ruff_linter__rules__flake8_boolean_trap__tests__extend_allowed_callable.snap @@ -36,4 +36,3 @@ FBT003 Boolean positional value in function call | 123 | settings(True) | ^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B002_B002.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B002_B002.py.snap index 891ffb6e4fc441..d60a5fb596436d 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B002_B002.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B002_B002.py.snap @@ -27,7 +27,6 @@ B002 Python does not support the unary prefix increment operator (`++`) 23 | def this_is_buggy_too(n): 24 | return ++n, --n | ^^^ - | B002 Python does not support the unary prefix decrement operator (`--`) --> B002.py:24:17 @@ -35,4 +34,3 @@ B002 Python does not support the unary prefix decrement operator (`--`) 23 | def this_is_buggy_too(n): 24 | return ++n, --n | ^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B006_B006_5.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B006_B006_5.py.snap index 1af32ce6af62f2..018c6e39f4e9dd 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B006_B006_5.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B006_B006_5.py.snap @@ -267,7 +267,6 @@ B006 Do not use mutable data structures for argument defaults | 67 | def import_module_wrong(value: dict[str, str] = {}): import os | ^^ - | help: Replace with `None`; initialize within function B006 Do not use mutable data structures for argument defaults @@ -275,7 +274,6 @@ B006 Do not use mutable data structures for argument defaults | 70 | def import_module_wrong(value: dict[str, str] = {}): import os; import sys | ^^ - | help: Replace with `None`; initialize within function B006 Do not use mutable data structures for argument defaults diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B006_B006_B008.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B006_B006_B008.py.snap index 7bdf721a3f054c..d4e71b5232f58b 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B006_B006_B008.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B006_B006_B008.py.snap @@ -79,7 +79,6 @@ B006 Do not use mutable data structures for argument defaults 81 | 82 | def single_line_func_wrong(value = {}): ... | ^^ - | help: Replace with `None`; initialize within function B006 [*] Do not use mutable data structures for argument defaults diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B009_B009_B010.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B009_B009_B010.py.snap index f80ae80ec2d420..9ae70121a889b0 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B009_B009_B010.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B009_B009_B010.py.snap @@ -260,7 +260,6 @@ B009 [*] Do not call `getattr` with a constant attribute value. It is not any sa 34 | / getattr("foo" 35 | | "bar", "real") | |______________________^ - | help: Replace `getattr` with attribute access | 33 | getattr(x + y, "real") @@ -352,7 +351,6 @@ B009 [*] Do not call `getattr` with a constant attribute value. It is not any sa 87 | | "foo", 88 | | ) | |_^ - | help: Replace `getattr` with attribute access | 83 | diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B010_B009_B010.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B010_B009_B010.py.snap index 0a1bac254ffd31..b9036308d29f3e 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B010_B009_B010.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B010_B009_B010.py.snap @@ -114,7 +114,6 @@ B010 [*] Do not call `setattr` with a constant attribute value. It is not any sa 80 | getattr(foo, "ſ") 81 | setattr(foo, "ſ", 1) | ^^^^^^^^^^^^^^^^^^^^ - | help: Replace `setattr` with assignment | 80 | getattr(foo, "ſ") diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B011_B011.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B011_B011.py.snap index 0eed584e82c691..60c7697ffed0cb 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B011_B011.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B011_B011.py.snap @@ -26,7 +26,6 @@ B011 [*] Do not `assert False` (`python -O` removes these calls), raise `Asserti 9 | assert 1 != 2, "message" 10 | assert False, "message" | ^^^^^ - | help: Replace `assert False` | 9 | assert 1 != 2, "message" diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B012_B012.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B012_B012.py.snap index 91083d507014f7..b85072993e8e50 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B012_B012.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B012_B012.py.snap @@ -8,7 +8,6 @@ B012 `return` inside `finally` blocks cause exceptions to be silenced 4 | finally: 5 | return # warning | ^^^^^^ - | B012 `return` inside `finally` blocks cause exceptions to be silenced --> B012.py:13:13 @@ -17,7 +16,6 @@ B012 `return` inside `finally` blocks cause exceptions to be silenced 12 | if 1 + 0 == 2 - 1: 13 | return # warning | ^^^^^^ - | B012 `return` inside `finally` blocks cause exceptions to be silenced --> B012.py:21:13 @@ -81,7 +79,6 @@ B012 `return` inside `finally` blocks cause exceptions to be silenced 93 | while True: 94 | return # warning | ^^^^^^ - | B012 `continue` inside `finally` blocks cause exceptions to be silenced --> B012.py:101:9 @@ -101,7 +98,6 @@ B012 `break` inside `finally` blocks cause exceptions to be silenced 106 | finally: 107 | break # warning | ^^^^^ - | B012 `break` inside `finally` blocks cause exceptions to be silenced --> B012.py:118:17 @@ -110,4 +106,3 @@ B012 `break` inside `finally` blocks cause exceptions to be silenced 117 | case 0, *x: 118 | break # warning | ^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B015_B015.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B015_B015.py.snap index 3c63b71912e7a8..a0dbf0f3cc3bb7 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B015_B015.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B015_B015.py.snap @@ -19,7 +19,6 @@ B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `a 6 | 7 | 1 in (1, 2) | ^^^^^^^^^^^ - | B015 Pointless comparison at end of function scope. Did you mean to return the expression result? --> B015.py:17:5 @@ -28,7 +27,6 @@ B015 Pointless comparison at end of function scope. Did you mean to return the e 16 | 17 | 1 in (1, 2) | ^^^^^^^^^^^ - | B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. --> B015.py:21:5 @@ -45,4 +43,3 @@ B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `a 28 | class TestClass: 29 | 1 == 1 | ^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B017_B017_1.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B017_B017_1.py.snap index 5b0767019c2b25..3b2288b44510cd 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B017_B017_1.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B017_B017_1.py.snap @@ -18,7 +18,6 @@ B017 Do not assert blind exception: `BaseException` 20 | self.assertRaises(Exception, something_else) 21 | self.assertRaises(BaseException, something_else) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | B017 Do not assert blind exception: `Exception` --> B017_1.py:25:5 diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B018_B018.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B018_B018.py.snap index 6013b01e3f7c10..25b0c14ae2bfd9 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B018_B018.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B018_B018.py.snap @@ -106,7 +106,6 @@ B018 Found useless expression. Either assign it to a variable or remove it. 19 | {1, 2} # set 20 | {"foo": "bar"} # dict | ^^^^^^^^^^^^^^ - | B018 Found useless expression. Either assign it to a variable or remove it. --> B018.py:24:5 @@ -125,7 +124,6 @@ B018 Found useless expression. Either assign it to a variable or remove it. 26 | "str" 27 | 1 | ^ - | B018 Found useless expression. Either assign it to a variable or remove it. --> B018.py:39:5 @@ -232,7 +230,6 @@ B018 Found useless expression. Either assign it to a variable or remove it. 47 | {1, 2} # set 48 | {"foo": "bar"} # dict | ^^^^^^^^^^^^^^ - | B018 Found useless expression. Either assign it to a variable or remove it. --> B018.py:52:5 @@ -251,7 +248,6 @@ B018 Found useless expression. Either assign it to a variable or remove it. 54 | "str" 55 | 3 | ^ - | B018 Found useless expression. Either assign it to a variable or remove it. --> B018.py:63:5 @@ -280,4 +276,3 @@ B018 Found useless expression. Either assign it to a variable or remove it. 64 | object().__class__ # Attribute (raise) 65 | "foo" + "bar" # BinOp (raise) | ^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B021_B021.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B021_B021.py.snap index fa9f286493c90a..4de66c82bc9377 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B021_B021.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B021_B021.py.snap @@ -19,7 +19,6 @@ B021 f-string used as docstring. Python will interpret this as a joined string, 13 | def foo2(): 14 | f"""hello {VARIABLE}!""" | ^^^^^^^^^^^^^^^^^^^^^^^^ - | B021 f-string used as docstring. Python will interpret this as a joined string, rather than a docstring. --> B021.py:22:5 @@ -27,7 +26,6 @@ B021 f-string used as docstring. Python will interpret this as a joined string, 21 | class bar2: 22 | f"""hello {VARIABLE}!""" | ^^^^^^^^^^^^^^^^^^^^^^^^ - | B021 f-string used as docstring. Python will interpret this as a joined string, rather than a docstring. --> B021.py:30:5 @@ -35,7 +33,6 @@ B021 f-string used as docstring. Python will interpret this as a joined string, 29 | def foo2(): 30 | f"""hello {VARIABLE}!""" | ^^^^^^^^^^^^^^^^^^^^^^^^ - | B021 f-string used as docstring. Python will interpret this as a joined string, rather than a docstring. --> B021.py:38:5 @@ -43,7 +40,6 @@ B021 f-string used as docstring. Python will interpret this as a joined string, 37 | class bar2: 38 | f"""hello {VARIABLE}!""" | ^^^^^^^^^^^^^^^^^^^^^^^^ - | B021 f-string used as docstring. Python will interpret this as a joined string, rather than a docstring. --> B021.py:46:5 @@ -51,7 +47,6 @@ B021 f-string used as docstring. Python will interpret this as a joined string, 45 | def foo2(): 46 | f"hello {VARIABLE}!" | ^^^^^^^^^^^^^^^^^^^^ - | B021 f-string used as docstring. Python will interpret this as a joined string, rather than a docstring. --> B021.py:54:5 @@ -59,7 +54,6 @@ B021 f-string used as docstring. Python will interpret this as a joined string, 53 | class bar2: 54 | f"hello {VARIABLE}!" | ^^^^^^^^^^^^^^^^^^^^ - | B021 f-string used as docstring. Python will interpret this as a joined string, rather than a docstring. --> B021.py:62:5 @@ -67,7 +61,6 @@ B021 f-string used as docstring. Python will interpret this as a joined string, 61 | def foo2(): 62 | f"hello {VARIABLE}!" | ^^^^^^^^^^^^^^^^^^^^ - | B021 f-string used as docstring. Python will interpret this as a joined string, rather than a docstring. --> B021.py:70:5 @@ -75,7 +68,6 @@ B021 f-string used as docstring. Python will interpret this as a joined string, 69 | class bar2: 70 | f"hello {VARIABLE}!" | ^^^^^^^^^^^^^^^^^^^^ - | B021 f-string used as docstring. Python will interpret this as a joined string, rather than a docstring. --> B021.py:74:5 diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B023_B023.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B023_B023.py.snap index 034c5f4f0308aa..561c4bbf2bfbd6 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B023_B023.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B023_B023.py.snap @@ -70,7 +70,6 @@ B023 Function definition does not bind loop variable `x` 30 | gn = (lambda: x for x in range(2)) # error 31 | dt = {x: lambda: x for x in range(2)} # error | ^ - | B023 Function definition does not bind loop variable `x` --> B023.py:40:34 @@ -90,7 +89,6 @@ B023 Function definition does not bind loop variable `x` 41 | 42 | [lambda: x async for x in pointless_async_iterable()] # error | ^ - | B023 Function definition does not bind loop variable `a` --> B023.py:50:30 @@ -143,7 +141,6 @@ B023 Function definition does not bind loop variable `j` 60 | for k in range(3): 61 | lambda: j * k # error | ^ - | B023 Function definition does not bind loop variable `k` --> B023.py:61:21 @@ -152,7 +149,6 @@ B023 Function definition does not bind loop variable `k` 60 | for k in range(3): 61 | lambda: j * k # error | ^ - | B023 Function definition does not bind loop variable `l` --> B023.py:68:10 @@ -171,7 +167,6 @@ B023 Function definition does not bind loop variable `i` 81 | for i in range(3): 82 | lambda: f"{i}" | ^ - | B023 Function definition does not bind loop variable `x` --> B023.py:117:24 @@ -243,4 +238,3 @@ B023 Function definition does not bind loop variable `i` 173 | if False: 174 | return [lambda: i for i in range(3)] # error | ^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B026_B026.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B026_B026.py.snap index 3acc613e933e9b..98e03ccfef73e0 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B026_B026.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B026_B026.py.snap @@ -72,4 +72,3 @@ B026 Star-arg unpacking after a keyword argument is strongly discouraged 20 | foo(bam="bam", *["bar"], *["baz"]) 21 | foo(*["bar"], bam="bam", *["baz"]) | ^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B029_B029.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B029_B029.py.snap index 2feb56e38b0297..74eea51d40a62a 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B029_B029.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B029_B029.py.snap @@ -45,4 +45,3 @@ B029 Using `except* ():` with an empty tuple does not catch anything; add except 23 | / except* () as e: 24 | | pass | |________^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B031_B031.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B031_B031.py.snap index 50698965e322a6..b0854c5b616920 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B031_B031.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B031_B031.py.snap @@ -30,7 +30,6 @@ B031 Using the generator returned from `itertools.groupby()` more than once will 32 | collect_shop_items("Jane", section_items) 33 | collect_shop_items("Joe", section_items) # B031 | ^^^^^^^^^^^^^ - | B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage --> B031.py:40:37 diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B035_B035.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B035_B035.py.snap index 9d25a4c1b60b53..87e78384e6a16c 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B035_B035.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B035_B035.py.snap @@ -94,4 +94,3 @@ B035 Dictionary comprehension uses static key: `tokens` 24 | {constant[0]: value.upper() for value in data} 25 | {tokens: token for token in tokens} | ^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B039_B039.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B039_B039.py.snap index 07fdb4b2a7178e..1656b5c04dba1e 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B039_B039.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B039_B039.py.snap @@ -159,5 +159,4 @@ B039 Do not use mutable data structures for `ContextVar` defaults 39 | def baz(): ... 40 | ContextVar("cv", default=baz()) | ^^^^^ - | help: Replace with `None`; initialize with `.set()`` diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B043_B043.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B043_B043.py.snap index 4748d849bb437b..a188337ef79cf0 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B043_B043.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B043_B043.py.snap @@ -139,7 +139,6 @@ B043 [*] Do not call `delattr` with a constant attribute value. It is not any sa 37 | import builtins 38 | builtins.delattr(foo, "bar") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace `delattr` with `del` statement | 37 | import builtins diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B901_B901.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B901_B901.py.snap index 666db24c08f756..c8ded0415e1a39 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B901_B901.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B901_B901.py.snap @@ -28,7 +28,6 @@ B901 Using `yield` and `return {value}` in a generator function can lead to conf 55 | def broken3(): 56 | return (yield from []) | ^^^^^^^^^^^^^^^^^^^^^^ - | B901 Using `yield` and `return {value}` in a generator function can lead to confusing behavior --> B901.py:61:5 @@ -37,7 +36,6 @@ B901 Using `yield` and `return {value}` in a generator function can lead to conf 60 | x = yield from [] 61 | return x | ^^^^^^^^ - | B901 Using `yield` and `return {value}` in a generator function can lead to confusing behavior --> B901.py:72:5 @@ -45,7 +43,6 @@ B901 Using `yield` and `return {value}` in a generator function can lead to conf 71 | inner((yield from [])) 72 | return x | ^^^^^^^^ - | B901 Using `yield` and `return {value}` in a generator function can lead to confusing behavior --> B901.py:83:5 @@ -54,7 +51,6 @@ B901 Using `yield` and `return {value}` in a generator function can lead to conf 82 | yield 1 83 | return foo() | ^^^^^^^^^^^^ - | B901 Using `yield` and `return {value}` in a generator function can lead to confusing behavior --> B901.py:88:5 @@ -63,7 +59,6 @@ B901 Using `yield` and `return {value}` in a generator function can lead to conf 87 | yield 1 88 | return [1, 2, 3] | ^^^^^^^^^^^^^^^^ - | B901 Using `yield` and `return {value}` in a generator function can lead to confusing behavior --> B901.py:116:5 @@ -72,7 +67,6 @@ B901 Using `yield` and `return {value}` in a generator function can lead to conf 115 | yield 116 | return "should error" | ^^^^^^^^^^^^^^^^^^^^^ - | B901 Using `yield` and `return {value}` in a generator function can lead to confusing behavior --> B901.py:122:5 @@ -81,7 +75,6 @@ B901 Using `yield` and `return {value}` in a generator function can lead to conf 121 | yield 122 | return "should error" | ^^^^^^^^^^^^^^^^^^^^^ - | B901 Using `yield` and `return {value}` in a generator function can lead to confusing behavior --> B901.py:128:5 @@ -90,4 +83,3 @@ B901 Using `yield` and `return {value}` in a generator function can lead to conf 127 | yield 128 | return "should error" | ^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B903_class_as_data_structure.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B903_class_as_data_structure.py.snap index 6c5e006f18fba5..5dec517fdcf4f7 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B903_class_as_data_structure.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B903_class_as_data_structure.py.snap @@ -9,7 +9,6 @@ B903 Class could be dataclass or namedtuple 8 | | self.x = x 9 | | self.y = y | |__________________^ - | B903 Class could be dataclass or namedtuple --> class_as_data_structure.py:40:1 @@ -50,7 +49,6 @@ B903 Class could be dataclass or namedtuple 67 | | self.foo = foo 68 | | self.bar = bar | |______________________^ - | B903 Class could be dataclass or namedtuple --> class_as_data_structure.py:85:1 @@ -60,7 +58,6 @@ B903 Class could be dataclass or namedtuple 87 | | self.foo = foo 88 | | self.bar = bar | |______________________^ - | B903 Class could be dataclass or namedtuple --> class_as_data_structure.py:91:1 @@ -72,7 +69,6 @@ B903 Class could be dataclass or namedtuple 95 | | self.foo = foo 96 | | self.bar = bar | |______________________^ - | B903 Class could be dataclass or namedtuple --> class_as_data_structure.py:99:1 diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B903_py39_class_as_data_structure.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B903_py39_class_as_data_structure.py.snap index 57347eeb2f2e8f..598fb5b0079edc 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B903_py39_class_as_data_structure.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B903_py39_class_as_data_structure.py.snap @@ -9,7 +9,6 @@ B903 Class could be dataclass or namedtuple 8 | | self.x = x 9 | | self.y = y | |__________________^ - | B903 Class could be dataclass or namedtuple --> class_as_data_structure.py:40:1 @@ -50,7 +49,6 @@ B903 Class could be dataclass or namedtuple 67 | | self.foo = foo 68 | | self.bar = bar | |______________________^ - | B903 Class could be dataclass or namedtuple --> class_as_data_structure.py:85:1 @@ -60,7 +58,6 @@ B903 Class could be dataclass or namedtuple 87 | | self.foo = foo 88 | | self.bar = bar | |______________________^ - | B903 Class could be dataclass or namedtuple --> class_as_data_structure.py:91:1 @@ -72,4 +69,3 @@ B903 Class could be dataclass or namedtuple 95 | | self.foo = foo 96 | | self.bar = bar | |______________________^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B904_B904.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B904_B904.py.snap index 19d7b0c5bbdb9e..133533f5c9386d 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B904_B904.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B904_B904.py.snap @@ -63,7 +63,6 @@ B904 Within an `except` clause, raise exceptions with `raise ... from err` or `r 64 | else: 65 | raise RuntimeError("bang!") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling --> B904.py:73:13 diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B905.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B905.py.snap index a4c059bcfcde6a..201710c1ec9b90 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B905.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B905.py.snap @@ -118,7 +118,6 @@ B905 [*] `zip()` without an explicit `strict=` parameter 33 | # Error 34 | zip(*lot_of_iterators) | ^^^^^^^^^^^^^^^^^^^^^^ - | help: Add explicit value for parameter `strict=` | 33 | # Error diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B909_B909.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B909_B909.py.snap index f55c3c4f5de63c..d461a55e896a79 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B909_B909.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B909_B909.py.snap @@ -235,7 +235,6 @@ B909 Mutation to loop iterable `a.some_list` during iteration 84 | a.some_list.remove(0) 85 | del a.some_list[2] | ^^^^^^^^^^^^^^^^^^ - | B909 Mutation to loop iterable `foo` during iteration --> B909.py:93:5 @@ -330,7 +329,6 @@ B909 Mutation to loop iterable `foo` during iteration 104 | foo -= bar 105 | foo ^= bar | ^^^^^^^^^^ - | B909 Mutation to loop iterable `foo` during iteration --> B909.py:136:9 diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B912_B912.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B912_B912.py.snap index 1f3d8d27ad5e39..2adef201a2e609 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B912_B912.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B912_B912.py.snap @@ -139,7 +139,6 @@ B912 [*] `map()` without an explicit `strict=` parameter 35 | # Regression https://github.com/astral-sh/ruff/issues/20997 36 | map(f, *lots_of_iterators) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Add explicit value for parameter `strict=` | 35 | # Regression https://github.com/astral-sh/ruff/issues/20997 diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__extend_immutable_calls_arg_default.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__extend_immutable_calls_arg_default.snap index 5d5317e0a77ed9..6d46c3943ecc86 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__extend_immutable_calls_arg_default.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__extend_immutable_calls_arg_default.snap @@ -23,4 +23,3 @@ B008 Do not perform function call `L` in argument defaults; instead, perform the 47 | def okay(obj = N()): ... 48 | def error(obj = L()): ... | ^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__extend_mutable_contextvar_default.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__extend_mutable_contextvar_default.snap index 9988069bd2b047..b0ca802b579ce0 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__extend_mutable_contextvar_default.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__extend_mutable_contextvar_default.snap @@ -7,5 +7,4 @@ B039 Do not use mutable data structures for `ContextVar` defaults 6 | from something_else import Depends 7 | ContextVar("cv", default=Depends()) | ^^^^^^^^^ - | help: Replace with `None`; initialize with `.set()`` diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__preview__B006_B006_5.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__preview__B006_B006_5.py.snap index 1af32ce6af62f2..018c6e39f4e9dd 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__preview__B006_B006_5.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__preview__B006_B006_5.py.snap @@ -267,7 +267,6 @@ B006 Do not use mutable data structures for argument defaults | 67 | def import_module_wrong(value: dict[str, str] = {}): import os | ^^ - | help: Replace with `None`; initialize within function B006 Do not use mutable data structures for argument defaults @@ -275,7 +274,6 @@ B006 Do not use mutable data structures for argument defaults | 70 | def import_module_wrong(value: dict[str, str] = {}): import os; import sys | ^^ - | help: Replace with `None`; initialize within function B006 Do not use mutable data structures for argument defaults diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__preview__B006_B006_B008.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__preview__B006_B006_B008.py.snap index 7bdf721a3f054c..d4e71b5232f58b 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__preview__B006_B006_B008.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__preview__B006_B006_B008.py.snap @@ -79,7 +79,6 @@ B006 Do not use mutable data structures for argument defaults 81 | 82 | def single_line_func_wrong(value = {}): ... | ^^ - | help: Replace with `None`; initialize within function B006 [*] Do not use mutable data structures for argument defaults diff --git a/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A001_A001.py.snap b/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A001_A001.py.snap index e220c41130d3c2..bb1b7a8b3949b6 100644 --- a/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A001_A001.py.snap +++ b/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A001_A001.py.snap @@ -173,4 +173,3 @@ A001 Variable `sum` is shadowing a Python builtin 29 | 30 | [0 for sum in ()] | ^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A001_A001.py_builtins_ignorelist.snap b/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A001_A001.py_builtins_ignorelist.snap index c14d83400486c5..d78d048fdd796f 100644 --- a/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A001_A001.py_builtins_ignorelist.snap +++ b/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A001_A001.py_builtins_ignorelist.snap @@ -162,4 +162,3 @@ A001 Variable `sum` is shadowing a Python builtin 29 | 30 | [0 for sum in ()] | ^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A003_A003.py.snap b/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A003_A003.py.snap index 537a64433c9203..b13c2a3b53217e 100644 --- a/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A003_A003.py.snap +++ b/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A003_A003.py.snap @@ -27,4 +27,3 @@ A003 Python builtin is shadowed by class attribute `bin` from line 35 35 | bin = 2 36 | foo = [bin] | ^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A003_A003.py_builtins_ignorelist.snap b/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A003_A003.py_builtins_ignorelist.snap index c335dca6bd34e2..674e4a6f189d9c 100644 --- a/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A003_A003.py_builtins_ignorelist.snap +++ b/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A003_A003.py_builtins_ignorelist.snap @@ -18,4 +18,3 @@ A003 Python builtin is shadowed by class attribute `bin` from line 35 35 | bin = 2 36 | foo = [bin] | ^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A004_A004.py.snap b/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A004_A004.py.snap index 9df8672c5ea88a..9f81225ab3ceda 100644 --- a/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A004_A004.py.snap +++ b/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A004_A004.py.snap @@ -68,7 +68,6 @@ A004 Import `BaseExceptionGroup` is shadowing a Python builtin 10 | if sys.version_info < (3, 11): 11 | from exceptiongroup import BaseExceptionGroup, ExceptionGroup | ^^^^^^^^^^^^^^^^^^ - | A004 Import `ExceptionGroup` is shadowing a Python builtin --> A004.py:11:52 @@ -76,4 +75,3 @@ A004 Import `ExceptionGroup` is shadowing a Python builtin 10 | if sys.version_info < (3, 11): 11 | from exceptiongroup import BaseExceptionGroup, ExceptionGroup | ^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A004_A004.py_builtins_ignorelist.snap b/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A004_A004.py_builtins_ignorelist.snap index b5381b7f41c974..2dc1f24e4c578c 100644 --- a/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A004_A004.py_builtins_ignorelist.snap +++ b/crates/ruff_linter/src/rules/flake8_builtins/snapshots/ruff_linter__rules__flake8_builtins__tests__A004_A004.py_builtins_ignorelist.snap @@ -57,7 +57,6 @@ A004 Import `BaseExceptionGroup` is shadowing a Python builtin 10 | if sys.version_info < (3, 11): 11 | from exceptiongroup import BaseExceptionGroup, ExceptionGroup | ^^^^^^^^^^^^^^^^^^ - | A004 Import `ExceptionGroup` is shadowing a Python builtin --> A004.py:11:52 @@ -65,4 +64,3 @@ A004 Import `ExceptionGroup` is shadowing a Python builtin 10 | if sys.version_info < (3, 11): 11 | from exceptiongroup import BaseExceptionGroup, ExceptionGroup | ^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_commas/snapshots/ruff_linter__rules__flake8_commas__tests__COM81.py.snap b/crates/ruff_linter/src/rules/flake8_commas/snapshots/ruff_linter__rules__flake8_commas__tests__COM81.py.snap index 2e5644a58e6e72..dab988936c0af1 100644 --- a/crates/ruff_linter/src/rules/flake8_commas/snapshots/ruff_linter__rules__flake8_commas__tests__COM81.py.snap +++ b/crates/ruff_linter/src/rules/flake8_commas/snapshots/ruff_linter__rules__flake8_commas__tests__COM81.py.snap @@ -61,7 +61,6 @@ COM812 [*] Trailing comma missing 22 | 2, 23 | 3 | ^ - | help: Add trailing comma | 22 | 2, diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C400_C400.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C400_C400.py.snap index 1966f8c80ff80f..702b707c455e92 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C400_C400.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C400_C400.py.snap @@ -29,7 +29,6 @@ C400 [*] Unnecessary generator (rewrite as a list comprehension) 4 | | 2 * x + 1 for x in range(3) 5 | | ) | |_^ - | help: Rewrite as a list comprehension | 2 | even_nums = list(2 * x for x in range(3)) @@ -170,7 +169,6 @@ C400 [*] Unnecessary generator (rewrite as a list comprehension) 26 | | # some more 27 | | ) | |__^ - | help: Rewrite as a list comprehension | 21 | list((0 for _ in []),) diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C400_C400_py315.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C400_C400_py315.py.snap index 572fda02161098..b3f136505c18f0 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C400_C400_py315.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C400_C400_py315.py.snap @@ -8,7 +8,6 @@ C400 [*] Unnecessary generator (rewrite as a list comprehension) 2 | 3 | list(*x for x in xs) | ^^^^^^^^^^^^^^^^^^^^ - | help: Rewrite as a list comprehension | 2 | diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C401_C401.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C401_C401.py.snap index 0e7e68b74b8a5b..28dffa3bc545f2 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C401_C401.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C401_C401.py.snap @@ -86,7 +86,6 @@ C401 [*] Unnecessary generator (rewrite as a set comprehension) 11 | print(f"Hello {set(f(a) for a in 'abc')} World") 12 | print(f"Hello { set(f(a) for a in 'abc') } World") | ^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Rewrite as a set comprehension | 11 | print(f"Hello {set(f(a) for a in 'abc')} World") @@ -454,7 +453,6 @@ C401 [*] Unnecessary generator (rewrite using `set()`) 44 | print(t"{set(a for a in 'abc') - set(a for a in 'ab')}") 45 | print(t"{ set(a for a in 'abc') - set(a for a in 'ab') }") | ^^^^^^^^^^^^^^^^^^^^^ - | help: Rewrite using `set()` | 44 | print(t"{set(a for a in 'abc') - set(a for a in 'ab')}") @@ -471,7 +469,6 @@ C401 [*] Unnecessary generator (rewrite using `set()`) 44 | print(t"{set(a for a in 'abc') - set(a for a in 'ab')}") 45 | print(t"{ set(a for a in 'abc') - set(a for a in 'ab') }") | ^^^^^^^^^^^^^^^^^^^^ - | help: Rewrite using `set()` | 44 | print(t"{set(a for a in 'abc') - set(a for a in 'ab')}") diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C401_C401_py315.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C401_C401_py315.py.snap index f335e0b44edf71..e7972d05801728 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C401_C401_py315.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C401_C401_py315.py.snap @@ -8,7 +8,6 @@ C401 [*] Unnecessary generator (rewrite as a set comprehension) 2 | 3 | set(*x for x in xs) | ^^^^^^^^^^^^^^^^^^^ - | help: Rewrite as a set comprehension | 2 | diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C403_C403.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C403_C403.py.snap index b245ea00ae850b..e6dcb05b14a6c2 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C403_C403.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C403_C403.py.snap @@ -405,7 +405,6 @@ C403 [*] Unnecessary list comprehension (rewrite as a set comprehension) 47 | s = t"{ set([x for x in 'ab']) | set([x for x in 'ab']) }" 48 | s = t"{set([x for x in 'ab']) | set([x for x in 'ab'])}" | ^^^^^^^^^^^^^^^^^^^^^^ - | help: Rewrite as a set comprehension | 47 | s = t"{ set([x for x in 'ab']) | set([x for x in 'ab']) }" @@ -421,7 +420,6 @@ C403 [*] Unnecessary list comprehension (rewrite as a set comprehension) 47 | s = t"{ set([x for x in 'ab']) | set([x for x in 'ab']) }" 48 | s = t"{set([x for x in 'ab']) | set([x for x in 'ab'])}" | ^^^^^^^^^^^^^^^^^^^^^^ - | help: Rewrite as a set comprehension | 47 | s = t"{ set([x for x in 'ab']) | set([x for x in 'ab']) }" diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C403_C403_py315.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C403_C403_py315.py.snap index 7ed3ba81d2090f..2231cf55865c94 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C403_C403_py315.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C403_C403_py315.py.snap @@ -8,7 +8,6 @@ C403 [*] Unnecessary list comprehension (rewrite as a set comprehension) 2 | 3 | set([*x for x in xs]) | ^^^^^^^^^^^^^^^^^^^^^ - | help: Rewrite as a set comprehension | 2 | diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C404_C404.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C404_C404.py.snap index bbbc23c396b844..8f46f7a7f01cdb 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C404_C404.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C404_C404.py.snap @@ -168,7 +168,6 @@ C404 [*] Unnecessary list comprehension (rewrite as a dict comprehension) 15 | # Regression test for: https://github.com/astral-sh/ruff/issues/7087 16 | saved.append(dict([(k, v)for k,v in list(unique_instance.__dict__.items()) if k in [f.name for f in unique_instance._meta.fields]])) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Rewrite as a dict comprehension | 15 | # Regression test for: https://github.com/astral-sh/ruff/issues/7087 diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C405_C405.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C405_C405.py.snap index 59eee7baf540d3..d8e9ff2ba17c9c 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C405_C405.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C405_C405.py.snap @@ -563,7 +563,6 @@ C405 [*] Unnecessary list literal (rewrite as a set literal) 34 | t"a {set(['a', 'b']) - set(['a'])} b" 35 | t"a { set(['a', 'b']) - set(['a']) } b" | ^^^^^^^^^^^^^^^ - | help: Rewrite as a set literal | 34 | t"a {set(['a', 'b']) - set(['a'])} b" @@ -579,7 +578,6 @@ C405 [*] Unnecessary list literal (rewrite as a set literal) 34 | t"a {set(['a', 'b']) - set(['a'])} b" 35 | t"a { set(['a', 'b']) - set(['a']) } b" | ^^^^^^^^^^ - | help: Rewrite as a set literal | 34 | t"a {set(['a', 'b']) - set(['a'])} b" diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C408_C408.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C408_C408.py.snap index 0002bcc8387122..0fea149499c567 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C408_C408.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C408_C408.py.snap @@ -623,7 +623,6 @@ C408 [*] Unnecessary `dict()` call (rewrite as a literal) 47 | dict(𝕒=1, b=2) 48 | dict(a=1, b=2) # already NFKC-normalized: unchanged | ^^^^^^^^^^^^^^ - | help: Rewrite as a literal | 47 | dict(𝕒=1, b=2) diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C409_C409.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C409_C409.py.snap index dccb52bf726be4..96fb2835886316 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C409_C409.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C409_C409.py.snap @@ -255,7 +255,6 @@ C409 [*] Unnecessary list literal passed to `tuple()` (rewrite as a tuple litera 46 | t9 = tuple([1],) 47 | t10 = tuple([1, 2],) | ^^^^^^^^^^^^^^ - | help: Rewrite as a tuple literal | 46 | t9 = tuple([1],) diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C410_C410.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C410_C410.py.snap index ea6b3060f95e70..9e3043db41a485 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C410_C410.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C410_C410.py.snap @@ -60,7 +60,6 @@ C410 [*] Unnecessary tuple literal passed to `list()` (rewrite as a single list 3 | l3 = list([]) 4 | l4 = list(()) | ^^^^^^^^ - | help: Rewrite as a single list literal | 3 | l3 = list([]) diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C411_C411_py315.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C411_C411_py315.py.snap index 375114392b31c0..91188754db0e8f 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C411_C411_py315.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C411_C411_py315.py.snap @@ -8,5 +8,4 @@ C411 Unnecessary `list()` call (remove the outer call to `list()`) 2 | 3 | list([*x for x in xs]) | ^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove outer `list()` call diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C413_C413.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C413_C413.py.snap index 4a5feb7d4db95c..4acd1d7baeda7c 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C413_C413.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C413_C413.py.snap @@ -291,7 +291,6 @@ C413 [*] Unnecessary `list()` call around `sorted()` 28 | / list(sorted 29 | | ("xy")) | |_______^ - | help: Remove unnecessary `list()` call | 27 | ("")) diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C414_C414.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C414_C414.py.snap index 55b028356fb422..c2cf4caba83904 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C414_C414.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C414_C414.py.snap @@ -460,7 +460,6 @@ C414 [*] Unnecessary `list()` call within `sorted()` 46 | | key=lambda xxxxx: xxxxx or "", 47 | | ) | |_^ - | help: Remove the inner `list()` call | 44 | xxxxxxxxxxx_xxxxx_xxxxx = sorted( diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C417_C417.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C417_C417.py.snap index bd1f3e7f0894c5..26214dbd820642 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C417_C417.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C417_C417.py.snap @@ -176,7 +176,6 @@ C417 [*] Unnecessary `map()` usage (rewrite using a generator expression) 12 | all(map(lambda v: isinstance(v, dict), nums)) 13 | filter(func, map(lambda v: v, nums)) | ^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace `map()` with a generator expression | 12 | all(map(lambda v: isinstance(v, dict), nums)) @@ -319,7 +318,6 @@ C417 [*] Unnecessary `map()` usage (rewrite using a dict comprehension) 75 | _ = t"{set(map(lambda x: x % 2 == 0, nums))}" 76 | _ = t"{dict(map(lambda v: (v, v**2), nums))}" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace `map()` with a dict comprehension | 75 | _ = t"{set(map(lambda x: x % 2 == 0, nums))}" diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C417_C417_1.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C417_C417_1.py.snap index 7ed6953d33ff27..bf25050df06154 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C417_C417_1.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C417_C417_1.py.snap @@ -8,7 +8,6 @@ C417 [*] Unnecessary `map()` usage (rewrite using a generator expression) 6 | list = ... 7 | list(map(lambda x: x, [])) | ^^^^^^^^^^^^^^^^^^^^ - | help: Replace `map()` with a generator expression | 6 | list = ... diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C418_C418_py315.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C418_C418_py315.py.snap index 1d63a5a8cd5a68..3dc227f900bb79 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C418_C418_py315.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C418_C418_py315.py.snap @@ -8,5 +8,4 @@ C418 Unnecessary dict comprehension passed to `dict()` (remove the outer call to 2 | 3 | dict({**d for d in dicts}) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove outer `dict()` call diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C419_C419_py315.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C419_C419_py315.py.snap index 0af68931a95882..438cf0716e107d 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C419_C419_py315.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C419_C419_py315.py.snap @@ -18,5 +18,4 @@ C419 Unnecessary set comprehension 3 | all([*x for x in xs]) 4 | any({*x for x in xs}) | ^^^^^^^^^^^^^^^^ - | help: Remove unnecessary comprehension diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C420_C420.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C420_C420.py.snap index 203d399eaefb9a..a851b26c1f8514 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C420_C420.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C420_C420.py.snap @@ -8,7 +8,6 @@ C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instea 5 | numbers = [1, 2, 3] 6 | {n: None for n in numbers} # RUF025 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `dict.fromkeys(iterable, value)`) | 5 | numbers = [1, 2, 3] @@ -39,7 +38,6 @@ C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instea 14 | def func(): 15 | {n: 1.1 for n in [1, 2, 3]} # RUF025 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `dict.fromkeys(iterable)`) | 14 | def func(): @@ -55,7 +53,6 @@ C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instea 25 | 26 | f({c: "a" for c in "12345"}) # RUF025 | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `dict.fromkeys(iterable)`) | 25 | @@ -70,7 +67,6 @@ C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instea 29 | def func(): 30 | {n: True for n in [1, 2, 2]} # RUF025 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `dict.fromkeys(iterable)`) | 29 | def func(): @@ -85,7 +81,6 @@ C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instea 33 | def func(): 34 | {n: b"hello" for n in (1, 2, 2)} # RUF025 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `dict.fromkeys(iterable)`) | 33 | def func(): @@ -100,7 +95,6 @@ C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instea 37 | def func(): 38 | {n: ... for n in [1, 2, 3]} # RUF025 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `dict.fromkeys(iterable)`) | 37 | def func(): @@ -115,7 +109,6 @@ C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instea 41 | def func(): 42 | {n: False for n in {1: "a", 2: "b"}} # RUF025 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `dict.fromkeys(iterable)`) | 41 | def func(): @@ -130,7 +123,6 @@ C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instea 45 | def func(): 46 | {(a, b): 1 for (a, b) in [(1, 2), (3, 4)]} # RUF025 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `dict.fromkeys(iterable)`) | 45 | def func(): @@ -145,7 +137,6 @@ C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instea 53 | a = f() 54 | {n: a for n in [1, 2, 3]} # RUF025 | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `dict.fromkeys(iterable)`) | 53 | a = f() @@ -161,7 +152,6 @@ C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instea 58 | values = ["a", "b", "c"] 59 | [{n: values for n in [1, 2, 3]}] # RUF025 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `dict.fromkeys(iterable)`) | 58 | values = ["a", "b", "c"] @@ -184,7 +174,6 @@ C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instea 102 | | iterable # 8 103 | | } # 9 | |_^ - | help: Replace with `dict.fromkeys(iterable, value)`) | 94 | # https://github.com/astral-sh/ruff/issues/18764 diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C420_C420_1.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C420_C420_1.py.snap index 41a17dc8a718ac..e979590b6e8399 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C420_C420_1.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C420_C420_1.py.snap @@ -6,7 +6,6 @@ C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instea | 1 | {x: NotImplemented for x in "XY"} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `dict.fromkeys(iterable)`) | - {x: NotImplemented for x in "XY"} diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C420_C420_2.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C420_C420_2.py.snap index 75b6af4ebb6149..76e3b9d9f5249a 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C420_C420_2.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C420_C420_2.py.snap @@ -6,7 +6,6 @@ C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instea | 1 | foo or{x: None for x in bar} | ^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `dict.fromkeys(iterable, value)`) | - foo or{x: None for x in bar} diff --git a/crates/ruff_linter/src/rules/flake8_datetimez/snapshots/ruff_linter__rules__flake8_datetimez__tests__DTZ011_DTZ011.py.snap b/crates/ruff_linter/src/rules/flake8_datetimez/snapshots/ruff_linter__rules__flake8_datetimez__tests__DTZ011_DTZ011.py.snap index 316856748586cd..398da9f3267e3f 100644 --- a/crates/ruff_linter/src/rules/flake8_datetimez/snapshots/ruff_linter__rules__flake8_datetimez__tests__DTZ011_DTZ011.py.snap +++ b/crates/ruff_linter/src/rules/flake8_datetimez/snapshots/ruff_linter__rules__flake8_datetimez__tests__DTZ011_DTZ011.py.snap @@ -18,5 +18,4 @@ DTZ011 `datetime.date.today()` used 8 | # unqualified 9 | date.today() | ^^^^^^^^^^^^ - | help: Use `datetime.datetime.now(tz=...).date()` instead diff --git a/crates/ruff_linter/src/rules/flake8_datetimez/snapshots/ruff_linter__rules__flake8_datetimez__tests__DTZ012_DTZ012.py.snap b/crates/ruff_linter/src/rules/flake8_datetimez/snapshots/ruff_linter__rules__flake8_datetimez__tests__DTZ012_DTZ012.py.snap index 9160496ea65132..c1efa6f9c85151 100644 --- a/crates/ruff_linter/src/rules/flake8_datetimez/snapshots/ruff_linter__rules__flake8_datetimez__tests__DTZ012_DTZ012.py.snap +++ b/crates/ruff_linter/src/rules/flake8_datetimez/snapshots/ruff_linter__rules__flake8_datetimez__tests__DTZ012_DTZ012.py.snap @@ -18,5 +18,4 @@ DTZ012 `datetime.date.fromtimestamp()` used 8 | # unqualified 9 | date.fromtimestamp(1234) | ^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `datetime.datetime.fromtimestamp(ts, tz=...).date()` instead diff --git a/crates/ruff_linter/src/rules/flake8_datetimez/snapshots/ruff_linter__rules__flake8_datetimez__tests__DTZ901_DTZ901.py.snap b/crates/ruff_linter/src/rules/flake8_datetimez/snapshots/ruff_linter__rules__flake8_datetimez__tests__DTZ901_DTZ901.py.snap index 193014c717b952..b09afcea033380 100644 --- a/crates/ruff_linter/src/rules/flake8_datetimez/snapshots/ruff_linter__rules__flake8_datetimez__tests__DTZ901_DTZ901.py.snap +++ b/crates/ruff_linter/src/rules/flake8_datetimez/snapshots/ruff_linter__rules__flake8_datetimez__tests__DTZ901_DTZ901.py.snap @@ -40,7 +40,6 @@ DTZ901 Use of `datetime.datetime.min` without timezone information 8 | datetime.datetime.max.replace(year=...) 9 | datetime.datetime.min.replace(hour=...) | ^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `datetime.datetime.min.replace(tzinfo=...)` DTZ901 Use of `datetime.datetime.max` without timezone information @@ -82,5 +81,4 @@ DTZ901 Use of `datetime.datetime.min` without timezone information 30 | datetime.max.replace(year=...) 31 | datetime.min.replace(hour=...) | ^^^^^^^^^^^^ - | help: Replace with `datetime.datetime.min.replace(tzinfo=...)` diff --git a/crates/ruff_linter/src/rules/flake8_debugger/snapshots/ruff_linter__rules__flake8_debugger__tests__T100_T100.py.snap b/crates/ruff_linter/src/rules/flake8_debugger/snapshots/ruff_linter__rules__flake8_debugger__tests__T100_T100.py.snap index e8b2f2a1fa9c70..2cf50c35deb385 100644 --- a/crates/ruff_linter/src/rules/flake8_debugger/snapshots/ruff_linter__rules__flake8_debugger__tests__T100_T100.py.snap +++ b/crates/ruff_linter/src/rules/flake8_debugger/snapshots/ruff_linter__rules__flake8_debugger__tests__T100_T100.py.snap @@ -201,7 +201,6 @@ T100 Trace found: `ptvsd.wait_for_attach` used 24 | break_into_debugger() 25 | wait_for_attach() | ^^^^^^^^^^^^^^^^^ - | T100 Import for `sys.breakpointhook` found --> T100.py:33:5 @@ -261,4 +260,3 @@ T100 Trace found: `sys.__breakpointhook__` used 42 | sys.breakpointhook() # error 43 | sys.__breakpointhook__() # error | ^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_django/snapshots/ruff_linter__rules__flake8_django__tests__DJ001_DJ001.py.snap b/crates/ruff_linter/src/rules/flake8_django/snapshots/ruff_linter__rules__flake8_django__tests__DJ001_DJ001.py.snap index 56a8c683fba0ef..80a89942f98bfe 100644 --- a/crates/ruff_linter/src/rules/flake8_django/snapshots/ruff_linter__rules__flake8_django__tests__DJ001_DJ001.py.snap +++ b/crates/ruff_linter/src/rules/flake8_django/snapshots/ruff_linter__rules__flake8_django__tests__DJ001_DJ001.py.snap @@ -61,7 +61,6 @@ DJ001 Avoid using `null=True` on string-based fields such as `URLField` 11 | filepathfield = models.FilePathField(max_length=255, null=True) 12 | urlfield = models.URLField(max_length=255, null=True) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | DJ001 Avoid using `null=True` on string-based fields such as `CharField` --> DJ001.py:16:17 @@ -123,7 +122,6 @@ DJ001 Avoid using `null=True` on string-based fields such as `URLField` 20 | filepathfield = models.FilePathField(max_length=255, null=True) 21 | urlfield = models.URLField(max_length=255, null=True) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | DJ001 Avoid using `null=True` on string-based fields such as `CharField` --> DJ001.py:25:17 @@ -185,7 +183,6 @@ DJ001 Avoid using `null=True` on string-based fields such as `URLField` 29 | filepathfield = models.FilePathField(max_length=255, null=True) 30 | urlfield = models.URLField(max_length=255, null=True) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | DJ001 Avoid using `null=True` on string-based fields such as `CharField` --> DJ001.py:52:35 @@ -214,4 +211,3 @@ DJ001 Avoid using `null=True` on string-based fields such as `SlugField` 53 | textfield: models.TextField = models.TextField(max_length=255, null=True) 54 | slugfield: models.SlugField = models.SlugField(max_length=255, null=True) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_django/snapshots/ruff_linter__rules__flake8_django__tests__DJ003_DJ003.py.snap b/crates/ruff_linter/src/rules/flake8_django/snapshots/ruff_linter__rules__flake8_django__tests__DJ003_DJ003.py.snap index e07b14604ccd10..8ba9bbd1b90ca1 100644 --- a/crates/ruff_linter/src/rules/flake8_django/snapshots/ruff_linter__rules__flake8_django__tests__DJ003_DJ003.py.snap +++ b/crates/ruff_linter/src/rules/flake8_django/snapshots/ruff_linter__rules__flake8_django__tests__DJ003_DJ003.py.snap @@ -7,7 +7,6 @@ DJ003 Avoid passing `locals()` as context to a `render` function 4 | def test_view1(request): 5 | return render(request, "index.html", locals()) | ^^^^^^^^ - | DJ003 Avoid passing `locals()` as context to a `render` function --> DJ003.py:9:50 @@ -15,4 +14,3 @@ DJ003 Avoid passing `locals()` as context to a `render` function 8 | def test_view2(request): 9 | return render(request, "index.html", context=locals()) | ^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_django/snapshots/ruff_linter__rules__flake8_django__tests__DJ006_DJ006.py.snap b/crates/ruff_linter/src/rules/flake8_django/snapshots/ruff_linter__rules__flake8_django__tests__DJ006_DJ006.py.snap index a78edbc24837fa..055c648e8e65a4 100644 --- a/crates/ruff_linter/src/rules/flake8_django/snapshots/ruff_linter__rules__flake8_django__tests__DJ006_DJ006.py.snap +++ b/crates/ruff_linter/src/rules/flake8_django/snapshots/ruff_linter__rules__flake8_django__tests__DJ006_DJ006.py.snap @@ -8,4 +8,3 @@ DJ006 Do not use `exclude` with `ModelForm`, use `fields` instead 5 | class Meta: 6 | exclude = ["bar"] | ^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_django/snapshots/ruff_linter__rules__flake8_django__tests__DJ007_DJ007.py.snap b/crates/ruff_linter/src/rules/flake8_django/snapshots/ruff_linter__rules__flake8_django__tests__DJ007_DJ007.py.snap index 6220696a2d0b9a..debfc9a45d3661 100644 --- a/crates/ruff_linter/src/rules/flake8_django/snapshots/ruff_linter__rules__flake8_django__tests__DJ007_DJ007.py.snap +++ b/crates/ruff_linter/src/rules/flake8_django/snapshots/ruff_linter__rules__flake8_django__tests__DJ007_DJ007.py.snap @@ -8,7 +8,6 @@ DJ007 Do not use `__all__` with `ModelForm`, use `fields` instead 5 | class Meta: 6 | fields = "__all__" | ^^^^^^^^^^^^^^^^^^ - | DJ007 Do not use `__all__` with `ModelForm`, use `fields` instead --> DJ007.py:11:9 @@ -17,4 +16,3 @@ DJ007 Do not use `__all__` with `ModelForm`, use `fields` instead 10 | class Meta: 11 | fields = b"__all__" | ^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_django/snapshots/ruff_linter__rules__flake8_django__tests__DJ012_DJ012.py.snap b/crates/ruff_linter/src/rules/flake8_django/snapshots/ruff_linter__rules__flake8_django__tests__DJ012_DJ012.py.snap index 14cd967f3c6d98..256b1bc795c5c5 100644 --- a/crates/ruff_linter/src/rules/flake8_django/snapshots/ruff_linter__rules__flake8_django__tests__DJ012_DJ012.py.snap +++ b/crates/ruff_linter/src/rules/flake8_django/snapshots/ruff_linter__rules__flake8_django__tests__DJ012_DJ012.py.snap @@ -8,7 +8,6 @@ DJ012 Order of model's inner classes, methods, and fields does not follow the Dj 27 | 28 | first_name = models.CharField(max_length=32) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | DJ012 Order of model's inner classes, methods, and fields does not follow the Django Style Guide: field declaration should come before manager declaration --> DJ012.py:43:5 @@ -17,7 +16,6 @@ DJ012 Order of model's inner classes, methods, and fields does not follow the Dj 42 | 43 | first_name = models.CharField(max_length=32) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | DJ012 Order of model's inner classes, methods, and fields does not follow the Django Style Guide: Magic method should come before custom method --> DJ012.py:56:5 @@ -27,7 +25,6 @@ DJ012 Order of model's inner classes, methods, and fields does not follow the Dj 56 | / def __str__(self): 57 | | return "foobar" | |_______________________^ - | DJ012 Order of model's inner classes, methods, and fields does not follow the Django Style Guide: `save` method should come before `get_absolute_url` method --> DJ012.py:69:5 @@ -37,7 +34,6 @@ DJ012 Order of model's inner classes, methods, and fields does not follow the Dj 69 | / def save(self): 70 | | pass | |____________^ - | DJ012 Order of model's inner classes, methods, and fields does not follow the Django Style Guide: field declaration should come before `Meta` class --> DJ012.py:123:5 @@ -56,7 +52,6 @@ DJ012 Order of model's inner classes, methods, and fields does not follow the Dj 128 | 129 | middle_name = models.CharField(max_length=32) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | DJ012 Order of model's inner classes, methods, and fields does not follow the Django Style Guide: field declaration should come before `Meta` class --> DJ012.py:146:5 @@ -65,4 +60,3 @@ DJ012 Order of model's inner classes, methods, and fields does not follow the Dj 145 | 146 | first_name = models.CharField(max_length=32) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_errmsg/snapshots/ruff_linter__rules__flake8_errmsg__tests__custom.snap b/crates/ruff_linter/src/rules/flake8_errmsg/snapshots/ruff_linter__rules__flake8_errmsg__tests__custom.snap index 2d045fe812452b..845ebe42ea5bb9 100644 --- a/crates/ruff_linter/src/rules/flake8_errmsg/snapshots/ruff_linter__rules__flake8_errmsg__tests__custom.snap +++ b/crates/ruff_linter/src/rules/flake8_errmsg/snapshots/ruff_linter__rules__flake8_errmsg__tests__custom.snap @@ -7,7 +7,6 @@ EM101 [*] Exception must not use a string literal, assign to variable first 4 | def f_a(): 5 | raise RuntimeError("This is an example exception") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Assign to variable; remove string literal | 4 | def f_a(): @@ -25,7 +24,6 @@ EM102 [*] Exception must not use an f-string literal, assign to variable first 17 | example = "example" 18 | raise RuntimeError(f"This is an {example} exception") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Assign to variable; remove f-string literal | 17 | example = "example" @@ -42,7 +40,6 @@ EM103 [*] Exception must not use a `.format()` string directly, assign to variab 21 | def f_c(): 22 | raise RuntimeError("This is an {example} exception".format(example="example")) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Assign to variable; remove `.format()` string | 21 | def f_c(): @@ -60,7 +57,6 @@ EM101 [*] Exception must not use a string literal, assign to variable first 31 | msg = "hello" 32 | raise RuntimeError("This is an example exception") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Assign to variable; remove string literal | 31 | msg = "hello" @@ -78,7 +74,6 @@ EM101 [*] Exception must not use a string literal, assign to variable first 38 | 39 | raise RuntimeError("This is an example exception") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Assign to variable; remove string literal | 38 | @@ -95,7 +90,6 @@ EM101 [*] Exception must not use a string literal, assign to variable first 45 | def nested(): 46 | raise RuntimeError("This is an example exception") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Assign to variable; remove string literal | 45 | def nested(): @@ -152,7 +146,6 @@ EM103 [*] Exception must not use a `.format()` string directly, assign to variab 54 | raise RuntimeError(f"This is an exception: {foo}") 55 | raise RuntimeError("This is an exception: {}".format(foo)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Assign to variable; remove `.format()` string | 54 | raise RuntimeError(f"This is an exception: {foo}") @@ -180,7 +173,6 @@ EM101 Exception must not use a string literal, assign to variable first 59 | if foo: raise RuntimeError("This is an example exception") 60 | if foo: x = 1; raise RuntimeError("This is an example exception") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Assign to variable; remove string literal EM102 [*] Exception must not use an f-string literal, assign to variable first @@ -189,7 +181,6 @@ EM102 [*] Exception must not use an f-string literal, assign to variable first 63 | def f_triple_quoted_string(): 64 | raise RuntimeError(f"""This is an {"example"} exception""") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Assign to variable; remove f-string literal | 63 | def f_triple_quoted_string(): diff --git a/crates/ruff_linter/src/rules/flake8_errmsg/snapshots/ruff_linter__rules__flake8_errmsg__tests__defaults.snap b/crates/ruff_linter/src/rules/flake8_errmsg/snapshots/ruff_linter__rules__flake8_errmsg__tests__defaults.snap index d9332caa292919..a4d86c3aa72a30 100644 --- a/crates/ruff_linter/src/rules/flake8_errmsg/snapshots/ruff_linter__rules__flake8_errmsg__tests__defaults.snap +++ b/crates/ruff_linter/src/rules/flake8_errmsg/snapshots/ruff_linter__rules__flake8_errmsg__tests__defaults.snap @@ -7,7 +7,6 @@ EM101 [*] Exception must not use a string literal, assign to variable first 4 | def f_a(): 5 | raise RuntimeError("This is an example exception") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Assign to variable; remove string literal | 4 | def f_a(): @@ -24,7 +23,6 @@ EM101 [*] Exception must not use a string literal, assign to variable first 8 | def f_a_short(): 9 | raise RuntimeError("Error") | ^^^^^^^ - | help: Assign to variable; remove string literal | 8 | def f_a_short(): @@ -41,7 +39,6 @@ EM101 [*] Exception must not use a string literal, assign to variable first 12 | def f_a_empty(): 13 | raise RuntimeError("") | ^^ - | help: Assign to variable; remove string literal | 12 | def f_a_empty(): @@ -59,7 +56,6 @@ EM102 [*] Exception must not use an f-string literal, assign to variable first 17 | example = "example" 18 | raise RuntimeError(f"This is an {example} exception") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Assign to variable; remove f-string literal | 17 | example = "example" @@ -76,7 +72,6 @@ EM103 [*] Exception must not use a `.format()` string directly, assign to variab 21 | def f_c(): 22 | raise RuntimeError("This is an {example} exception".format(example="example")) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Assign to variable; remove `.format()` string | 21 | def f_c(): @@ -94,7 +89,6 @@ EM101 [*] Exception must not use a string literal, assign to variable first 31 | msg = "hello" 32 | raise RuntimeError("This is an example exception") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Assign to variable; remove string literal | 31 | msg = "hello" @@ -112,7 +106,6 @@ EM101 [*] Exception must not use a string literal, assign to variable first 38 | 39 | raise RuntimeError("This is an example exception") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Assign to variable; remove string literal | 38 | @@ -129,7 +122,6 @@ EM101 [*] Exception must not use a string literal, assign to variable first 45 | def nested(): 46 | raise RuntimeError("This is an example exception") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Assign to variable; remove string literal | 45 | def nested(): @@ -186,7 +178,6 @@ EM103 [*] Exception must not use a `.format()` string directly, assign to variab 54 | raise RuntimeError(f"This is an exception: {foo}") 55 | raise RuntimeError("This is an exception: {}".format(foo)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Assign to variable; remove `.format()` string | 54 | raise RuntimeError(f"This is an exception: {foo}") @@ -214,7 +205,6 @@ EM101 Exception must not use a string literal, assign to variable first 59 | if foo: raise RuntimeError("This is an example exception") 60 | if foo: x = 1; raise RuntimeError("This is an example exception") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Assign to variable; remove string literal EM102 [*] Exception must not use an f-string literal, assign to variable first @@ -223,7 +213,6 @@ EM102 [*] Exception must not use an f-string literal, assign to variable first 63 | def f_triple_quoted_string(): 64 | raise RuntimeError(f"""This is an {"example"} exception""") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Assign to variable; remove f-string literal | 63 | def f_triple_quoted_string(): diff --git a/crates/ruff_linter/src/rules/flake8_errmsg/snapshots/ruff_linter__rules__flake8_errmsg__tests__string_exception.snap b/crates/ruff_linter/src/rules/flake8_errmsg/snapshots/ruff_linter__rules__flake8_errmsg__tests__string_exception.snap index 404727a7a797db..1a8001fa15e116 100644 --- a/crates/ruff_linter/src/rules/flake8_errmsg/snapshots/ruff_linter__rules__flake8_errmsg__tests__string_exception.snap +++ b/crates/ruff_linter/src/rules/flake8_errmsg/snapshots/ruff_linter__rules__flake8_errmsg__tests__string_exception.snap @@ -7,7 +7,6 @@ EM101 [*] Exception must not use a string literal, assign to variable first 1 | def f_byte(): 2 | raise RuntimeError(b"This is an example exception") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Assign to variable; remove string literal | 1 | def f_byte(): @@ -24,7 +23,6 @@ EM101 [*] Exception must not use a string literal, assign to variable first 5 | def f_byte_empty(): 6 | raise RuntimeError(b"") | ^^^ - | help: Assign to variable; remove string literal | 5 | def f_byte_empty(): diff --git a/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE004_1.py.snap b/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE004_1.py.snap index f36efc45fc8ac1..e311ac219e8810 100644 --- a/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE004_1.py.snap +++ b/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE004_1.py.snap @@ -6,7 +6,6 @@ EXE004 [*] Avoid whitespace before shebang | 1 | #!/usr/bin/python | ^^^^ - | help: Remove whitespace before shebang | - #!/usr/bin/python diff --git a/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE004_4.py.snap b/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE004_4.py.snap index bd5717279ac817..49c7601c2a04ef 100644 --- a/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE004_4.py.snap +++ b/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE004_4.py.snap @@ -7,7 +7,6 @@ EXE004 [*] Avoid whitespace before shebang 1 | / 2 | | #!/usr/bin/env python | |____^ - | help: Remove whitespace before shebang | - diff --git a/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE005_1.py.snap b/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE005_1.py.snap index c0adb495ed6261..5666d9a830b256 100644 --- a/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE005_1.py.snap +++ b/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE005_1.py.snap @@ -7,4 +7,3 @@ EXE005 Shebang should be at the beginning of the file 2 | # A python comment 3 | #!/usr/bin/python | ^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE005_2.py.snap b/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE005_2.py.snap index 9cea26ce628cbd..235f19ef699302 100644 --- a/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE005_2.py.snap +++ b/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE005_2.py.snap @@ -7,4 +7,3 @@ EXE005 Shebang should be at the beginning of the file 3 | # A python comment 4 | #!/usr/bin/python | ^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE005_3.py.snap b/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE005_3.py.snap index bd861dada80449..29fdfd28fc2b36 100644 --- a/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE005_3.py.snap +++ b/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE005_3.py.snap @@ -8,4 +8,3 @@ EXE005 Shebang should be at the beginning of the file 5 | # A python comment 6 | #!/usr/bin/python | ^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_fixme/snapshots/ruff_linter__rules__flake8_fixme__tests__line-contains-todo_T00.py.snap b/crates/ruff_linter/src/rules/flake8_fixme/snapshots/ruff_linter__rules__flake8_fixme__tests__line-contains-todo_T00.py.snap index 4e5e4c0a7979d6..53dc89f6fc124e 100644 --- a/crates/ruff_linter/src/rules/flake8_fixme/snapshots/ruff_linter__rules__flake8_fixme__tests__line-contains-todo_T00.py.snap +++ b/crates/ruff_linter/src/rules/flake8_fixme/snapshots/ruff_linter__rules__flake8_fixme__tests__line-contains-todo_T00.py.snap @@ -27,4 +27,3 @@ FIX002 Line contains TODO, consider resolving the issue 9 | 10 | # test # TODO: todo | ^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__f-string-in-get-text-func-call_INT001.py.snap b/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__f-string-in-get-text-func-call_INT001.py.snap index 9cfb1b5242d73c..db4755d6ef79f6 100644 --- a/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__f-string-in-get-text-func-call_INT001.py.snap +++ b/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__f-string-in-get-text-func-call_INT001.py.snap @@ -68,7 +68,6 @@ INT001 f-string is resolved before function call; consider `_("string %s") % arg 24 | gettext_fn(f"Hello, {name}!") 25 | ngettext_fn(f"Hello, {name}!", f"Hello, {name}s!", 2) | ^^^^^^^^^^^^^^^^^ - | INT001 f-string is resolved before function call; consider `_("string %s") % arg` --> INT001.py:31:14 @@ -130,7 +129,6 @@ INT001 f-string is resolved before function call; consider `_("string %s") % arg 40 | print(_(a)) 41 | print(_(f"{a}")) | ^^^^^^ - | INT001 f-string is resolved before function call; consider `_("string %s") % arg` --> INT001.py:51:12 @@ -159,4 +157,3 @@ INT001 f-string is resolved before function call; consider `_("string %s") % arg 52 | builtins.gettext(f"{'value'}") 53 | builtins.ngettext(f"{'value'}", f"{'values'}", 2) | ^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__format-in-get-text-func-call_INT002.py.snap b/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__format-in-get-text-func-call_INT002.py.snap index b368f71065204d..a2da0ebcdbf327 100644 --- a/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__format-in-get-text-func-call_INT002.py.snap +++ b/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__format-in-get-text-func-call_INT002.py.snap @@ -68,7 +68,6 @@ INT002 `format` method argument is resolved before function call; consider `_("s 20 | gettext_fn("Hello, {}!".format(name)) 21 | ngettext_fn("Hello, {}!".format(name), "Hello, {}s!".format(name), 2) | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | INT002 `format` method argument is resolved before function call; consider `_("string %s") % arg` --> INT002.py:27:14 @@ -130,7 +129,6 @@ INT002 `format` method argument is resolved before function call; consider `_("s 36 | print(_(a)) 37 | print(_("{}".format(a))) | ^^^^^^^^^^^^^^ - | INT002 `format` method argument is resolved before function call; consider `_("string %s") % arg` --> INT002.py:47:12 @@ -159,4 +157,3 @@ INT002 `format` method argument is resolved before function call; consider `_("s 48 | builtins.gettext("{}".format("line")) 49 | builtins.ngettext("{}".format("line"), "{}".format("lines"), 2) | ^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__preview__f-string-in-get-text-func-call_INT001.py.snap b/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__preview__f-string-in-get-text-func-call_INT001.py.snap index db981c06b3cf74..5635a06fe7f741 100644 --- a/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__preview__f-string-in-get-text-func-call_INT001.py.snap +++ b/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__preview__f-string-in-get-text-func-call_INT001.py.snap @@ -88,7 +88,6 @@ INT001 f-string is resolved before function call; consider `_("string %s") % arg 24 | gettext_fn(f"Hello, {name}!") 25 | ngettext_fn(f"Hello, {name}!", f"Hello, {name}s!", 2) | ^^^^^^^^^^^^^^^^^ - | INT001 f-string in plural argument is resolved before function call --> INT001.py:25:32 @@ -97,7 +96,6 @@ INT001 f-string in plural argument is resolved before function call 24 | gettext_fn(f"Hello, {name}!") 25 | ngettext_fn(f"Hello, {name}!", f"Hello, {name}s!", 2) | ^^^^^^^^^^^^^^^^^^ - | INT001 f-string is resolved before function call; consider `_("string %s") % arg` --> INT001.py:31:14 @@ -159,7 +157,6 @@ INT001 f-string is resolved before function call; consider `_("string %s") % arg 40 | print(_(a)) 41 | print(_(f"{a}")) | ^^^^^^ - | INT001 f-string is resolved before function call; consider `_("string %s") % arg` --> INT001.py:51:12 @@ -188,7 +185,6 @@ INT001 f-string is resolved before function call; consider `_("string %s") % arg 52 | builtins.gettext(f"{'value'}") 53 | builtins.ngettext(f"{'value'}", f"{'values'}", 2) | ^^^^^^^^^^^^ - | INT001 f-string in plural argument is resolved before function call --> INT001.py:53:33 @@ -197,4 +193,3 @@ INT001 f-string in plural argument is resolved before function call 52 | builtins.gettext(f"{'value'}") 53 | builtins.ngettext(f"{'value'}", f"{'values'}", 2) | ^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__preview__format-in-get-text-func-call_INT002.py.snap b/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__preview__format-in-get-text-func-call_INT002.py.snap index ad26c43eff6ca1..07279f41cb3fe3 100644 --- a/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__preview__format-in-get-text-func-call_INT002.py.snap +++ b/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__preview__format-in-get-text-func-call_INT002.py.snap @@ -89,7 +89,6 @@ INT002 `format` method argument is resolved before function call; consider `_("s 20 | gettext_fn("Hello, {}!".format(name)) 21 | ngettext_fn("Hello, {}!".format(name), "Hello, {}s!".format(name), 2) | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | INT002 `format` method in plural argument is resolved before function call --> INT002.py:21:40 @@ -98,7 +97,6 @@ INT002 `format` method in plural argument is resolved before function call 20 | gettext_fn("Hello, {}!".format(name)) 21 | ngettext_fn("Hello, {}!".format(name), "Hello, {}s!".format(name), 2) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | INT002 `format` method argument is resolved before function call; consider `_("string %s") % arg` --> INT002.py:27:14 @@ -160,7 +158,6 @@ INT002 `format` method argument is resolved before function call; consider `_("s 36 | print(_(a)) 37 | print(_("{}".format(a))) | ^^^^^^^^^^^^^^ - | INT002 `format` method argument is resolved before function call; consider `_("string %s") % arg` --> INT002.py:47:12 @@ -189,7 +186,6 @@ INT002 `format` method argument is resolved before function call; consider `_("s 48 | builtins.gettext("{}".format("line")) 49 | builtins.ngettext("{}".format("line"), "{}".format("lines"), 2) | ^^^^^^^^^^^^^^^^^^^ - | INT002 `format` method in plural argument is resolved before function call --> INT002.py:49:40 @@ -198,4 +194,3 @@ INT002 `format` method in plural argument is resolved before function call 48 | builtins.gettext("{}".format("line")) 49 | builtins.ngettext("{}".format("line"), "{}".format("lines"), 2) | ^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__preview__printf-in-get-text-func-call_INT003.py.snap b/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__preview__printf-in-get-text-func-call_INT003.py.snap index 496caa891db138..9b92dd6f9a1616 100644 --- a/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__preview__printf-in-get-text-func-call_INT003.py.snap +++ b/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__preview__printf-in-get-text-func-call_INT003.py.snap @@ -89,7 +89,6 @@ INT003 printf-style format is resolved before function call; consider `_("string 20 | gettext_fn("Hello, %s!" % name) 21 | ngettext_fn("Hello, %s!" % name, "Hello, %ss!" % name, 2) | ^^^^^^^^^^^^^^^^^^^ - | INT003 printf-style format in plural argument is resolved before function call --> INT003.py:21:34 @@ -98,7 +97,6 @@ INT003 printf-style format in plural argument is resolved before function call 20 | gettext_fn("Hello, %s!" % name) 21 | ngettext_fn("Hello, %s!" % name, "Hello, %ss!" % name, 2) | ^^^^^^^^^^^^^^^^^^^^ - | INT003 printf-style format is resolved before function call; consider `_("string %s") % arg` --> INT003.py:27:14 @@ -160,7 +158,6 @@ INT003 printf-style format is resolved before function call; consider `_("string 36 | print(_(a)) 37 | print(_("%s" % a)) | ^^^^^^^^ - | INT003 printf-style format is resolved before function call; consider `_("string %s") % arg` --> INT003.py:47:12 @@ -189,7 +186,6 @@ INT003 printf-style format is resolved before function call; consider `_("string 48 | builtins.gettext("%s" % "line") 49 | builtins.ngettext("%s" % "line", "%s" % "lines", 2) | ^^^^^^^^^^^^^ - | INT003 printf-style format in plural argument is resolved before function call --> INT003.py:49:34 @@ -198,4 +194,3 @@ INT003 printf-style format in plural argument is resolved before function call 48 | builtins.gettext("%s" % "line") 49 | builtins.ngettext("%s" % "line", "%s" % "lines", 2) | ^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__printf-in-get-text-func-call_INT003.py.snap b/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__printf-in-get-text-func-call_INT003.py.snap index 496422c556a343..9e1254ac4514a4 100644 --- a/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__printf-in-get-text-func-call_INT003.py.snap +++ b/crates/ruff_linter/src/rules/flake8_gettext/snapshots/ruff_linter__rules__flake8_gettext__tests__printf-in-get-text-func-call_INT003.py.snap @@ -68,7 +68,6 @@ INT003 printf-style format is resolved before function call; consider `_("string 20 | gettext_fn("Hello, %s!" % name) 21 | ngettext_fn("Hello, %s!" % name, "Hello, %ss!" % name, 2) | ^^^^^^^^^^^^^^^^^^^ - | INT003 printf-style format is resolved before function call; consider `_("string %s") % arg` --> INT003.py:27:14 @@ -130,7 +129,6 @@ INT003 printf-style format is resolved before function call; consider `_("string 36 | print(_(a)) 37 | print(_("%s" % a)) | ^^^^^^^^ - | INT003 printf-style format is resolved before function call; consider `_("string %s") % arg` --> INT003.py:47:12 @@ -159,4 +157,3 @@ INT003 printf-style format is resolved before function call; consider `_("string 48 | builtins.gettext("%s" % "line") 49 | builtins.ngettext("%s" % "line", "%s" % "lines", 2) | ^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC001_ISC.py.snap b/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC001_ISC.py.snap index ab330314eee98b..9e98634ba0dba6 100644 --- a/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC001_ISC.py.snap +++ b/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC001_ISC.py.snap @@ -436,7 +436,6 @@ ISC001 [*] Implicitly concatenated string literals on one line 92 | _ = "\12""foo" # fix should be "\12foo" 93 | _ = "\12" "" # fix should be "\12" | ^^^^^^^^ - | help: Combine string literals | 92 | _ = "\12""foo" # fix should be "\12foo" diff --git a/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC001_ISC_syntax_error.py.snap b/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC001_ISC_syntax_error.py.snap index ac74361ae58a8b..236b856612e67e 100644 --- a/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC001_ISC_syntax_error.py.snap +++ b/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC001_ISC_syntax_error.py.snap @@ -186,7 +186,6 @@ invalid-syntax: f-string: unterminated triple-quoted string 28 | | "i" "j" 29 | | ) | |__^ - | invalid-syntax: f-string: unterminated string --> ISC_syntax_error.py:30:1 @@ -194,4 +193,3 @@ invalid-syntax: f-string: unterminated string 28 | "i" "j" 29 | ) | ^ - | diff --git a/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC001_ISC_syntax_error_2.py.snap b/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC001_ISC_syntax_error_2.py.snap index 6cd82329199795..b63614973d41cc 100644 --- a/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC001_ISC_syntax_error_2.py.snap +++ b/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC001_ISC_syntax_error_2.py.snap @@ -121,7 +121,6 @@ ISC001 Implicitly concatenated string literals on one line 6 | f"" f" 7 | f"" f"" f" | ^^^^^^^ - | help: Combine string literals invalid-syntax: f-string: unterminated string @@ -131,4 +130,3 @@ invalid-syntax: f-string: unterminated string 6 | f"" f" 7 | f"" f"" f" | ^ - | diff --git a/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC002_ISC.py.snap b/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC002_ISC.py.snap index 290691d0a7d4ae..d7c775dcf734af 100644 --- a/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC002_ISC.py.snap +++ b/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC002_ISC.py.snap @@ -47,4 +47,3 @@ ISC002 Implicitly concatenated string literals over multiple lines | __________^ 209 | | t"def"} g" | |__________^ - | diff --git a/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC002_ISC_syntax_error.py.snap b/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC002_ISC_syntax_error.py.snap index 6c645ec5d1fc9f..100d5e9587794c 100644 --- a/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC002_ISC_syntax_error.py.snap +++ b/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC002_ISC_syntax_error.py.snap @@ -99,7 +99,6 @@ invalid-syntax: f-string: unterminated triple-quoted string 28 | | "i" "j" 29 | | ) | |__^ - | invalid-syntax: f-string: unterminated string --> ISC_syntax_error.py:30:1 @@ -107,4 +106,3 @@ invalid-syntax: f-string: unterminated string 28 | "i" "j" 29 | ) | ^ - | diff --git a/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC002_ISC_syntax_error_2.py.snap b/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC002_ISC_syntax_error_2.py.snap index 3f47730b50325e..0c97d71ca7f2ba 100644 --- a/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC002_ISC_syntax_error_2.py.snap +++ b/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC002_ISC_syntax_error_2.py.snap @@ -50,4 +50,3 @@ invalid-syntax: f-string: unterminated string 6 | f"" f" 7 | f"" f"" f" | ^ - | diff --git a/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC003_ISC.py.snap b/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC003_ISC.py.snap index 71bcd5365acd1f..aef8d1887a3b55 100644 --- a/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC003_ISC.py.snap +++ b/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC003_ISC.py.snap @@ -349,7 +349,6 @@ ISC003 Explicitly concatenated string should be implicitly concatenated 223 | | "def" 224 | | ) + "ghi" | |_________^ - | help: Remove redundant '+' operator to implicitly concatenate ISC003 [*] Explicitly concatenated string should be implicitly concatenated diff --git a/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__multiline_ISC001_ISC.py.snap b/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__multiline_ISC001_ISC.py.snap index ab330314eee98b..9e98634ba0dba6 100644 --- a/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__multiline_ISC001_ISC.py.snap +++ b/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__multiline_ISC001_ISC.py.snap @@ -436,7 +436,6 @@ ISC001 [*] Implicitly concatenated string literals on one line 92 | _ = "\12""foo" # fix should be "\12foo" 93 | _ = "\12" "" # fix should be "\12" | ^^^^^^^^ - | help: Combine string literals | 92 | _ = "\12""foo" # fix should be "\12foo" diff --git a/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__multiline_ISC002_ISC.py.snap b/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__multiline_ISC002_ISC.py.snap index b0882b15b3ff06..345c1e2f76d3b6 100644 --- a/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__multiline_ISC002_ISC.py.snap +++ b/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__multiline_ISC002_ISC.py.snap @@ -88,7 +88,6 @@ ISC002 Implicitly concatenated string literals over multiple lines | __________^ 209 | | t"def"} g" | |__________^ - | ISC002 Implicitly concatenated string literals over multiple lines --> ISC.py:217:5 diff --git a/crates/ruff_linter/src/rules/flake8_import_conventions/snapshots/ruff_linter__rules__flake8_import_conventions__tests__defaults.snap b/crates/ruff_linter/src/rules/flake8_import_conventions/snapshots/ruff_linter__rules__flake8_import_conventions__tests__defaults.snap index 24522f70909fbd..7a919ec733cc4c 100644 --- a/crates/ruff_linter/src/rules/flake8_import_conventions/snapshots/ruff_linter__rules__flake8_import_conventions__tests__defaults.snap +++ b/crates/ruff_linter/src/rules/flake8_import_conventions/snapshots/ruff_linter__rules__flake8_import_conventions__tests__defaults.snap @@ -113,7 +113,6 @@ ICN001 [*] `networkx` should be imported as `nx` 11 | import tkinter 12 | import networkx | ^^^^^^^^ - | help: Alias `networkx` to `nx` | 11 | import tkinter @@ -242,7 +241,6 @@ ICN001 [*] `networkx` should be imported as `nx` 21 | import tkinter as tkr 22 | import networkx as nxy | ^^^ - | help: Alias `networkx` to `nx` | 21 | import tkinter as tkr diff --git a/crates/ruff_linter/src/rules/flake8_import_conventions/snapshots/ruff_linter__rules__flake8_import_conventions__tests__same_name.snap b/crates/ruff_linter/src/rules/flake8_import_conventions/snapshots/ruff_linter__rules__flake8_import_conventions__tests__same_name.snap index 51f5f763764bb7..430456689a09aa 100644 --- a/crates/ruff_linter/src/rules/flake8_import_conventions/snapshots/ruff_linter__rules__flake8_import_conventions__tests__same_name.snap +++ b/crates/ruff_linter/src/rules/flake8_import_conventions/snapshots/ruff_linter__rules__flake8_import_conventions__tests__same_name.snap @@ -7,7 +7,6 @@ ICN001 [*] `django.conf.settings` should be imported as `settings` 9 | def unconventional_alias(): 10 | from django.conf import settings as s | ^ - | help: Alias `django.conf.settings` to `settings` | 9 | def unconventional_alias(): diff --git a/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG002_LOG002.py.snap b/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG002_LOG002.py.snap index 2c9233a22f713c..f3a695620c5381 100644 --- a/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG002_LOG002.py.snap +++ b/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG002_LOG002.py.snap @@ -61,7 +61,6 @@ LOG002 [*] Use `__name__` with `logging.getLogger()` 14 | logging.getLogger(__cached__) 15 | getLogger(name=__cached__) | ^^^^^^^^^^ - | help: Replace with `__name__` | 14 | logging.getLogger(__cached__) diff --git a/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG004_LOG004_0.py.snap b/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG004_LOG004_0.py.snap index 7d92793da56baa..e6bbb3636a98e0 100644 --- a/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG004_LOG004_0.py.snap +++ b/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG004_LOG004_0.py.snap @@ -44,7 +44,6 @@ LOG004 `.exception()` call outside exception handlers 14 | logger.exception("") 15 | exc("") | ^^^^^^^ - | help: Replace with `.error()` LOG004 [*] `.exception()` call outside exception handlers @@ -90,5 +89,4 @@ LOG004 `.exception()` call outside exception handlers 20 | logger.exception("") 21 | exc("") | ^^^^^^^ - | help: Replace with `.error()` diff --git a/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG004_LOG004_1.py.snap b/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG004_LOG004_1.py.snap index 4f6f9d5d072898..96ff758efacc7f 100644 --- a/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG004_LOG004_1.py.snap +++ b/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG004_LOG004_1.py.snap @@ -6,7 +6,6 @@ LOG004 [*] `.exception()` call outside exception handlers | 4 | logger.exception("") | ^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `.error()` | 3 | diff --git a/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG014_LOG014_0.py.snap b/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG014_LOG014_0.py.snap index 8f8ae216381e80..9aa12dfdc37996 100644 --- a/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG014_LOG014_0.py.snap +++ b/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG014_LOG014_0.py.snap @@ -25,7 +25,6 @@ LOG014 [*] `exc_info=` outside exception handlers 12 | logging.info("", exc_info=True) 13 | logger.info("", exc_info=True) | ^^^^^^^^^^^^^ - | help: Remove `exc_info=` | 12 | logging.info("", exc_info=True) @@ -57,7 +56,6 @@ LOG014 [*] `exc_info=` outside exception handlers 16 | logging.info("", exc_info=1) 17 | logger.info("", exc_info=1) | ^^^^^^^^^^ - | help: Remove `exc_info=` | 16 | logging.info("", exc_info=1) @@ -91,7 +89,6 @@ LOG014 [*] `exc_info=` outside exception handlers 21 | logging.info("", exc_info=True) 22 | logger.info("", exc_info=True) | ^^^^^^^^^^^^^ - | help: Remove `exc_info=` | 21 | logging.info("", exc_info=True) diff --git a/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG014_LOG014_1.py.snap b/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG014_LOG014_1.py.snap index 171f59119e7524..79c6d2f14bfea8 100644 --- a/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG014_LOG014_1.py.snap +++ b/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG014_LOG014_1.py.snap @@ -6,7 +6,6 @@ LOG014 [*] `exc_info=` outside exception handlers | 4 | logger.info("", exc_info=True) | ^^^^^^^^^^^^^ - | help: Remove `exc_info=` | 3 | diff --git a/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG015_LOG015.py.snap b/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG015_LOG015.py.snap index 27a0e6d28e764f..d5c73b65a37c93 100644 --- a/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG015_LOG015.py.snap +++ b/crates/ruff_linter/src/rules/flake8_logging/snapshots/ruff_linter__rules__flake8_logging__tests__LOG015_LOG015.py.snap @@ -90,7 +90,6 @@ LOG015 `exception()` call on root logger 10 | logging.log("adipiscing") 11 | logging.exception("elit.") | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use own logger instead LOG015 `debug()` call on root logger @@ -182,5 +181,4 @@ LOG015 `exception()` call on root logger 32 | log("adipiscing") 33 | exception("elit.") | ^^^^^^^^^^^^^^^^^^ - | help: Use own logger instead diff --git a/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G001.py.snap b/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G001.py.snap index f12fb47ed8f73b..745071fd8880b7 100644 --- a/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G001.py.snap +++ b/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G001.py.snap @@ -156,4 +156,3 @@ G001 Logging statement uses `str.format` 26 | log(level=logging.INFO, msg="Hello {}".format("World!")) 27 | log(msg="Hello {}".format("World!"), level=logging.INFO) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G002.py.snap b/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G002.py.snap index dab094f006b4cb..5b9515962f8e16 100644 --- a/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G002.py.snap +++ b/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G002.py.snap @@ -37,4 +37,3 @@ G002 Logging statement uses `%` 8 | info("Hello %s" % "World!") 9 | log(logging.INFO, "Hello %s" % "World!") | ^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G003.py.snap b/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G003.py.snap index 5e17edd42c8faf..7ec90fe193eeb1 100644 --- a/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G003.py.snap +++ b/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G003.py.snap @@ -37,4 +37,3 @@ G003 Logging statement uses `+` 8 | info("Hello" + " " + "World!") 9 | log(logging.INFO, "Hello" + " " + "World!") | ^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G004.py.snap b/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G004.py.snap index f02d019ad5a508..d8464d847dc9f7 100644 --- a/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G004.py.snap +++ b/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G004.py.snap @@ -75,7 +75,6 @@ G004 Logging statement uses f-string 23 | directory_path = "/home/hamir/ruff/crates/ruff_linter/resources/test/" 24 | logging.info(f"{count} out of {total} files in {directory_path} checked") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Convert to lazy `%` formatting G004 Logging statement uses f-string @@ -162,7 +161,6 @@ G004 Logging statement uses f-string 43 | logging.info(f"Processing {len(data)} items") 44 | logging.info(f"Status: {data.get('status', 'unknown').upper()}") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Convert to lazy `%` formatting G004 Logging statement uses f-string @@ -217,5 +215,4 @@ G004 Logging statement uses f-string 65 | x = 1 66 | logging.error(f"{x} -> %s", x) | ^^^^^^^^^^^^ - | help: Convert to lazy `%` formatting diff --git a/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G004_arg_order.py.snap b/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G004_arg_order.py.snap index cb976e768a6b75..1c233b7c2f6a56 100644 --- a/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G004_arg_order.py.snap +++ b/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G004_arg_order.py.snap @@ -19,5 +19,4 @@ G004 Logging statement uses f-string 9 | logger.error(f"{X} -> %s", Y) 10 | logger.error(f"{Y} -> %s", X) | ^^^^^^^^^^^^ - | help: Convert to lazy `%` formatting diff --git a/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G004_implicit_concat.py.snap b/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G004_implicit_concat.py.snap index 051bba97a6e79e..5defa6cc4ec633 100644 --- a/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G004_implicit_concat.py.snap +++ b/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__G004_implicit_concat.py.snap @@ -30,5 +30,4 @@ G004 Logging statement uses f-string 7 | log.info("a " f"b {variablename}") 8 | log.info("prefix " f"middle {variablename}" f" suffix") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Convert to lazy `%` formatting diff --git a/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__preview__G004_G004.py.snap b/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__preview__G004_G004.py.snap index a606baa92a80ec..6921cae7d97d4c 100644 --- a/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__preview__G004_G004.py.snap +++ b/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__preview__G004_G004.py.snap @@ -111,7 +111,6 @@ G004 [*] Logging statement uses f-string 23 | directory_path = "/home/hamir/ruff/crates/ruff_linter/resources/test/" 24 | logging.info(f"{count} out of {total} files in {directory_path} checked") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Convert to lazy `%` formatting | 23 | directory_path = "/home/hamir/ruff/crates/ruff_linter/resources/test/" @@ -204,7 +203,6 @@ G004 Logging statement uses f-string 43 | logging.info(f"Processing {len(data)} items") 44 | logging.info(f"Status: {data.get('status', 'unknown').upper()}") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Convert to lazy `%` formatting G004 Logging statement uses f-string @@ -259,5 +257,4 @@ G004 Logging statement uses f-string 65 | x = 1 66 | logging.error(f"{x} -> %s", x) | ^^^^^^^^^^^^ - | help: Convert to lazy `%` formatting diff --git a/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__preview__G004_G004_arg_order.py.snap b/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__preview__G004_G004_arg_order.py.snap index cb976e768a6b75..1c233b7c2f6a56 100644 --- a/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__preview__G004_G004_arg_order.py.snap +++ b/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__preview__G004_G004_arg_order.py.snap @@ -19,5 +19,4 @@ G004 Logging statement uses f-string 9 | logger.error(f"{X} -> %s", Y) 10 | logger.error(f"{Y} -> %s", X) | ^^^^^^^^^^^^ - | help: Convert to lazy `%` formatting diff --git a/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__preview__G004_G004_implicit_concat.py.snap b/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__preview__G004_G004_implicit_concat.py.snap index e8591b58e7dcee..5aa21a2be0a634 100644 --- a/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__preview__G004_G004_implicit_concat.py.snap +++ b/crates/ruff_linter/src/rules/flake8_logging_format/snapshots/ruff_linter__rules__flake8_logging_format__tests__preview__G004_G004_implicit_concat.py.snap @@ -42,7 +42,6 @@ G004 [*] Logging statement uses f-string 7 | log.info("a " f"b {variablename}") 8 | log.info("prefix " f"middle {variablename}" f" suffix") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Convert to lazy `%` formatting | 7 | log.info("a " f"b {variablename}") diff --git a/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE790_PIE790.py.snap b/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE790_PIE790.py.snap index 9ca4b319c394df..d429ead79e01b5 100644 --- a/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE790_PIE790.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE790_PIE790.py.snap @@ -8,7 +8,6 @@ PIE790 [*] Unnecessary `pass` statement 3 | 4 | pass | ^^^^ - | help: Remove unnecessary `pass` | 3 | @@ -23,7 +22,6 @@ PIE790 [*] Unnecessary `pass` statement 8 | """foo""" 9 | pass | ^^^^ - | help: Remove unnecessary `pass` | 8 | """foo""" @@ -38,7 +36,6 @@ PIE790 [*] Unnecessary `pass` statement 13 | """This is a function.""" 14 | pass; print("hello") | ^^^^ - | help: Remove unnecessary `pass` | 13 | """This is a function.""" @@ -54,7 +51,6 @@ PIE790 [*] Unnecessary `pass` statement 20 | """bar""" 21 | pass | ^^^^ - | help: Remove unnecessary `pass` | 20 | """bar""" @@ -69,7 +65,6 @@ PIE790 [*] Unnecessary `pass` statement 27 | """bar""" 28 | pass | ^^^^ - | help: Remove unnecessary `pass` | 27 | """bar""" @@ -84,7 +79,6 @@ PIE790 [*] Unnecessary `pass` statement 34 | """bar""" 35 | pass | ^^^^ - | help: Remove unnecessary `pass` | 34 | """bar""" @@ -99,7 +93,6 @@ PIE790 [*] Unnecessary `pass` statement 41 | """bar""" 42 | pass | ^^^^ - | help: Remove unnecessary `pass` | 41 | """bar""" @@ -114,7 +107,6 @@ PIE790 [*] Unnecessary `pass` statement 49 | 50 | pass | ^^^^ - | help: Remove unnecessary `pass` | 49 | @@ -129,7 +121,6 @@ PIE790 [*] Unnecessary `pass` statement 57 | 58 | pass | ^^^^ - | help: Remove unnecessary `pass` | 57 | @@ -161,7 +152,6 @@ PIE790 [*] Unnecessary `pass` statement 73 | """bar""" 74 | pass | ^^^^ - | help: Remove unnecessary `pass` | 73 | """bar""" @@ -210,7 +200,6 @@ PIE790 [*] Unnecessary `pass` statement 86 | """buzz""" 87 | pass | ^^^^ - | help: Remove unnecessary `pass` | 86 | """buzz""" @@ -242,7 +231,6 @@ PIE790 [*] Unnecessary `pass` statement 95 | """buzz""" 96 | pass | ^^^^ - | help: Remove unnecessary `pass` | 95 | """buzz""" @@ -257,7 +245,6 @@ PIE790 [*] Unnecessary `pass` statement 100 | """buzz""" 101 | pass # bar | ^^^^ - | help: Remove unnecessary `pass` | 100 | """buzz""" @@ -273,7 +260,6 @@ PIE790 [*] Unnecessary `pass` statement 129 | print("foo") 130 | pass | ^^^^ - | help: Remove unnecessary `pass` | 129 | print("foo") @@ -288,7 +274,6 @@ PIE790 [*] Unnecessary `pass` statement 135 | print("foo") 136 | pass | ^^^^ - | help: Remove unnecessary `pass` | 135 | print("foo") @@ -384,7 +369,6 @@ PIE790 [*] Unnecessary `pass` statement 149 | pass # comment 150 | pass | ^^^^ - | help: Remove unnecessary `pass` | 149 | pass # comment @@ -399,7 +383,6 @@ PIE790 [*] Unnecessary `...` literal 154 | print("foo") 155 | ... | ^^^ - | help: Remove unnecessary `...` | 154 | print("foo") @@ -414,7 +397,6 @@ PIE790 [*] Unnecessary `...` literal 160 | print("foo") 161 | ... | ^^^ - | help: Remove unnecessary `...` | 160 | print("foo") @@ -559,7 +541,6 @@ PIE790 [*] Unnecessary `...` literal 208 | """Docstring""" 209 | ... | ^^^ - | help: Remove unnecessary `...` | 208 | """Docstring""" diff --git a/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE794_PIE794.py.snap b/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE794_PIE794.py.snap index 0cdcf548803073..72a0b2dbcf1720 100644 --- a/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE794_PIE794.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE794_PIE794.py.snap @@ -44,7 +44,6 @@ PIE794 [*] Class field `bar` is defined multiple times 22 | # ... 23 | bar = StringField() # PIE794 | ^^^^^^^^^^^^^^^^^^^ - | help: Remove duplicate field definition for `bar` | 22 | # ... @@ -60,7 +59,6 @@ PIE794 [*] Class field `bar` is defined multiple times 39 | # ... 40 | bar = StringField() # PIE794 | ^^^^^^^^^^^^^^^^^^^ - | help: Remove duplicate field definition for `bar` | 39 | # ... @@ -76,7 +74,6 @@ PIE794 [*] Class field `name` is defined multiple times 45 | name = name + " Bar" 46 | name = "Bar" # PIE794 | ^^^^^^^^^^^^ - | help: Remove duplicate field definition for `name` | 45 | name = name + " Bar" @@ -92,7 +89,6 @@ PIE794 [*] Class field `name` is defined multiple times 51 | name: str = name + " Bar" 52 | name: str = "Bar" # PIE794 | ^^^^^^^^^^^^^^^^^ - | help: Remove duplicate field definition for `name` | 51 | name: str = name + " Bar" @@ -108,7 +104,6 @@ PIE794 [*] Class field `start_line` is defined multiple times 56 | start_line: int 57 | start_line: int # PIE794 | ^^^^^^^^^^^^^^^ - | help: Remove duplicate field definition for `start_line` | 56 | start_line: int diff --git a/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE796_PIE796.py.snap b/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE796_PIE796.py.snap index e164e69c5c1c28..4657641895f640 100644 --- a/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE796_PIE796.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE796_PIE796.py.snap @@ -8,7 +8,6 @@ PIE796 Enum contains duplicate value: `"B"` 7 | B = "B" 8 | C = "B" # PIE796 | ^^^^^^^ - | PIE796 Enum contains duplicate value: `2` --> PIE796.py:14:5 @@ -17,7 +16,6 @@ PIE796 Enum contains duplicate value: `2` 13 | B = 2 14 | C = 2 # PIE796 | ^^^^^ - | PIE796 Enum contains duplicate value: `"2"` --> PIE796.py:20:5 @@ -26,7 +24,6 @@ PIE796 Enum contains duplicate value: `"2"` 19 | B = "2" 20 | C = "2" # PIE796 | ^^^^^^^ - | PIE796 Enum contains duplicate value: `2.5` --> PIE796.py:26:5 @@ -35,7 +32,6 @@ PIE796 Enum contains duplicate value: `2.5` 25 | B = 2.5 26 | C = 2.5 # PIE796 | ^^^^^^^ - | PIE796 Enum contains duplicate value: `False` --> PIE796.py:33:5 @@ -44,7 +40,6 @@ PIE796 Enum contains duplicate value: `False` 32 | C = False 33 | D = False # PIE796 | ^^^^^^^^^ - | PIE796 Enum contains duplicate value: `None` --> PIE796.py:40:5 @@ -53,7 +48,6 @@ PIE796 Enum contains duplicate value: `None` 39 | C = None 40 | D = None # PIE796 | ^^^^^^^^ - | PIE796 Enum contains duplicate value: `2` --> PIE796.py:54:5 @@ -62,7 +56,6 @@ PIE796 Enum contains duplicate value: `2` 53 | B = 2 54 | C = 2 # PIE796 | ^^^^^ - | PIE796 Enum contains duplicate value: `...` --> PIE796.py:71:5 @@ -81,7 +74,6 @@ PIE796 Enum contains duplicate value: `...` 71 | B = ... # PIE796 72 | C = ... # PIE796 | ^^^^^^^ - | PIE796 Enum contains duplicate value: `cast(SomeType, ...)` --> PIE796.py:79:5 @@ -100,4 +92,3 @@ PIE796 Enum contains duplicate value: `cast(SomeType, ...)` 79 | B = cast(SomeType, ...) # PIE796 80 | C = cast(SomeType, ...) # PIE796 | ^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE800_PIE800.py.snap b/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE800_PIE800.py.snap index ec85a35557fc80..52ba224af0b368 100644 --- a/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE800_PIE800.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE800_PIE800.py.snap @@ -395,7 +395,6 @@ PIE800 [*] Unnecessary spread `**` 96 | | # Comment 97 | | }), 6: 3} | |_^ - | help: Remove unnecessary dict | 94 | }, 6: 3} diff --git a/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE807_PIE807.py.snap b/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE807_PIE807.py.snap index 5f88013e2e6714..3054374f38a2e6 100644 --- a/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE807_PIE807.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE807_PIE807.py.snap @@ -25,7 +25,6 @@ PIE807 [*] Prefer `dict` over useless lambda 3 | foo: List[str] = field(default_factory=lambda: []) # PIE807 4 | bar: Dict[str, int] = field(default_factory=lambda: {}) # PIE807 | ^^^^^^^^^^ - | help: Replace with `lambda` with `dict` | 3 | foo: List[str] = field(default_factory=lambda: []) # PIE807 @@ -57,7 +56,6 @@ PIE807 [*] Prefer `dict` over useless lambda 8 | foo = fields.ListField(default=lambda: []) # PIE807 9 | bar = fields.ListField(default=lambda: {}) # PIE807 | ^^^^^^^^^^ - | help: Replace with `lambda` with `dict` | 8 | foo = fields.ListField(default=lambda: []) # PIE807 @@ -89,7 +87,6 @@ PIE807 [*] Prefer `dict` over useless lambda 13 | foo = fields.ListField(lambda: []) # PIE807 14 | bar = fields.ListField(default=lambda: {}) # PIE807 | ^^^^^^^^^^ - | help: Replace with `lambda` with `dict` | 13 | foo = fields.ListField(lambda: []) # PIE807 diff --git a/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE808_PIE808.py.snap b/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE808_PIE808.py.snap index 9f784595426c53..ed12ff97e9f490 100644 --- a/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE808_PIE808.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pie/snapshots/ruff_linter__rules__flake8_pie__tests__PIE808_PIE808.py.snap @@ -41,7 +41,6 @@ PIE808 [*] Unnecessary `start` argument in `range` 18 | # regression test for https://github.com/astral-sh/ruff/pull/18805 19 | range((0), 42) | ^ - | help: Remove `start` argument | 18 | # regression test for https://github.com/astral-sh/ruff/pull/18805 @@ -55,7 +54,6 @@ PIE808 [*] Unnecessary `start` argument in `range` | 27 | range(0, 3) | ^ - | help: Remove `start` argument | 26 | diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI002_PYI002.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI002_PYI002.pyi.snap index 744b2850cf12e8..0e2a4e11af22ef 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI002_PYI002.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI002_PYI002.pyi.snap @@ -39,4 +39,3 @@ PYI002 `if` test must be a simple comparison against `sys.platform` or `sys.vers 5 | if hasattr(sys, 'maxint'): ... # Y002 If test must be a simple comparison against sys.platform or sys.version_info 6 | if sys.maxsize == 42: ... # Y002 If test must be a simple comparison against sys.platform or sys.version_info | ^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI005_PYI005.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI005_PYI005.pyi.snap index 1dfd4b7b5582a9..ece2f68432e976 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI005_PYI005.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI005_PYI005.pyi.snap @@ -17,4 +17,3 @@ PYI005 Version comparison must be against a length-2 tuple 4 | if sys.version_info[:1] == (2, 7): ... # Y005 5 | if sys.version_info[:2] == (2,): ... # Y005 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI006_PYI006.py.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI006_PYI006.py.snap index a7ed2ffa50720c..cdef1fb4e3947e 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI006_PYI006.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI006_PYI006.py.snap @@ -81,4 +81,3 @@ PYI006 Use `<` or `>=` for `sys.version_info` comparisons 19 | if python_version > (3, 10): ... # Error: PYI006 Use only `<` and `>=` for version info comparisons 20 | elif python_version == (3, 11): ... # Error: PYI006 Use only `<` and `>=` for version info comparisons | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI006_PYI006.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI006_PYI006.pyi.snap index 8db85b25ce1174..2de610d4b82f87 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI006_PYI006.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI006_PYI006.pyi.snap @@ -81,4 +81,3 @@ PYI006 Use `<` or `>=` for `sys.version_info` comparisons 19 | if python_version > (3, 10): ... # Error: PYI006 Use only `<` and `>=` for version info comparisons 20 | elif python_version == (3, 11): ... # Error: PYI006 Use only `<` and `>=` for version info comparisons | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI007_PYI007.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI007_PYI007.pyi.snap index 6e444fcbc678e1..a0515757742340 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI007_PYI007.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI007_PYI007.pyi.snap @@ -30,4 +30,3 @@ PYI007 Unrecognized `sys.platform` check 10 | 11 | if sys.platform == 10.12: ... # Error: PYI007 Unrecognized sys.platform check | ^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI009_PYI009.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI009_PYI009.pyi.snap index 1959a217ca91d9..047e12d9819991 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI009_PYI009.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI009_PYI009.pyi.snap @@ -25,7 +25,6 @@ PYI009 [*] Empty body should contain `...`, not `pass` 7 | class Foo: 8 | pass # ERROR PYI009, since we're in a stub file | ^^^^ - | help: Replace `pass` with `...` | 7 | class Foo: diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI013_PYI013.py.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI013_PYI013.py.snap index a9abb985d57664..abaf31f44d4896 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI013_PYI013.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI013_PYI013.py.snap @@ -8,7 +8,6 @@ PYI013 [*] Non-empty class body must not contain `...` 2 | value: int 3 | ... | ^^^ - | help: Remove unnecessary `...` | 2 | value: int @@ -53,7 +52,6 @@ PYI013 [*] Non-empty class body must not contain `...` 12 | ... 13 | ... | ^^^ - | help: Remove unnecessary `...` | 12 | ... @@ -68,7 +66,6 @@ PYI013 [*] Non-empty class body must not contain `...` 20 | 21 | ... | ^^^ - | help: Remove unnecessary `...` | 20 | @@ -83,7 +80,6 @@ PYI013 [*] Non-empty class body must not contain `...` 25 | value: int 26 | ... | ^^^ - | help: Remove unnecessary `...` | 25 | value: int @@ -130,7 +126,6 @@ PYI013 [*] Non-empty class body must not contain `...` 43 | value: int 44 | ... # preserve me | ^^^ - | help: Remove unnecessary `...` | 43 | value: int diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI016_PYI016.py.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI016_PYI016.py.snap index 6e618a76809f07..1e7493cc15a1ec 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI016_PYI016.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI016_PYI016.py.snap @@ -774,7 +774,6 @@ PYI016 [*] Duplicate union member `int` 114 | 115 | field35: "int | str | int" # Error | ^^^ - | help: Remove duplicate union member `int` | 114 | diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI016_PYI016.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI016_PYI016.pyi.snap index 8ea26dd248f195..e528fa5fdcb3f4 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI016_PYI016.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI016_PYI016.pyi.snap @@ -1003,7 +1003,6 @@ PYI016 [*] Duplicate union member `complex` 134 | field48: typing.Union[typing.Optional[typing.Union[complex, complex]], complex] 135 | field49: typing.Optional[complex | complex] | complex | ^^^^^^^ - | help: Remove duplicate union member `complex` | 134 | field48: typing.Union[typing.Optional[typing.Union[complex, complex]], complex] @@ -1018,7 +1017,6 @@ PYI016 [*] Duplicate union member `complex` 134 | field48: typing.Union[typing.Optional[typing.Union[complex, complex]], complex] 135 | field49: typing.Optional[complex | complex] | complex | ^^^^^^^ - | help: Remove duplicate union member `complex` | 134 | field48: typing.Union[typing.Optional[typing.Union[complex, complex]], complex] diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI019_PYI019_0.py.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI019_PYI019_0.py.snap index c66f5a4096712d..18480905e97f9f 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI019_PYI019_0.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI019_PYI019_0.py.snap @@ -7,7 +7,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `_S` 6 | class BadClass: 7 | def __new__(cls: type[_S], *args: str, **kwargs: int) -> _S: ... # PYI019 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `_S` with `Self` | 6 | class BadClass: @@ -21,7 +20,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `_S` | 10 | def bad_instance_method(self: _S, arg: bytes) -> _S: ... # PYI019 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `_S` with `Self` | 9 | @@ -36,7 +34,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `_S` 13 | @classmethod 14 | def bad_class_method(cls: type[_S], arg: int) -> _S: ... # PYI019 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `_S` with `Self` | 13 | @classmethod @@ -51,7 +48,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `_S` 17 | @classmethod 18 | def bad_posonly_class_method(cls: type[_S], /) -> _S: ... # PYI019 | ^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `_S` with `Self` | 17 | @classmethod @@ -67,7 +63,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `S` 38 | class PEP695BadDunderNew[T]: 39 | def __new__[S](cls: type[S], *args: Any, ** kwargs: Any) -> S: ... # PYI019 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `S` with `Self` | 38 | class PEP695BadDunderNew[T]: @@ -81,7 +76,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `S` | 42 | def generic_instance_method[S](self: S) -> S: ... # PYI019 | ^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `S` with `Self` | 41 | @@ -97,7 +91,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `S` 53 | @foo_classmethod 54 | def foo[S](cls: type[S]) -> S: ... # PYI019 | ^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `S` with `Self` | 53 | @foo_classmethod @@ -344,7 +337,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `_S695` 88 | 89 | def mixing_old_and_new_style_type_vars[T](self: _S695, a: T, b: T) -> _S695: ... | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `_S695` with `Self` | 88 | @@ -377,7 +369,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `S` 113 | @classmethod 114 | def m[S](cls: type[S]) -> type[S]: ... # PYI019 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `S` with `Self` | 113 | @classmethod @@ -410,7 +401,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `S` 119 | @classmethod 120 | def n[S](cls: type[S], other: S) -> int: ... | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `S` with `Self` | 119 | @classmethod @@ -613,7 +603,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `_S` 191 | @classmethod 192 | def bad_class_method_with_string_annotations(cls: "type[_S]") -> "_S": ... # PYI019 | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `_S` with `Self` | 191 | @classmethod @@ -628,7 +617,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `_S` 195 | @classmethod 196 | def bad_class_method_with_mixed_annotations_1(cls: "type[_S]") -> _S: ... # PYI019 | ^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `_S` with `Self` | 195 | @classmethod @@ -643,7 +631,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `_S` 199 | @classmethod 200 | def bad_class_method_with_mixed_annotations_1(cls: type[_S]) -> "_S": ... # PYI019 | ^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `_S` with `Self` | 199 | @classmethod @@ -659,7 +646,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `S` 204 | @classmethod 205 | def m[S](cls: "type[S]") -> "type[S]": ... # PYI019 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `S` with `Self` | 204 | @classmethod diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI019_PYI019_0.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI019_PYI019_0.pyi.snap index 8e70f15c92f109..05c83b71d94c6e 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI019_PYI019_0.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI019_PYI019_0.pyi.snap @@ -7,7 +7,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `_S` 6 | class BadClass: 7 | def __new__(cls: type[_S], *args: str, **kwargs: int) -> _S: ... # PYI019 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `_S` with `Self` | 6 | class BadClass: @@ -21,7 +20,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `_S` | 10 | def bad_instance_method(self: _S, arg: bytes) -> _S: ... # PYI019 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `_S` with `Self` | 9 | @@ -36,7 +34,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `_S` 13 | @classmethod 14 | def bad_class_method(cls: type[_S], arg: int) -> _S: ... # PYI019 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `_S` with `Self` | 13 | @classmethod @@ -51,7 +48,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `_S` 17 | @classmethod 18 | def bad_posonly_class_method(cls: type[_S], /) -> _S: ... # PYI019 | ^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `_S` with `Self` | 17 | @classmethod @@ -67,7 +63,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `S` 38 | class PEP695BadDunderNew[T]: 39 | def __new__[S](cls: type[S], *args: Any, ** kwargs: Any) -> S: ... # PYI019 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `S` with `Self` | 38 | class PEP695BadDunderNew[T]: @@ -81,7 +76,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `S` | 42 | def generic_instance_method[S](self: S) -> S: ... # PYI019 | ^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `S` with `Self` | 41 | @@ -97,7 +91,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `S` 53 | @foo_classmethod 54 | def foo[S](cls: type[S]) -> S: ... # PYI019 | ^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `S` with `Self` | 53 | @foo_classmethod @@ -344,7 +337,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `_S695` 88 | 89 | def mixing_old_and_new_style_type_vars[T](self: _S695, a: T, b: T) -> _S695: ... | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `_S695` with `Self` | 88 | @@ -377,7 +369,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `S` 113 | @classmethod 114 | def m[S](cls: type[S]) -> type[S]: ... # PYI019 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `S` with `Self` | 113 | @classmethod @@ -392,7 +383,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `S` 117 | class PEP695TypeParameterAtTheVeryEndOfTheList: 118 | def f[T, S](self: S) -> S: ... | ^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `S` with `Self` | 117 | class PEP695TypeParameterAtTheVeryEndOfTheList: @@ -466,7 +456,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `S` 140 | | ] 141 | | ) -> S: ... | |__________^ - | help: Replace TypeVar `S` with `Self` | 133 | @@ -509,7 +498,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `S` 146 | @classmethod 147 | def n[S](cls: type[S], other: S) -> int: ... | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `S` with `Self` | 146 | @classmethod @@ -576,7 +564,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `S` 166 | def m[S: int, T: int](self: S, other: T) -> S: ... 167 | def n[T: (int, str), S: (int, str)](self: S, other: T) -> S: ... | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `S` with `Self` | 166 | def m[S: int, T: int](self: S, other: T) -> S: ... @@ -608,7 +595,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `_S` 183 | @classmethod 184 | def bad_class_method_with_string_annotations(cls: "type[_S]") -> "_S": ... # PYI019 | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `_S` with `Self` | 183 | @classmethod @@ -623,7 +609,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `_S` 187 | @classmethod 188 | def bad_class_method_with_mixed_annotations_1(cls: "type[_S]") -> _S: ... # PYI019 | ^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `_S` with `Self` | 187 | @classmethod @@ -638,7 +623,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `_S` 191 | @classmethod 192 | def bad_class_method_with_mixed_annotations_1(cls: type[_S]) -> "_S": ... # PYI019 | ^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `_S` with `Self` | 191 | @classmethod @@ -654,7 +638,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `S` 196 | @classmethod 197 | def m[S](cls: "type[S]") -> "type[S]": ... # PYI019 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `S` with `Self` | 196 | @classmethod diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI019_PYI019_1.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI019_PYI019_1.pyi.snap index c29053ea7f3345..fbf3fc8400723f 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI019_PYI019_1.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI019_PYI019_1.pyi.snap @@ -7,7 +7,6 @@ PYI019 [*] Use `Self` instead of custom TypeVar `S` 3 | class F: 4 | def m[S](self: S) -> S: ... | ^^^^^^^^^^^^^^^^^ - | help: Replace TypeVar `S` with `Self` | 3 | class F: diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025_1.py.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025_1.py.snap index 3e8f027673c721..c9b60ae0d1ebc8 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025_1.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025_1.py.snap @@ -7,7 +7,6 @@ PYI025 [*] Use `from collections.abc import Set as AbstractSet` to avoid confusi 9 | def f(): 10 | from collections.abc import Set # PYI025 | ^^^ - | help: Alias `Set` to `AbstractSet` | 9 | def f(): diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025_3.py.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025_3.py.snap index 707581ab150375..53947d49061b10 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025_3.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025_3.py.snap @@ -8,7 +8,6 @@ PYI025 [*] Use `from collections.abc import Set as AbstractSet` to avoid confusi 5 | 6 | from collections.abc import Set as Set # PYI025 triggered but fix is not marked as safe | ^^^ - | help: Alias `Set` to `AbstractSet` | 5 | diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025_3.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025_3.pyi.snap index 57895043ddea2f..8411cbc8b59451 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025_3.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI025_PYI025_3.pyi.snap @@ -8,7 +8,6 @@ PYI025 [*] Use `from collections.abc import Set as AbstractSet` to avoid confusi 5 | 6 | from collections.abc import Set as Set # PYI025 triggered but fix is not marked as safe | ^^^ - | help: Alias `Set` to `AbstractSet` | 5 | diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI032_PYI032.py.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI032_PYI032.py.snap index 1d4d845c22a684..a1234728cdb531 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI032_PYI032.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI032_PYI032.py.snap @@ -24,7 +24,6 @@ PYI032 [*] Prefer `object` to `Any` for the second parameter to `__ne__` 6 | def __eq__(self, other: Any) -> bool: ... # PYI032 7 | def __ne__(self, other: typing.Any) -> typing.Any: ... # PYI032 | ^^^^^^^^^^ - | help: Replace with `object` | 6 | def __eq__(self, other: Any) -> bool: ... # PYI032 @@ -56,7 +55,6 @@ PYI032 [*] Prefer `object` to `Any` for the second parameter to `__ne__` 27 | def __eq__(self, other: "Any") -> bool: ... # PYI032 28 | def __ne__(self, other: "Any") -> bool: ... # PYI032 | ^^^^^ - | help: Replace with `object` | 27 | def __eq__(self, other: "Any") -> bool: ... # PYI032 diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI032_PYI032.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI032_PYI032.pyi.snap index 929e2b34cfbab1..bd1e6cc98ceed0 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI032_PYI032.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI032_PYI032.pyi.snap @@ -24,7 +24,6 @@ PYI032 [*] Prefer `object` to `Any` for the second parameter to `__ne__` 6 | def __eq__(self, other: Any) -> bool: ... # PYI032 7 | def __ne__(self, other: typing.Any) -> typing.Any: ... # PYI032 | ^^^^^^^^^^ - | help: Replace with `object` | 6 | def __eq__(self, other: Any) -> bool: ... # PYI032 @@ -56,7 +55,6 @@ PYI032 [*] Prefer `object` to `Any` for the second parameter to `__ne__` 26 | def __eq__(self, other: "Any") -> bool: ... # PYI032 27 | def __ne__(self, other: "Any") -> bool: ... # PYI032 | ^^^^^ - | help: Replace with `object` | 26 | def __eq__(self, other: "Any") -> bool: ... # PYI032 diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI034_PYI034.py.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI034_PYI034.py.snap index b1a75c12028686..e812b69d2d7c77 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI034_PYI034.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI034_PYI034.py.snap @@ -273,7 +273,6 @@ PYI034 [*] `__enter__` methods in classes like `Generic1` usually return `self` 334 | def __new__(cls: type[Generic1]) -> Generic1: ... 335 | def __enter__(self: Generic1) -> Generic1: ... | ^^^^^^^^^ - | help: Use `Self` as return type | 334 | def __new__(cls: type[Generic1]) -> Generic1: ... @@ -415,7 +414,6 @@ PYI034 [*] `__enter__` methods in classes like `Generic5` usually return `self` 359 | def __new__(cls: type[Generic5]) -> Generic5: ... 360 | def __enter__(self: Generic5) -> Generic5: ... | ^^^^^^^^^ - | help: Use `Self` as return type | 359 | def __new__(cls: type[Generic5]) -> Generic5: ... @@ -487,7 +485,6 @@ PYI034 [*] `__iadd__` methods in classes like `UsesStringizedForwardReferences` 393 | async def __aenter__(self) -> "UsesStringizedForwardReferences": ... # PYI034 394 | def __iadd__(self, other) -> "UsesStringizedForwardReferences": ... # PYI034 | ^^^^^^^^ - | help: Use `Self` as return type | 393 | async def __aenter__(self) -> "UsesStringizedForwardReferences": ... # PYI034 diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI034_PYI034.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI034_PYI034.pyi.snap index cf6dae8bff9ecf..bec2f0f25d6804 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI034_PYI034.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI034_PYI034.pyi.snap @@ -258,7 +258,6 @@ PYI034 [*] `__enter__` methods in classes like `Generic1` usually return `self` 228 | def __new__(cls: type[Generic1]) -> Generic1: ... 229 | def __enter__(self: Generic1) -> Generic1: ... | ^^^^^^^^^ - | help: Use `Self` as return type | 228 | def __new__(cls: type[Generic1]) -> Generic1: ... @@ -400,7 +399,6 @@ PYI034 [*] `__enter__` methods in classes like `Generic5` usually return `self` 253 | def __new__(cls: type[Generic5]) -> Generic5: ... 254 | def __enter__(self: Generic5) -> Generic5: ... | ^^^^^^^^^ - | help: Use `Self` as return type | 253 | def __new__(cls: type[Generic5]) -> Generic5: ... diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI036_PYI036.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI036_PYI036.pyi.snap index 1fac76995463d6..fe50de855a5224 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI036_PYI036.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI036_PYI036.pyi.snap @@ -169,7 +169,6 @@ PYI036 All keyword-only arguments in `__aexit__` must have a default value 74 | def __exit__(self, typ, exc, tb, weird_extra_arg, extra_arg2 = None) -> None: ... # PYI036: Extra arg must have default 75 | async def __aexit__(self, typ, exc, tb, *, weird_extra_arg) -> None: ... # PYI036: kwargs must have default | ^^^^^^^^^^^^^^^ - | PYI036 The first argument in `__exit__` should be annotated with `object` or `type[BaseException] | None` --> PYI036.pyi:89:29 @@ -220,4 +219,3 @@ PYI036 Annotations for a three-argument `__exit__` overload (excluding `self`) s 164 | @overload 165 | def __exit__(self, exc_typ: object, exc: Exception, tb: builtins.TracebackType) -> None: ... # PYI036 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI041_PYI041_1.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI041_PYI041_1.pyi.snap index 904d60832624b5..fe68fdfd7f274d 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI041_PYI041_1.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI041_PYI041_1.pyi.snap @@ -6,7 +6,6 @@ PYI041 [*] Use `float` instead of `int | float` | 21 | def f0(arg1: float | int) -> None: ... # PYI041 | ^^^^^^^^^^^ - | help: Remove redundant type | 20 | @@ -20,7 +19,6 @@ PYI041 [*] Use `complex` instead of `float | complex` | 24 | def f1(arg1: float, *, arg2: float | list[str] | type[bool] | complex) -> None: ... # PYI041 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove redundant type | 23 | @@ -34,7 +32,6 @@ PYI041 [*] Use `float` instead of `int | float` | 27 | def f2(arg1: int, /, arg2: int | int | float) -> None: ... # PYI041 | ^^^^^^^^^^^^^^^^^ - | help: Remove redundant type | 26 | @@ -48,7 +45,6 @@ PYI041 [*] Use `float` instead of `int | float` | 30 | def f3(arg1: int, *args: Union[int | int | float]) -> None: ... # PYI041 | ^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove redundant type | 29 | @@ -123,7 +119,6 @@ PYI041 [*] Use `float` instead of `int | float` 48 | 49 | def f5(arg1: int, *args: Union[int, int, float]) -> None: ... # PYI041 | ^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove redundant type | 48 | @@ -137,7 +132,6 @@ PYI041 [*] Use `float` instead of `int | float` | 52 | def f6(arg1: int, *args: Union[Union[int, int, float]]) -> None: ... # PYI041 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove redundant type | 51 | @@ -151,7 +145,6 @@ PYI041 [*] Use `float` instead of `int | float` | 55 | def f7(arg1: int, *args: Union[Union[Union[int, int, float]]]) -> None: ... # PYI041 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove redundant type | 54 | @@ -165,7 +158,6 @@ PYI041 [*] Use `float` instead of `int | float` | 58 | def f8(arg1: int, *args: Union[Union[Union[int | int | float]]]) -> None: ... # PYI041 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove redundant type | 57 | @@ -253,7 +245,6 @@ PYI041 [*] Use `complex` instead of `int | float | complex` 71 | 72 | def bad5(self, arg: int | (float | complex)) -> None: ... # PYI041 | ^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove redundant type | 71 | @@ -287,7 +278,6 @@ PYI041 [*] Use `float` instead of `int | float` 79 | 80 | def f3(self, arg: None | float | None | int | None = None) -> None: ... # PYI041 - with fix | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove redundant type | 79 | diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI045_PYI045.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI045_PYI045.pyi.snap index 7b97f5d3f8d4b9..70ad469cc45339 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI045_PYI045.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI045_PYI045.pyi.snap @@ -63,4 +63,3 @@ PYI045 `__aiter__` methods should return an `AsyncIterator`, not an `AsyncIterab 48 | class TypingAsyncIterableReturn: 49 | def __aiter__(self) -> typing.AsyncIterable: ... # Error: PYI045 | ^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI052_PYI052.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI052_PYI052.pyi.snap index 2895a6c4f31832..59831af205f0c1 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI052_PYI052.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI052_PYI052.pyi.snap @@ -150,4 +150,3 @@ PYI052 Need type annotation for `WIZ` 113 | class Bop: 114 | WIZ = 4 | ^ - | diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI054_PYI054.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI054_PYI054.pyi.snap index ac2bbd14abeec1..335d4c319d2bf3 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI054_PYI054.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI054_PYI054.pyi.snap @@ -131,7 +131,6 @@ PYI054 [*] Numeric literals with a string representation longer than ten charact 19 | field16: complex = -1e1234567j 20 | field17: complex = 1e123456789j # Error: PYI054 | ^^^^^^^^^^^^ - | help: Replace with `...` | 19 | field16: complex = -1e1234567j diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI055_PYI055.py.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI055_PYI055.py.snap index 86fcce77f677eb..38150e6db7cccf 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI055_PYI055.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI055_PYI055.py.snap @@ -132,7 +132,6 @@ PYI055 [*] Multiple `type` members in a union. Combine them into one, e.g., `typ 10 | y: Union[Union[Union[type[float | int], type[complex]]]] 11 | z: Union[type[complex], Union[Union[type[Union[float, int]]]]] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Combine multiple `type` members | 10 | y: Union[Union[Union[type[float | int], type[complex]]]] @@ -162,7 +161,6 @@ PYI055 [*] Multiple `type` members in a union. Combine them into one, e.g., `typ 28 | # OK 29 | item: type[requests_mock.Mocker] | type[httpretty] = requests_mock.Mocker | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Combine multiple `type` members | 28 | # OK @@ -217,7 +215,6 @@ PYI055 [*] Multiple `type` members in a union. Combine them into one, e.g., `typ 37 | | type[requests_mock.Mocker], # another comment 38 | | type[httpretty], type[str]] = requests_mock.Mocker | |___________________________________^ - | help: Combine multiple `type` members | 35 | y: Union[type[requests_mock.Mocker], type[httpretty], type[str]] = requests_mock.Mocker @@ -235,7 +232,6 @@ PYI055 [*] Multiple `type` members in a union. Combine them into one, e.g., `typ 44 | # PYI055 45 | x: Union[type[requests_mock.Mocker], type[httpretty], type[str]] = requests_mock.Mocker | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Combine multiple `type` members | 44 | # PYI055 diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI055_PYI055.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI055_PYI055.pyi.snap index a7bd149bec9a17..b5defd6f570d2c 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI055_PYI055.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI055_PYI055.pyi.snap @@ -224,7 +224,6 @@ PYI055 [*] Multiple `type` members in a union. Combine them into one, e.g., `typ 30 | | type[requests_mock.Mocker], # another comment 31 | | type[httpretty], type[str]] = requests_mock.Mocker | |___________________________________^ - | help: Combine multiple `type` members | 28 | item2: Union[type[requests_mock.Mocker], type[httpretty], type[str]] = requests_mock.Mocker diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI059_PYI059.py.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI059_PYI059.py.snap index a0300be88fda07..19a7941f315b04 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI059_PYI059.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI059_PYI059.py.snap @@ -102,7 +102,6 @@ PYI059 `Generic[]` should always be the last base class 44 | # in case of multiple Generic[] inheritance, don't fix it. 45 | class C(Generic[T], Generic[K, V]): ... # PYI059 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Move `Generic[]` to the end PYI059 [*] `Generic[]` should always be the last base class diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI059_PYI059.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI059_PYI059.pyi.snap index ed0457cc8767d2..bc4a086f4c19d4 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI059_PYI059.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI059_PYI059.pyi.snap @@ -52,7 +52,6 @@ PYI059 [*] `Generic[]` should always be the last base class 21 | # the Generic's position issue persists. 22 | class Foo(Generic, LinkedList): ... # PYI059 | ^^^^^^^^^^^^^^^^^^^^^ - | help: Move `Generic[]` to the end | 21 | # the Generic's position issue persists. @@ -101,5 +100,4 @@ PYI059 `Generic[]` should always be the last base class 39 | # in case of multiple Generic[] inheritance, don't fix it. 40 | class C(Generic[T], Generic[K, V]): ... # PYI059 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Move `Generic[]` to the end diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI061_PYI061.py.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI061_PYI061.py.snap index 95ccdb7063d92a..346f1f57fbd473 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI061_PYI061.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI061_PYI061.py.snap @@ -282,7 +282,6 @@ PYI061 [*] Use `Literal[...] | None` rather than `Literal[None, ...]` 67 | # only emit Y062: 68 | Literal[None, True, None, True] # Y062 Duplicate "Literal[]" member "True" | ^^^^ - | help: Replace with `Literal[...] | None` | 67 | # only emit Y062: @@ -299,7 +298,6 @@ PYI061 [*] Use `Literal[...] | None` rather than `Literal[None, ...]` 67 | # only emit Y062: 68 | Literal[None, True, None, True] # Y062 Duplicate "Literal[]" member "True" | ^^^^ - | help: Replace with `Literal[...] | None` | 67 | # only emit Y062: @@ -527,7 +525,6 @@ PYI061 [*] Use `Literal[...] | None` rather than `Literal[None, ...]` 91 | # Rewriting this changes `typing.get_args(options)` at runtime, so the fix is unsafe. 92 | options = Literal["foo", "bar", None] | ^^^^ - | help: Replace with `Literal[...] | None` | 91 | # Rewriting this changes `typing.get_args(options)` at runtime, so the fix is unsafe. diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI061_PYI061.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI061_PYI061.pyi.snap index 2dc7d767869164..86a44243cce595 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI061_PYI061.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI061_PYI061.pyi.snap @@ -6,7 +6,6 @@ PYI061 [*] Use `None` rather than `Literal[None]` | 4 | def func1(arg1: Literal[None]): ... | ^^^^ - | help: Replace with `None` | 3 | @@ -20,7 +19,6 @@ PYI061 [*] Use `None` rather than `Literal[None]` | 7 | def func2(arg1: Literal[None] | int): ... | ^^^^ - | help: Replace with `None` | 6 | @@ -34,7 +32,6 @@ PYI061 [*] Use `None` rather than `Literal[None]` | 10 | def func3() -> Literal[None]: ... | ^^^^ - | help: Replace with `None` | 9 | @@ -48,7 +45,6 @@ PYI061 [*] Use `Literal[...] | None` rather than `Literal[None, ...]` | 13 | def func4(arg1: Literal[int, None, float]): ... | ^^^^ - | help: Replace with `Literal[...] | None` | 12 | @@ -62,7 +58,6 @@ PYI061 [*] Use `None` rather than `Literal[None]` | 16 | def func5(arg1: Literal[None, None]): ... | ^^^^ - | help: Replace with `None` | 15 | @@ -76,7 +71,6 @@ PYI061 [*] Use `None` rather than `Literal[None]` | 16 | def func5(arg1: Literal[None, None]): ... | ^^^^ - | help: Replace with `None` | 15 | @@ -132,7 +126,6 @@ PYI061 Use `None` rather than `Literal[None]` | 31 | def func8(arg1: Literal[None] | None):... | ^^^^ - | help: Replace with `None` PYI061 [*] Use `None` rather than `Literal[None]` @@ -140,7 +133,6 @@ PYI061 [*] Use `None` rather than `Literal[None]` | 34 | def func9(arg1: Union[Literal[None], None]): ... | ^^^^ - | help: Replace with `None` | 33 | @@ -172,7 +164,6 @@ PYI061 [*] Use `Literal[...] | None` rather than `Literal[None, ...]` 42 | Literal[None] # PYI061 None inside "Literal[]" expression. Replace with "None" 43 | Literal[True, None] # PYI061 None inside "Literal[]" expression. Replace with "Literal[True] | None" | ^^^^ - | help: Replace with `Literal[...] | None` | 42 | Literal[None] # PYI061 None inside "Literal[]" expression. Replace with "None" @@ -274,5 +265,4 @@ PYI061 Use `None` rather than `Literal[None]` 54 | d: None | (Literal[None] | None) 55 | e: None | ((None | Literal[None]) | None) | None | ^^^^ - | help: Replace with `None` diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI062_PYI062.py.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI062_PYI062.py.snap index 628a693de4c51b..5a7f1931629670 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI062_PYI062.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI062_PYI062.py.snap @@ -298,7 +298,6 @@ PYI062 [*] Duplicate literal member `1` 32 | Literal[Literal[Literal[1], Literal[1]]] # once 33 | Literal[Literal[1], Literal[Literal[Literal[1]]]] # once | ^ - | help: Remove duplicates | 32 | Literal[Literal[Literal[1], Literal[1]]] # once diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI062_PYI062.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI062_PYI062.pyi.snap index a6b44dde8fc619..28c3c6aa97402a 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI062_PYI062.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI062_PYI062.pyi.snap @@ -298,7 +298,6 @@ PYI062 [*] Duplicate literal member `1` 32 | Literal[Literal[Literal[1], Literal[1]]] # once 33 | Literal[Literal[1], Literal[Literal[Literal[1]]]] # once | ^ - | help: Remove duplicates | 32 | Literal[Literal[Literal[1], Literal[1]]] # once diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__preview_PYI041_PYI041_4.py.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__preview_PYI041_PYI041_4.py.snap index 4de04c2e135fe1..917bc5aa77e575 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__preview_PYI041_PYI041_4.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__preview_PYI041_PYI041_4.py.snap @@ -69,5 +69,4 @@ PYI041 Use `float` instead of `int | float` | ___________^ 8 | | t, float, Foo]") -> "None": ... | |_______________^ - | help: Remove redundant type diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__py38_PYI061_PYI061.py.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__py38_PYI061_PYI061.py.snap index ea86e80b20ef2c..add20bd27590fa 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__py38_PYI061_PYI061.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__py38_PYI061_PYI061.py.snap @@ -302,7 +302,6 @@ PYI061 [*] Use `Optional[Literal[...]]` rather than `Literal[None, ...]` 67 | # only emit Y062: 68 | Literal[None, True, None, True] # Y062 Duplicate "Literal[]" member "True" | ^^^^ - | help: Replace with `Optional[Literal[...]]` | - from typing import Literal, Union @@ -323,7 +322,6 @@ PYI061 [*] Use `Optional[Literal[...]]` rather than `Literal[None, ...]` 67 | # only emit Y062: 68 | Literal[None, True, None, True] # Y062 Duplicate "Literal[]" member "True" | ^^^^ - | help: Replace with `Optional[Literal[...]]` | - from typing import Literal, Union @@ -579,7 +577,6 @@ PYI061 [*] Use `Optional[Literal[...]]` rather than `Literal[None, ...]` 91 | # Rewriting this changes `typing.get_args(options)` at runtime, so the fix is unsafe. 92 | options = Literal["foo", "bar", None] | ^^^^ - | help: Replace with `Optional[Literal[...]]` | - from typing import Literal, Union diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__py38_PYI061_PYI061.pyi.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__py38_PYI061_PYI061.pyi.snap index 2dc7d767869164..86a44243cce595 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__py38_PYI061_PYI061.pyi.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__py38_PYI061_PYI061.pyi.snap @@ -6,7 +6,6 @@ PYI061 [*] Use `None` rather than `Literal[None]` | 4 | def func1(arg1: Literal[None]): ... | ^^^^ - | help: Replace with `None` | 3 | @@ -20,7 +19,6 @@ PYI061 [*] Use `None` rather than `Literal[None]` | 7 | def func2(arg1: Literal[None] | int): ... | ^^^^ - | help: Replace with `None` | 6 | @@ -34,7 +32,6 @@ PYI061 [*] Use `None` rather than `Literal[None]` | 10 | def func3() -> Literal[None]: ... | ^^^^ - | help: Replace with `None` | 9 | @@ -48,7 +45,6 @@ PYI061 [*] Use `Literal[...] | None` rather than `Literal[None, ...]` | 13 | def func4(arg1: Literal[int, None, float]): ... | ^^^^ - | help: Replace with `Literal[...] | None` | 12 | @@ -62,7 +58,6 @@ PYI061 [*] Use `None` rather than `Literal[None]` | 16 | def func5(arg1: Literal[None, None]): ... | ^^^^ - | help: Replace with `None` | 15 | @@ -76,7 +71,6 @@ PYI061 [*] Use `None` rather than `Literal[None]` | 16 | def func5(arg1: Literal[None, None]): ... | ^^^^ - | help: Replace with `None` | 15 | @@ -132,7 +126,6 @@ PYI061 Use `None` rather than `Literal[None]` | 31 | def func8(arg1: Literal[None] | None):... | ^^^^ - | help: Replace with `None` PYI061 [*] Use `None` rather than `Literal[None]` @@ -140,7 +133,6 @@ PYI061 [*] Use `None` rather than `Literal[None]` | 34 | def func9(arg1: Union[Literal[None], None]): ... | ^^^^ - | help: Replace with `None` | 33 | @@ -172,7 +164,6 @@ PYI061 [*] Use `Literal[...] | None` rather than `Literal[None, ...]` 42 | Literal[None] # PYI061 None inside "Literal[]" expression. Replace with "None" 43 | Literal[True, None] # PYI061 None inside "Literal[]" expression. Replace with "Literal[True] | None" | ^^^^ - | help: Replace with `Literal[...] | None` | 42 | Literal[None] # PYI061 None inside "Literal[]" expression. Replace with "None" @@ -274,5 +265,4 @@ PYI061 Use `None` rather than `Literal[None]` 54 | d: None | (Literal[None] | None) 55 | e: None | ((None | Literal[None]) | None) | None | ^^^^ - | help: Replace with `None` diff --git a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__pyi021_pie790_isolation_check.snap b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__pyi021_pie790_isolation_check.snap index c1e4f0b4b3cb1f..620f48aa6e6b3e 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__pyi021_pie790_isolation_check.snap +++ b/crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__pyi021_pie790_isolation_check.snap @@ -25,7 +25,6 @@ PIE790 [*] Unnecessary `...` literal 5 | """Will report both, but only fix the first.""" # ERROR PYI021 6 | ... # ERROR PIE790 | ^^^ - | help: Remove unnecessary `...` | 5 | """Will report both, but only fix the first.""" # ERROR PYI021 diff --git a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT008.snap b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT008.snap index ca221bd73bfd8e..90713cb0312cf6 100644 --- a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT008.snap +++ b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT008.snap @@ -123,4 +123,3 @@ PT008 Use `return_value=` instead of patching with `lambda` 47 | mocker.patch.object(obj, "attr", lambda *args, **kwargs: None) 48 | module_mocker.patch.object(obj, "attr", lambda *args, **kwargs: None) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT009.snap b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT009.snap index 72090c6833c186..abf2f69567858f 100644 --- a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT009.snap +++ b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT009.snap @@ -582,7 +582,6 @@ PT009 [*] Use a regular `assert` instead of unittest-style `failIfEqual` 93 | def test_fail_if_equal(self): 94 | self.failIfEqual(1, 2) # Error | ^^^^^^^^^^^^^^^^ - | help: Replace `failIfEqual(...)` with `assert ...` | 93 | def test_fail_if_equal(self): diff --git a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT012.snap b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT012.snap index cd6b2a6d20af89..4f08228382ef1a 100644 --- a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT012.snap +++ b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT012.snap @@ -9,7 +9,6 @@ PT012 `pytest.raises()` block should contain a single simple statement 43 | | len([]) 44 | | [].size | |_______________^ - | PT012 `pytest.raises()` block should contain a single simple statement --> PT012.py:48:5 @@ -72,7 +71,6 @@ PT012 `pytest.raises()` block should contain a single simple statement 66 | | if True: 67 | | raise Exception | |_______________________________^ - | PT012 `pytest.raises()` block should contain a single simple statement --> PT012.py:71:5 @@ -84,7 +82,6 @@ PT012 `pytest.raises()` block should contain a single simple statement 74 | | except: 75 | | raise | |_________________^ - | PT012 `pytest.raises()` block should contain a single simple statement --> PT012.py:83:5 @@ -134,4 +131,3 @@ PT012 `pytest.raises()` block should contain a single simple statement 96 | | async for a in b: 97 | | assert foo | |______________________^ - | diff --git a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT013.snap b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT013.snap index edf98e63d94b5a..b127438d884f45 100644 --- a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT013.snap +++ b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT013.snap @@ -28,4 +28,3 @@ PT013 Incorrect import of `pytest`; use `import pytest` instead 12 | from pytest import fixture 13 | from pytest import fixture as other_name | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT017.snap b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT017.snap index 6fc520ff76348d..19129ac463e8ab 100644 --- a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT017.snap +++ b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT017.snap @@ -8,4 +8,3 @@ PT017 Found assertion on exception `e` in `except` block, use `pytest.raises()` 18 | except Exception as e: 19 | assert e.message, "blah blah" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT018.snap b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT018.snap index 92f42410e9e138..15b8ed2c4a9a7a 100644 --- a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT018.snap +++ b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT018.snap @@ -259,7 +259,6 @@ PT018 Assertion should be broken down into multiple parts 39 | # detected, but no fix for mixed conditions (e.g. `a or b and c`) 40 | assert not (something or something_else and something_third) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Break down assertion into multiple parts PT018 [*] Assertion should be broken down into multiple parts @@ -287,7 +286,6 @@ PT018 [*] Assertion should be broken down into multiple parts 44 | assert something and something_else # Error 45 | assert something and something_else and something_third # Error | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Break down assertion into multiple parts | 44 | assert something and something_else # Error @@ -327,7 +325,6 @@ PT018 Assertion should be broken down into multiple parts 53 | x = 1; \ 54 | assert something and something_else | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Break down assertion into multiple parts PT018 [*] Assertion should be broken down into multiple parts @@ -396,5 +393,4 @@ PT018 Assertion should be broken down into multiple parts 78 | | something and something_else 79 | | ) | |_____^ - | help: Break down assertion into multiple parts diff --git a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT022.snap b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT022.snap index 0d4813e1873cd4..fcd8705d8b94db 100644 --- a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT022.snap +++ b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT022.snap @@ -8,7 +8,6 @@ PT022 [*] No teardown in fixture `error`, use `return` instead of `yield` 16 | resource = acquire_resource() 17 | yield resource | ^^^^^^^^^^^^^^ - | help: Replace `yield` with `return` | 16 | resource = acquire_resource() @@ -24,7 +23,6 @@ PT022 [*] No teardown in fixture `error`, use `return` instead of `yield` 36 | resource = acquire_resource() 37 | yield resource | ^^^^^^^^^^^^^^ - | help: Replace `yield` with `return` | 34 | @pytest.fixture() @@ -43,7 +41,6 @@ PT022 [*] No teardown in fixture `error`, use `return` instead of `yield` 42 | resource = acquire_resource() 43 | yield resource | ^^^^^^^^^^^^^^ - | help: Replace `yield` with `return` | 40 | @pytest.fixture() diff --git a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT028.snap b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT028.snap index d91741bcddfd2e..0d4024d9bd2ee8 100644 --- a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT028.snap +++ b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT028.snap @@ -158,7 +158,6 @@ PT028 [*] Test function parameter `a` has default argument 10 | def test_foo(a: (int) = (1)): ... 11 | def test_foo(a=1, /, b=2, *, c=3): ... | ^ - | help: Remove default argument | 10 | def test_foo(a: (int) = (1)): ... @@ -175,7 +174,6 @@ PT028 [*] Test function parameter `b` has default argument 10 | def test_foo(a: (int) = (1)): ... 11 | def test_foo(a=1, /, b=2, *, c=3): ... | ^ - | help: Remove default argument | 10 | def test_foo(a: (int) = (1)): ... @@ -192,7 +190,6 @@ PT028 [*] Test function parameter `c` has default argument 10 | def test_foo(a: (int) = (1)): ... 11 | def test_foo(a=1, /, b=2, *, c=3): ... | ^ - | help: Remove default argument | 10 | def test_foo(a: (int) = (1)): ... diff --git a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT031.snap b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT031.snap index 498b32eacfa77b..442182375a3318 100644 --- a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT031.snap +++ b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__PT031.snap @@ -9,7 +9,6 @@ PT031 `pytest.warns()` block should contain a single simple statement 43 | | foo() 44 | | bar() | |_____________^ - | PT031 `pytest.warns()` block should contain a single simple statement --> PT031.py:48:5 @@ -72,7 +71,6 @@ PT031 `pytest.warns()` block should contain a single simple statement 66 | | if True: 67 | | foo() | |_____________________^ - | PT031 `pytest.warns()` block should contain a single simple statement --> PT031.py:71:5 @@ -84,7 +82,6 @@ PT031 `pytest.warns()` block should contain a single simple statement 74 | | except: 75 | | raise | |_________________^ - | PT031 `pytest.warns()` block should contain a single simple statement --> PT031.py:83:5 @@ -134,4 +131,3 @@ PT031 `pytest.warns()` block should contain a single simple statement 96 | | async for a in b: 97 | | assert foo | |______________________^ - | diff --git a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__is_pytest_test.snap b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__is_pytest_test.snap index d8906b88455857..c3597dcf9d8e18 100644 --- a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__is_pytest_test.snap +++ b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__is_pytest_test.snap @@ -61,7 +61,6 @@ PT028 [*] Test function parameter `a` has default argument 7 | def test_this_too_is_a_test(self, a=1): ... 8 | def testAndOfCourseThis(self, a=1): ... | ^ - | help: Remove default argument | 7 | def test_this_too_is_a_test(self, a=1): ... diff --git a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__preview__PT018_PT018.py.snap b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__preview__PT018_PT018.py.snap index 8f9feb7a6c9f42..1a299ba99a1b22 100644 --- a/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__preview__PT018_PT018.py.snap +++ b/crates/ruff_linter/src/rules/flake8_pytest_style/snapshots/ruff_linter__rules__flake8_pytest_style__tests__preview__PT018_PT018.py.snap @@ -317,7 +317,6 @@ PT018 Assertion should be broken down into multiple parts 78 | | something and something_else 79 | | ) | |_____^ - | help: Break down assertion into multiple parts @@ -616,7 +615,6 @@ PT018 [*] Assertion should be broken down into multiple parts 78 | | something and something_else 79 | | ) | |_____^ - | help: Break down assertion into multiple parts | 75 | def test_comments(): diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__only_multiline_doubles_all.py.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__only_multiline_doubles_all.py.snap index 2e8097b08233b3..e2b969aedb1500 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__only_multiline_doubles_all.py.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__only_multiline_doubles_all.py.snap @@ -11,7 +11,6 @@ Q001 [*] Double quote multiline found but single quotes preferred 6 | | double quote string 7 | | """ | |___^ - | help: Replace double multiline quotes with single quotes | 4 | diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap index e44689e5980d8a..7935bd5f49a315 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap @@ -33,7 +33,6 @@ Q001 [*] Double quote multiline found but single quotes preferred 10 | | this is not a docstring 11 | | """ | |___^ - | help: Replace double multiline quotes with single quotes | 8 | pass diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap index 77109e8df46f97..9520a1fc218563 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap @@ -25,7 +25,6 @@ Q001 [*] Double quote multiline found but single quotes preferred 5 | pass 6 | """ this is not a docstring """ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace double multiline quotes with single quotes | 5 | pass diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap index 7d6abc4bf2a386..4d53a37f63ede6 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap @@ -40,7 +40,6 @@ Q002 [*] Single quote docstring found but double quotes preferred 8 | 9 | class Nested(foo()[:]): ''' inline docstring '''; pass | ^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace single quotes docstring with double quotes | 8 | diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap index 1286d50cb56ade..a797388c0792f6 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap @@ -46,7 +46,6 @@ Q002 [*] Single quote docstring found but double quotes preferred 26 | def function_with_single_docstring(a): 27 | 'Single line docstring' | ^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace single quotes docstring with double quotes | 26 | def function_with_single_docstring(a): diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_mixed_quotes_class_var_1.py.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_mixed_quotes_class_var_1.py.snap index f76e2d2544a41d..aafe221fec038a 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_mixed_quotes_class_var_1.py.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_mixed_quotes_class_var_1.py.snap @@ -60,7 +60,6 @@ Q002 Single quote docstring found but double quotes preferred 8 | 9 | class Nested(foo()[:]): ''"Start with empty string" ' and lint docstring safely'; pass | ^^ - | help: Replace single quotes docstring with double quotes Q002 [*] Single quote docstring found but double quotes preferred @@ -70,7 +69,6 @@ Q002 [*] Single quote docstring found but double quotes preferred 8 | 9 | class Nested(foo()[:]): ''"Start with empty string" ' and lint docstring safely'; pass | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace single quotes docstring with double quotes | 8 | diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_mixed_quotes_class_var_2.py.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_mixed_quotes_class_var_2.py.snap index 50124a4fd06eb4..61253ebe239669 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_mixed_quotes_class_var_2.py.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_mixed_quotes_class_var_2.py.snap @@ -72,7 +72,6 @@ Q002 [*] Single quote docstring found but double quotes preferred 8 | 9 | class Nested(foo()[:]): 'Do not'" start with empty string" ' and lint docstring safely'; pass | ^^^^^^^^ - | help: Replace single quotes docstring with double quotes | 8 | @@ -87,7 +86,6 @@ Q002 [*] Single quote docstring found but double quotes preferred 8 | 9 | class Nested(foo()[:]): 'Do not'" start with empty string" ' and lint docstring safely'; pass | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace single quotes docstring with double quotes | 8 | diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_mixed_quotes_module_singleline_var_1.py.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_mixed_quotes_module_singleline_var_1.py.snap index 700b68128eb472..dbbf6c1b35bd50 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_mixed_quotes_module_singleline_var_1.py.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_mixed_quotes_module_singleline_var_1.py.snap @@ -33,7 +33,6 @@ Q001 [*] Double quote multiline found but single quotes preferred 4 | pass 5 | """ this is not a docstring """ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace double multiline quotes with single quotes | 4 | pass diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_mixed_quotes_module_singleline_var_2.py.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_mixed_quotes_module_singleline_var_2.py.snap index 1f48167adf6e92..48503a33b2bbb4 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_mixed_quotes_module_singleline_var_2.py.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_mixed_quotes_module_singleline_var_2.py.snap @@ -38,7 +38,6 @@ Q001 [*] Double quote multiline found but single quotes preferred 4 | pass 5 | """ this is not a docstring """ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace double multiline quotes with single quotes | 4 | pass diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap index a92f5f6965bab3..d520428d8ea3a9 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap @@ -40,7 +40,6 @@ Q002 [*] Double quote docstring found but single quotes preferred 8 | 9 | class Nested(foo()[:]): """ inline docstring """; pass | ^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace double quotes docstring with single quotes | 8 | diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap index d4bbf6696f1ecd..90a6c15e183645 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap @@ -46,7 +46,6 @@ Q002 [*] Double quote docstring found but single quotes preferred 26 | def function_with_single_docstring(a): 27 | "Single line docstring" | ^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace double quotes docstring with single quotes | 26 | def function_with_single_docstring(a): diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_mixed_quotes_class_var_1.py.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_mixed_quotes_class_var_1.py.snap index 28bd74c2a0cbd9..1e01cbb5a886b4 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_mixed_quotes_class_var_1.py.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_mixed_quotes_class_var_1.py.snap @@ -28,5 +28,4 @@ Q002 Double quote docstring found but single quotes preferred 8 | 9 | class Nested(foo()[:]): ""'Start with empty string' ' and lint docstring safely'; pass | ^^ - | help: Replace double quotes docstring with single quotes diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_mixed_quotes_class_var_2.py.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_mixed_quotes_class_var_2.py.snap index 8d5a27598ec99b..e5cc5e652231ba 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_mixed_quotes_class_var_2.py.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_mixed_quotes_class_var_2.py.snap @@ -40,7 +40,6 @@ Q002 [*] Double quote docstring found but single quotes preferred 8 | 9 | class Nested(foo()[:]): "Do not"' start with empty string' ' and lint docstring safely'; pass | ^^^^^^^^ - | help: Replace double quotes docstring with single quotes | 8 | diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap index 67f3b4f08ceb4e..236d3304e20ecc 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap @@ -33,7 +33,6 @@ Q001 [*] Single quote multiline found but double quotes preferred 10 | | this is not a docstring 11 | | ''' | |___^ - | help: Replace single multiline quotes with double quotes | 8 | pass diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap index 56d20c5bdbfb16..a23fc815351983 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap @@ -25,7 +25,6 @@ Q001 [*] Single quote multiline found but double quotes preferred 5 | pass 6 | ''' this is not a docstring ''' | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace single multiline quotes with double quotes | 5 | pass diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap index 4d59c43c2c7015..bd4d6fa017ab1f 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap @@ -179,7 +179,6 @@ Q003 [*] Change outer quotes to avoid escaping inner quotes 38 | f"\"normal\" {f"\"nested\" {"other"} normal"} 'single quotes'" # Q003 39 | f"\"normal\" {f"\"nested\" {"other"} 'single quotes'"} normal" # Q003 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Change outer quotes to avoid escaping inner quotes | 38 | f"\"normal\" {f"\"nested\" {"other"} normal"} 'single quotes'" # Q003 @@ -335,7 +334,6 @@ Q003 [*] Change outer quotes to avoid escaping inner quotes 60 | t"\"normal\" {t"\"nested\" {"other"} normal"} 'single quotes'" # Q003 61 | t"\"normal\" {t"\"nested\" {"other"} 'single quotes'"} normal" # Q003 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Change outer quotes to avoid escaping inner quotes | 60 | t"\"normal\" {t"\"nested\" {"other"} normal"} 'single quotes'" # Q003 diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_doubles_over_singles_escaped_py311.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_doubles_over_singles_escaped_py311.snap index 386a1f16903f66..2cc3c94994f248 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_doubles_over_singles_escaped_py311.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_doubles_over_singles_escaped_py311.snap @@ -214,7 +214,6 @@ Q003 [*] Change outer quotes to avoid escaping inner quotes 60 | t"\"normal\" {t"\"nested\" {"other"} normal"} 'single quotes'" # Q003 61 | t"\"normal\" {t"\"nested\" {"other"} 'single quotes'"} normal" # Q003 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Change outer quotes to avoid escaping inner quotes | 60 | t"\"normal\" {t"\"nested\" {"other"} normal"} 'single quotes'" # Q003 diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_doubles_over_singles_escaped_unnecessary.py.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_doubles_over_singles_escaped_unnecessary.py.snap index e995376b96f09e..08a6364fdcfaae 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_doubles_over_singles_escaped_unnecessary.py.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_doubles_over_singles_escaped_unnecessary.py.snap @@ -302,7 +302,6 @@ Q004 [*] Unnecessary escape on inner quote character 45 | # Invalid escapes in bytestrings are also triggered: 46 | x = b"\xe7\xeb\x0c\xa1\x1b\x83tN\xce=x\xe9\xbe\x01\xb9\x13B_\xba\xe7\x0c2\xce\'rm\x0e\xcd\xe9.\xf8\xd2" # Q004 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove backslash | 45 | # Invalid escapes in bytestrings are also triggered: diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap index f8e725e4359de1..092dc8ec5a4076 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap @@ -112,7 +112,6 @@ Q000 [*] Single quotes found but double quotes preferred 26 | 'This can use "single" quotes' 27 | 'But this needs to be changed' | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace single quotes with double quotes | 26 | 'This can use "single" quotes' diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_doubles_over_singles_would_be_triple_quotes.py.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_doubles_over_singles_would_be_triple_quotes.py.snap index 17507020bdfbb9..6260fa19f67284 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_doubles_over_singles_would_be_triple_quotes.py.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_doubles_over_singles_would_be_triple_quotes.py.snap @@ -30,7 +30,6 @@ Q000 [*] Single quotes found but double quotes preferred 1 | s = ''"Start with empty string" ' and lint docstring safely' 2 | s = 'Do not'" start with empty string" ' and lint docstring safely' | ^^^^^^^^ - | help: Replace single quotes with double quotes | 1 | s = ''"Start with empty string" ' and lint docstring safely' @@ -44,7 +43,6 @@ Q000 [*] Single quotes found but double quotes preferred 1 | s = ''"Start with empty string" ' and lint docstring safely' 2 | s = 'Do not'" start with empty string" ' and lint docstring safely' | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace single quotes with double quotes | 1 | s = ''"Start with empty string" ' and lint docstring safely' diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap index 1bbb2878d744a8..46600a513b9432 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap @@ -214,7 +214,6 @@ Q003 [*] Change outer quotes to avoid escaping inner quotes 40 | f'\'normal\' {f'\'nested\' {'other'} normal'} "double quotes"' # Q003 41 | f'\'normal\' {f'\'nested\' {'other'} "double quotes"'} normal' # Q00l | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Change outer quotes to avoid escaping inner quotes | 40 | f'\'normal\' {f'\'nested\' {'other'} normal'} "double quotes"' # Q003 @@ -388,7 +387,6 @@ Q003 [*] Change outer quotes to avoid escaping inner quotes 64 | t'\'normal\' {t'\'nested\' {'other'} normal'} "double quotes"' # Q003 65 | t'\'normal\' {t'\'nested\' {'other'} "double quotes"'} normal' # Q00l | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Change outer quotes to avoid escaping inner quotes | 64 | t'\'normal\' {t'\'nested\' {'other'} normal'} "double quotes"' # Q003 diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_singles_over_doubles_escaped_py311.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_singles_over_doubles_escaped_py311.snap index 0efcd426fcd56f..a034a879a6c160 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_singles_over_doubles_escaped_py311.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_singles_over_doubles_escaped_py311.snap @@ -267,7 +267,6 @@ Q003 [*] Change outer quotes to avoid escaping inner quotes 64 | t'\'normal\' {t'\'nested\' {'other'} normal'} "double quotes"' # Q003 65 | t'\'normal\' {t'\'nested\' {'other'} "double quotes"'} normal' # Q00l | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Change outer quotes to avoid escaping inner quotes | 64 | t'\'normal\' {t'\'nested\' {'other'} normal'} "double quotes"' # Q003 diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_singles_over_doubles_escaped_unnecessary.py.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_singles_over_doubles_escaped_unnecessary.py.snap index 39c1227564335f..dcdf0dd56afedb 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_singles_over_doubles_escaped_unnecessary.py.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_singles_over_doubles_escaped_unnecessary.py.snap @@ -321,7 +321,6 @@ Q004 [*] Unnecessary escape on inner quote character 44 | this_is_fine = 'This is an \\"escaped\\" quote' 45 | this_should_raise_Q004 = 'This is an \\\"escaped\\\" quote with an extra backslash' | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove backslash | 44 | this_is_fine = 'This is an \\"escaped\\" quote' diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap index 8d292c18827a37..4aeda3de025878 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap @@ -112,7 +112,6 @@ Q000 [*] Double quotes found but single quotes preferred 26 | "This can use 'double' quotes" 27 | "But this needs to be changed" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace double quotes with single quotes | 26 | "This can use 'double' quotes" diff --git a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_singles_over_doubles_would_be_triple_quotes.py.snap b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_singles_over_doubles_would_be_triple_quotes.py.snap index 4e5583b7f70aa5..abfdc490253558 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_singles_over_doubles_would_be_triple_quotes.py.snap +++ b/crates/ruff_linter/src/rules/flake8_quotes/snapshots/ruff_linter__rules__flake8_quotes__tests__require_singles_over_doubles_would_be_triple_quotes.py.snap @@ -16,7 +16,6 @@ Q000 [*] Double quotes found but single quotes preferred 1 | s = ""'Start with empty string' ' and lint docstring safely' 2 | s = "Do not"' start with empty string' ' and lint docstring safely' | ^^^^^^^^ - | help: Replace double quotes with single quotes | 1 | s = ""'Start with empty string' ' and lint docstring safely' diff --git a/crates/ruff_linter/src/rules/flake8_raise/snapshots/ruff_linter__rules__flake8_raise__tests__unnecessary-paren-on-raise-exception_RSE102.py.snap b/crates/ruff_linter/src/rules/flake8_raise/snapshots/ruff_linter__rules__flake8_raise__tests__unnecessary-paren-on-raise-exception_RSE102.py.snap index 8b9f917e854111..5e2ff0db58e080 100644 --- a/crates/ruff_linter/src/rules/flake8_raise/snapshots/ruff_linter__rules__flake8_raise__tests__unnecessary-paren-on-raise-exception_RSE102.py.snap +++ b/crates/ruff_linter/src/rules/flake8_raise/snapshots/ruff_linter__rules__flake8_raise__tests__unnecessary-paren-on-raise-exception_RSE102.py.snap @@ -251,7 +251,6 @@ RSE102 [*] Unnecessary parentheses on raised exception 106 | if future.exception(): 107 | raise future.Exception() | ^^ - | help: Remove unnecessary parentheses | 106 | if future.exception(): @@ -269,7 +268,6 @@ RSE102 [*] Unnecessary parentheses on raised exception 111 | | # comment 112 | | ) | |_^ - | help: Remove unnecessary parentheses | 109 | diff --git a/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET501_RET501.py.snap b/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET501_RET501.py.snap index c814daac2742a7..e741c2ab9b7929 100644 --- a/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET501_RET501.py.snap +++ b/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET501_RET501.py.snap @@ -8,7 +8,6 @@ RET501 [*] Do not explicitly `return None` in function if it is the only possibl 3 | return 4 | return None # error | ^^^^^^^^^^^ - | help: Remove explicit `return None` | 3 | return @@ -44,7 +43,6 @@ RET501 [*] Do not explicitly `return None` in function if it is the only possibl 60 | | None # comment 61 | | ) | |_________^ - | help: Remove explicit `return None` | 58 | return diff --git a/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET503_RET503.py.snap b/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET503_RET503.py.snap index 2e9440c2b22621..eaaa56b939d770 100644 --- a/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET503_RET503.py.snap +++ b/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET503_RET503.py.snap @@ -28,7 +28,6 @@ RET503 [*] Missing explicit `return` at the end of function able to return non-` 29 | | else: 30 | | return 2 | |________________^ - | help: Add explicit `return` statement | 30 | return 2 @@ -46,7 +45,6 @@ RET503 [*] Missing explicit `return` at the end of function able to return non-` 36 | | 37 | | print() # error | |___________^ - | help: Add explicit `return` statement | 37 | print() # error @@ -84,7 +82,6 @@ RET503 [*] Missing explicit `return` at the end of function able to return non-` 52 | | else: 53 | | print() # error | |_______________^ - | help: Add explicit `return` statement | 53 | print() # error @@ -102,7 +99,6 @@ RET503 [*] Missing explicit `return` at the end of function able to return non-` 59 | | return False 60 | | no_such_function() # error | |______________________^ - | help: Add explicit `return` statement | 60 | no_such_function() # error @@ -120,7 +116,6 @@ RET503 [*] Missing explicit `return` at the end of function able to return non-` 66 | | return False 67 | | print("", end="") # error | |_____________________^ - | help: Add explicit `return` statement | 67 | print("", end="") # error @@ -139,7 +134,6 @@ RET503 [*] Missing explicit `return` at the end of function able to return non-` 85 | | return 1 86 | | y += 1 | |______________^ - | help: Add explicit `return` statement | 86 | y += 1 @@ -158,7 +152,6 @@ RET503 [*] Missing explicit `return` at the end of function able to return non-` 116 | | break 117 | | return z | |________________^ - | help: Add explicit `return` statement | 117 | return z @@ -179,7 +172,6 @@ RET503 [*] Missing explicit `return` at the end of function able to return non-` 126 | | return z 127 | | return None | |___________________^ - | help: Add explicit `return` statement | 127 | return None @@ -197,7 +189,6 @@ RET503 [*] Missing explicit `return` at the end of function able to return non-` 133 | | continue 134 | | return z | |________________^ - | help: Add explicit `return` statement | 134 | return z @@ -218,7 +209,6 @@ RET503 [*] Missing explicit `return` at the end of function able to return non-` 143 | | return z 144 | | return None | |___________________^ - | help: Add explicit `return` statement | 144 | return None @@ -237,7 +227,6 @@ RET503 [*] Missing explicit `return` at the end of function able to return non-` 275 | | for value in values: 276 | | print(value) | |____________________^ - | help: Add explicit `return` statement | 276 | print(value) @@ -257,7 +246,6 @@ RET503 [*] Missing explicit `return` at the end of function able to return non-` 291 | | case 1: 292 | | print() # error | |___________________^ - | help: Add explicit `return` statement | 292 | print() # error @@ -274,7 +262,6 @@ RET503 [*] Missing explicit `return` at the end of function able to return non-` 301 | | if True: 302 | | return "" | |_____________________^ - | help: Add explicit `return` statement | 302 | return "" @@ -290,7 +277,6 @@ RET503 [*] Missing explicit `return` at the end of function able to return non-` 306 | | if True: 307 | | return "" | |_____________________^ - | help: Add explicit `return` statement | 307 | return "" @@ -306,7 +292,6 @@ RET503 [*] Missing explicit `return` at the end of function able to return non-` 311 | | if True: 312 | | return "" # type: ignore | |_____________________^ - | help: Add explicit `return` statement | 312 | return "" # type: ignore @@ -322,7 +307,6 @@ RET503 [*] Missing explicit `return` at the end of function able to return non-` 316 | | if True: 317 | | return "" ; | |_____________________^ - | help: Add explicit `return` statement | 317 | return "" ; @@ -356,7 +340,6 @@ RET503 [*] Missing explicit `return` at the end of function able to return non-` 328 | | return 1 329 | | x = 2 \ | |_________^ - | help: Add explicit `return` statement | 330 | @@ -375,7 +358,6 @@ RET503 [*] Missing explicit `return` at the end of function able to return non-` 402 | | with c: 403 | | d | |_____________^ - | help: Add explicit `return` statement | 403 | d @@ -396,7 +378,6 @@ RET503 [*] Missing explicit `return` at the end of function able to return non-` 417 | | return 5 418 | | bar() | |_________^ - | help: Add explicit `return` statement | 417 | return 5 diff --git a/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET504_RET504.py.snap b/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET504_RET504.py.snap index a88286f4f46685..f86aab6b5a37f4 100644 --- a/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET504_RET504.py.snap +++ b/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET504_RET504.py.snap @@ -8,7 +8,6 @@ RET504 [*] Unnecessary assignment to `a` before `return` statement 5 | a = 1 6 | return a # RET504 | ^ - | help: Remove unnecessary assignment | 4 | def x(): @@ -26,7 +25,6 @@ RET504 [*] Unnecessary assignment to `formatted` before `return` statement 22 | formatted = formatted.replace("()", "").replace(" ", " ").strip() 23 | return formatted | ^^^^^^^^^ - | help: Remove unnecessary assignment | 21 | # clean up after any blank components @@ -44,7 +42,6 @@ RET504 [*] Unnecessary assignment to `queryset` before `return` statement 245 | queryset = queryset.filter(c=3) 246 | return queryset | ^^^^^^^^ - | help: Remove unnecessary assignment | 244 | queryset = Model.filter(a=1) @@ -62,7 +59,6 @@ RET504 [*] Unnecessary assignment to `queryset` before `return` statement 250 | queryset = Model.filter(a=1) 251 | return queryset # RET504 | ^^^^^^^^ - | help: Remove unnecessary assignment | 249 | def get_queryset(): @@ -80,7 +76,6 @@ RET504 [*] Unnecessary assignment to `val` before `return` statement 268 | val = 1 269 | return val # RET504 | ^^^ - | help: Remove unnecessary assignment | 267 | return val @@ -98,7 +93,6 @@ RET504 [*] Unnecessary assignment to `x` before `return` statement 320 | x = f.read() 321 | return x # RET504 | ^ - | help: Remove unnecessary assignment | 319 | with open("foo.txt", "r") as f: @@ -116,7 +110,6 @@ RET504 [*] Unnecessary assignment to `b` before `return` statement 341 | b=a 342 | return b # RET504 | ^ - | help: Remove unnecessary assignment | 340 | a = 1 @@ -134,7 +127,6 @@ RET504 [*] Unnecessary assignment to `b` before `return` statement 347 | b =a 348 | return b # RET504 | ^ - | help: Remove unnecessary assignment | 346 | a = 1 @@ -152,7 +144,6 @@ RET504 [*] Unnecessary assignment to `b` before `return` statement 353 | b= a 354 | return b # RET504 | ^ - | help: Remove unnecessary assignment | 352 | a = 1 @@ -170,7 +161,6 @@ RET504 [*] Unnecessary assignment to `a` before `return` statement 358 | a = 1 # Comment 359 | return a | ^ - | help: Remove unnecessary assignment | 357 | def foo(): @@ -188,7 +178,6 @@ RET504 [*] Unnecessary assignment to `D` before `return` statement 364 | D=0.4853881 + 3.6006116*P - 0.0117368*(P-1.3822)**2 365 | return D | ^ - | help: Remove unnecessary assignment | 363 | def mavko_debari(P_kbar): @@ -206,7 +195,6 @@ RET504 [*] Unnecessary assignment to `y` before `return` statement 399 | y = y + 2 400 | return y # RET504 | ^ - | help: Remove unnecessary assignment | 398 | x = 1 @@ -224,7 +212,6 @@ RET504 [*] Unnecessary assignment to `services` before `return` statement 422 | services = a["services"] 423 | return services | ^^^^^^^^ - | help: Remove unnecessary assignment | 421 | if "services" in a: @@ -263,7 +250,6 @@ RET504 [*] Unnecessary assignment to `x` before `return` statement 462 | ) 463 | return x | ^ - | help: Remove unnecessary assignment | 460 | def f(): diff --git a/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET505_RET505.py.snap b/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET505_RET505.py.snap index c53c0627e7ca64..7882189b06b24e 100644 --- a/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET505_RET505.py.snap +++ b/crates/ruff_linter/src/rules/flake8_return/snapshots/ruff_linter__rules__flake8_return__tests__RET505_RET505.py.snap @@ -271,7 +271,6 @@ RET505 [*] Unnecessary `else` after `return` statement 176 | return 177 | else: pass | ^^^^ - | help: Remove unnecessary `else` | 176 | return @@ -305,7 +304,6 @@ RET505 [*] Unnecessary `else` after `return` statement 199 | if self._sb is not None: return self._sb 200 | else: self._sb = '\033[01;%dm'; self._sa = '\033[0;0m'; | ^^^^ - | help: Remove unnecessary `else` | 199 | if self._sb is not None: return self._sb diff --git a/crates/ruff_linter/src/rules/flake8_self/snapshots/ruff_linter__rules__flake8_self__tests__custom_method_decorators.snap b/crates/ruff_linter/src/rules/flake8_self/snapshots/ruff_linter__rules__flake8_self__tests__custom_method_decorators.snap index c584ba4f52d99d..4720565ffabb5a 100644 --- a/crates/ruff_linter/src/rules/flake8_self/snapshots/ruff_linter__rules__flake8_self__tests__custom_method_decorators.snap +++ b/crates/ruff_linter/src/rules/flake8_self/snapshots/ruff_linter__rules__flake8_self__tests__custom_method_decorators.snap @@ -8,4 +8,3 @@ SLF001 Private member accessed: `_x` 18 | def bad_staticmethod(this): 19 | return this._x # error | ^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_self/snapshots/ruff_linter__rules__flake8_self__tests__ignore_names.snap b/crates/ruff_linter/src/rules/flake8_self/snapshots/ruff_linter__rules__flake8_self__tests__ignore_names.snap index 155b9281c230dc..c57560008cce32 100644 --- a/crates/ruff_linter/src/rules/flake8_self/snapshots/ruff_linter__rules__flake8_self__tests__ignore_names.snap +++ b/crates/ruff_linter/src/rules/flake8_self/snapshots/ruff_linter__rules__flake8_self__tests__ignore_names.snap @@ -7,7 +7,6 @@ SLF001 Private member accessed: `_asdict` 5 | def foo(obj): 6 | obj._asdict # SLF001 | ^^^^^^^^^^^ - | SLF001 Private member accessed: `_bar` --> SLF001_extended.py:10:5 @@ -15,4 +14,3 @@ SLF001 Private member accessed: `_bar` 9 | def foo(obj): 10 | obj._bar # SLF001 | ^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_self/snapshots/ruff_linter__rules__flake8_self__tests__private-member-access_SLF001_1.py.snap b/crates/ruff_linter/src/rules/flake8_self/snapshots/ruff_linter__rules__flake8_self__tests__private-member-access_SLF001_1.py.snap index ea0102f2f3b7b7..b4e340dd01603c 100644 --- a/crates/ruff_linter/src/rules/flake8_self/snapshots/ruff_linter__rules__flake8_self__tests__private-member-access_SLF001_1.py.snap +++ b/crates/ruff_linter/src/rules/flake8_self/snapshots/ruff_linter__rules__flake8_self__tests__private-member-access_SLF001_1.py.snap @@ -8,4 +8,3 @@ SLF001 Private member accessed: `_x` 69 | alias = self 70 | print(alias._x) # error (self is not an instance parameter) | ^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM101_SIM101.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM101_SIM101.py.snap index 0474f054bda7d5..193b47c6ded60d 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM101_SIM101.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM101_SIM101.py.snap @@ -346,7 +346,6 @@ SIM101 [*] Multiple `isinstance` calls for `x`, merge into a single call 71 | ((isinstance(x, int)) or isinstance(x, str)) 72 | isinstance(x, int) or (isinstance(x, str)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Merge `isinstance` calls for `x` | 71 | ((isinstance(x, int)) or isinstance(x, str)) diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM103_SIM103.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM103_SIM103.py.snap index d32b0a775486d9..5ef3e5bca6b1d0 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM103_SIM103.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM103_SIM103.py.snap @@ -11,7 +11,6 @@ SIM103 [*] Return the condition `bool(a)` directly 5 | | else: 6 | | return False | |____________________^ - | help: Replace with `return bool(a)` | 2 | # SIM103 @@ -34,7 +33,6 @@ SIM103 [*] Return the condition `a == b` directly 13 | | else: 14 | | return False | |____________________^ - | help: Replace with `return a == b` | 10 | # SIM103 @@ -57,7 +55,6 @@ SIM103 [*] Return the condition `bool(b)` directly 23 | | else: 24 | | return False | |____________________^ - | help: Replace with `return bool(b)` | 20 | return 1 @@ -80,7 +77,6 @@ SIM103 [*] Return the condition `bool(b)` directly 34 | | else: 35 | | return False | |________________________^ - | help: Replace with `return bool(b)` | 31 | else: @@ -103,7 +99,6 @@ SIM103 [*] Return the condition `not a` directly 59 | | else: 60 | | return True | |___________________^ - | help: Replace with `return not a` | 56 | # SIM103 @@ -126,7 +121,6 @@ SIM103 Return the condition directly 85 | | else: 86 | | return False | |____________________^ - | help: Inline condition SIM103 [*] Return the condition `not (keys is not None and notice.key not in keys)` directly @@ -139,7 +133,6 @@ SIM103 [*] Return the condition `not (keys is not None and notice.key not in key 93 | | else: 94 | | return True | |___________________^ - | help: Replace with `return not (keys is not None and notice.key not in keys)` | 90 | # SIM103 @@ -161,7 +154,6 @@ SIM103 [*] Return the condition `bool(a)` directly 105 | | return True 106 | | return False | |________________^ - | help: Replace with `return bool(a)` | 103 | # SIM103 @@ -182,7 +174,6 @@ SIM103 [*] Return the condition `not a` directly 112 | | return False 113 | | return True | |_______________^ - | help: Replace with `return not a` | 110 | # SIM103 @@ -202,7 +193,6 @@ SIM103 [*] Return the condition `10 < a` directly 118 | | return False 119 | | return True | |_______________^ - | help: Replace with `return 10 < a` | 116 | def f(): @@ -222,7 +212,6 @@ SIM103 [*] Return the condition `not 10 < a` directly 124 | | return False 125 | | return True | |_______________^ - | help: Replace with `return not 10 < a` | 122 | def f(): @@ -242,7 +231,6 @@ SIM103 [*] Return the condition `10 not in a` directly 130 | | return False 131 | | return True | |_______________^ - | help: Replace with `return 10 not in a` | 128 | def f(): @@ -262,7 +250,6 @@ SIM103 [*] Return the condition `10 in a` directly 136 | | return False 137 | | return True | |_______________^ - | help: Replace with `return 10 in a` | 134 | def f(): @@ -282,7 +269,6 @@ SIM103 [*] Return the condition `a is not 10` directly 142 | | return False 143 | | return True | |_______________^ - | help: Replace with `return a is not 10` | 140 | def f(): @@ -302,7 +288,6 @@ SIM103 [*] Return the condition `a is 10` directly 148 | | return False 149 | | return True | |_______________^ - | help: Replace with `return a is 10` | 146 | def f(): @@ -322,7 +307,6 @@ SIM103 [*] Return the condition `a != 10` directly 154 | | return False 155 | | return True | |_______________^ - | help: Replace with `return a != 10` | 152 | def f(): @@ -342,7 +326,6 @@ SIM103 [*] Return the condition `a == 10` directly 160 | | return False 161 | | return True | |_______________^ - | help: Replace with `return a == 10` | 158 | def f(): diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_0.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_0.py.snap index 34ea7264437219..d4ed691c68c477 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_0.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_0.py.snap @@ -10,7 +10,6 @@ SIM105 [*] Use `contextlib.suppress(ValueError)` instead of `try`-`except`-`pass 8 | | except ValueError: 9 | | pass | |________^ - | help: Replace `try`-`except`-`pass` with `with contextlib.suppress(ValueError): ...` | 1 + import contextlib @@ -144,7 +143,6 @@ SIM105 [*] Use `contextlib.suppress(ValueError)` instead of `try`-`except`-`pass 87 | | except ValueError: 88 | | ... | |___________^ - | help: Replace `try`-`except`-`pass` with `with contextlib.suppress(ValueError): ...` | 1 + import contextlib @@ -263,7 +261,6 @@ SIM105 [*] Use `contextlib.suppress()` instead of `try`-`except`-`pass` 135 | | except (): 136 | | pass | |________^ - | help: Replace `try`-`except`-`pass` with `with contextlib.suppress(): ...` | 1 + import contextlib @@ -288,7 +285,6 @@ SIM105 [*] Use `contextlib.suppress(BaseException)` instead of `try`-`except`-`p 142 | | except BaseException: 143 | | pass | |________^ - | help: Replace `try`-`except`-`pass` with `with contextlib.suppress(BaseException): ...` | 1 + import contextlib diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_1.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_1.py.snap index 26c3aad9cf58cf..aad14a968178be 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_1.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_1.py.snap @@ -10,7 +10,6 @@ SIM105 [*] Use `contextlib.suppress(ValueError)` instead of `try`-`except`-`pass 7 | | except ValueError: 8 | | pass | |________^ - | help: Replace `try`-`except`-`pass` with `with contextlib.suppress(ValueError): ...` | 2 | import math diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_2.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_2.py.snap index cfb7cfb521d0c6..aa96b346443063 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_2.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_2.py.snap @@ -10,7 +10,6 @@ SIM105 [*] Use `contextlib.suppress(ValueError)` instead of `try`-`except`-`pass 12 | | except ValueError: 13 | | pass | |________^ - | help: Replace `try`-`except`-`pass` with `with contextlib.suppress(ValueError): ...` | 9 | # SIM105 diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_3.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_3.py.snap index 3f4f3a5e14f53b..6e1aab90c461fe 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_3.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_3.py.snap @@ -11,5 +11,4 @@ SIM105 Use `contextlib.suppress(ValueError)` instead of `try`-`except`-`pass` 12 | | except ValueError: 13 | | pass | |____________^ - | help: Replace `try`-`except`-`pass` with `with contextlib.suppress(ValueError): ...` diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_4.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_4.py.snap index a5b73e255aa5c4..3443d5b7095092 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_4.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM105_SIM105_4.py.snap @@ -9,7 +9,6 @@ SIM105 [*] Use `contextlib.suppress(ImportError)` instead of `try`-`except`-`pas 3 | | from __builtin__ import bytes, str, open, super, range, zip, round, int, pow, object, input 4 | | except ImportError: pass | |___________________________^ - | help: Replace `try`-`except`-`pass` with `with contextlib.suppress(ImportError): ...` | 1 | #!/usr/bin/env python diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM107_SIM107.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM107_SIM107.py.snap index 705b45e39db522..b5605539ba44e7 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM107_SIM107.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM107_SIM107.py.snap @@ -8,4 +8,3 @@ SIM107 Don't use `return` in `try`-`except` and `finally` 8 | finally: 9 | return "3" | ^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM108_SIM108.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM108_SIM108.py.snap index b7c72bcbb5187d..d18fbf41523282 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM108_SIM108.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM108_SIM108.py.snap @@ -35,7 +35,6 @@ SIM108 [*] Use ternary operator `b = 1 if a else 2` instead of `if`-`else`-block 32 | | else: 33 | | b = 2 | |_____________^ - | help: Replace `if`-`else`-block with `b = 1 if a else 2` | 29 | else: @@ -59,7 +58,6 @@ SIM108 Use ternary operator `abc = x if x > 0 else -x` instead of `if`-`else`-bl 62 | | # test test test 63 | | abc = -x | |____________^ - | help: Replace `if`-`else`-block with `abc = x if x > 0 else -x` SIM108 [*] Use ternary operator `b = "cccccccccccccccccccccccccccccccccß" if a else "ddddddddddddddddddddddddddddddddd💣"` instead of `if`-`else`-block @@ -71,7 +69,6 @@ SIM108 [*] Use ternary operator `b = "cccccccccccccccccccccccccccccccccß" if a 84 | | else: 85 | | b = "ddddddddddddddddddddddddddddddddd💣" | |_____________________________________________^ - | help: Replace `if`-`else`-block with `b = "cccccccccccccccccccccccccccccccccß" if a else "ddddddddddddddddddddddddddddddddd💣"` | 81 | # SIM108 @@ -93,7 +90,6 @@ SIM108 Use ternary operator `exitcode = 0 if True else 1` instead of `if`-`else` 107 | | else: 108 | | exitcode = 1 # Trailing comment | |________________^ - | help: Replace `if`-`else`-block with `exitcode = 0 if True else 1` SIM108 Use ternary operator `x = 3 if True else 5` instead of `if`-`else`-block @@ -103,7 +99,6 @@ SIM108 Use ternary operator `x = 3 if True else 5` instead of `if`-`else`-block 112 | / if True: x = 3 # Foo 113 | | else: x = 5 | |___________^ - | help: Replace `if`-`else`-block with `x = 3 if True else 5` SIM108 Use ternary operator `x = 3 if True else 5` instead of `if`-`else`-block @@ -115,7 +110,6 @@ SIM108 Use ternary operator `x = 3 if True else 5` instead of `if`-`else`-block 119 | | else: 120 | | x = 5 | |_________^ - | help: Replace `if`-`else`-block with `x = 3 if True else 5` SIM108 [*] Use binary operator `z = cond or other_cond` instead of `if`-`else`-block @@ -303,7 +297,6 @@ SIM108 [*] Use ternary operator `z = not foo() if foo() else other` instead of ` 195 | | else: 196 | | z = other | |_____________^ - | help: Replace `if`-`else`-block with `z = not foo() if foo() else other` | 192 | # from Two to one. @@ -351,7 +344,6 @@ SIM108 [*] Use ternary operator `var = "str" if cond else f'{first}-{second}'` i 209 | | else: 210 | | var = f'{first}-{second}' | |_____________________________^ - | help: Replace `if`-`else`-block with `var = "str" if cond else f'{first}-{second}'` | 206 | diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM110_SIM110.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM110_SIM110.py.snap index 5c015e778805dc..240553f8cfaa76 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM110_SIM110.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM110_SIM110.py.snap @@ -11,7 +11,6 @@ SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop 5 | | return True 6 | | return False | |________________^ - | help: Replace with `return any(check(x) for x in iterable)` | 2 | # SIM110 @@ -34,7 +33,6 @@ SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loo 27 | | return False 28 | | return True | |_______________^ - | help: Replace with `return all(not check(x) for x in iterable)` | 24 | # SIM111 @@ -57,7 +55,6 @@ SIM110 [*] Use `return all(x.is_empty() for x in iterable)` instead of `for` loo 35 | | return False 36 | | return True | |_______________^ - | help: Replace with `return all(x.is_empty() for x in iterable)` | 32 | # SIM111 @@ -81,7 +78,6 @@ SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop 58 | | else: 59 | | return False | |____________________^ - | help: Replace with `return any(check(x) for x in iterable)` | 54 | # SIM110 @@ -106,7 +102,6 @@ SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loo 67 | | else: 68 | | return True | |___________________^ - | help: Replace with `return all(not check(x) for x in iterable)` | 63 | # SIM111 @@ -182,7 +177,6 @@ SIM110 Use `return any(check(x) for x in iterable)` instead of `for` loop 126 | | return True 127 | | return False | |________________^ - | help: Replace with `return any(check(x) for x in iterable)` SIM110 Use `return all(not check(x) for x in iterable)` instead of `for` loop @@ -195,7 +189,6 @@ SIM110 Use `return all(not check(x) for x in iterable)` instead of `for` loop 136 | | return False 137 | | return True | |_______________^ - | help: Replace with `return all(not check(x) for x in iterable)` SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop @@ -207,7 +200,6 @@ SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop 146 | | return True 147 | | return False | |________________^ - | help: Replace with `return any(check(x) for x in iterable)` | 143 | # SIM110 @@ -229,7 +221,6 @@ SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loo 156 | | return False 157 | | return True | |_______________^ - | help: Replace with `return all(not check(x) for x in iterable)` | 153 | # SIM111 @@ -252,7 +243,6 @@ SIM110 [*] Use `return any(x.isdigit() for x in "012ß9💣2ℝ9012ß9💣2ℝ90 164 | | return True 165 | | return False | |________________^ - | help: Replace with `return any(x.isdigit() for x in "012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ")` | 161 | # SIM110 diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM110_SIM111.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM110_SIM111.py.snap index db068d9fb2d969..d4093cc4edf729 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM110_SIM111.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM110_SIM111.py.snap @@ -11,7 +11,6 @@ SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop 5 | | return True 6 | | return False | |________________^ - | help: Replace with `return any(check(x) for x in iterable)` | 2 | # SIM110 @@ -34,7 +33,6 @@ SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loo 27 | | return False 28 | | return True | |_______________^ - | help: Replace with `return all(not check(x) for x in iterable)` | 24 | # SIM111 @@ -57,7 +55,6 @@ SIM110 [*] Use `return all(x.is_empty() for x in iterable)` instead of `for` loo 35 | | return False 36 | | return True | |_______________^ - | help: Replace with `return all(x.is_empty() for x in iterable)` | 32 | # SIM111 @@ -81,7 +78,6 @@ SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop 58 | | else: 59 | | return False | |____________________^ - | help: Replace with `return any(check(x) for x in iterable)` | 54 | # SIM110 @@ -106,7 +102,6 @@ SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loo 67 | | else: 68 | | return True | |___________________^ - | help: Replace with `return all(not check(x) for x in iterable)` | 63 | # SIM111 @@ -182,7 +177,6 @@ SIM110 Use `return any(check(x) for x in iterable)` instead of `for` loop 126 | | return True 127 | | return False | |________________^ - | help: Replace with `return any(check(x) for x in iterable)` SIM110 Use `return all(not check(x) for x in iterable)` instead of `for` loop @@ -195,7 +189,6 @@ SIM110 Use `return all(not check(x) for x in iterable)` instead of `for` loop 136 | | return False 137 | | return True | |_______________^ - | help: Replace with `return all(not check(x) for x in iterable)` SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop @@ -207,7 +200,6 @@ SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop 146 | | return True 147 | | return False | |________________^ - | help: Replace with `return any(check(x) for x in iterable)` | 143 | # SIM110 @@ -229,7 +221,6 @@ SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loo 156 | | return False 157 | | return True | |_______________^ - | help: Replace with `return all(not check(x) for x in iterable)` | 153 | # SIM111 @@ -252,7 +243,6 @@ SIM110 [*] Use `return all(x in y for x in iterable)` instead of `for` loop 164 | | return False 165 | | return True | |_______________^ - | help: Replace with `return all(x in y for x in iterable)` | 161 | # SIM111 @@ -275,7 +265,6 @@ SIM110 [*] Use `return all(x <= y for x in iterable)` instead of `for` loop 172 | | return False 173 | | return True | |_______________^ - | help: Replace with `return all(x <= y for x in iterable)` | 169 | # SIM111 @@ -298,7 +287,6 @@ SIM110 [*] Use `return all(not x.isdigit() for x in "012ß9💣2ℝ9012ß9💣2 180 | | return False 181 | | return True | |_______________^ - | help: Replace with `return all(not x.isdigit() for x in "012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9")` | 177 | # SIM111 diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM113_SIM113.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM113_SIM113.py.snap index 1e4771fe56b927..6f817cd51f4ca3 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM113_SIM113.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM113_SIM113.py.snap @@ -28,7 +28,6 @@ SIM113 Use `enumerate()` for index variable `idx` in `for` loop 26 | h(x, y) 27 | idx += 1 | ^^^^^^^^ - | SIM113 Use `enumerate()` for index variable `idx` in `for` loop --> SIM113.py:36:9 @@ -37,7 +36,6 @@ SIM113 Use `enumerate()` for index variable `idx` in `for` loop 35 | sum += h(x, idx) 36 | idx += 1 | ^^^^^^^^ - | SIM113 Use `enumerate()` for index variable `idx` in `for` loop --> SIM113.py:44:9 @@ -67,7 +65,6 @@ SIM113 Use `enumerate()` for index variable `i` in `for` loop 208 | print(f"{i}: {val}") 209 | i += 1 | ^^^^^^ - | SIM113 Use `enumerate()` for index variable `i` in `for` loop --> SIM113.py:220:9 @@ -76,4 +73,3 @@ SIM113 Use `enumerate()` for index variable `i` in `for` loop 219 | print(f"{i}: {val}") 220 | i += 1 | ^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM114_SIM114.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM114_SIM114.py.snap index 001ad64df394a3..73bd00c13417c1 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM114_SIM114.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM114_SIM114.py.snap @@ -284,7 +284,6 @@ SIM114 [*] Combine `if` branches using logical `or` operator 73 | | elif result.eofs == "C": 74 | | errors = 1 | |______________^ - | help: Combine `if` branches | 70 | errors = 1 @@ -328,7 +327,6 @@ SIM114 [*] Combine `if` branches using logical `or` operator 124 | | elif b is None: 125 | | return 4 | |________________^ - | help: Combine `if` branches | 121 | return 3 @@ -349,7 +347,6 @@ SIM114 [*] Combine `if` branches using logical `or` operator 134 | | elif a := 1: 135 | | return 3 | |________________^ - | help: Combine `if` branches | 131 | b = False @@ -368,7 +365,6 @@ SIM114 [*] Combine `if` branches using logical `or` operator 140 | | elif c: # but not on the second branch 141 | | b | |_____^ - | help: Combine `if` branches | 137 | @@ -385,7 +381,6 @@ SIM114 [*] Combine `if` branches using logical `or` operator 144 | / if a: b # here's a comment 145 | | elif c: b | |_________^ - | help: Combine `if` branches | 143 | @@ -402,7 +397,6 @@ SIM114 [*] Combine `if` branches using logical `or` operator 149 | | elif(100 < x and x < 200 and 300 < y and y < 800): 150 | | pass | |________^ - | help: Combine `if` branches | 147 | diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM118_SIM118.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM118_SIM118.py.snap index 63ac2d757ad735..9edee0fda8c793 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM118_SIM118.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM118_SIM118.py.snap @@ -352,7 +352,6 @@ SIM118 [*] Use `key in dict` instead of `key in dict.keys()` 64 | d = SneakyDict() 65 | key in d.keys() # SIM118 | ^^^^^^^^^^^^^^^ - | help: Remove `.keys()` | 64 | d = SneakyDict() diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM210_SIM210.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM210_SIM210.py.snap index 122346560d3c53..072f7aac6ec876 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM210_SIM210.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM210_SIM210.py.snap @@ -62,7 +62,6 @@ SIM210 Use `bool(...)` instead of `True if ... else False` 14 | 15 | a = True if b else False | ^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `bool(...) SIM210 [*] Remove unnecessary `True if ... else False` @@ -73,7 +72,6 @@ SIM210 [*] Remove unnecessary `True if ... else False` | ___________^ 20 | | psl.privatesuffix(src.netloc)) else False | |____________________________________________________________________________^ - | help: Remove unnecessary `True if ... else False` | 18 | # Regression test for: https://github.com/astral-sh/ruff/issues/7076 diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM222_SIM222.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM222_SIM222.py.snap index d26697a514e492..70c80500972364 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM222_SIM222.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM222_SIM222.py.snap @@ -586,7 +586,6 @@ SIM222 [*] Use `frozenset(frozenset({1}))` instead of `frozenset(frozenset({1})) 96 | 97 | a or frozenset(frozenset({1})) or True or frozenset(frozenset({2})) # SIM222 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `frozenset(frozenset({1}))` | 96 | @@ -968,7 +967,6 @@ SIM222 [*] Use `f"{1}{''}"` instead of `f"{1}{''}" or ...` 168 | print(f"{''}{''}" or "bar") 169 | print(f"{1}{''}" or "bar") | ^^^^^^^^^^^^^^^^^^^ - | help: Replace with `f"{1}{''}"` | 168 | print(f"{''}{''}" or "bar") diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM223_SIM223.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM223_SIM223.py.snap index a2eb3f6295bba3..31886dd5a0e8d7 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM223_SIM223.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM223_SIM223.py.snap @@ -586,7 +586,6 @@ SIM223 [*] Use `False` instead of `... and False and ...` 91 | 92 | a and frozenset(frozenset({1})) and False and frozenset(frozenset({2})) # SIM222 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `False` | 91 | diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM905_SIM905.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM905_SIM905.py.snap index f27744047f5ec5..c8a7d2238f9a59 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM905_SIM905.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM905_SIM905.py.snap @@ -1174,7 +1174,6 @@ SIM905 [*] Consider using a list literal instead of `str.split` 156 | | "Fred\ Bloggs"@example.com 157 | | "Joe.\\Blow"@example.com""".split("\n") | |_______________________________________^ - | help: Replace with list literal | 134 | # https://github.com/astral-sh/ruff/issues/19581 - embedded quotes in raw strings @@ -1320,7 +1319,6 @@ SIM905 [*] Consider using a list literal instead of `str.split` 172 | " a b c d ".rsplit(maxsplit=2) # [" a b", "c", "d"] 173 | "a b".split(maxsplit=1) # ["a", "b"] | ^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with list literal | 172 | " a b c d ".rsplit(maxsplit=2) # [" a b", "c", "d"] diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM910_SIM910.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM910_SIM910.py.snap index 70aee21be4260c..e73560d633fe9e 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM910_SIM910.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM910_SIM910.py.snap @@ -146,7 +146,6 @@ SIM910 [*] Use `dict.get("Cat")` instead of `dict.get("Cat", None)` 56 | dict = {"Tom": 23, "Maria": 23, "Dog": 11} 57 | age = dict.get("Cat", None) | ^^^^^^^^^^^^^^^^^^^^^ - | help: Replace `dict.get("Cat", None)` with `dict.get("Cat")` | 56 | dict = {"Tom": 23, "Maria": 23, "Dog": 11} @@ -215,7 +214,6 @@ SIM910 [*] Use `ages.get(get_key())` instead of `ages.get(get_key(), None)` 83 | ages = {"Tom": 23, "Maria": 23, "Dog": 11} 84 | age = ages.get(get_key(), None) | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace `ages.get(get_key(), None)` with `ages.get(get_key())` | 83 | ages = {"Tom": 23, "Maria": 23, "Dog": 11} @@ -234,7 +232,6 @@ SIM910 [*] Use `dict.get()` without default value 90 | | None, 91 | | ) | |_^ - | help: Remove default value | 86 | diff --git a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__preview__SIM113_SIM113.py.snap b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__preview__SIM113_SIM113.py.snap index 5af873a570caad..3f351f9bd1bf9e 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__preview__SIM113_SIM113.py.snap +++ b/crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__preview__SIM113_SIM113.py.snap @@ -28,7 +28,6 @@ SIM113 Use `enumerate()` for index variable `idx` in `for` loop 26 | h(x, y) 27 | idx += 1 | ^^^^^^^^ - | SIM113 Use `enumerate()` for index variable `idx` in `for` loop --> SIM113.py:36:9 @@ -37,7 +36,6 @@ SIM113 Use `enumerate()` for index variable `idx` in `for` loop 35 | sum += h(x, idx) 36 | idx += 1 | ^^^^^^^^ - | SIM113 Use `enumerate()` for index variable `idx` in `for` loop --> SIM113.py:44:9 @@ -77,7 +75,6 @@ SIM113 Use `enumerate()` for index variable `i` in `for` loop 208 | print(f"{i}: {val}") 209 | i += 1 | ^^^^^^ - | SIM113 Use `enumerate()` for index variable `i` in `for` loop --> SIM113.py:220:9 @@ -86,4 +83,3 @@ SIM113 Use `enumerate()` for index variable `i` in `for` loop 219 | print(f"{i}: {val}") 220 | i += 1 | ^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__ban_all_imports.snap b/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__ban_all_imports.snap index 4a04d49a287f70..57abe5915e5252 100644 --- a/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__ban_all_imports.snap +++ b/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__ban_all_imports.snap @@ -203,5 +203,4 @@ TID252 Prefer absolute imports over relative imports 27 | from .........parent import ultragrantparent 28 | from ...........................parent import ultragrantparent | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace relative imports with absolute imports diff --git a/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__ban_parent_imports.snap b/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__ban_parent_imports.snap index 3f085ace7cbb10..8692306a55eff7 100644 --- a/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__ban_parent_imports.snap +++ b/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__ban_parent_imports.snap @@ -154,5 +154,4 @@ TID252 Prefer absolute imports over relative imports from parent modules 27 | from .........parent import ultragrantparent 28 | from ...........................parent import ultragrantparent | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace relative imports from parent modules with absolute imports diff --git a/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__ban_parent_imports_package.snap b/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__ban_parent_imports_package.snap index 8d341f94aa1bc6..d608a98dcae0f1 100644 --- a/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__ban_parent_imports_package.snap +++ b/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__ban_parent_imports_package.snap @@ -112,7 +112,6 @@ TID252 [*] Prefer absolute imports over relative imports from parent modules 9 | from . import logger, models 10 | from ..protocol.UpperCaseModule import some_function | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace relative imports from parent modules with absolute imports | 9 | from . import logger, models diff --git a/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__banned_api_package.snap b/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__banned_api_package.snap index f387a1dc4ac0e5..4852b94ebfcc2c 100644 --- a/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__banned_api_package.snap +++ b/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__banned_api_package.snap @@ -29,4 +29,3 @@ TID251 `my_package.sublib.protocol` is banned: The protocol module is deprecated 9 | from . import logger, models 10 | from ..protocol.UpperCaseModule import some_function | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__preview_lazy_import_mismatch.snap b/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__preview_lazy_import_mismatch.snap index 87e40f92a6fdd6..d88842a4de6357 100644 --- a/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__preview_lazy_import_mismatch.snap +++ b/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__preview_lazy_import_mismatch.snap @@ -80,7 +80,6 @@ TID254 [*] `pkg` should be imported lazily 27 | 28 | x = 1; import pkg.submodule | ^^^^^^^^^^^^^ - | help: Convert to a lazy import | 27 | diff --git a/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__preview_lazy_import_mismatch_all.snap b/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__preview_lazy_import_mismatch_all.snap index 907edfcd0401d9..cbf1915ed79a1a 100644 --- a/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__preview_lazy_import_mismatch_all.snap +++ b/crates/ruff_linter/src/rules/flake8_tidy_imports/snapshots/ruff_linter__rules__flake8_tidy_imports__tests__preview_lazy_import_mismatch_all.snap @@ -99,7 +99,6 @@ TID254 [*] Use a `lazy` import instead of an eager import 27 | 28 | x = 1; import pkg.submodule | ^^^^^^^^^^^^^ - | help: Convert to a lazy import | 27 | diff --git a/crates/ruff_linter/src/rules/flake8_todos/snapshots/ruff_linter__rules__flake8_todos__tests__invalid-todo-capitalization_TD006.py.snap b/crates/ruff_linter/src/rules/flake8_todos/snapshots/ruff_linter__rules__flake8_todos__tests__invalid-todo-capitalization_TD006.py.snap index 5dcfaeaf3b42a5..b6e38a7191a963 100644 --- a/crates/ruff_linter/src/rules/flake8_todos/snapshots/ruff_linter__rules__flake8_todos__tests__invalid-todo-capitalization_TD006.py.snap +++ b/crates/ruff_linter/src/rules/flake8_todos/snapshots/ruff_linter__rules__flake8_todos__tests__invalid-todo-capitalization_TD006.py.snap @@ -43,7 +43,6 @@ TD006 [*] Invalid TODO capitalization: `todo` should be `TODO` 6 | # todo (evanrittenhouse): another invalid capitalization 7 | # foo # todo: invalid capitalization | ^^^^ - | help: Replace `todo` with `TODO` | 6 | # todo (evanrittenhouse): another invalid capitalization diff --git a/crates/ruff_linter/src/rules/flake8_todos/snapshots/ruff_linter__rules__flake8_todos__tests__invalid-todo-tag_TD001.py.snap b/crates/ruff_linter/src/rules/flake8_todos/snapshots/ruff_linter__rules__flake8_todos__tests__invalid-todo-tag_TD001.py.snap index dbfe98f34b4d61..8479b25af9abbf 100644 --- a/crates/ruff_linter/src/rules/flake8_todos/snapshots/ruff_linter__rules__flake8_todos__tests__invalid-todo-tag_TD001.py.snap +++ b/crates/ruff_linter/src/rules/flake8_todos/snapshots/ruff_linter__rules__flake8_todos__tests__invalid-todo-tag_TD001.py.snap @@ -28,4 +28,3 @@ TD001 Invalid TODO tag: `XXX` 8 | # FIXME (evanrittenhouse): this is not fine 9 | # foo # XXX: this isn't fine either | ^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_todos/snapshots/ruff_linter__rules__flake8_todos__tests__missing-todo-author_TD002.py.snap b/crates/ruff_linter/src/rules/flake8_todos/snapshots/ruff_linter__rules__flake8_todos__tests__missing-todo-author_TD002.py.snap index c502cfd8e0634a..724b65e540f5e9 100644 --- a/crates/ruff_linter/src/rules/flake8_todos/snapshots/ruff_linter__rules__flake8_todos__tests__missing-todo-author_TD002.py.snap +++ b/crates/ruff_linter/src/rules/flake8_todos/snapshots/ruff_linter__rules__flake8_todos__tests__missing-todo-author_TD002.py.snap @@ -40,4 +40,3 @@ TD002 Missing author in TODO; try: `# TODO(): ...` or `# TODO @ DataFrame: 10 | x = DataFrame() | --------- Used at runtime here - | help: Move out of type-checking block | 3 | from typing_extensions import TYPE_CHECKING diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TC004_2.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TC004_2.py.snap index 7bec54976db5d3..709bb9b82971eb 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TC004_2.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TC004_2.py.snap @@ -13,7 +13,6 @@ TC004 [*] Move import `datetime.date` out of type-checking block. Import is used 7 | def example(): 8 | return date() | ---- Used at runtime here - | help: Move out of type-checking block | 1 | from typing import TYPE_CHECKING diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_quote.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_quote.py.snap index 14bdada4821665..d8b6f0a655154b 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_quote.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_quote.py.snap @@ -10,7 +10,6 @@ TC004 [*] Move import `pandas.DataFrame` out of type-checking block. Import is u 111 | 112 | x: TypeAlias = DataFrame | None | --------- Used at runtime here - | help: Move out of type-checking block | 1 + from pandas import DataFrame diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_base_classes_1.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_base_classes_1.py.snap index e83089f22dc529..db0d51de8ed6b5 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_base_classes_1.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_base_classes_1.py.snap @@ -14,7 +14,6 @@ TC004 [*] Move import `datetime` out of type-checking block. Import is used for 17 | class A(pydantic.BaseModel): 18 | x: datetime.datetime | -------- Used at runtime here - | help: Move out of type-checking block | 7 | from pydantic import BaseModel @@ -41,7 +40,6 @@ TC004 [*] Move import `array.array` out of type-checking block. Import is used f 37 | class G(BaseModel): 38 | x: array | ----- Used at runtime here - | help: Move out of type-checking block | 7 | from pydantic import BaseModel @@ -68,7 +66,6 @@ TC004 [*] Move import `pandas` out of type-checking block. Import is used for mo 21 | class B(BaseModel): 22 | x: pandas.DataFrame | ------ Used at runtime here - | help: Move out of type-checking block | 7 | from pydantic import BaseModel diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_decorators_1.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_decorators_1.py.snap index beeba4cb30fecd..c02544dddfdf08 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_decorators_1.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_decorators_1.py.snap @@ -15,7 +15,6 @@ TC004 [*] Move import `datetime` out of type-checking block. Import is used for 20 | class A: 21 | x: datetime.datetime | -------- Used at runtime here - | help: Move out of type-checking block | 9 | import numpy @@ -43,7 +42,6 @@ TC004 [*] Move import `array.array` out of type-checking block. Import is used f 35 | class D: 36 | x: array | ----- Used at runtime here - | help: Move out of type-checking block | 9 | import numpy @@ -71,7 +69,6 @@ TC004 [*] Move import `pandas` out of type-checking block. Import is used for mo 25 | class B: 26 | x: pandas.DataFrame | ------ Used at runtime here - | help: Move out of type-checking block | 9 | import numpy diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_whitespace.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_whitespace.py.snap index a7429f2c8965c4..f1d806a07f4e0b 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_whitespace.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_whitespace.py.snap @@ -10,7 +10,6 @@ TC004 [*] Move import `builtins` out of type-checking block. Import is used for | ^^^^^^^^ 6 | builtins.print("!") | -------- Used at runtime here - | help: Move out of type-checking block | 2 | # there is a (potentially invisible) unicode formfeed character (000C) between `TYPE_CHECKING` and the backslash diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-string-union_TC010_1.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-string-union_TC010_1.py.snap index 559272a6ad6daa..b2693c688bc25e 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-string-union_TC010_1.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-string-union_TC010_1.py.snap @@ -8,4 +8,3 @@ TC010 Invalid string member in `X | Y`-style union type 17 | 18 | OldS = TypeVar('OldS', int | 'str', str) # TC010 | ^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-string-union_TC010_2.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-string-union_TC010_2.py.snap index 3588e7b2414fa0..78ecb96408cff6 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-string-union_TC010_2.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__runtime-string-union_TC010_2.py.snap @@ -8,4 +8,3 @@ TC010 Invalid string member in `X | Y`-style union type 15 | 16 | OldS = TypeVar('OldS', int | 'str', str) # TC010 | ^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__strict_typing-only-standard-library-import_init_var.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__strict_typing-only-standard-library-import_init_var.py.snap index 8f7ea785e75455..44fc3c1612bcfe 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__strict_typing-only-standard-library-import_init_var.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__strict_typing-only-standard-library-import_init_var.py.snap @@ -30,7 +30,6 @@ TC003 [*] Move standard library import `pathlib.Path` into a type-checking block 5 | from dataclasses import FrozenInstanceError, InitVar, dataclass 6 | from pathlib import Path | ^^^^ - | help: Move into type-checking block | 5 | from dataclasses import FrozenInstanceError, InitVar, dataclass diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__strict_typing-only-standard-library-import_kw_only.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__strict_typing-only-standard-library-import_kw_only.py.snap index 941e23f2e5a7a8..9769c79b31870c 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__strict_typing-only-standard-library-import_kw_only.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__strict_typing-only-standard-library-import_kw_only.py.snap @@ -8,7 +8,6 @@ TC003 [*] Move standard library import `dataclasses.Field` into a type-checking 4 | 5 | from dataclasses import KW_ONLY, dataclass, Field | ^^^^^ - | help: Move into type-checking block | 4 | diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__tc004_precedence_over_tc007.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__tc004_precedence_over_tc007.snap index 1c926868a70221..566470801b8583 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__tc004_precedence_over_tc007.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__tc004_precedence_over_tc007.snap @@ -11,7 +11,6 @@ TC004 [*] Move import `foo.Foo` out of type-checking block. Import is used for m 7 | 8 | a: TypeAlias = Foo | None # OK | --- Used at runtime here - | help: Move out of type-checking block | 4 | from typing import TYPE_CHECKING, TypeAlias diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__tc010_precedence_over_tc008.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__tc010_precedence_over_tc008.snap index da622ad403cf5e..55c4cdebc4c77a 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__tc010_precedence_over_tc008.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__tc010_precedence_over_tc008.snap @@ -24,4 +24,3 @@ TC010 Invalid string member in `X | Y`-style union type 6 | a: TypeAlias = 'int | None' # TC008 7 | b: TypeAlias = 'int' | None # TC010 | ^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-standard-library-import_init_var.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-standard-library-import_init_var.py.snap index 2be302e2545812..6309149d40a567 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-standard-library-import_init_var.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-standard-library-import_init_var.py.snap @@ -7,7 +7,6 @@ TC003 [*] Move standard library import `pathlib.Path` into a type-checking block 5 | from dataclasses import FrozenInstanceError, InitVar, dataclass 6 | from pathlib import Path | ^^^^ - | help: Move into type-checking block | 5 | from dataclasses import FrozenInstanceError, InitVar, dataclass diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-standard-library-import_module__undefined.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-standard-library-import_module__undefined.py.snap index f1379bd8600584..b3c19763e74e4b 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-standard-library-import_module__undefined.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-standard-library-import_module__undefined.py.snap @@ -8,7 +8,6 @@ TC003 [*] Move standard library import `collections.abc.Sequence` into a type-ch 2 | 3 | from collections.abc import Sequence | ^^^^^^^^ - | help: Move into type-checking block | 2 | diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_decorators_2.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_decorators_2.py.snap index b857ebb414cab4..4365a7675df35a 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_decorators_2.py.snap +++ b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_decorators_2.py.snap @@ -8,7 +8,6 @@ TC002 [*] Move third-party import `numpy` into a type-checking block 9 | 10 | import numpy # TC002 | ^^^^^ - | help: Move into type-checking block | 9 | diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH124_py_path_1.py.snap b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH124_py_path_1.py.snap index 69808fd0ed5475..3739af48ae5eee 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH124_py_path_1.py.snap +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH124_py_path_1.py.snap @@ -8,4 +8,3 @@ PTH124 `py.path` is in maintenance mode, use `pathlib` instead 2 | 3 | p = py.path.local("../foo") | ^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH124_py_path_2.py.snap b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH124_py_path_2.py.snap index 3b73893a1f108c..0950c633ddebda 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH124_py_path_2.py.snap +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH124_py_path_2.py.snap @@ -8,4 +8,3 @@ PTH124 `py.path` is in maintenance mode, use `pathlib` instead 2 | 3 | p = path("/foo") | ^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH202_PTH202.py.snap b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH202_PTH202.py.snap index b7175ee1cd98bd..8aeccc3405ba2c 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH202_PTH202.py.snap +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH202_PTH202.py.snap @@ -246,7 +246,6 @@ PTH202 `os.path.getsize` should be replaced by `Path.stat().st_size` 35 | getsize(filename1) 36 | getsize(filename2) | ^^^^^^^ - | help: Replace with `Path(...).stat().st_size` PTH202 `os.path.getsize` should be replaced by `Path.stat().st_size` @@ -361,5 +360,4 @@ PTH202 `os.path.getsize` should be replaced by `Path.stat().st_size` 81 | 82 | os.path.getsize(pathlib.Path("filename")) | ^^^^^^^^^^^^^^^ - | help: Replace with `Path(...).stat().st_size` diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH202_PTH202_2.py.snap b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH202_PTH202_2.py.snap index 5b4fade357b0a4..c5dd82e6bea68c 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH202_PTH202_2.py.snap +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH202_PTH202_2.py.snap @@ -30,5 +30,4 @@ PTH202 `os.path.getsize` should be replaced by `Path.stat().st_size` 4 | os.path.getsize(filename=b"filename") 5 | os.path.getsize(filename=__file__) | ^^^^^^^^^^^^^^^ - | help: Replace with `Path(...).stat().st_size` diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH203_PTH203.py.snap b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH203_PTH203.py.snap index 2a3663c845c431..ca9731a00cc432 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH203_PTH203.py.snap +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH203_PTH203.py.snap @@ -30,7 +30,6 @@ PTH203 `os.path.getatime` should be replaced by `Path.stat().st_atime` 6 | os.path.getatime(b"filename") 7 | os.path.getatime(Path("filename")) | ^^^^^^^^^^^^^^^^ - | help: Replace with `Path.stat(...).st_atime` PTH203 `os.path.getatime` should be replaced by `Path.stat().st_atime` @@ -60,7 +59,6 @@ PTH203 `os.path.getatime` should be replaced by `Path.stat().st_atime` 11 | getatime(b"filename") 12 | getatime(Path("filename")) | ^^^^^^^^ - | help: Replace with `Path.stat(...).st_atime` PTH203 `os.path.getatime` should be replaced by `Path.stat().st_atime` @@ -152,5 +150,4 @@ PTH203 `os.path.getatime` should be replaced by `Path.stat().st_atime` 34 | 35 | getatime(Path("dir") / "file.txt") | ^^^^^^^^ - | help: Replace with `Path.stat(...).st_atime` diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH204_PTH204.py.snap b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH204_PTH204.py.snap index 10b08dfdb358a2..4632c8b4249932 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH204_PTH204.py.snap +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH204_PTH204.py.snap @@ -28,7 +28,6 @@ PTH204 `os.path.getmtime` should be replaced by `Path.stat().st_mtime` 7 | os.path.getmtime(b"filename") 8 | os.path.getmtime(Path("filename")) | ^^^^^^^^^^^^^^^^ - | help: Replace with `Path.stat(...).st_mtime` PTH204 `os.path.getmtime` should be replaced by `Path.stat().st_mtime` @@ -58,5 +57,4 @@ PTH204 `os.path.getmtime` should be replaced by `Path.stat().st_mtime` 12 | getmtime(b"filename") 13 | getmtime(Path("filename")) | ^^^^^^^^ - | help: Replace with `Path.stat(...).st_mtime` diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH205_PTH205.py.snap b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH205_PTH205.py.snap index 65ae0f721939c3..59184a82604f77 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH205_PTH205.py.snap +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH205_PTH205.py.snap @@ -62,5 +62,4 @@ PTH205 `os.path.getctime` should be replaced by `Path.stat().st_ctime` 11 | getctime(b"filename") 12 | getctime(Path("filename")) | ^^^^^^^^ - | help: Replace with `Path.stat(...).st_ctime` diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH208_PTH208.py.snap b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH208_PTH208.py.snap index b35f942060fc5e..9aeb2ced0d577d 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH208_PTH208.py.snap +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH208_PTH208.py.snap @@ -37,7 +37,6 @@ PTH208 Use `pathlib.Path.iterdir()` instead. 9 | bytes_path = b'.' 10 | os.listdir(bytes_path) | ^^^^^^^^^^ - | PTH208 Use `pathlib.Path.iterdir()` instead. --> PTH208.py:16:1 @@ -45,7 +44,6 @@ PTH208 Use `pathlib.Path.iterdir()` instead. 15 | path_path = Path('.') 16 | os.listdir(path_path) | ^^^^^^^^^^ - | PTH208 Use `pathlib.Path.iterdir()` instead. --> PTH208.py:19:4 diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH211_PTH211.py.snap b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH211_PTH211.py.snap index cd46c1b704b455..2b2d8e98dc5719 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH211_PTH211.py.snap +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__PTH211_PTH211.py.snap @@ -94,5 +94,4 @@ PTH211 `os.symlink` should be replaced by `Path.symlink_to` 22 | os.symlink("usr/bin/python", dst="tmp/python", target_is_directory= True ) 23 | os.symlink("usr/bin/python", dst="tmp/python", target_is_directory="nonboolean") | ^^^^^^^^^^ - | help: Replace with `Path(...).symlink_to(...)` diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__full_name.py.snap b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__full_name.py.snap index e818dc83d86396..bc4e59683c863f 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__full_name.py.snap +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__full_name.py.snap @@ -635,5 +635,4 @@ PTH101 `os.chmod()` should be replaced by `Path.chmod()` 186 | os.chmod(_AttrHolder.fd, 0o644) # Suppressed: resolved as `int` 187 | os.chmod(_AttrHolder.name, 0o644) # Diagnostic + fix: resolved as `str` | ^^^^^^^^ - | help: Replace with `Path(...).chmod(...)` diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__import_as.py.snap b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__import_as.py.snap index f2b4eeff44967e..89653f3915b543 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__import_as.py.snap +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__import_as.py.snap @@ -290,4 +290,3 @@ PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, an 30 | foo_p.samefile(p) 31 | foo_p.splitext(p) | ^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__import_from.py.snap b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__import_from.py.snap index 60da4269a63564..3482761ca311b6 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__import_from.py.snap +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__import_from.py.snap @@ -314,7 +314,6 @@ PTH123 `open()` should be replaced by `Path.open()` 35 | fp.read() 36 | open(p).close() | ^^^^ - | help: Replace with `Path.open()` PTH123 `open()` should be replaced by `Path.open()` @@ -324,7 +323,6 @@ PTH123 `open()` should be replaced by `Path.open()` 42 | 43 | with open(p) as _: ... # Error | ^^^^ - | help: Replace with `Path.open()` PTH104 `os.rename()` should be replaced by `Path.rename()` diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__import_from_as.py.snap b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__import_from_as.py.snap index 14992042957b0d..224ed57fbaa4dc 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__import_from_as.py.snap +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__import_from_as.py.snap @@ -290,4 +290,3 @@ PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, an 37 | xsamefile(p) 38 | xsplitext(p) | ^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH201_PTH201.py.snap b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH201_PTH201.py.snap index 24b0d2fe5f4864..5af0ac59be8f4a 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH201_PTH201.py.snap +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH201_PTH201.py.snap @@ -366,7 +366,6 @@ PTH201 [*] Do not pass the current directory explicitly to `Path` 77 | _ = PureWindowsPath(".") 78 | _ = PackagePath(".") | ^^^ - | help: Remove the current directory argument | 77 | _ = PureWindowsPath(".") diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH202_PTH202.py.snap b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH202_PTH202.py.snap index 03e14cc83b05d5..1a4120aea658ac 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH202_PTH202.py.snap +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH202_PTH202.py.snap @@ -372,7 +372,6 @@ PTH202 [*] `os.path.getsize` should be replaced by `Path.stat().st_size` 35 | getsize(filename1) 36 | getsize(filename2) | ^^^^^^^ - | help: Replace with `Path(...).stat().st_size` | 35 | getsize(filename1) @@ -577,7 +576,6 @@ PTH202 [*] `os.path.getsize` should be replaced by `Path.stat().st_size` 81 | 82 | os.path.getsize(pathlib.Path("filename")) | ^^^^^^^^^^^^^^^ - | help: Replace with `Path(...).stat().st_size` | 81 | diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH202_PTH202_2.py.snap b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH202_PTH202_2.py.snap index 9da2fd4bcdc458..1d644eb58ad5fb 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH202_PTH202_2.py.snap +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH202_PTH202_2.py.snap @@ -47,7 +47,6 @@ PTH202 [*] `os.path.getsize` should be replaced by `Path.stat().st_size` 4 | os.path.getsize(filename=b"filename") 5 | os.path.getsize(filename=__file__) | ^^^^^^^^^^^^^^^ - | help: Replace with `Path(...).stat().st_size` | 1 | import os diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH203_PTH203.py.snap b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH203_PTH203.py.snap index 035dc33fe8d413..8e855df1b51760 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH203_PTH203.py.snap +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH203_PTH203.py.snap @@ -42,7 +42,6 @@ PTH203 [*] `os.path.getatime` should be replaced by `Path.stat().st_atime` 6 | os.path.getatime(b"filename") 7 | os.path.getatime(Path("filename")) | ^^^^^^^^^^^^^^^^ - | help: Replace with `Path.stat(...).st_atime` | 6 | os.path.getatime(b"filename") @@ -90,7 +89,6 @@ PTH203 [*] `os.path.getatime` should be replaced by `Path.stat().st_atime` 11 | getatime(b"filename") 12 | getatime(Path("filename")) | ^^^^^^^^ - | help: Replace with `Path.stat(...).st_atime` | 11 | getatime(b"filename") @@ -237,7 +235,6 @@ PTH203 [*] `os.path.getatime` should be replaced by `Path.stat().st_atime` 34 | 35 | getatime(Path("dir") / "file.txt") | ^^^^^^^^ - | help: Replace with `Path.stat(...).st_atime` | 34 | diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH204_PTH204.py.snap b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH204_PTH204.py.snap index 835040a92f2440..58cdff17995966 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH204_PTH204.py.snap +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH204_PTH204.py.snap @@ -40,7 +40,6 @@ PTH204 [*] `os.path.getmtime` should be replaced by `Path.stat().st_mtime` 7 | os.path.getmtime(b"filename") 8 | os.path.getmtime(Path("filename")) | ^^^^^^^^^^^^^^^^ - | help: Replace with `Path.stat(...).st_mtime` | 7 | os.path.getmtime(b"filename") @@ -88,7 +87,6 @@ PTH204 [*] `os.path.getmtime` should be replaced by `Path.stat().st_mtime` 12 | getmtime(b"filename") 13 | getmtime(Path("filename")) | ^^^^^^^^ - | help: Replace with `Path.stat(...).st_mtime` | 12 | getmtime(b"filename") diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH205_PTH205.py.snap b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH205_PTH205.py.snap index 6ba2cf7ca78800..1a124d5b1bf35e 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH205_PTH205.py.snap +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview__PTH205_PTH205.py.snap @@ -92,7 +92,6 @@ PTH205 [*] `os.path.getctime` should be replaced by `Path.stat().st_ctime` 11 | getctime(b"filename") 12 | getctime(Path("filename")) | ^^^^^^^^ - | help: Replace with `Path.stat(...).st_ctime` | 11 | getctime(b"filename") diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview_full_name.py.snap b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview_full_name.py.snap index c2a5e815825e2e..968f293563c352 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview_full_name.py.snap +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview_full_name.py.snap @@ -1008,7 +1008,6 @@ PTH101 [*] `os.chmod()` should be replaced by `Path.chmod()` 186 | os.chmod(_AttrHolder.fd, 0o644) # Suppressed: resolved as `int` 187 | os.chmod(_AttrHolder.name, 0o644) # Diagnostic + fix: resolved as `str` | ^^^^^^^^ - | help: Replace with `Path(...).chmod(...)` | 142 | import sys diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview_import_as.py.snap b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview_import_as.py.snap index 8a9b44e4f8e33c..327e1a1bc05079 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview_import_as.py.snap +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview_import_as.py.snap @@ -445,4 +445,3 @@ PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, an 30 | foo_p.samefile(p) 31 | foo_p.splitext(p) | ^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview_import_from.py.snap b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview_import_from.py.snap index 9465129e50b6d6..0f889292ca723f 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview_import_from.py.snap +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview_import_from.py.snap @@ -479,7 +479,6 @@ PTH123 [*] `open()` should be replaced by `Path.open()` 35 | fp.read() 36 | open(p).close() | ^^^^ - | help: Replace with `Path.open()` | 4 | from os.path import isabs, join, basename, dirname, samefile, splitext @@ -499,7 +498,6 @@ PTH123 [*] `open()` should be replaced by `Path.open()` 42 | 43 | with open(p) as _: ... # Error | ^^^^ - | help: Replace with `Path.open()` | 4 | from os.path import isabs, join, basename, dirname, samefile, splitext diff --git a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview_import_from_as.py.snap b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview_import_from_as.py.snap index bf494515133c9e..2e5f5bcf1ad185 100644 --- a/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview_import_from_as.py.snap +++ b/crates/ruff_linter/src/rules/flake8_use_pathlib/snapshots/ruff_linter__rules__flake8_use_pathlib__tests__preview_import_from_as.py.snap @@ -445,4 +445,3 @@ PTH122 `os.path.splitext()` should be replaced by `Path.suffix`, `Path.stem`, an 37 | xsamefile(p) 38 | xsplitext(p) | ^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__1_separate_subpackage_first_and_third_party_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__1_separate_subpackage_first_and_third_party_imports.py.snap index 474bc9ff241464..4af5fa8f98df5f 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__1_separate_subpackage_first_and_third_party_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__1_separate_subpackage_first_and_third_party_imports.py.snap @@ -13,7 +13,6 @@ I001 [*] Import block is un-sorted or un-formatted 7 | | import foo.bar 8 | | import foo.bar.baz | |__________________^ - | help: Organize imports | 1 | import sys diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__2_separate_subpackage_first_and_third_party_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__2_separate_subpackage_first_and_third_party_imports.py.snap index c4740a9f252b3e..887980a2bd6434 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__2_separate_subpackage_first_and_third_party_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__2_separate_subpackage_first_and_third_party_imports.py.snap @@ -13,7 +13,6 @@ I001 [*] Import block is un-sorted or un-formatted 7 | | import foo.bar 8 | | import foo.bar.baz | |__________________^ - | help: Organize imports | 1 | import sys diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__add_newline_before_comments.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__add_newline_before_comments.py.snap index 26ecb23ee6efe8..555d6ccc20e8a5 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__add_newline_before_comments.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__add_newline_before_comments.py.snap @@ -12,7 +12,6 @@ I001 [*] Import block is un-sorted or un-formatted 6 | | # before it. 7 | | import leading_prefix | |_____________________^ - | help: Organize imports | 1 | import os diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__as_imports_comments.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__as_imports_comments.py.snap index 1c5b54e61c6902..1db22a4a0e1d51 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__as_imports_comments.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__as_imports_comments.py.snap @@ -20,7 +20,6 @@ I001 [*] Import block is un-sorted or un-formatted 14 | | Member # Comment on `Member` 15 | | ) | |_^ - | help: Organize imports | - from foo import ( # Comment on `foo` diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__bom_unsorted.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__bom_unsorted.py.snap index 55511be6a8834a..181eb565f8807d 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__bom_unsorted.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__bom_unsorted.py.snap @@ -7,7 +7,6 @@ I001 [*] Import block is un-sorted or un-formatted 1 | / import foo 2 | | import bar | |__________^ - | help: Organize imports | - import foo diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__case_sensitive_case_sensitive.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__case_sensitive_case_sensitive.py.snap index 3604920fb13e10..d84c4838e77a23 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__case_sensitive_case_sensitive.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__case_sensitive_case_sensitive.py.snap @@ -14,7 +14,6 @@ I001 [*] Import block is un-sorted or un-formatted 8 | | from g import a, B, c 9 | | from h import A, b, C | |_____________________^ - | help: Organize imports | 2 | import B diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__closest_to_furthest_relative_imports_order.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__closest_to_furthest_relative_imports_order.py.snap index bf0ca0eb2dd154..a77cb654ef1240 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__closest_to_furthest_relative_imports_order.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__closest_to_furthest_relative_imports_order.py.snap @@ -8,7 +8,6 @@ I001 [*] Import block is un-sorted or un-formatted 2 | | from .. import b 3 | | from . import c | |_______________^ - | help: Organize imports | 1 + from . import c diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_as_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_as_imports.py.snap index c1931d0594e600..e43c9f990be35e 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_as_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_as_imports.py.snap @@ -9,7 +9,6 @@ I001 [*] Import block is un-sorted or un-formatted 3 | | from module import function 4 | | from module import function as f | |________________________________^ - | help: Organize imports | 1 + from module import CONSTANT, function diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_as_imports_combine_as_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_as_imports_combine_as_imports.py.snap index c4f6721d4573ad..9fcbbe57f2b1bd 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_as_imports_combine_as_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_as_imports_combine_as_imports.py.snap @@ -9,7 +9,6 @@ I001 [*] Import block is un-sorted or un-formatted 3 | | from module import function 4 | | from module import function as f | |________________________________^ - | help: Organize imports | - from module import Class as C diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_import_from.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_import_from.py.snap index 8305cfb8dc1275..6350201903671d 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_import_from.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combine_import_from.py.snap @@ -10,7 +10,6 @@ I001 [*] Import block is un-sorted or un-formatted 4 | | from collections import ChainMap 5 | | from collections import MutableSequence, MutableMapping | |_______________________________________________________^ - | help: Organize imports | - from collections import Awaitable diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__comments.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__comments.py.snap index c832d00d8c2057..0927db196b1639 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__comments.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__comments.py.snap @@ -38,7 +38,6 @@ I001 [*] Import block is un-sorted or un-formatted 32 | | from F import a # Comment 1 33 | | from F import b | |_______________^ - | help: Organize imports | 2 | # Comment 2 diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__deduplicate_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__deduplicate_imports.py.snap index 188dcdb1df848f..f90f628d5cc5db 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__deduplicate_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__deduplicate_imports.py.snap @@ -9,7 +9,6 @@ I001 [*] Import block is un-sorted or un-formatted 3 | | import os as os1 4 | | import os as os2 | |________________^ - | help: Organize imports | 1 | import os diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__detect_same_package.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__detect_same_package.snap index 2847791bc720f5..2baad8d7ca9a82 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__detect_same_package.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__detect_same_package.snap @@ -8,7 +8,6 @@ I001 [*] Import block is un-sorted or un-formatted 2 | | import pandas 3 | | import foo.baz | |______________^ - | help: Organize imports | 1 | import os diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__fit_line_length.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__fit_line_length.py.snap index 2365b71c778aa1..6135ea2c0372f8 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__fit_line_length.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__fit_line_length.py.snap @@ -14,7 +14,6 @@ I001 [*] Import block is un-sorted or un-formatted 13 | | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 14 | | ) | |_____^ - | help: Organize imports | 7 | from line_with_88 import aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__fit_line_length_comment.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__fit_line_length_comment.py.snap index b416777b811f55..0be10899f89b81 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__fit_line_length_comment.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__fit_line_length_comment.py.snap @@ -13,7 +13,6 @@ I001 [*] Import block is un-sorted or un-formatted 7 | | # The next import doesn't fit on one line. 8 | | from h import i # 012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9012ß9💣2ℝ9 | |_______________^ - | help: Organize imports | 1 | import a diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_single_line_force_single_line.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_single_line_force_single_line.py.snap index 1fb1a840629601..c48cd441fdf587 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_single_line_force_single_line.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_single_line_force_single_line.py.snap @@ -32,7 +32,6 @@ I001 [*] Import block is un-sorted or un-formatted 26 | | # comment 9 27 | | from baz import * # comment 10 | |_________________^ - | help: Organize imports | - import sys, math diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections.py.snap index 7cf19fe93f9511..b7f693ac66534c 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections.py.snap @@ -18,7 +18,6 @@ I001 [*] Import block is un-sorted or un-formatted 12 | | from .my.nested import fn2 13 | | from ...grandparent import fn3 | |______________________________^ - | help: Organize imports | - from a import a1 # import_from diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections.py.snap index 14092c991280b1..13c4640dcbe656 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections.py.snap @@ -18,7 +18,6 @@ I001 [*] Import block is un-sorted or un-formatted 12 | | from .my.nested import fn2 13 | | from ...grandparent import fn3 | |______________________________^ - | help: Organize imports | - from a import a1 # import_from diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections_future.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections_future.py.snap index ed36520a792cca..2f8f2c71ba0cd7 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections_future.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections_future.py.snap @@ -7,7 +7,6 @@ I001 [*] Import block is un-sorted or un-formatted 1 | / import __future__ 2 | | from __future__ import annotations | |__________________________________^ - | help: Organize imports | 1 + from __future__ import annotations diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections_with_as_names.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections_with_as_names.py.snap index d6c305f1864491..046d53ad5d980b 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections_with_as_names.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_force_sort_within_sections_with_as_names.py.snap @@ -10,7 +10,6 @@ I001 [*] Import block is un-sorted or un-formatted 4 | | import datetime as dt 5 | | import datetime | |_______________^ - | help: Organize imports | 1 + import datetime diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_lazy_force_sort_within_sections.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_lazy_force_sort_within_sections.py.snap index 74ed4fb0a0d2ec..87eb58ef3146ad 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_lazy_force_sort_within_sections.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_sort_within_sections_lazy_force_sort_within_sections.py.snap @@ -9,7 +9,6 @@ I001 [*] Import block is un-sorted or un-formatted 3 | | lazy import os 4 | | import os | |_________^ - | help: Organize imports | 1 + from math import pi diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_to_top.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_to_top.py.snap index 0e5054e367645b..b226f8936c6c54 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_to_top.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_to_top.py.snap @@ -28,7 +28,6 @@ I001 [*] Import block is un-sorted or un-formatted 22 | | from lib3.lib4 import foo 23 | | from lib3.lib4.lib5 import foo | |______________________________^ - | help: Organize imports | - import lib6 diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_to_top_force_to_top.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_to_top_force_to_top.py.snap index 211d009b0b17a9..47564887eae0fe 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_to_top_force_to_top.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_to_top_force_to_top.py.snap @@ -28,7 +28,6 @@ I001 [*] Import block is un-sorted or un-formatted 22 | | from lib3.lib4 import foo 23 | | from lib3.lib4.lib5 import foo | |______________________________^ - | help: Organize imports | - import lib6 diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_wrap_aliases.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_wrap_aliases.py.snap index a614900e48a727..ad36f643acacff 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_wrap_aliases.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_wrap_aliases.py.snap @@ -8,7 +8,6 @@ I001 [*] Import block is un-sorted or un-formatted 2 | | from .b import b1 as b1 3 | | from .c import c1 | |_________________^ - | help: Organize imports | - from .a import a1 as a1, a2 as a2 diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_wrap_aliases_force_wrap_aliases.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_wrap_aliases_force_wrap_aliases.py.snap index db642eb36cd0af..55e2ef2493d2ca 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_wrap_aliases_force_wrap_aliases.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__force_wrap_aliases_force_wrap_aliases.py.snap @@ -8,7 +8,6 @@ I001 [*] Import block is un-sorted or un-formatted 2 | | from .b import b1 as b1 3 | | from .c import c1 | |_________________^ - | help: Organize imports | - from .a import a1 as a1, a2 as a2 diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__forced_separate.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__forced_separate.py.snap index a8f4bde79e117e..1f5f81af22dc1d 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__forced_separate.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__forced_separate.py.snap @@ -13,7 +13,6 @@ I001 [*] Import block is un-sorted or un-formatted 7 | | from experiments.weird import varieties 8 | | from office_helper.assistants import entity_registry as er | |__________________________________________________________^ - | help: Organize imports | 2 | # but we want tests and experiments to be separated, in that order diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__from_first_lazy_from_first.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__from_first_lazy_from_first.py.snap index 7dae3bb6f624ca..f35e5a369afe7b 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__from_first_lazy_from_first.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__from_first_lazy_from_first.py.snap @@ -9,7 +9,6 @@ I001 [*] Import block is un-sorted or un-formatted 3 | | lazy import os 4 | | import os | |_________^ - | help: Organize imports | 1 + from math import pi diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__future_from.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__future_from.py.snap index dc1d3a0f3c2429..782750f0b494b6 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__future_from.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__future_from.py.snap @@ -7,7 +7,6 @@ I001 [*] Import block is un-sorted or un-formatted 1 | / import __future__ 2 | | from __future__ import annotations | |__________________________________^ - | help: Organize imports | 1 + from __future__ import annotations diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__glob_1_separate_subpackage_first_and_third_party_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__glob_1_separate_subpackage_first_and_third_party_imports.py.snap index 474bc9ff241464..4af5fa8f98df5f 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__glob_1_separate_subpackage_first_and_third_party_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__glob_1_separate_subpackage_first_and_third_party_imports.py.snap @@ -13,7 +13,6 @@ I001 [*] Import block is un-sorted or un-formatted 7 | | import foo.bar 8 | | import foo.bar.baz | |__________________^ - | help: Organize imports | 1 | import sys diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__if_elif_else.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__if_elif_else.py.snap index cdd6062828f1fc..ed5a1d04bad100 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__if_elif_else.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__if_elif_else.py.snap @@ -9,7 +9,6 @@ I001 [*] Import block is un-sorted or un-formatted 6 | / from setuptools.command.sdist import sdist as _sdist 7 | | from distutils.command.sdist import sdist as _sdist | |_______________________________________________________^ - | help: Organize imports | 5 | else: diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_from_after_import.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_from_after_import.py.snap index 0791a31b5382fa..1b72f5f7a553aa 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_from_after_import.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_from_after_import.py.snap @@ -7,7 +7,6 @@ I001 [*] Import block is un-sorted or un-formatted 1 | / from collections import Collection 2 | | import os | |_________^ - | help: Organize imports | 1 + import os diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_force_sort_within_sections_import_heading_force_sort_within_sections.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_force_sort_within_sections_import_heading_force_sort_within_sections.py.snap index 38f51764deff82..6319a48b69f2d5 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_force_sort_within_sections_import_heading_force_sort_within_sections.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_force_sort_within_sections_import_heading_force_sort_within_sections.py.snap @@ -10,7 +10,6 @@ I001 [*] Import block is un-sorted or un-formatted 4 | | import requests 5 | | import pandas | |_____________^ - | help: Organize imports | 1 + # Future imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_import_heading.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_import_heading.py.snap index 1347d28216dc0c..97506d845c3a2c 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_import_heading.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_import_heading.py.snap @@ -16,7 +16,6 @@ I001 [*] Import block is un-sorted or un-formatted 10 | | 11 | | from . import my_local_folder_object | |____________________________________^ - | help: Organize imports | 1 + # Future imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_import_heading_already_present.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_import_heading_already_present.py.snap index 489f917f6f35fa..9c98987e91b151 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_import_heading_already_present.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_import_heading_already_present.py.snap @@ -20,7 +20,6 @@ I001 [*] Import block is un-sorted or un-formatted 14 | | 15 | | from . import my_local_folder_object | |____________________________________^ - | help: Organize imports | 8 | # Third party imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_import_heading_duplicate.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_import_heading_duplicate.py.snap index 2330bd1d34c2be..5011e2658c54e5 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_import_heading_duplicate.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_import_heading_duplicate.py.snap @@ -12,7 +12,6 @@ I001 [*] Import block is un-sorted or un-formatted 6 | | import requests 7 | | import pandas | |_____________^ - | help: Organize imports | 1 | # Standard library imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_import_heading_unsorted.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_import_heading_unsorted.py.snap index 28ebdda43a575c..f8eca59df03325 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_import_heading_unsorted.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_import_heading_unsorted.py.snap @@ -12,7 +12,6 @@ I001 [*] Import block is un-sorted or un-formatted 6 | | from my_first_party import my_first_party_object 7 | | from . import my_local_folder_object | |____________________________________^ - | help: Organize imports | - import pandas diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_partial_import_heading_partial.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_partial_import_heading_partial.py.snap index 56235ae6e81a80..147944e848a5c9 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_partial_import_heading_partial.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_partial_import_heading_partial.py.snap @@ -10,7 +10,6 @@ I001 [*] Import block is un-sorted or un-formatted 4 | | import requests 5 | | import pandas | |_____________^ - | help: Organize imports | 1 + # Standard library imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_single_section_import_heading_single_section.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_single_section_import_heading_single_section.py.snap index 2f3e5ff0077957..5be1e45c00a00a 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_single_section_import_heading_single_section.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_single_section_import_heading_single_section.py.snap @@ -7,7 +7,6 @@ I001 [*] Import block is un-sorted or un-formatted 1 | / import requests 2 | | import pandas | |_____________^ - | help: Organize imports | - import requests diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_with_no_lines_before_import_heading_with_no_lines_before.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_with_no_lines_before_import_heading_with_no_lines_before.py.snap index 002504462dffd8..cdf84e9b593053 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_with_no_lines_before_import_heading_with_no_lines_before.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_with_no_lines_before_import_heading_with_no_lines_before.py.snap @@ -16,7 +16,6 @@ I001 [*] Import block is un-sorted or un-formatted 10 | | 11 | | from . import my_local_folder_object | |____________________________________^ - | help: Organize imports | 1 + # Future imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_wrong_heading_import_heading_wrong_heading.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_wrong_heading_import_heading_wrong_heading.py.snap index b7d617c2c8e596..80bec7999ac9ec 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_wrong_heading_import_heading_wrong_heading.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__import_heading_wrong_heading_import_heading_wrong_heading.py.snap @@ -14,7 +14,6 @@ I001 [*] Import block is un-sorted or un-formatted 8 | | 9 | | from my_first_party import my_first_party_object | |________________________________________________^ - | help: Organize imports | 1 | # Wrong heading diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__inline_comments.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__inline_comments.py.snap index 48eb4d3c25b53c..1e561c667093c1 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__inline_comments.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__inline_comments.py.snap @@ -16,7 +16,6 @@ I001 [*] Import block is un-sorted or un-formatted 10 | | 11 | | from d.prometheus.metrics import TERMINAL_CURRENTLY_RUNNING_TOTAL, OTHER_RUNNING_TOTAL # type:ignore[attr-defined] | |______________________________________________________________________________________^ - | help: Organize imports | 3 | ) diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__known_local_folder_closest_separate_local_folder_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__known_local_folder_closest_separate_local_folder_imports.py.snap index 723bbdc0abf059..9d1897dd175a32 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__known_local_folder_closest_separate_local_folder_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__known_local_folder_closest_separate_local_folder_imports.py.snap @@ -12,7 +12,6 @@ I001 [*] Import block is un-sorted or un-formatted 6 | | from .. import trailing_prefix 7 | | from ruff import check | |______________________^ - | help: Organize imports | 1 + import os diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__known_local_folder_separate_local_folder_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__known_local_folder_separate_local_folder_imports.py.snap index 4ecc5700214eb4..cfaa6b42c8aeef 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__known_local_folder_separate_local_folder_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__known_local_folder_separate_local_folder_imports.py.snap @@ -12,7 +12,6 @@ I001 [*] Import block is un-sorted or un-formatted 6 | | from .. import trailing_prefix 7 | | from ruff import check | |______________________^ - | help: Organize imports | 1 + import os diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lazy_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lazy_imports.py.snap index 5ea9ddb5cb2aa1..23ebddd7180a13 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lazy_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lazy_imports.py.snap @@ -9,7 +9,6 @@ I001 [*] Import block is un-sorted or un-formatted 3 | | lazy import os 4 | | import os | |_________^ - | help: Organize imports | - lazy from math import pi diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__leading_prefix.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__leading_prefix.py.snap index d924544c1fe5f6..77e731cab7bcac 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__leading_prefix.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__leading_prefix.py.snap @@ -44,5 +44,4 @@ I001 Import block is un-sorted or un-formatted 12 | x = 1; \ 13 | import os | ^^^^^^^^^ - | help: Organize imports diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_from_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_from_imports.py.snap index 462aead51846f6..52b4750dac3a02 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_from_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_from_imports.py.snap @@ -8,7 +8,6 @@ I001 [*] Import block is un-sorted or un-formatted 2 | | from short import b 3 | | from loooooooooooooooooooooog import c | |______________________________________^ - | help: Organize imports | 1 + from short import b diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_non_ascii_members.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_non_ascii_members.py.snap index aa6fe68f4dca4b..d8f31f831063a9 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_non_ascii_members.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_non_ascii_members.py.snap @@ -16,7 +16,6 @@ I001 [*] Import block is un-sorted or un-formatted 10 | | λοοοοοοοοοοοοοονγ, 11 | | ) | |_^ - | help: Organize imports | 1 | from module1 import ( diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_non_ascii_modules.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_non_ascii_modules.py.snap index fad0099d66dfa3..ad038adb64d964 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_non_ascii_modules.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_non_ascii_modules.py.snap @@ -14,7 +14,6 @@ I001 [*] Import block is un-sorted or un-formatted 8 | | import μεδιυυυυυμ 9 | | import looooooooooooooong | |_________________________^ - | help: Organize imports | - import loooooooooooooong diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_straight_and_from_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_straight_and_from_imports.py.snap index 696b43cdf030cd..d969d064fefa0d 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_straight_and_from_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_straight_and_from_imports.py.snap @@ -11,7 +11,6 @@ I001 [*] Import block is un-sorted or un-formatted 5 | | from mediuuuum import c 6 | | from short import b | |___________________^ - | help: Organize imports | 1 + import short diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_straight_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_straight_imports.py.snap index a4c0b6b8e17a87..629a252b9c499a 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_straight_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_straight_imports.py.snap @@ -9,7 +9,6 @@ I001 [*] Import block is un-sorted or un-formatted 3 | | import looooooooooooooooong 4 | | import mediuuuuuuma | |___________________^ - | help: Organize imports | 1 + import short diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_with_relative_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_with_relative_imports.py.snap index d4f6848db535c1..f9eae0c402b3eb 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_with_relative_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort__length_sort_with_relative_imports.py.snap @@ -12,7 +12,6 @@ I001 [*] Import block is un-sorted or un-formatted 6 | | from .mediuuuum import a 7 | | from ......short import b | |_________________________^ - | help: Organize imports | - from ..looooooooooooooong import a diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_from_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_from_imports.py.snap index 43ce4317c43d90..dde79e759427a4 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_from_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_from_imports.py.snap @@ -8,7 +8,6 @@ I001 [*] Import block is un-sorted or un-formatted 2 | | from short import b 3 | | from loooooooooooooooooooooog import c | |______________________________________^ - | help: Organize imports | 1 + from loooooooooooooooooooooog import c diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_straight_and_from_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_straight_and_from_imports.py.snap index d3ab2430225b81..3299b6f541b78c 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_straight_and_from_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_straight_and_from_imports.py.snap @@ -11,7 +11,6 @@ I001 [*] Import block is un-sorted or un-formatted 5 | | from mediuuuum import c 6 | | from short import b | |___________________^ - | help: Organize imports | 1 + import short diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_straight_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_straight_imports.py.snap index a4c0b6b8e17a87..629a252b9c499a 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_straight_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__length_sort_straight__length_sort_straight_imports.py.snap @@ -9,7 +9,6 @@ I001 [*] Import block is un-sorted or un-formatted 3 | | import looooooooooooooooong 4 | | import mediuuuuuuma | |___________________^ - | help: Organize imports | 1 + import short diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__line_ending_crlf.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__line_ending_crlf.py.snap index 03c5d233ad3490..d6e945ffebcf4a 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__line_ending_crlf.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__line_ending_crlf.py.snap @@ -6,7 +6,6 @@ I001 [*] Import block is un-sorted or un-formatted | 1 | from long_module_name import member_one, member_two, member_three, member_four, member_five | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Organize imports | - from long_module_name import member_one, member_two, member_three, member_four, member_five diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__line_ending_lf.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__line_ending_lf.py.snap index 14b68ac0db1cfc..5ff5c8e84a4abd 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__line_ending_lf.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__line_ending_lf.py.snap @@ -6,7 +6,6 @@ I001 [*] Import block is un-sorted or un-formatted | 1 | from long_module_name import member_one, member_two, member_three, member_four, member_five | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Organize imports | - from long_module_name import member_one, member_two, member_three, member_four, member_five diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports.pyi.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports.pyi.snap index 93b16f68d2cd3f..1653128b16a110 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports.pyi.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports.pyi.snap @@ -14,7 +14,6 @@ I001 [*] Import block is un-sorted or un-formatted 8 | | 9 | | from . import my_local_folder_object | |____________________________________^ - | help: Organize imports | 4 | diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_func_after.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_func_after.py.snap index 66cdaf79f82c68..ad9975a69afe02 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_func_after.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_func_after.py.snap @@ -14,7 +14,6 @@ I001 [*] Import block is un-sorted or un-formatted 8 | | 9 | | from . import my_local_folder_object | |____________________________________^ - | help: Organize imports | 4 | diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports.pyi.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports.pyi.snap index 93b16f68d2cd3f..1653128b16a110 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports.pyi.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports.pyi.snap @@ -14,7 +14,6 @@ I001 [*] Import block is un-sorted or un-formatted 8 | | 9 | | from . import my_local_folder_object | |____________________________________^ - | help: Organize imports | 4 | diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports_func_after.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports_func_after.py.snap index 0656649411883f..35fb31db47e81e 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports_func_after.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports_func_after.py.snap @@ -14,7 +14,6 @@ I001 [*] Import block is un-sorted or un-formatted 8 | | 9 | | from . import my_local_folder_object | |____________________________________^ - | help: Organize imports | 4 | diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports_nothing_after.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports_nothing_after.py.snap index f3caf1a0aae4a1..aa1e760692d5b2 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports_nothing_after.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_after_imports_lines_after_imports_nothing_after.py.snap @@ -14,7 +14,6 @@ I001 [*] Import block is un-sorted or un-formatted 8 | | 9 | | from . import my_local_folder_object | |____________________________________^ - | help: Organize imports | 4 | diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_between_typeslines_between_types.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_between_typeslines_between_types.py.snap index c4ae98971710a0..890cea62bc9916 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_between_typeslines_between_types.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__lines_between_typeslines_between_types.py.snap @@ -21,7 +21,6 @@ I001 [*] Import block is un-sorted or un-formatted 15 | | from . import config 16 | | from .data import Data | |______________________^ - | help: Organize imports | 11 | diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__magic_trailing_comma.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__magic_trailing_comma.py.snap index 7a5716dbc5f4f6..ac554299c2de84 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__magic_trailing_comma.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__magic_trailing_comma.py.snap @@ -43,7 +43,6 @@ I001 [*] Import block is un-sorted or un-formatted 37 | | member3, 38 | | ) | |_^ - | help: Organize imports | 1 | # This has a magic trailing comma, will be sorted, but not rolled into one line diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__match_case.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__match_case.py.snap index 5ee663f1253347..435058e786a687 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__match_case.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__match_case.py.snap @@ -29,7 +29,6 @@ I001 [*] Import block is un-sorted or un-formatted 6 | / import collections 7 | | import abc | |__________________^ - | help: Organize imports | 5 | case 2: diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__natural_order.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__natural_order.py.snap index 068f8618af37f9..9df996f9bbce30 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__natural_order.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__natural_order.py.snap @@ -21,7 +21,6 @@ I001 [*] Import block is un-sorted or un-formatted 15 | | uint64, 16 | | ) | |_^ - | help: Organize imports | 1 | import numpy1 diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_detect_same_package.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_detect_same_package.snap index 9963dc0c55913a..5c7538732e37b6 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_detect_same_package.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_detect_same_package.snap @@ -8,7 +8,6 @@ I001 [*] Import block is un-sorted or un-formatted 2 | | import pandas 3 | | import foo.baz | |______________^ - | help: Organize imports | 1 | import os diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before.py.snap index 0e044c85d3fb9b..9a01d87bf60a00 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before.py.snap @@ -14,7 +14,6 @@ I001 [*] Import block is un-sorted or un-formatted 8 | | 9 | | from . import my_local_folder_object | |____________________________________^ - | help: Organize imports | 4 | diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before.py_no_lines_before.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before.py_no_lines_before.py.snap index 7e9b198adff123..1f491b556f3676 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before.py_no_lines_before.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before.py_no_lines_before.py.snap @@ -14,7 +14,6 @@ I001 [*] Import block is un-sorted or un-formatted 8 | | 9 | | from . import my_local_folder_object | |____________________________________^ - | help: Organize imports | 1 | from __future__ import annotations diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before_with_empty_sections.py_no_lines_before_with_empty_sections.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before_with_empty_sections.py_no_lines_before_with_empty_sections.py.snap index 6eae2c4e7c66df..f400356b5c0b2b 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before_with_empty_sections.py_no_lines_before_with_empty_sections.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_lines_before_with_empty_sections.py_no_lines_before_with_empty_sections.py.snap @@ -8,7 +8,6 @@ I001 [*] Import block is un-sorted or un-formatted 2 | | from typing import Any 3 | | from . import my_local_folder_object | |____________________________________^ - | help: Organize imports | 2 | from typing import Any diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_standard_library_no_standard_library.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_standard_library_no_standard_library.py.snap index 86c59f05cf7089..2329492ec61bde 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_standard_library_no_standard_library.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_standard_library_no_standard_library.py.snap @@ -14,7 +14,6 @@ I001 [*] Import block is un-sorted or un-formatted 8 | | from . import local 9 | | import sys | |__________^ - | help: Organize imports | 2 | diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_wrap_star.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_wrap_star.py.snap index 56cdb2c514633f..5f930fa4cf5748 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_wrap_star.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__no_wrap_star.py.snap @@ -6,7 +6,6 @@ I001 [*] Import block is un-sorted or un-formatted | 1 | from .subscription import * # type: ignore # some very long comment explaining why this needs a type ignore | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Organize imports | - from .subscription import * # type: ignore # some very long comment explaining why this needs a type ignore diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type.py.snap index 70564ab0d845e6..a5c6c7f57dd1ea 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type.py.snap @@ -17,7 +17,6 @@ I001 [*] Import block is un-sorted or un-formatted 11 | | import BAR 12 | | import bar | |__________^ - | help: Organize imports | - import StringIO diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_false_order_by_type.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_false_order_by_type.py.snap index 73ce2c088a47d7..56f6cd71c8dfbe 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_false_order_by_type.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_false_order_by_type.py.snap @@ -17,7 +17,6 @@ I001 [*] Import block is un-sorted or un-formatted 11 | | import BAR 12 | | import bar | |__________^ - | help: Organize imports | - import StringIO diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_classes.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_classes.py.snap index 6b0c0c28ef602a..6c6d57a9e0fb3a 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_classes.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_classes.py.snap @@ -9,7 +9,6 @@ I001 [*] Import block is un-sorted or un-formatted 3 | | from module import CLASS, Class, CONSTANT, function, BASIC, Apple 4 | | from torch.nn import SELU, AClass, A_CONSTANT | |_____________________________________________^ - | help: Organize imports | - from sklearn.svm import func, SVC, CONST, Klass diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_classes_order_by_type_with_custom_classes.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_classes_order_by_type_with_custom_classes.py.snap index dacac652e87036..13bfb34aeacdd8 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_classes_order_by_type_with_custom_classes.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_classes_order_by_type_with_custom_classes.py.snap @@ -9,7 +9,6 @@ I001 [*] Import block is un-sorted or un-formatted 3 | | from module import CLASS, Class, CONSTANT, function, BASIC, Apple 4 | | from torch.nn import SELU, AClass, A_CONSTANT | |_____________________________________________^ - | help: Organize imports | - from sklearn.svm import func, SVC, CONST, Klass diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_constants.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_constants.py.snap index 423fdc237bc38d..47c84868ef4a30 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_constants.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_constants.py.snap @@ -7,7 +7,6 @@ I001 [*] Import block is un-sorted or un-formatted 1 | / from sklearn.svm import XYZ, func, variable, Const, Klass, constant 2 | | from subprocess import First, var, func, Class, konst, A_constant, Last, STDOUT | |_______________________________________________________________________________^ - | help: Organize imports | - from sklearn.svm import XYZ, func, variable, Const, Klass, constant diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_constants_order_by_type_with_custom_constants.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_constants_order_by_type_with_custom_constants.py.snap index 89f24a9b526d7e..424e09e48c1caf 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_constants_order_by_type_with_custom_constants.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_constants_order_by_type_with_custom_constants.py.snap @@ -7,7 +7,6 @@ I001 [*] Import block is un-sorted or un-formatted 1 | / from sklearn.svm import XYZ, func, variable, Const, Klass, constant 2 | | from subprocess import First, var, func, Class, konst, A_constant, Last, STDOUT | |_______________________________________________________________________________^ - | help: Organize imports | - from sklearn.svm import XYZ, func, variable, Const, Klass, constant diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_variables.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_variables.py.snap index 846d879150fbc8..6a5a853dde6598 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_variables.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_variables.py.snap @@ -7,7 +7,6 @@ I001 [*] Import block is un-sorted or un-formatted 1 | / from sklearn.svm import VAR, Class, MyVar, CONST, abc 2 | | from subprocess import utils, var_ABC, Variable, Klass, CONSTANT, exe | |_____________________________________________________________________^ - | help: Organize imports | - from sklearn.svm import VAR, Class, MyVar, CONST, abc diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_variables_order_by_type_with_custom_variables.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_variables_order_by_type_with_custom_variables.py.snap index 25a89760fb08a5..f14d7b908142f9 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_variables_order_by_type_with_custom_variables.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_by_type_with_custom_variables_order_by_type_with_custom_variables.py.snap @@ -7,7 +7,6 @@ I001 [*] Import block is un-sorted or un-formatted 1 | / from sklearn.svm import VAR, Class, MyVar, CONST, abc 2 | | from subprocess import utils, var_ABC, Variable, Klass, CONSTANT, exe | |_____________________________________________________________________^ - | help: Organize imports | - from sklearn.svm import VAR, Class, MyVar, CONST, abc diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_relative_imports_by_level.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_relative_imports_by_level.py.snap index cafaec9d2f06c1..9cea317ea3c4c6 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_relative_imports_by_level.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__order_relative_imports_by_level.py.snap @@ -9,7 +9,6 @@ I001 [*] Import block is un-sorted or un-formatted 3 | | from ..b import a 4 | | from .b import a | |________________^ - | help: Organize imports | - from .a import a diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_comment_order.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_comment_order.py.snap index 0b1a3551b2c127..72714ceb927db5 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_comment_order.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_comment_order.py.snap @@ -16,7 +16,6 @@ I001 [*] Import block is un-sorted or un-formatted 10 | | from errno import EIO 11 | | import abc | |__________^ - | help: Organize imports | 1 + import abc diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_import_star.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_import_star.py.snap index 7e78c93b3d7819..775915d45b4724 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_import_star.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_import_star.py.snap @@ -11,7 +11,6 @@ I001 [*] Import block is un-sorted or un-formatted 5 | | # Above 6 | | from some_module import * # Aside | |_________________________^ - | help: Organize imports | - from some_other_module import some_class diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_indentation.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_indentation.py.snap index 170e452d41391e..50cfe29752e53d 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_indentation.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__preserve_indentation.py.snap @@ -28,7 +28,6 @@ I001 [*] Import block is un-sorted or un-formatted 5 | / import sys 6 | | import os | |_____________^ - | help: Organize imports | 4 | else: diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__propagate_inline_comments_propagate_inline_comments.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__propagate_inline_comments_propagate_inline_comments.py.snap index 7bcf5b5e365213..c9c8f7b9de93e1 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__propagate_inline_comments_propagate_inline_comments.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__propagate_inline_comments_propagate_inline_comments.py.snap @@ -9,7 +9,6 @@ I001 [*] Import block is un-sorted or un-formatted 3 | | items, 4 | | ) | |_^ - | help: Organize imports | 2 | a_long_variable_name_that_causes_problems, diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__reorder_within_section.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__reorder_within_section.py.snap index fc3d806d48d619..296be519a13fb7 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__reorder_within_section.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__reorder_within_section.py.snap @@ -7,7 +7,6 @@ I001 [*] Import block is un-sorted or un-formatted 1 | / import sys 2 | | import os | |_________^ - | help: Organize imports | 1 + import os diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_useless_alias_this_this.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_useless_alias_this_this.py.snap index 575e4c65533cdf..f45944876129cc 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_useless_alias_this_this.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_useless_alias_this_this.py.snap @@ -6,5 +6,4 @@ PLC0414 Required import does not rename original package. | 1 | import this as this | ^^^^^^^^^^^^ - | help: Change required import or disable rule. diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_importfrom_with_useless_alias_this_this_from.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_importfrom_with_useless_alias_this_this_from.py.snap index a4eb5e2aaff43d..320b84a5f9bc4c 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_importfrom_with_useless_alias_this_this_from.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_importfrom_with_useless_alias_this_this_from.py.snap @@ -6,5 +6,4 @@ PLC0414 Required import does not rename original package. | 1 | from module import this as this | ^^^^^^^^^^^^ - | help: Change required import or disable rule. diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__section_order_sections.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__section_order_sections.py.snap index d3d5a6e2fe5300..e8e384d0cff834 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__section_order_sections.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__section_order_sections.py.snap @@ -12,7 +12,6 @@ I001 [*] Import block is un-sorted or un-formatted 6 | | from library import foo 7 | | from . import local | |___________________^ - | help: Organize imports | 1 | from __future__ import annotations diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__sections_sections.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__sections_sections.py.snap index 38ccfca016c4dc..6d24a6547eb1e6 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__sections_sections.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__sections_sections.py.snap @@ -12,7 +12,6 @@ I001 [*] Import block is un-sorted or un-formatted 6 | | from library import foo 7 | | from . import local | |___________________^ - | help: Organize imports | 1 | from __future__ import annotations diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_first_party_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_first_party_imports.py.snap index 5517a50b31a9e1..2999a9b2cb4386 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_first_party_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_first_party_imports.py.snap @@ -10,7 +10,6 @@ I001 [*] Import block is un-sorted or un-formatted 4 | | import os 5 | | from leading_prefix import Class | |________________________________^ - | help: Organize imports | 1 + import os diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_future_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_future_imports.py.snap index abbd2d55b6cdc9..1c9049487b7adc 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_future_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_future_imports.py.snap @@ -8,7 +8,6 @@ I001 [*] Import block is un-sorted or un-formatted 2 | | import os 3 | | from __future__ import annotations | |__________________________________^ - | help: Organize imports | - import sys diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_local_folder_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_local_folder_imports.py.snap index 88b02df6169340..62e21c5a6659e6 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_local_folder_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_local_folder_imports.py.snap @@ -12,7 +12,6 @@ I001 [*] Import block is un-sorted or un-formatted 6 | | from .. import trailing_prefix 7 | | from ruff import check | |______________________^ - | help: Organize imports | 1 + import os diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_third_party_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_third_party_imports.py.snap index 26fde68ecb5753..f931ab534b9b25 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_third_party_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__separate_third_party_imports.py.snap @@ -9,7 +9,6 @@ I001 [*] Import block is un-sorted or un-formatted 3 | | import numpy as np 4 | | import os | |_________^ - | help: Organize imports | - import pandas as pd diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__skip.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__skip.py.snap index 34aaaa42a8d471..6f8bc5b4db8a1a 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__skip.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__skip.py.snap @@ -9,7 +9,6 @@ I001 [*] Import block is un-sorted or un-formatted 20 | / import collections 21 | | import abc | |______________^ - | help: Organize imports | 19 | import os # isort: skip @@ -27,7 +26,6 @@ I001 [*] Import block is un-sorted or un-formatted 27 | / import collections 28 | | import abc | |______________^ - | help: Organize imports | 26 | import os # isort:skip @@ -44,7 +42,6 @@ I001 [*] Import block is un-sorted or un-formatted 33 | import sys; import os # isort:skip # isort:skip 34 | import sys; import os | ^^^^^^^^^^^^^^^^^^^^^ - | help: Organize imports | 33 | import sys; import os # isort:skip # isort:skip diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__sort_similar_imports.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__sort_similar_imports.py.snap index 0c589c5d30971c..6964d1f7196643 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__sort_similar_imports.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__sort_similar_imports.py.snap @@ -31,7 +31,6 @@ I001 [*] Import block is un-sorted or un-formatted 25 | | import x 26 | | import x as a | |_____________^ - | help: Organize imports | - from a import b diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__split.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__split.py.snap index 4e58973fcb7580..65bd1fcdf646e7 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__split.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__split.py.snap @@ -28,7 +28,6 @@ I001 [*] Import block is un-sorted or un-formatted 20 | / import D 21 | | import B | |____________^ - | help: Organize imports | 19 | @@ -46,7 +45,6 @@ I001 [*] Import block is un-sorted or un-formatted 30 | / import d 31 | | import c | |________^ - | help: Organize imports | 29 | diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__split_on_trailing_comma_magic_trailing_comma.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__split_on_trailing_comma_magic_trailing_comma.py.snap index 4ad739b5375c71..2d3ec8531f519c 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__split_on_trailing_comma_magic_trailing_comma.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__split_on_trailing_comma_magic_trailing_comma.py.snap @@ -43,7 +43,6 @@ I001 [*] Import block is un-sorted or un-formatted 37 | | member3, 38 | | ) | |_^ - | help: Organize imports | 1 | # This has a magic trailing comma, will be sorted, but not rolled into one line diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__star_before_others.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__star_before_others.py.snap index 66a62a417d9897..109bbf659730ac 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__star_before_others.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__star_before_others.py.snap @@ -8,7 +8,6 @@ I001 [*] Import block is un-sorted or un-formatted 2 | | from .settings import ENV 3 | | from .settings import * | |_______________________^ - | help: Organize imports | 1 | from .logging import config_logging diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__trailing_comment.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__trailing_comment.py.snap index 2756a1ccab063f..b28c3f020d2c89 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__trailing_comment.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__trailing_comment.py.snap @@ -115,7 +115,6 @@ I001 [*] Import block is un-sorted or un-formatted 53 | | # e 54 | | ) # f | |_^ - | help: Organize imports | 49 | # a diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__trailing_suffix.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__trailing_suffix.py.snap index db440fdd49ea60..614e80f9e8205e 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__trailing_suffix.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__trailing_suffix.py.snap @@ -19,5 +19,4 @@ I001 Import block is un-sorted or un-formatted 5 | / import sys 6 | | import os; x = 1 | |_____________^ - | help: Organize imports diff --git a/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy-deprecated-function_NPY003.py.snap b/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy-deprecated-function_NPY003.py.snap index 2b57eba3db052d..1a7b461cdfd0db 100644 --- a/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy-deprecated-function_NPY003.py.snap +++ b/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy-deprecated-function_NPY003.py.snap @@ -78,7 +78,6 @@ NPY003 [*] `np.alltrue` is deprecated; use `np.all` instead 7 | np.sometrue(np.random.rand(5, 5)) 8 | np.alltrue(np.random.rand(5, 5)) | ^^^^^^^^^^ - | help: Replace with `np.all` | 7 | np.sometrue(np.random.rand(5, 5)) @@ -176,7 +175,6 @@ NPY003 [*] `np.alltrue` is deprecated; use `np.all` instead 17 | sometrue(np.random.rand(5, 5)) 18 | alltrue(np.random.rand(5, 5)) | ^^^^^^^ - | help: Replace with `np.all` | 1 + from numpy import all diff --git a/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy-deprecated-type-alias_NPY001.py.snap b/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy-deprecated-type-alias_NPY001.py.snap index 8e7371e8f8188d..e215442bc4aadb 100644 --- a/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy-deprecated-type-alias_NPY001.py.snap +++ b/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy-deprecated-type-alias_NPY001.py.snap @@ -130,7 +130,6 @@ NPY001 [*] Type alias `np.float` is deprecated, replace with builtin type 24 | 25 | float(1) | ^^^^^ - | help: Replace `np.float` with builtin type | 23 | from numpy import float diff --git a/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy-legacy-random_NPY002.py.snap b/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy-legacy-random_NPY002.py.snap index 8a0bf558f05c24..d1fd359f6b9b3b 100644 --- a/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy-legacy-random_NPY002.py.snap +++ b/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy-legacy-random_NPY002.py.snap @@ -565,4 +565,3 @@ NPY002 Replace legacy `np.random.zipf` call with `np.random.Generator` 66 | numpy.random.weibull() 67 | numpy.random.zipf() | ^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy2-deprecation_NPY201_3.py.snap b/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy2-deprecation_NPY201_3.py.snap index a93e8ae6b26aa0..10bb6c129ca869 100644 --- a/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy2-deprecation_NPY201_3.py.snap +++ b/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy2-deprecation_NPY201_3.py.snap @@ -135,7 +135,6 @@ NPY201 [*] `np.format_parser` will be removed in NumPy 2.0. Use `numpy.rec.forma 15 | 16 | np.format_parser | ^^^^^^^^^^^^^^^^ - | help: Replace with `numpy.rec.format_parser` | 1 + from numpy.rec import format_parser diff --git a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD002_fail.snap b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD002_fail.snap index 46ebde74d51620..f07b80f849c66f 100644 --- a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD002_fail.snap +++ b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD002_fail.snap @@ -8,7 +8,6 @@ PD002 [*] `inplace=True` should be avoided; it has inconsistent behavior 3 | x = pd.DataFrame() 4 | x.drop(["a"], axis=1, inplace=True) | ^^^^^^^^^^^^ - | help: Assign to variable; remove `inplace` arg | 3 | x = pd.DataFrame() diff --git a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD003_fail.snap b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD003_fail.snap index 88202b0f96af5e..0fccfaee8d7757 100644 --- a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD003_fail.snap +++ b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD003_fail.snap @@ -7,4 +7,3 @@ PD003 `.isna` is preferred to `.isnull`; functionality is equivalent 2 | import pandas as pd 3 | nulls = pd.isnull(val) | ^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD004_fail.snap b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD004_fail.snap index acef589141a220..0ec15ef1d45b2d 100644 --- a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD004_fail.snap +++ b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD004_fail.snap @@ -7,4 +7,3 @@ PD004 `.notna` is preferred to `.notnull`; functionality is equivalent 2 | import pandas as pd 3 | not_nulls = pd.notnull(val) | ^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD007_fail.snap b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD007_fail.snap index 45c7779e8f9826..cd5ae53cb6fc8e 100644 --- a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD007_fail.snap +++ b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD007_fail.snap @@ -8,4 +8,3 @@ PD007 `.ix` is deprecated; use more explicit `.loc` or `.iloc` 3 | x = pd.DataFrame() 4 | y = x.ix[[0, 2], "A"] | ^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD008_fail.snap b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD008_fail.snap index 9c2cfd6badfc56..e66b6731f2e12b 100644 --- a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD008_fail.snap +++ b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD008_fail.snap @@ -8,4 +8,3 @@ PD008 Use `.loc` instead of `.at`. If speed is important, use NumPy. 3 | x = pd.DataFrame() 4 | index = x.at[:, ["B", "A"]] | ^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD009_fail.snap b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD009_fail.snap index 29aaa732bcf93d..0436f76faece34 100644 --- a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD009_fail.snap +++ b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD009_fail.snap @@ -8,4 +8,3 @@ PD009 Use `.iloc` instead of `.iat`. If speed is important, use NumPy. 3 | x = pd.DataFrame() 4 | index = x.iat[:, 1:3] | ^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD011_fail_values.snap b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD011_fail_values.snap index 8663ed6b380977..90729a93c59776 100644 --- a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD011_fail_values.snap +++ b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD011_fail_values.snap @@ -8,4 +8,3 @@ PD011 Use `.to_numpy()` or `.array` instead of `.values` 3 | x = pd.DataFrame() 4 | result = x.values | ^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD013_fail_stack.snap b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD013_fail_stack.snap index 00b141414e13b2..66734836053f78 100644 --- a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD013_fail_stack.snap +++ b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD013_fail_stack.snap @@ -8,4 +8,3 @@ PD013 `.melt` is preferred to `.stack`; provides same functionality 3 | x = pd.DataFrame() 4 | y = x.stack(level=-1, dropna=True) | ^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD015_fail_merge_on_pandas_object.snap b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD015_fail_merge_on_pandas_object.snap index a812e664371123..6387c0abfe12fe 100644 --- a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD015_fail_merge_on_pandas_object.snap +++ b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD015_fail_merge_on_pandas_object.snap @@ -8,4 +8,3 @@ PD015 Use `.merge` method instead of `pd.merge` function. They have equivalent f 4 | y = pd.DataFrame() 5 | pd.merge(x, y) | ^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD901_fail_df_var.snap b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD901_fail_df_var.snap index 3463a135e42af7..6f695929aa3aba 100644 --- a/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD901_fail_df_var.snap +++ b/crates/ruff_linter/src/rules/pandas_vet/snapshots/ruff_linter__rules__pandas_vet__tests__PD901_fail_df_var.snap @@ -7,4 +7,3 @@ PD901 Avoid using the generic variable name `df` for DataFrames 2 | import pandas as pd 3 | df = pd.DataFrame() | ^^ - | diff --git a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N803_N803.py.snap b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N803_N803.py.snap index b0a87e09efe418..66dbfd24828d8c 100644 --- a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N803_N803.py.snap +++ b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N803_N803.py.snap @@ -24,14 +24,12 @@ N803 Argument name `A` should be lowercase 21 | @override # Incorrect usage 22 | def func(_, a, A): ... | ^ - | N803 Argument name `A` should be lowercase --> N803.py:25:21 | 25 | func = lambda _, a, A: ... | ^ - | N803 Argument name `A` should be lowercase --> N803.py:29:42 @@ -39,4 +37,3 @@ N803 Argument name `A` should be lowercase 28 | class Extended(Class): 29 | method = override(lambda self, _, a, A: ...) # Incorrect usage | ^ - | diff --git a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N806_N806.py.snap b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N806_N806.py.snap index cbbee871b7a2f1..e8adb0888f54e3 100644 --- a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N806_N806.py.snap +++ b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N806_N806.py.snap @@ -68,7 +68,6 @@ N806 Variable `ValidationError` in function should be lowercase 59 | Address: Type = apps.get_model("zerver", variable) # OK 60 | ValidationError = import_string(variable) # N806 | ^^^^^^^^^^^^^^^ - | N806 Variable `BadName` in function should be lowercase --> N806.py:65:14 diff --git a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N812_N812.py.snap b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N812_N812.py.snap index b59c063630363b..20c4d3142e1ca7 100644 --- a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N812_N812.py.snap +++ b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N812_N812.py.snap @@ -26,4 +26,3 @@ N812 Lowercase `another_lowercase` imported as non-lowercase `AnotherLowercase` 2 | from mod import lowercase as Lowercase 3 | from mod import another_lowercase as AnotherLowercase | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N813_N813.py.snap b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N813_N813.py.snap index 14417060898057..0bd3810f532c04 100644 --- a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N813_N813.py.snap +++ b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N813_N813.py.snap @@ -26,4 +26,3 @@ N813 Camelcase `AnotherCamelCase` imported as lowercase `another_camelcase` 2 | from mod import CamelCase as camelcase 3 | from mod import AnotherCamelCase as another_camelcase | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N817_N817.py.snap b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N817_N817.py.snap index 0d905c23c3fcdc..e377a28d0383c0 100644 --- a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N817_N817.py.snap +++ b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N817_N817.py.snap @@ -15,7 +15,6 @@ N817 CamelCase `CamelCase` imported as acronym `CC` 1 | import mod.CaMel as CM 2 | from mod import CamelCase as CC | ^^^^^^^^^^^^^^^ - | N817 CamelCase `ElementTree` imported as acronym `ET` --> N817.py:10:26 @@ -23,4 +22,3 @@ N817 CamelCase `ElementTree` imported as acronym `ET` 9 | # Always an error (relative import) 10 | from ..xml.eltree import ElementTree as ET | ^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__camelcase_imported_as_incorrect_convention.snap b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__camelcase_imported_as_incorrect_convention.snap index 4899f2a8c7fd4e..eb1bf5d39e3992 100644 --- a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__camelcase_imported_as_incorrect_convention.snap +++ b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__camelcase_imported_as_incorrect_convention.snap @@ -15,7 +15,6 @@ N817 CamelCase `CamelCase` imported as acronym `CC` 1 | import mod.CaMel as CM 2 | from mod import CamelCase as CC | ^^^^^^^^^^^^^^^ - | N817 CamelCase `ElementTree` imported as acronym `ET` --> N817.py:6:8 @@ -43,4 +42,3 @@ N817 CamelCase `ElementTree` imported as acronym `ET` 9 | # Always an error (relative import) 10 | from ..xml.eltree import ElementTree as ET | ^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N806_N806.py.snap b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N806_N806.py.snap index c23a98ed80ee3d..2dd39d031b7686 100644 --- a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N806_N806.py.snap +++ b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N806_N806.py.snap @@ -18,4 +18,3 @@ N806 Variable `STILL_BAD` in function should be lowercase 5 | BAD_ALLOWED = 0 6 | STILL_BAD = 0 | ^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N811_N811.py.snap b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N811_N811.py.snap index 10ac76e53fcc6b..8efb21b082d3b7 100644 --- a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N811_N811.py.snap +++ b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N811_N811.py.snap @@ -17,4 +17,3 @@ N811 Constant `STILL_BAD` imported as non-constant `stillBad` 4 | from mod import BAD_ALLOWED as badAllowed 5 | from mod import STILL_BAD as stillBad | ^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N812_N812.py.snap b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N812_N812.py.snap index 326c27cf596218..943aa1a11c1bc5 100644 --- a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N812_N812.py.snap +++ b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N812_N812.py.snap @@ -17,4 +17,3 @@ N812 Lowercase `stillbad` imported as non-lowercase `StillBad` 4 | from mod import badallowed as BadAllowed 5 | from mod import stillbad as StillBad | ^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N813_N813.py.snap b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N813_N813.py.snap index 7c25edab923ebe..e800f23eb06f6a 100644 --- a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N813_N813.py.snap +++ b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N813_N813.py.snap @@ -27,4 +27,3 @@ N813 Camelcase `StillBad` imported as lowercase `still_bad` 7 | from mod import BadAllowed as bad_allowed 8 | from mod import StillBad as still_bad | ^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N814_N814.py.snap b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N814_N814.py.snap index 6fe30f71802ce8..fe8213c8b1bb90 100644 --- a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N814_N814.py.snap +++ b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N814_N814.py.snap @@ -27,4 +27,3 @@ N814 Camelcase `StillBad` imported as constant `STILL_BAD` 7 | from mod import BadAllowed as BAD_ALLOWED 8 | from mod import StillBad as STILL_BAD | ^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N815_N815.py.snap b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N815_N815.py.snap index a4f746e425ee18..60d83d962e2b87 100644 --- a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N815_N815.py.snap +++ b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N815_N815.py.snap @@ -59,4 +59,3 @@ N815 Variable `still_Bad` in class scope should not be mixedCase 18 | bad_Allowed: set 19 | still_Bad: set | ^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N816_N816.py.snap b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N816_N816.py.snap index 9be58b1c566c07..f9a457b3938efd 100644 --- a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N816_N816.py.snap +++ b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N816_N816.py.snap @@ -27,4 +27,3 @@ N816 Variable `still_Bad` in global scope should not be mixedCase 7 | bad_Allowed = 0 8 | still_Bad = 0 | ^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N817_N817.py.snap b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N817_N817.py.snap index b2284aba6fa037..28677a7fe79335 100644 --- a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N817_N817.py.snap +++ b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__ignore_names_N817_N817.py.snap @@ -17,4 +17,3 @@ N817 CamelCase `StillBad` imported as acronym `SB` 4 | from mod import BadAllowed as BA 5 | from mod import StillBad as SB | ^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__PERF401_PERF401.py.snap b/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__PERF401_PERF401.py.snap index 9b92595c243878..6da3feb3c0f08e 100644 --- a/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__PERF401_PERF401.py.snap +++ b/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__PERF401_PERF401.py.snap @@ -8,7 +8,6 @@ PERF401 Use a list comprehension to create a transformed list 5 | if i % 2: 6 | result.append(i) # PERF401 | ^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension PERF401 Use a list comprehension to create a transformed list @@ -18,7 +17,6 @@ PERF401 Use a list comprehension to create a transformed list 12 | for i in items: 13 | result.append(i * i) # PERF401 | ^^^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension PERF401 Use an async list comprehension to create a transformed list @@ -28,7 +26,6 @@ PERF401 Use an async list comprehension to create a transformed list 81 | if i % 2: 82 | result.append(i) # PERF401 | ^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension PERF401 Use an async list comprehension to create a transformed list @@ -38,7 +35,6 @@ PERF401 Use an async list comprehension to create a transformed list 88 | async for i in items: 89 | result.append(i) # PERF401 | ^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension PERF401 Use `list.extend` with an async comprehension to create a transformed list @@ -48,7 +44,6 @@ PERF401 Use `list.extend` with an async comprehension to create a transformed li 95 | async for i in items: 96 | result.append(i) # PERF401 | ^^^^^^^^^^^^^^^^ - | help: Replace for loop with list.extend PERF401 Use `list.extend` to create a transformed list @@ -58,7 +53,6 @@ PERF401 Use `list.extend` to create a transformed list 101 | for i in range(10): 102 | result.append(i * 2) # PERF401 | ^^^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with list.extend PERF401 Use `list.extend` to create a transformed list @@ -68,7 +62,6 @@ PERF401 Use `list.extend` to create a transformed list 110 | if i % 2: # single-line comment 3 should be protected 111 | result.append(i) # PERF401 | ^^^^^^^^^^^^^^^^ - | help: Replace for loop with list.extend PERF401 Use a list comprehension to create a transformed list @@ -78,7 +71,6 @@ PERF401 Use a list comprehension to create a transformed list 118 | if i % 2: # single-line comment 3 should be protected 119 | result.append(i) # PERF401 | ^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension PERF401 Use a list comprehension to create a transformed list @@ -88,7 +80,6 @@ PERF401 Use a list comprehension to create a transformed list 134 | for value in param: 135 | new_layers.append(value * 3) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension PERF401 Use a list comprehension to create a transformed list @@ -98,7 +89,6 @@ PERF401 Use a list comprehension to create a transformed list 141 | for _ in range(10): 142 | result.append(var + 1) # PERF401 | ^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension PERF401 Use a list comprehension to create a transformed list @@ -108,7 +98,6 @@ PERF401 Use a list comprehension to create a transformed list 148 | for i in range(10): 149 | result.append(i + 1) # PERF401 | ^^^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension PERF401 Use a list comprehension to create a transformed list @@ -118,7 +107,6 @@ PERF401 Use a list comprehension to create a transformed list 155 | for i in range(10): 156 | result.append(i + 1) # PERF401 | ^^^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension PERF401 Use a list comprehension to create a transformed list @@ -128,7 +116,6 @@ PERF401 Use a list comprehension to create a transformed list 161 | for i in range(10): 162 | result.append(i * 2) # PERF401 | ^^^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension PERF401 Use `list.extend` to create a transformed list @@ -138,7 +125,6 @@ PERF401 Use `list.extend` to create a transformed list 168 | for i in range(10): 169 | result.append(i * 2) # PERF401 | ^^^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with list.extend PERF401 Use a list comprehension to create a transformed list @@ -160,7 +146,6 @@ PERF401 Use a list comprehension to create a transformed list 197 | for i in i: 198 | result.append(i + 1) # PERF401 | ^^^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension PERF401 Use a list comprehension to create a transformed list @@ -176,7 +161,6 @@ PERF401 Use a list comprehension to create a transformed list 215 | | ) 216 | | ) # PERF401 | |_____________^ - | help: Replace for loop with list comprehension PERF401 Use a list comprehension to create a transformed list @@ -186,7 +170,6 @@ PERF401 Use a list comprehension to create a transformed list 221 | for i in range(10): 222 | result.append(i * 2) # PERF401 | ^^^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension PERF401 Use a list comprehension to create a transformed list @@ -314,5 +297,4 @@ PERF401 Use a list comprehension to create a transformed list 327 | if i > 0: 328 | filtered.append(i) | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension diff --git a/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__PERF402_PERF402.py.snap b/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__PERF402_PERF402.py.snap index 670d80e9337c5b..cf5512528675cd 100644 --- a/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__PERF402_PERF402.py.snap +++ b/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__PERF402_PERF402.py.snap @@ -8,4 +8,3 @@ PERF402 Use `list` or `list.copy` to create a copy of a list 4 | for i in items: 5 | result.append(i) # PERF402 | ^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__PERF403_PERF403.py.snap b/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__PERF403_PERF403.py.snap index 4a83c843e7e510..8b6f755c336223 100644 --- a/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__PERF403_PERF403.py.snap +++ b/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__PERF403_PERF403.py.snap @@ -8,7 +8,6 @@ PERF403 Use a dictionary comprehension instead of a for-loop 4 | for idx, name in enumerate(fruit): 5 | result[idx] = name # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension PERF403 Use a dictionary comprehension instead of a for-loop @@ -18,7 +17,6 @@ PERF403 Use a dictionary comprehension instead of a for-loop 12 | if idx % 2: 13 | result[idx] = name # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension PERF403 Use a dictionary comprehension instead of a for-loop @@ -28,7 +26,6 @@ PERF403 Use a dictionary comprehension instead of a for-loop 32 | if idx % 2: 33 | result[idx] = name # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension PERF403 Use a dictionary comprehension instead of a for-loop @@ -38,7 +35,6 @@ PERF403 Use a dictionary comprehension instead of a for-loop 62 | if idx % 2: 63 | result[idx] = name # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension PERF403 Use a dictionary comprehension instead of a for-loop @@ -48,7 +44,6 @@ PERF403 Use a dictionary comprehension instead of a for-loop 77 | for name in fruit: 78 | result[name] = name # PERF403 | ^^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension PERF403 Use a dictionary comprehension instead of a for-loop @@ -58,7 +53,6 @@ PERF403 Use a dictionary comprehension instead of a for-loop 84 | for idx, name in enumerate(fruit): 85 | result[name] = idx # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension PERF403 Use a dictionary comprehension instead of a for-loop @@ -68,7 +62,6 @@ PERF403 Use a dictionary comprehension instead of a for-loop 93 | for idx, name in enumerate(fruit): 94 | result[name] = idx # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension PERF403 Use a dictionary comprehension instead of a for-loop @@ -80,7 +73,6 @@ PERF403 Use a dictionary comprehension instead of a for-loop 107 | | name # comment 4 108 | | ] = idx # PERF403 | |_______________^ - | help: Replace for loop with dict comprehension PERF403 Use a dictionary comprehension instead of a for-loop @@ -90,7 +82,6 @@ PERF403 Use a dictionary comprehension instead of a for-loop 114 | for idx, name in enumerate(fruit): 115 | result[name] = idx # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension PERF403 Use a dictionary comprehension instead of a for-loop @@ -100,7 +91,6 @@ PERF403 Use a dictionary comprehension instead of a for-loop 121 | for idx, name in enumerate(fruit): 122 | result[name] = idx # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension PERF403 Use a dictionary comprehension instead of a for-loop @@ -110,7 +100,6 @@ PERF403 Use a dictionary comprehension instead of a for-loop 128 | for idx, name in enumerate(fruit): 129 | result[name] = idx # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension PERF403 Use a dictionary comprehension instead of a for-loop @@ -120,7 +109,6 @@ PERF403 Use a dictionary comprehension instead of a for-loop 136 | for idx, name in enumerate(fruit): 137 | result[name] = idx # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension PERF403 Use a dictionary comprehension instead of a for-loop @@ -130,7 +118,6 @@ PERF403 Use a dictionary comprehension instead of a for-loop 144 | if last_idx := idx % 3: 145 | result[name] = idx # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension PERF403 Use a dictionary comprehension instead of a for-loop @@ -140,7 +127,6 @@ PERF403 Use a dictionary comprehension instead of a for-loop 152 | for idx, name in indices, fruit: 153 | result[name] = idx # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension PERF403 Use a dictionary comprehension instead of a for-loop @@ -174,7 +160,6 @@ PERF403 Use a dictionary comprehension instead of a for-loop 171 | for o,(x,)in(): 172 | v[x,]=o | ^^^^^^^ - | help: Replace for loop with dict comprehension PERF403 Use a dictionary comprehension instead of a for-loop @@ -229,5 +214,4 @@ PERF403 Use a dictionary comprehension instead of a for-loop 232 | ) in ["a", "b", "c"]: 233 | result[k] = k | ^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension diff --git a/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__preview__PERF401_PERF401.py.snap b/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__preview__PERF401_PERF401.py.snap index 60a2662ecf44de..11c02e0081e2f3 100644 --- a/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__preview__PERF401_PERF401.py.snap +++ b/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__preview__PERF401_PERF401.py.snap @@ -8,7 +8,6 @@ PERF401 [*] Use a list comprehension to create a transformed list 5 | if i % 2: 6 | result.append(i) # PERF401 | ^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension | 2 | items = [1, 2, 3, 4] @@ -28,7 +27,6 @@ PERF401 [*] Use a list comprehension to create a transformed list 12 | for i in items: 13 | result.append(i * i) # PERF401 | ^^^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension | 10 | items = [1, 2, 3, 4] @@ -47,7 +45,6 @@ PERF401 [*] Use an async list comprehension to create a transformed list 81 | if i % 2: 82 | result.append(i) # PERF401 | ^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension | 78 | items = [1, 2, 3, 4] @@ -67,7 +64,6 @@ PERF401 [*] Use an async list comprehension to create a transformed list 88 | async for i in items: 89 | result.append(i) # PERF401 | ^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension | 86 | items = [1, 2, 3, 4] @@ -86,7 +82,6 @@ PERF401 [*] Use `list.extend` with an async comprehension to create a transforme 95 | async for i in items: 96 | result.append(i) # PERF401 | ^^^^^^^^^^^^^^^^ - | help: Replace for loop with list.extend | 94 | result = [1, 2] @@ -104,7 +99,6 @@ PERF401 [*] Use `list.extend` to create a transformed list 101 | for i in range(10): 102 | result.append(i * 2) # PERF401 | ^^^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with list.extend | 100 | result, _ = [1, 2, 3, 4], ... @@ -122,7 +116,6 @@ PERF401 [*] Use `list.extend` to create a transformed list 110 | if i % 2: # single-line comment 3 should be protected 111 | result.append(i) # PERF401 | ^^^^^^^^^^^^^^^^ - | help: Replace for loop with list.extend | 107 | if True: @@ -145,7 +138,6 @@ PERF401 [*] Use a list comprehension to create a transformed list 118 | if i % 2: # single-line comment 3 should be protected 119 | result.append(i) # PERF401 | ^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension | 114 | def f(): @@ -170,7 +162,6 @@ PERF401 [*] Use a list comprehension to create a transformed list 134 | for value in param: 135 | new_layers.append(value * 3) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension | 132 | if param: @@ -189,7 +180,6 @@ PERF401 [*] Use a list comprehension to create a transformed list 141 | for _ in range(10): 142 | result.append(var + 1) # PERF401 | ^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension | 138 | def f(): @@ -209,7 +199,6 @@ PERF401 [*] Use a list comprehension to create a transformed list 148 | for i in range(10): 149 | result.append(i + 1) # PERF401 | ^^^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension | 146 | # make sure that `tmp` is not deleted @@ -229,7 +218,6 @@ PERF401 [*] Use a list comprehension to create a transformed list 155 | for i in range(10): 156 | result.append(i + 1) # PERF401 | ^^^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension | 153 | # make sure that `tmp` is not deleted @@ -249,7 +237,6 @@ PERF401 [*] Use a list comprehension to create a transformed list 161 | for i in range(10): 162 | result.append(i * 2) # PERF401 | ^^^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension | 159 | def f(): @@ -269,7 +256,6 @@ PERF401 [*] Use `list.extend` to create a transformed list 168 | for i in range(10): 169 | result.append(i * 2) # PERF401 | ^^^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with list.extend | 167 | result.append(1) @@ -308,7 +294,6 @@ PERF401 [*] Use a list comprehension to create a transformed list 197 | for i in i: 198 | result.append(i + 1) # PERF401 | ^^^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension | 195 | i = [1, 2, 3] @@ -333,7 +318,6 @@ PERF401 [*] Use a list comprehension to create a transformed list 215 | | ) 216 | | ) # PERF401 | |_____________^ - | help: Replace for loop with list comprehension | 201 | def f(): @@ -371,7 +355,6 @@ PERF401 [*] Use a list comprehension to create a transformed list 221 | for i in range(10): 222 | result.append(i * 2) # PERF401 | ^^^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension | 219 | def f(): @@ -609,7 +592,6 @@ PERF401 [*] Use a list comprehension to create a transformed list 327 | if i > 0: 328 | filtered.append(i) | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with list comprehension | 322 | original = list(range(10000)) diff --git a/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__preview__PERF403_PERF403.py.snap b/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__preview__PERF403_PERF403.py.snap index 8935a108b6a499..df2817b12dd298 100644 --- a/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__preview__PERF403_PERF403.py.snap +++ b/crates/ruff_linter/src/rules/perflint/snapshots/ruff_linter__rules__perflint__tests__preview__PERF403_PERF403.py.snap @@ -8,7 +8,6 @@ PERF403 [*] Use a dictionary comprehension instead of a for-loop 4 | for idx, name in enumerate(fruit): 5 | result[idx] = name # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension | 2 | fruit = ["apple", "pear", "orange"] @@ -27,7 +26,6 @@ PERF403 [*] Use a dictionary comprehension instead of a for-loop 12 | if idx % 2: 13 | result[idx] = name # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension | 9 | fruit = ["apple", "pear", "orange"] @@ -47,7 +45,6 @@ PERF403 [*] Use a dictionary comprehension instead of a for-loop 32 | if idx % 2: 33 | result[idx] = name # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension | 28 | def foo(): @@ -68,7 +65,6 @@ PERF403 [*] Use `dict.update` instead of a for-loop 62 | if idx % 2: 63 | result[idx] = name # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with `dict.update` | 60 | fruit = ["apple", "pear", "orange"] @@ -87,7 +83,6 @@ PERF403 [*] Use a dictionary comprehension instead of a for-loop 77 | for name in fruit: 78 | result[name] = name # PERF403 | ^^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension | 75 | fruit = ["apple", "pear", "orange"] @@ -106,7 +101,6 @@ PERF403 [*] Use a dictionary comprehension instead of a for-loop 84 | for idx, name in enumerate(fruit): 85 | result[name] = idx # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension | 82 | fruit = ["apple", "pear", "orange"] @@ -125,7 +119,6 @@ PERF403 [*] Use a dictionary comprehension instead of a for-loop 93 | for idx, name in enumerate(fruit): 94 | result[name] = idx # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension | 91 | fruit = ["apple", "pear", "orange"] @@ -146,7 +139,6 @@ PERF403 [*] Use a dictionary comprehension instead of a for-loop 107 | | name # comment 4 108 | | ] = idx # PERF403 | |_______________^ - | help: Replace for loop with dict comprehension | 98 | fruit = ["apple", "pear", "orange"] @@ -176,7 +168,6 @@ PERF403 [*] Use a dictionary comprehension instead of a for-loop 114 | for idx, name in enumerate(fruit): 115 | result[name] = idx # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension | 112 | fruit = ["apple", "pear", "orange"] @@ -196,7 +187,6 @@ PERF403 [*] Use `dict.update` instead of a for-loop 121 | for idx, name in enumerate(fruit): 122 | result[name] = idx # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with `dict.update` | 120 | result = {"kiwi": 3} @@ -214,7 +204,6 @@ PERF403 [*] Use `dict.update` instead of a for-loop 128 | for idx, name in enumerate(fruit): 129 | result[name] = idx # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with `dict.update` | 127 | (_, result) = (None, {"kiwi": 3}) @@ -232,7 +221,6 @@ PERF403 [*] Use `dict.update` instead of a for-loop 136 | for idx, name in enumerate(fruit): 137 | result[name] = idx # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with `dict.update` | 135 | print(len(result)) @@ -250,7 +238,6 @@ PERF403 [*] Use a dictionary comprehension instead of a for-loop 144 | if last_idx := idx % 3: 145 | result[name] = idx # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension | 141 | fruit = ["apple", "pear", "orange"] @@ -270,7 +257,6 @@ PERF403 [*] Use a dictionary comprehension instead of a for-loop 152 | for idx, name in indices, fruit: 153 | result[name] = idx # PERF403 | ^^^^^^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension | 150 | indices = [0, 1, 2] @@ -333,7 +319,6 @@ PERF403 [*] Use a dictionary comprehension instead of a for-loop 171 | for o,(x,)in(): 172 | v[x,]=o | ^^^^^^^ - | help: Replace for loop with dict comprehension | 169 | def foo(): @@ -438,7 +423,6 @@ PERF403 [*] Use a dictionary comprehension instead of a for-loop 232 | ) in ["a", "b", "c"]: 233 | result[k] = k | ^^^^^^^^^^^^^ - | help: Replace for loop with dict comprehension | 228 | # comment duplication in target (https://github.com/astral-sh/ruff/issues/18787) diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E101_E101.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E101_E101.py.snap index 8f4ea63379205b..49d81e6d33c879 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E101_E101.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E101_E101.py.snap @@ -30,4 +30,3 @@ E101 Indentation contains mixed spaces and tabs 18 | # E101 19 | print("xyz"); | ^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E203_E20.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E203_E20.py.snap index 3724f16449c94a..b410c5738c60b2 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E203_E20.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E203_E20.py.snap @@ -301,7 +301,6 @@ E203 [*] Whitespace before ':' 204 | #: E203:1:13 205 | t"{ham[lower + 1 :, "columnname"]}" | ^^ - | help: Remove whitespace before ':' | 204 | #: E203:1:13 diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E231_E23.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E231_E23.py.snap index 1310cc21d587d6..ae646c1068e2ba 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E231_E23.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E231_E23.py.snap @@ -799,7 +799,6 @@ E231 [*] Missing whitespace after `:` 160 | #: E231 161 | {len(t's3://{self.s3_bucket_name}/'):1} | ^ - | help: Add missing whitespace | 160 | #: E231 diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E241_E24.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E241_E24.py.snap index 1f0b1dfb8dd625..3e569d5870152a 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E241_E24.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E241_E24.py.snap @@ -60,7 +60,6 @@ E241 [*] Multiple spaces after comma 12 | ef, +h, 13 | c, -d] | ^^^ - | help: Replace with single space | 12 | ef, +h, diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E262_E26.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E262_E26.py.snap index 18c9ee84f74f62..4d68b8a2239b40 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E262_E26.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E262_E26.py.snap @@ -116,7 +116,6 @@ E262 [*] Inline comment should start with `# ` 85 | 86 | a = 1 #:Foo | ^^^^^ - | help: Format space | 85 | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E301_E30_syntax_error.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E301_E30_syntax_error.py.snap index b8c6413c1d1873..c0ad46e9f3bfe0 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E301_E30_syntax_error.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E301_E30_syntax_error.py.snap @@ -39,7 +39,6 @@ invalid-syntax: Expected `)`, found newline 17 | 18 | foo = Foo( | ^ - | invalid-syntax: Expected `)`, found newline --> E30_syntax_error.py:21:9 diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E302_E30_syntax_error.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E302_E30_syntax_error.py.snap index 76c3d31211ffcc..f5afe14cc38c42 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E302_E30_syntax_error.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E302_E30_syntax_error.py.snap @@ -39,7 +39,6 @@ invalid-syntax: Expected `)`, found newline 17 | 18 | foo = Foo( | ^ - | invalid-syntax: Expected `)`, found newline --> E30_syntax_error.py:21:9 diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E303_E30.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E303_E30.py.snap index d388d8d38a150d..07c466c48c73e0 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E303_E30.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E303_E30.py.snap @@ -80,7 +80,6 @@ E303 [*] Too many blank lines (2) | 687 | # comment | ^^^^^^^^^ - | help: Remove extraneous blank line(s) | 685 | @@ -153,7 +152,6 @@ E303 [*] Too many blank lines (2) | 731 | # comment | ^^^^^^^^^ - | help: Remove extraneous blank line(s) | 729 | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E303_E30_syntax_error.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E303_E30_syntax_error.py.snap index af23f16de97eb6..18ae95026c7db8 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E303_E30_syntax_error.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E303_E30_syntax_error.py.snap @@ -38,7 +38,6 @@ invalid-syntax: Expected `)`, found newline 17 | 18 | foo = Foo( | ^ - | invalid-syntax: Expected `)`, found newline --> E30_syntax_error.py:21:9 diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E305_E30_syntax_error.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E305_E30_syntax_error.py.snap index f72c198e1e910c..c3ef5976fe8d9d 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E305_E30_syntax_error.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E305_E30_syntax_error.py.snap @@ -28,7 +28,6 @@ E305 Expected 2 blank lines after class or function definition, found (1) 17 | 18 | foo = Foo( | ^^^ - | help: Add missing blank line(s) invalid-syntax: Expected `)`, found newline @@ -38,7 +37,6 @@ invalid-syntax: Expected `)`, found newline 17 | 18 | foo = Foo( | ^ - | invalid-syntax: Expected `)`, found newline --> E30_syntax_error.py:21:9 diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E306_E30_syntax_error.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E306_E30_syntax_error.py.snap index 98d00f77af2f6a..05a9d59462ff4a 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E306_E30_syntax_error.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E306_E30_syntax_error.py.snap @@ -28,7 +28,6 @@ invalid-syntax: Expected `)`, found newline 17 | 18 | foo = Foo( | ^ - | invalid-syntax: Expected `)`, found newline --> E30_syntax_error.py:21:9 diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E401_E40.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E401_E40.py.snap index 664bbf64e467fc..2d8883eb252f64 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E401_E40.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E401_E40.py.snap @@ -61,7 +61,6 @@ E401 [*] Multiple imports on one line 67 | 68 | x = 1; import re as regex, string | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Split imports | 67 | @@ -147,7 +146,6 @@ E401 [*] Multiple imports on one line 79 | 80 | if True: import re as regex, string | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Split imports | 79 | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E402_E40.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E402_E40.py.snap index e5e1c752870596..cd3266b6d3da80 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E402_E40.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E402_E40.py.snap @@ -66,5 +66,4 @@ E402 Module level import not at top of file 67 | 68 | x = 1; import re as regex, string | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Move module level imports to top of file diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E402_E402_0.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E402_E402_0.py.snap index 758432087d1b22..ffe25e11696e40 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E402_E402_0.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E402_E402_0.py.snap @@ -8,7 +8,6 @@ E402 Module level import not at top of file 34 | 35 | import h | ^^^^^^^^ - | help: Move module level imports to top of file E402 Module level import not at top of file @@ -18,7 +17,6 @@ E402 Module level import not at top of file 44 | 45 | import k; import l | ^^^^^^^^ - | help: Move module level imports to top of file E402 Module level import not at top of file @@ -28,5 +26,4 @@ E402 Module level import not at top of file 44 | 45 | import k; import l | ^^^^^^^^ - | help: Move module level imports to top of file diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E402_E402_1.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E402_E402_1.py.snap index 1309f16b559caf..6fd705b9186529 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E402_E402_1.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E402_E402_1.py.snap @@ -20,5 +20,4 @@ E402 Module level import not at top of file 8 | 9 | import c | ^^^^^^^^ - | help: Move module level imports to top of file diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E501_E501.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E501_E501.py.snap index 52d785c025ba70..5ee9e29cfac450 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E501_E501.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E501_E501.py.snap @@ -17,7 +17,6 @@ E501 Line too long (95 > 88) 15 | _ = "---------------------------------------------------------------------------AAAAAAA" 16 | _ = "---------------------------------------------------------------------------亜亜亜亜亜亜亜" | ^^^^^^^ - | E501 Line too long (127 > 88) --> E501.py:25:89 diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E501_E501_3.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E501_E501_3.py.snap index 3ef339ef616ba8..c381e8de6bc9c6 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E501_E501_3.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E501_E501_3.py.snap @@ -17,4 +17,3 @@ E501 Line too long (89 > 88) 16 | # Error (89 characters) 17 | "shape:" + "shape:" + "shape:" + "shape:" + "shape:" + "shape:" + "shape:" + "shape:aaaa" # pyrefly: ignore[missing-attribute] | ^ - | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E713_E713.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E713_E713.py.snap index 278425f4543fab..b717528565cc6b 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E713_E713.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E713_E713.py.snap @@ -96,7 +96,6 @@ E713 [*] Test for membership should be `not in` 39 | assert not (re.search(r"^.:\\Users\\[^\\]*\\Downloads\\.*") is None) 40 | assert not('name' in request)or not request['name'] | ^^^^^^^^^^^^^^^^^ - | help: Convert to `not in` | 39 | assert not (re.search(r"^.:\\Users\\[^\\]*\\Downloads\\.*") is None) diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E714_E714.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E714_E714.py.snap index b4a022023ddf3d..3c59266b4cfc9e 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E714_E714.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E714_E714.py.snap @@ -42,7 +42,6 @@ E714 [*] Test for object identity should be `is not` 38 | assert [42, not foo] in bar 39 | assert not (re.search(r"^.:\\Users\\[^\\]*\\Downloads\\.*") is None) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Convert to `is not` | 38 | assert [42, not foo] in bar diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E731_E731.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E731_E731.py.snap index e54e545896a82a..90286da679ec85 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E731_E731.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E731_E731.py.snap @@ -8,7 +8,6 @@ E731 [*] Do not assign a `lambda` expression, use a `def` 2 | # E731 3 | f = lambda x: 2 * x | ^^^^^^^^^^^^^^^^^^^ - | help: Rewrite `f` as a `def` | 2 | # E731 @@ -26,7 +25,6 @@ E731 [*] Do not assign a `lambda` expression, use a `def` 7 | # E731 8 | f = lambda x: 2 * x | ^^^^^^^^^^^^^^^^^^^ - | help: Rewrite `f` as a `def` | 7 | # E731 @@ -44,7 +42,6 @@ E731 [*] Do not assign a `lambda` expression, use a `def` 13 | while False: 14 | this = lambda y, z: 2 * x | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Rewrite `this` as a `def` | 13 | while False: @@ -62,7 +59,6 @@ E731 [*] Do not assign a `lambda` expression, use a `def` 18 | # E731 19 | f = lambda: (yield 1) | ^^^^^^^^^^^^^^^^^^^^^ - | help: Rewrite `f` as a `def` | 18 | # E731 @@ -80,7 +76,6 @@ E731 [*] Do not assign a `lambda` expression, use a `def` 23 | # E731 24 | f = lambda: (yield from g()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Rewrite `f` as a `def` | 23 | # E731 @@ -98,7 +93,6 @@ E731 [*] Do not assign a `lambda` expression, use a `def` 56 | # E731 57 | f = lambda x: 2 * x | ^^^^^^^^^^^^^^^^^^^ - | help: Rewrite `f` as a `def` | 56 | # E731 @@ -155,7 +149,6 @@ E731 [*] Do not assign a `lambda` expression, use a `def` 85 | P = ParamSpec("P") 86 | f: Callable[P, int] = lambda *args: len(args) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Rewrite `f` as a `def` | 85 | P = ParamSpec("P") @@ -173,7 +166,6 @@ E731 [*] Do not assign a `lambda` expression, use a `def` 93 | 94 | f: Callable[[], None] = lambda: None | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Rewrite `f` as a `def` | 93 | @@ -191,7 +183,6 @@ E731 [*] Do not assign a `lambda` expression, use a `def` 101 | 102 | f: Callable[..., None] = lambda a, b: None | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Rewrite `f` as a `def` | 101 | @@ -209,7 +200,6 @@ E731 [*] Do not assign a `lambda` expression, use a `def` 109 | 110 | f: Callable[[int], int] = lambda x: 2 * x | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Rewrite `f` as a `def` | 109 | @@ -227,7 +217,6 @@ E731 [*] Do not assign a `lambda` expression, use a `def` 118 | 119 | f: Callable[[str, int], str] = lambda a, b: a * b | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Rewrite `f` as a `def` | 118 | @@ -245,7 +234,6 @@ E731 [*] Do not assign a `lambda` expression, use a `def` 126 | 127 | f: Callable[[str, int], tuple[str, int]] = lambda a, b: (a, b) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Rewrite `f` as a `def` | 126 | @@ -263,7 +251,6 @@ E731 [*] Do not assign a `lambda` expression, use a `def` 134 | 135 | f: Callable[[str, int, list[str]], list[str]] = lambda a, b, /, c: [*c, a * b] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Rewrite `f` as a `def` | 134 | @@ -299,7 +286,6 @@ E731 [*] Do not assign a `lambda` expression, use a `def` 139 | CELSIUS = (lambda deg_c: deg_c) 140 | FAHRENHEIT = (lambda deg_c: deg_c * 9 / 5 + 32) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Rewrite `FAHRENHEIT` as a `def` | 139 | CELSIUS = (lambda deg_c: deg_c) @@ -319,7 +305,6 @@ E731 [*] Do not assign a `lambda` expression, use a `def` 148 | | i := 1, 149 | | ) | |_____^ - | help: Rewrite `f` as a `def` | 146 | @@ -504,7 +489,6 @@ E731 [*] Do not assign a `lambda` expression, use a `def` 200 | f1: Callable[P, str] = lambda x: str(x) 201 | f2: Callable[..., str] = lambda x: str(x) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Rewrite `f2` as a `def` | 200 | f1: Callable[P, str] = lambda x: str(x) diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E741_E741.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E741_E741.py.snap index 70e66d2aece36e..bff44476002077 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E741_E741.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E741_E741.py.snap @@ -119,7 +119,6 @@ E741 Ambiguous variable name: `l` 25 | global l 26 | l = 0 | ^ - | E741 Ambiguous variable name: `l` --> E741.py:30:5 diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W191_W19.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W191_W19.py.snap index 1dd6489e64ca66..5f5763200d7fc7 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W191_W19.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W191_W19.py.snap @@ -261,7 +261,6 @@ W191 Indentation contains tabs 94 | return options.max_line_length, \ 95 | "E501 line too long (%d characters)" % length | ^^^^^^^^ - | W191 Indentation contains tabs --> W19.py:101:1 @@ -292,7 +291,6 @@ W191 Indentation contains tabs 127 | blah == 'yeah': 128 | blah = 'yeahnah' | ^^^^ - | W191 Indentation contains tabs --> W19.py:134:1 diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W292_W292_0.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W292_W292_0.py.snap index 107cf211a377c1..439b3a25914eba 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W292_W292_0.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W292_W292_0.py.snap @@ -7,7 +7,6 @@ W292 [*] No newline at end of file 1 | def fn() -> None: 2 | pass | ^ - | help: Add trailing newline | 1 | def fn() -> None: diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W293_W293.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W293_W293.py.snap index 801c1b06876f8a..b06d8bac204eb4 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W293_W293.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W293_W293.py.snap @@ -26,7 +26,6 @@ W293 [*] Blank line contains whitespace 9 | \ 10 | | ^^^^ - | help: Remove whitespace from blank line | 7 | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W605_W605_0.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W605_W605_0.py.snap index 08cd83d2d7fa65..b4f217c17f612f 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W605_W605_0.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W605_W605_0.py.snap @@ -76,7 +76,6 @@ W605 [*] Invalid escape sequence: `\_` 22 | #: W605:1:38 23 | value = 'new line\nand invalid escape \_ here' | ^^ - | help: Add backslash to escape sequence | 22 | #: W605:1:38 @@ -178,7 +177,6 @@ W605 [*] Invalid escape sequence: `\.` 59 | #: W605:1:13 60 | "foo \t bar \." | ^^ - | help: Add backslash to escape sequence | 59 | #: W605:1:13 diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W605_W605_1.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W605_W605_1.py.snap index 1556d76ad92d27..3d261c66d5584a 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W605_W605_1.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__W605_W605_1.py.snap @@ -76,7 +76,6 @@ W605 [*] Invalid escape sequence: `\_` 24 | #: W605:1:38 25 | value = f'new line\nand invalid escape \_ here' | ^^ - | help: Add backslash to escape sequence | 24 | #: W605:1:38 @@ -267,7 +266,6 @@ W605 [*] Invalid escape sequence: `\I` 67 | # Debug text (should trigger) 68 | t = f"{'\InHere'=}" | ^^ - | help: Use a raw string literal | 67 | # Debug text (should trigger) @@ -351,7 +349,6 @@ W605 [*] Invalid escape sequence: `\_` 93 | #: W605:1:38 94 | value = t'new line\nand invalid escape \_ here' | ^^ - | help: Add backslash to escape sequence | 93 | #: W605:1:38 @@ -542,7 +539,6 @@ W605 [*] Invalid escape sequence: `\I` 136 | # Debug text (should trigger) 137 | t = t"{'\InHere'=}" | ^^ - | help: Use a raw string literal | 136 | # Debug text (should trigger) diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E304_typing_stub.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E304_typing_stub.snap index 24b5b733de5ea1..57299e6af3b1f3 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E304_typing_stub.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_E304_typing_stub.snap @@ -8,7 +8,6 @@ E304 [*] Blank lines found after function decorator (1) 31 | 32 | def with_blank_line(): ... | ^^^ - | help: Remove extraneous blank line(s) | 30 | @decorated diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(-1)-between(0).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(-1)-between(0).snap index 1ec3eb63cacaee..56db367a6b1fdb 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(-1)-between(0).snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(-1)-between(0).snap @@ -10,7 +10,6 @@ I001 [*] Import block is un-sorted or un-formatted 4 | | 5 | | from typing import Any, Sequence | |________________________________^ - | help: Organize imports | 1 | import json @@ -47,7 +46,6 @@ I001 [*] Import block is un-sorted or un-formatted 29 | | 30 | | from typing_extensions import TypeAlias | |___________________________________________^ - | help: Organize imports | 27 | @@ -110,7 +108,6 @@ E302 [*] Expected 2 blank lines, found 1 61 | 62 | class MissingCommand(TypeError): ... # noqa: N818 | ^^^^^ - | help: Add missing blank line(s) | 61 | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(0)-between(0).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(0)-between(0).snap index fdb2845a32d99b..aef84333283206 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(0)-between(0).snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(0)-between(0).snap @@ -10,7 +10,6 @@ I001 [*] Import block is un-sorted or un-formatted 4 | | 5 | | from typing import Any, Sequence | |________________________________^ - | help: Organize imports | 1 | import json @@ -50,7 +49,6 @@ I001 [*] Import block is un-sorted or un-formatted 29 | | 30 | | from typing_extensions import TypeAlias | |___________________________________________^ - | help: Organize imports | 27 | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(1)-between(1).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(1)-between(1).snap index 4641dae72022ef..d1de6ad604bd69 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(1)-between(1).snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(1)-between(1).snap @@ -10,7 +10,6 @@ I001 [*] Import block is un-sorted or un-formatted 4 | | 5 | | from typing import Any, Sequence | |________________________________^ - | help: Organize imports | 2 | @@ -48,7 +47,6 @@ I001 [*] Import block is un-sorted or un-formatted 29 | | 30 | | from typing_extensions import TypeAlias | |___________________________________________^ - | help: Organize imports | 27 | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(4)-between(4).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(4)-between(4).snap index 180f36e2d048b3..7f1cfd0f15d321 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(4)-between(4).snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_top_level_isort_compatibility-lines-after(4)-between(4).snap @@ -10,7 +10,6 @@ I001 [*] Import block is un-sorted or un-formatted 4 | | 5 | | from typing import Any, Sequence | |________________________________^ - | help: Organize imports | 4 | @@ -28,7 +27,6 @@ E302 [*] Expected 4 blank lines, found 2 | 8 | class MissingCommand(TypeError): ... # noqa: N818 | ^^^^^ - | help: Add missing blank line(s) | 7 | @@ -64,7 +62,6 @@ I001 [*] Import block is un-sorted or un-formatted 29 | | 30 | | from typing_extensions import TypeAlias | |___________________________________________^ - | help: Organize imports | 27 | @@ -129,7 +126,6 @@ E302 [*] Expected 4 blank lines, found 1 61 | 62 | class MissingCommand(TypeError): ... # noqa: N818 | ^^^^^ - | help: Add missing blank line(s) | 61 | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_typing_stub_isort.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_typing_stub_isort.snap index 49e8ddcff25355..b440fb7b7fb59c 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_typing_stub_isort.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__blank_lines_typing_stub_isort.snap @@ -10,7 +10,6 @@ I001 [*] Import block is un-sorted or un-formatted 4 | | 5 | | from typing import Any, Sequence | |________________________________^ - | help: Organize imports | 1 | import json @@ -27,7 +26,6 @@ E303 [*] Too many blank lines (3) | 5 | from typing import Any, Sequence | ^^^^ - | help: Remove extraneous blank line(s) | 2 | @@ -41,7 +39,6 @@ E303 [*] Too many blank lines (2) | 8 | class MissingCommand(TypeError): ... # noqa: N818 | ^^^^^ - | help: Remove extraneous blank line(s) | 6 | @@ -103,7 +100,6 @@ I001 [*] Import block is un-sorted or un-formatted 29 | | 30 | | from typing_extensions import TypeAlias | |___________________________________________^ - | help: Organize imports | 27 | @@ -117,7 +113,6 @@ E303 [*] Too many blank lines (3) | 30 | from typing_extensions import TypeAlias | ^^^^ - | help: Remove extraneous blank line(s) | 27 | @@ -146,7 +141,6 @@ E303 [*] Too many blank lines (2) | 45 | def _exit(self) -> None: ... | ^^^ - | help: Remove extraneous blank line(s) | 43 | @@ -159,7 +153,6 @@ E303 [*] Too many blank lines (2) | 48 | def _optional_commands(self) -> dict[str, bool]: ... | ^^^ - | help: Remove extraneous blank line(s) | 46 | @@ -172,7 +165,6 @@ E303 [*] Too many blank lines (2) | 51 | def run(argv: Sequence[str]) -> int: ... | ^^^ - | help: Remove extraneous blank line(s) | 49 | @@ -185,7 +177,6 @@ E303 [*] Too many blank lines (2) | 54 | def read_line(fd: int = 0) -> bytearray: ... | ^^^ - | help: Remove extraneous blank line(s) | 52 | @@ -198,7 +189,6 @@ E303 [*] Too many blank lines (2) | 57 | def flush() -> None: ... | ^^^ - | help: Remove extraneous blank line(s) | 55 | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__max_doc_length.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__max_doc_length.snap index 434e683b8025e6..f6b8c414541b5e 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__max_doc_length.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__max_doc_length.snap @@ -7,7 +7,6 @@ W505 Doc line too long (57 > 50) 1 | #!/usr/bin/env python3 2 | """Here's a top-level docstring that's over the limit.""" | ^^^^^^^ - | W505 Doc line too long (56 > 50) --> W505.py:6:51 @@ -45,7 +44,6 @@ W505 Doc line too long (61 > 50) | 18 | "This is also considered a docstring, and is over the limit." | ^^^^^^^^^^^ - | W505 Doc line too long (82 > 50) --> W505.py:24:51 @@ -64,4 +62,3 @@ W505 Doc line too long (85 > 50) 30 | 31 | It's over the limit on this line, which isn't the first line in the docstring.""" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__max_doc_length_with_utf_8.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__max_doc_length_with_utf_8.snap index 20d826c6d5de3f..41a99a276073b8 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__max_doc_length_with_utf_8.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__max_doc_length_with_utf_8.snap @@ -7,7 +7,6 @@ W505 Doc line too long (57 > 50) 1 | #!/usr/bin/env python3 2 | """Here's a top-level ß9💣2ℝing that's over theß9💣2ℝ.""" | ^^^^^^ - | W505 Doc line too long (56 > 50) --> W505_utf_8.py:6:49 @@ -45,7 +44,6 @@ W505 Doc line too long (61 > 50) | 18 | "This is also considered a ß9💣2ℝing, and is over theß9💣2ℝ." | ^^^^^^^^^^^ - | W505 Doc line too long (82 > 50) --> W505_utf_8.py:24:50 @@ -64,4 +62,3 @@ W505 Doc line too long (85 > 50) 30 | 31 | It's over theß9💣2ℝ on this line, which isn't the first line in the ß9💣2ℝing.""" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E40.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E40.py.snap index 178481cc69fe2f..565c52fbffa066 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E40.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E40.py.snap @@ -106,5 +106,4 @@ E402 Module level import not at top of file 67 | 68 | x = 1; import re as regex, string | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Move module level imports to top of file diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_0.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_0.py.snap index 7701ecae603e63..dcc852a6d61196 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_0.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_0.py.snap @@ -8,7 +8,6 @@ E402 [*] Module level import not at top of file 34 | 35 | import h | ^^^^^^^^ - | help: Move module level imports to top of file | 1 | """Top-level docstring.""" @@ -28,7 +27,6 @@ E402 Module level import not at top of file 44 | 45 | import k; import l | ^^^^^^^^ - | help: Move module level imports to top of file E402 Module level import not at top of file @@ -38,5 +36,4 @@ E402 Module level import not at top of file 44 | 45 | import k; import l | ^^^^^^^^ - | help: Move module level imports to top of file diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_1.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_1.py.snap index 45ed06923e9f0a..24250ad891bbe3 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_1.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_1.py.snap @@ -30,7 +30,6 @@ E402 [*] Module level import not at top of file 8 | 9 | import c | ^^^^^^^^ - | help: Move module level imports to top of file | 1 + import c diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_comments.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_comments.py.snap index 605ceda0f9df27..58a281d0fbda15 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_comments.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_comments.py.snap @@ -136,7 +136,6 @@ E402 [*] Module level import not at top of file 24 | | value3, 25 | | ) | |_^ - | help: Move module level imports to top of file | 1 + from late_paren4 import ( diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_docstring.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_docstring.py.snap index 1fc4af4423a95b..11a8669004263d 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_docstring.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_docstring.py.snap @@ -8,7 +8,6 @@ E402 [*] Module level import not at top of file 4 | 5 | import os | ^^^^^^^^^ - | help: Move module level imports to top of file | 1 | """module docstring""" diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_future.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_future.py.snap index e7598f7f42477e..398b25c7f7cd21 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_future.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_future.py.snap @@ -8,7 +8,6 @@ E402 [*] Module level import not at top of file 4 | 5 | import os | ^^^^^^^^^ - | help: Move module level imports to top of file | 1 | from __future__ import annotations diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_shebang.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_shebang.py.snap index 0fa105895f2cb0..7c270535eb3ffb 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_shebang.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_shebang.py.snap @@ -8,7 +8,6 @@ E402 [*] Module level import not at top of file 4 | 5 | import os | ^^^^^^^^^ - | help: Move module level imports to top of file | 2 | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_shebang_docstring_and_future.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_shebang_docstring_and_future.py.snap index 1f30b27fdee730..d3b7eb8200f60d 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_shebang_docstring_and_future.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E402_E402_shebang_docstring_and_future.py.snap @@ -8,7 +8,6 @@ E402 [*] Module level import not at top of file 8 | 9 | import os | ^^^^^^^^^ - | help: Move module level imports to top of file | 5 | from __future__ import annotations diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E501_E501_5.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E501_E501_5.py.snap index e7fa6a9f744b48..3688b98ee9b55f 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E501_E501_5.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__E501_E501_5.py.snap @@ -17,4 +17,3 @@ E501 Line too long (89 > 88) 13 | # Error - trailing type: ignore after another comment (89 characters before pragma) 14 | "shape:" + "shape:" + "shape:" + "shape:" + "shape:" + "shape:" + "shape:aaaa" # comment # type: ignore | ^ - | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391.ipynb.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391.ipynb.snap index f6dc7f56ffde1b..9c9b72a525953a 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391.ipynb.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391.ipynb.snap @@ -51,7 +51,6 @@ W391 [*] Too many newlines at end of cell 19 | / 20 | | | |__^ - | help: Remove trailing newlines | 19 | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391_0.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391_0.py.snap index 343bb3d28b2596..571d9027bf73a4 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391_0.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391_0.py.snap @@ -8,7 +8,6 @@ W391 [*] Extra newline at end of file 13 | bar() 14 | | ^ - | help: Remove trailing newline | 13 | bar() diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391_2.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391_2.py.snap index 265c3e0eb076f0..64639baa614075 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391_2.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391_2.py.snap @@ -11,7 +11,6 @@ W391 [*] Too many newlines at end of file 16 | | 17 | | | |__^ - | help: Remove trailing newlines | 13 | bar() diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_1.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_1.snap index f9cc43321a3953..099d35b8df22fd 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_1.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_1.snap @@ -51,4 +51,3 @@ E501 Line too long (7 > 6) 15 | [1,2] 16 | [1, 2] | ^ - | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_2.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_2.snap index ff4b41e3d8a07d..0cb88215a48ded 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_2.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_2.snap @@ -94,4 +94,3 @@ E501 Line too long (8 > 6) 15 | [1,2] 16 | [1, 2] | ^^ - | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_4.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_4.snap index 6eedca02da98d8..2f61eeb298971e 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_4.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_4.snap @@ -116,4 +116,3 @@ E501 Line too long (10 > 6) 15 | [1,2] 16 | [1, 2] | ^^^^ - | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_8.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_8.snap index d1f68fe2db6ef3..ad5c60f7e27966 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_8.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__tab_size_8.snap @@ -116,4 +116,3 @@ E501 Line too long (14 > 6) 15 | [1,2] 16 | [1, 2] | ^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__task_tags_false.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__task_tags_false.snap index f7526d15b7810f..9f0687997f42c1 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__task_tags_false.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__task_tags_false.snap @@ -81,4 +81,3 @@ E501 Line too long (159 > 88) 7 | …ed task-tags sometimes are longer than line-length so that you can easily find them with `git grep` 8 | …gured task-tags sometimes are longer than line-length so that you can easily find them with `git grep` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(-1)-between(0).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(-1)-between(0).snap index 06d473fbd2a61b..426d10c76727a3 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(-1)-between(0).snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(-1)-between(0).snap @@ -10,7 +10,6 @@ I001 [*] Import block is un-sorted or un-formatted 4 | | 5 | | from typing import Any, Sequence | |________________________________^ - | help: Organize imports | 1 | import json @@ -25,7 +24,6 @@ E303 [*] Too many blank lines (3) | 5 | from typing import Any, Sequence | ^^^^ - | help: Remove extraneous blank line(s) | 3 | @@ -58,7 +56,6 @@ I001 [*] Import block is un-sorted or un-formatted 29 | | 30 | | from typing_extensions import TypeAlias | |___________________________________________^ - | help: Organize imports | 27 | @@ -72,7 +69,6 @@ E303 [*] Too many blank lines (3) | 30 | from typing_extensions import TypeAlias | ^^^^ - | help: Remove extraneous blank line(s) | 27 | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(0)-between(0).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(0)-between(0).snap index 226c58725f94bf..783c9fd0451d92 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(0)-between(0).snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(0)-between(0).snap @@ -10,7 +10,6 @@ I001 [*] Import block is un-sorted or un-formatted 4 | | 5 | | from typing import Any, Sequence | |________________________________^ - | help: Organize imports | 1 | import json @@ -28,7 +27,6 @@ E303 [*] Too many blank lines (3) | 5 | from typing import Any, Sequence | ^^^^ - | help: Remove extraneous blank line(s) | 3 | @@ -41,7 +39,6 @@ E303 [*] Too many blank lines (2) | 8 | class MissingCommand(TypeError): ... # noqa: N818 | ^^^^^ - | help: Remove extraneous blank line(s) | 5 | from typing import Any, Sequence @@ -75,7 +72,6 @@ I001 [*] Import block is un-sorted or un-formatted 29 | | 30 | | from typing_extensions import TypeAlias | |___________________________________________^ - | help: Organize imports | 27 | @@ -89,7 +85,6 @@ E303 [*] Too many blank lines (3) | 30 | from typing_extensions import TypeAlias | ^^^^ - | help: Remove extraneous blank line(s) | 27 | @@ -135,7 +130,6 @@ E303 [*] Too many blank lines (1) 61 | 62 | class MissingCommand(TypeError): ... # noqa: N818 | ^^^^^ - | help: Remove extraneous blank line(s) | 60 | from typing import Any, Sequence diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(1)-between(1).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(1)-between(1).snap index b05f821f873e5c..03ef7516876762 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(1)-between(1).snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(1)-between(1).snap @@ -10,7 +10,6 @@ I001 [*] Import block is un-sorted or un-formatted 4 | | 5 | | from typing import Any, Sequence | |________________________________^ - | help: Organize imports | 2 | @@ -26,7 +25,6 @@ E303 [*] Too many blank lines (3) | 5 | from typing import Any, Sequence | ^^^^ - | help: Remove extraneous blank line(s) | 3 | @@ -39,7 +37,6 @@ E303 [*] Too many blank lines (2) | 8 | class MissingCommand(TypeError): ... # noqa: N818 | ^^^^^ - | help: Remove extraneous blank line(s) | 6 | @@ -72,7 +69,6 @@ I001 [*] Import block is un-sorted or un-formatted 29 | | 30 | | from typing_extensions import TypeAlias | |___________________________________________^ - | help: Organize imports | 27 | @@ -86,7 +82,6 @@ E303 [*] Too many blank lines (3) | 30 | from typing_extensions import TypeAlias | ^^^^ - | help: Remove extraneous blank line(s) | 27 | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(4)-between(4).snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(4)-between(4).snap index a057fa67ae192e..a8c060f35d73a5 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(4)-between(4).snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__too_many_blank_lines_isort_compatibility-lines-after(4)-between(4).snap @@ -10,7 +10,6 @@ I001 [*] Import block is un-sorted or un-formatted 4 | | 5 | | from typing import Any, Sequence | |________________________________^ - | help: Organize imports | 4 | @@ -48,7 +47,6 @@ I001 [*] Import block is un-sorted or un-formatted 29 | | 30 | | from typing_extensions import TypeAlias | |___________________________________________^ - | help: Organize imports | 27 | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__w292_4.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__w292_4.snap index 4e72ca6c7d100e..b12cf346d6ed92 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__w292_4.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__w292_4.snap @@ -6,7 +6,6 @@ W292 [*] No newline at end of file | 1 | | ^ - | help: Add trailing newline | - diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__white_space_syntax_error_compatibility.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__white_space_syntax_error_compatibility.snap index 447a0efd5e2e0e..c332e864c41a0c 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__white_space_syntax_error_compatibility.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__white_space_syntax_error_compatibility.snap @@ -6,4 +6,3 @@ invalid-syntax: Expected an expression | 1 | a = (1 or) | ^ - | diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D103_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D103_D.py.snap index a284864e472c8f..6cf32eabdeec9d 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D103_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D103_D.py.snap @@ -7,4 +7,3 @@ D103 Missing docstring in public function 399 | @expect("D103: Missing docstring in public function") 400 | def oneliner_d102(): return | ^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D.py.snap index 5b0cd2750ea80c..134ff2bb6dae04 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D.py.snap @@ -10,7 +10,6 @@ D200 [*] One-line docstring should fit on one line 130 | | Wrong. 131 | | """ | |_______^ - | help: Reformat to one line | 128 | def asdlkfasd(): @@ -31,7 +30,6 @@ D200 [*] One-line docstring should fit on one line 598 | | 599 | | Wrong.""" | |_____________^ - | help: Reformat to one line | 596 | def one_liner(): @@ -52,7 +50,6 @@ D200 [*] One-line docstring should fit on one line 607 | | 608 | | """ | |_______^ - | help: Reformat to one line | 605 | def one_liner(): @@ -73,7 +70,6 @@ D200 One-line docstring should fit on one line 616 | | 617 | | """ | |_______^ - | help: Reformat to one line D200 One-line docstring should fit on one line @@ -85,7 +81,6 @@ D200 One-line docstring should fit on one line 625 | | 626 | | "Wrong.""" | |______________^ - | help: Reformat to one line D200 One-line docstring should fit on one line diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D200.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D200.py.snap index d75e5e9466c7f4..72eb17cdede5f5 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D200.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D200_D200.py.snap @@ -8,7 +8,6 @@ D200 One-line docstring should fit on one line 2 | / """\ 3 | | """ | |_______^ - | help: Reformat to one line D200 [*] One-line docstring should fit on one line @@ -18,7 +17,6 @@ D200 [*] One-line docstring should fit on one line 7 | / """\\ 8 | | """ | |_______^ - | help: Reformat to one line | 6 | def func(): @@ -36,5 +34,4 @@ D200 One-line docstring should fit on one line 12 | / """\ \ 13 | | """ | |_______^ - | help: Reformat to one line diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D201_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D201_D.py.snap index c11bf5bda59f95..de8307724f34a6 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D201_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D201_D.py.snap @@ -8,7 +8,6 @@ D201 [*] No blank lines allowed before function docstring (found 1) 136 | 137 | """Leading space.""" | ^^^^^^^^^^^^^^^^^^^^ - | help: Remove blank line(s) before function docstring | 135 | def leading_space(): @@ -43,7 +42,6 @@ D201 [*] No blank lines allowed before function docstring (found 1) 548 | | More content. 549 | | """ | |_______^ - | help: Remove blank line(s) before function docstring | 544 | def multiline_leading_space(): diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D202_D202.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D202_D202.py.snap index 3ce8c73bc01e5f..33e762f4b711ec 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D202_D202.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D202_D202.py.snap @@ -8,7 +8,6 @@ D202 [*] No blank lines allowed after function docstring (found 2) 56 | def outer(): 57 | """This is a docstring.""" | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove blank line(s) after function docstring | 57 | """This is a docstring.""" @@ -24,7 +23,6 @@ D202 [*] No blank lines allowed after function docstring (found 2) 67 | def outer(): 68 | """This is a docstring.""" | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove blank line(s) after function docstring | 68 | """This is a docstring.""" diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D203_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D203_D.py.snap index 8e0f1b125dde48..992037f4f60a12 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D203_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D203_D.py.snap @@ -7,7 +7,6 @@ D203 [*] 1 blank line required before class docstring 160 | class LeadingSpaceMissing: 161 | """Leading space missing.""" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Insert 1 blank line before class docstring | 160 | class LeadingSpaceMissing: @@ -75,7 +74,6 @@ D203 [*] 1 blank line required before class docstring 653 | class StatementOnSameLineAsDocstring: 654 | "After this docstring there's another statement on the same line separated by a semicolon."; priorities=1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Insert 1 blank line before class docstring | 653 | class StatementOnSameLineAsDocstring: diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D204_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D204_D.py.snap index 12d98ceeef9d5a..ed5fa25d858b37 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D204_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D204_D.py.snap @@ -57,7 +57,6 @@ D204 [*] 1 blank line required after class docstring 653 | class StatementOnSameLineAsDocstring: 654 | "After this docstring there's another statement on the same line separated by a semicolon."; priorities=1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Insert 1 blank line after class docstring | 653 | class StatementOnSameLineAsDocstring: diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D205_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D205_D.py.snap index 288e0c420a6abd..2b09f1aab33aff 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D205_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D205_D.py.snap @@ -11,7 +11,6 @@ D205 1 blank line required between summary line and description 202 | | 203 | | """ | |_______^ - | help: Insert single blank line D205 [*] 1 blank line required between summary line and description (found 2) @@ -26,7 +25,6 @@ D205 [*] 1 blank line required between summary line and description (found 2) 214 | | 215 | | """ | |_______^ - | help: Insert single blank line | 211 | diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D207_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D207_D.py.snap index 6d99cf972ba4bf..b9d96c349236e4 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D207_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D207_D.py.snap @@ -26,7 +26,6 @@ D207 [*] Docstring is under-indented 243 | 244 | """ | ^ - | help: Increase indentation | 243 | @@ -58,7 +57,6 @@ D207 [*] Docstring is under-indented 440 | Second Line 441 | """ | ^ - | help: Increase indentation | 440 | Second Line diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D208_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D208_D.py.snap index dffaf27ea1a896..21bddce5ea9c45 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D208_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D208_D.py.snap @@ -26,7 +26,6 @@ D208 [*] Docstring is over-indented 263 | 264 | """ | ^ - | help: Remove over-indentation | 263 | diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D208_D208.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D208_D208.py.snap index 8d8c481cc89300..1b574c671ea437 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D208_D208.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D208_D208.py.snap @@ -59,7 +59,6 @@ D208 [*] Docstring is over-indented 9 |     Returns: 10 | """ | ^ - | help: Remove over-indentation | 9 |     Returns: @@ -75,7 +74,6 @@ D208 [*] Docstring is over-indented 23 | Returns: 24 | """ | ^ - | help: Remove over-indentation | 23 | Returns: diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D209_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D209_D.py.snap index 839f2de59020cd..3d93975d39ee82 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D209_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D209_D.py.snap @@ -10,7 +10,6 @@ D209 [*] Multi-line docstring closing quotes should be on a separate line 282 | | 283 | | Description.""" | |___________________^ - | help: Move closing quotes to new line | 282 | @@ -29,7 +28,6 @@ D209 [*] Multi-line docstring closing quotes should be on a separate line 589 | | 590 | | Description. """ | |_____________________^ - | help: Move closing quotes to new line | 589 | diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D210_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D210_D.py.snap index 4ea80dbb187ac4..a984c9b0443d91 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D210_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D210_D.py.snap @@ -8,7 +8,6 @@ D210 [*] No whitespaces allowed surrounding docstring text 287 | def endswith(): 288 | """Whitespace at the end. """ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Trim surrounding whitespace | 287 | def endswith(): @@ -24,7 +23,6 @@ D210 [*] No whitespaces allowed surrounding docstring text 292 | def around(): 293 | """ Whitespace at everywhere. """ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Trim surrounding whitespace | 292 | def around(): @@ -43,7 +41,6 @@ D210 [*] No whitespaces allowed surrounding docstring text 301 | | This is the end. 302 | | """ | |_______^ - | help: Trim surrounding whitespace | 298 | def multiline(): @@ -59,5 +56,4 @@ D210 No whitespaces allowed surrounding docstring text 580 | def endswith_quote(): 581 | """Whitespace at the end, but also a quote" """ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Trim surrounding whitespace diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D211_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D211_D.py.snap index fe7ea92d97c20b..7f30b2fc716c46 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D211_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D211_D.py.snap @@ -8,7 +8,6 @@ D211 [*] No blank lines allowed before class docstring 169 | 170 | """With leading space.""" | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove blank line(s) before class docstring | 168 | class WithLeadingSpace: diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D212_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D212_D.py.snap index 7649e7e02e53aa..3660a3edb615a7 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D212_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D212_D.py.snap @@ -10,7 +10,6 @@ D212 [*] Multi-line docstring summary should start at the first line 130 | | Wrong. 131 | | """ | |_______^ - | help: Remove whitespace after opening quotes | 128 | def asdlkfasd(): @@ -29,7 +28,6 @@ D212 [*] Multi-line docstring summary should start at the first line 598 | | 599 | | Wrong.""" | |_____________^ - | help: Remove whitespace after opening quotes | 596 | def one_liner(): @@ -49,7 +47,6 @@ D212 [*] Multi-line docstring summary should start at the first line 625 | | 626 | | "Wrong.""" | |______________^ - | help: Remove whitespace after opening quotes | 623 | def one_liner(): diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D213_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D213_D.py.snap index 9d44f3e9544cee..a2cbde6dbcaf53 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D213_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D213_D.py.snap @@ -11,7 +11,6 @@ D213 [*] Multi-line docstring summary should start at the second line 202 | | 203 | | """ | |_______^ - | help: Insert line break and indentation after opening quotes | 199 | def multi_line_zero_separating_blanks(): @@ -33,7 +32,6 @@ D213 [*] Multi-line docstring summary should start at the second line 214 | | 215 | | """ | |_______^ - | help: Insert line break and indentation after opening quotes | 209 | def multi_line_two_separating_blanks(): @@ -54,7 +52,6 @@ D213 [*] Multi-line docstring summary should start at the second line 223 | | 224 | | """ | |_______^ - | help: Insert line break and indentation after opening quotes | 219 | def multi_line_one_separating_blanks(): @@ -75,7 +72,6 @@ D213 [*] Multi-line docstring summary should start at the second line 233 | | 234 | | """ | |_______^ - | help: Insert line break and indentation after opening quotes | 229 | def asdfsdf(): @@ -96,7 +92,6 @@ D213 [*] Multi-line docstring summary should start at the second line 243 | | 244 | | """ | |___^ - | help: Insert line break and indentation after opening quotes | 239 | def asdsdfsdffsdf(): @@ -117,7 +112,6 @@ D213 [*] Multi-line docstring summary should start at the second line 253 | | 254 | | """ | |_______^ - | help: Insert line break and indentation after opening quotes | 249 | def asdfsdsdf24(): @@ -138,7 +132,6 @@ D213 [*] Multi-line docstring summary should start at the second line 263 | | 264 | | """ | |___________^ - | help: Insert line break and indentation after opening quotes | 259 | def asdfsdsdfsdf24(): @@ -159,7 +152,6 @@ D213 [*] Multi-line docstring summary should start at the second line 273 | | 274 | | """ | |_______^ - | help: Insert line break and indentation after opening quotes | 269 | def asdfsdfsdsdsdfsdf24(): @@ -178,7 +170,6 @@ D213 [*] Multi-line docstring summary should start at the second line 282 | | 283 | | Description.""" | |___________________^ - | help: Insert line break and indentation after opening quotes | 280 | def asdfljdf24(): @@ -198,7 +189,6 @@ D213 [*] Multi-line docstring summary should start at the second line 301 | | This is the end. 302 | | """ | |_______^ - | help: Insert line break and indentation after opening quotes | 298 | def multiline(): @@ -220,7 +210,6 @@ D213 [*] Multi-line docstring summary should start at the second line 347 | | They are considered to be intentionally unescaped. 348 | | """ | |_______^ - | help: Insert line break and indentation after opening quotes | 342 | def exceptions_of_D301(): @@ -262,7 +251,6 @@ D213 [*] Multi-line docstring summary should start at the second line 395 | | 396 | | """ | |_______^ - | help: Insert line break and indentation after opening quotes | 391 | def old_209(): @@ -283,7 +271,6 @@ D213 [*] Multi-line docstring summary should start at the second line 440 | | Second Line 441 | | """ | |_______^ - | help: Insert line break and indentation after opening quotes | 437 | @expect('D213: Multi-line docstring summary should start at the second line') @@ -304,7 +291,6 @@ D213 [*] Multi-line docstring summary should start at the second line 453 | | 454 | | """ | |_______^ - | help: Insert line break and indentation after opening quotes | 449 | def a_following_valid_function(x=None): @@ -349,7 +335,6 @@ D213 [*] Multi-line docstring summary should start at the second line 548 | | More content. 549 | | """ | |_______^ - | help: Insert line break and indentation after opening quotes | 545 | @@ -412,7 +397,6 @@ D213 [*] Multi-line docstring summary should start at the second line 589 | | 590 | | Description. """ | |_____________________^ - | help: Insert line break and indentation after opening quotes | 587 | def asdfljdjgf24(): @@ -431,7 +415,6 @@ D213 [*] Multi-line docstring summary should start at the second line 607 | | 608 | | """ | |_______^ - | help: Insert line break and indentation after opening quotes | 605 | def one_liner(): @@ -450,7 +433,6 @@ D213 [*] Multi-line docstring summary should start at the second line 616 | | 617 | | """ | |_______^ - | help: Insert line break and indentation after opening quotes | 614 | def one_liner(): @@ -471,7 +453,6 @@ D213 [*] Multi-line docstring summary should start at the second line 675 | | to the one before 676 | | """ | |_______^ - | help: Insert line break and indentation after opening quotes | 670 | def retain_extra_whitespace(): @@ -495,7 +476,6 @@ D213 [*] Multi-line docstring summary should start at the second line 687 | | to the one before 688 | | """ | |_______^ - | help: Insert line break and indentation after opening quotes | 679 | def retain_extra_whitespace_multiple(): @@ -541,7 +521,6 @@ D213 [*] Multi-line docstring summary should start at the second line 707 | | This is overindented 708 | | """ | |_______^ - | help: Insert line break and indentation after opening quotes | 701 | def retain_extra_whitespace_followed_by_same_offset(): @@ -562,7 +541,6 @@ D213 [*] Multi-line docstring summary should start at the second line 716 | | And so is this, but it we should preserve the extra space on this line relative 717 | | """ | |_______^ - | help: Insert line break and indentation after opening quotes | 711 | def retain_extra_whitespace_not_overindented(): @@ -581,7 +559,6 @@ D213 [*] Multi-line docstring summary should start at the second line 723 | |     Returns: 724 | | """ | |_______^ - | help: Insert line break and indentation after opening quotes | 720 | def inconsistent_indent_byte_size(): diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D300_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D300_D.py.snap index 2a4bc2b5bbfcb5..f11fe7926f7000 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D300_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D300_D.py.snap @@ -8,7 +8,6 @@ D300 [*] Use triple double quotes `"""` 306 | def triple_single_quotes_raw(): 307 | r'''Summary.''' | ^^^^^^^^^^^^^^^ - | help: Convert to triple double quotes | 306 | def triple_single_quotes_raw(): @@ -24,7 +23,6 @@ D300 [*] Use triple double quotes `"""` 311 | def triple_single_quotes_raw_uppercase(): 312 | R'''Summary.''' | ^^^^^^^^^^^^^^^ - | help: Convert to triple double quotes | 311 | def triple_single_quotes_raw_uppercase(): @@ -40,7 +38,6 @@ D300 [*] Use triple double quotes `"""` 316 | def single_quotes_raw(): 317 | r'Summary.' | ^^^^^^^^^^^ - | help: Convert to triple double quotes | 316 | def single_quotes_raw(): @@ -56,7 +53,6 @@ D300 [*] Use triple double quotes `"""` 321 | def single_quotes_raw_uppercase(): 322 | R'Summary.' | ^^^^^^^^^^^ - | help: Convert to triple double quotes | 321 | def single_quotes_raw_uppercase(): @@ -72,7 +68,6 @@ D300 [*] Use triple double quotes `"""` 327 | def single_quotes_raw_uppercase_backslash(): 328 | R'Sum\mary.' | ^^^^^^^^^^^^ - | help: Convert to triple double quotes | 327 | def single_quotes_raw_uppercase_backslash(): @@ -124,7 +119,6 @@ D300 [*] Use triple double quotes `"""` 653 | class StatementOnSameLineAsDocstring: 654 | "After this docstring there's another statement on the same line separated by a semicolon."; priorities=1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Convert to triple double quotes | 653 | class StatementOnSameLineAsDocstring: @@ -157,7 +151,6 @@ D300 [*] Use triple double quotes `"""` 664 | / "We enforce a newline after the closing quote for a multi-line docstring \ 665 | | but continuations shouldn't be considered multi-line" | |_________________________________________________________^ - | help: Convert to triple double quotes | 663 | def newline_after_closing_quote(self): diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D300_D300.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D300_D300.py.snap index b4a3434b4c0774..794d33e32e54e0 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D300_D300.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D300_D300.py.snap @@ -7,7 +7,6 @@ D300 Use triple double quotes `"""` 5 | def ends_in_quote(): 6 | 'Sum\\mary."' | ^^^^^^^^^^^^^ - | help: Convert to triple double quotes D300 [*] Use triple double quotes `"""` @@ -16,7 +15,6 @@ D300 [*] Use triple double quotes `"""` 9 | def contains_quote(): 10 | 'Sum"\\mary.' | ^^^^^^^^^^^^^ - | help: Convert to triple double quotes | 9 | def contains_quote(): diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D301_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D301_D.py.snap index ba64f5b8869854..9d1f0339a35e70 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D301_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D301_D.py.snap @@ -8,7 +8,6 @@ D301 [*] Use `r"""` if any backslashes in a docstring 332 | def double_quotes_backslash(): 333 | """Sum\\mary.""" | ^^^^^^^^^^^^^^^^ - | help: Add `r` prefix | 332 | def double_quotes_backslash(): diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D301_D301.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D301_D301.py.snap index 28cd88214961e5..a6501bd05b1e2f 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D301_D301.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D301_D301.py.snap @@ -7,7 +7,6 @@ D301 [*] Use `r"""` if any backslashes in a docstring 1 | def double_quotes_backslash(): 2 | """Sum\\mary.""" | ^^^^^^^^^^^^^^^^ - | help: Add `r` prefix | 1 | def double_quotes_backslash(): @@ -23,7 +22,6 @@ D301 Use `r"""` if any backslashes in a docstring 36 | def shouldnt_add_raw_here2(): 37 | u"Sum\\mary." | ^^^^^^^^^^^^^ - | help: Add `r` prefix D301 [*] Use `r"""` if any backslashes in a docstring @@ -34,7 +32,6 @@ D301 [*] Use `r"""` if any backslashes in a docstring 94 | | This is single quote escape \". 95 | | """ | |_______^ - | help: Add `r` prefix | 92 | def should_add_raw_for_single_double_quote_escape(): @@ -52,7 +49,6 @@ D301 [*] Use `r"""` if any backslashes in a docstring 100 | | This is single quote escape \'. 101 | | ''' | |_______^ - | help: Add `r` prefix | 98 | def should_add_raw_for_single_single_quote_escape(): diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D.py.snap index 53ff711a747c23..a51349390f6679 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D.py.snap @@ -8,7 +8,6 @@ D400 [*] First line should end with a period 354 | def lwnlkjl(): 355 | """Summary""" | ^^^^^^^^^^^^^ - | help: Add period | 354 | def lwnlkjl(): @@ -25,7 +24,6 @@ D400 [*] First line should end with a period 405 | " or exclamation point (not 'r')") 406 | def oneliner_withdoc(): """One liner""" | ^^^^^^^^^^^^^^^ - | help: Add period | 405 | " or exclamation point (not 'r')") @@ -77,7 +75,6 @@ D400 [*] First line should end with a period 421 | @ignored_decorator 422 | def oneliner_ignored_decorator(): """One liner""" | ^^^^^^^^^^^^^^^ - | help: Add period | 421 | @ignored_decorator @@ -94,7 +91,6 @@ D400 [*] First line should end with a period 428 | " or exclamation point (not 'r')") 429 | def oneliner_with_decorator_expecting_errors(): """One liner""" | ^^^^^^^^^^^^^^^ - | help: Add period | 428 | " or exclamation point (not 'r')") @@ -180,7 +176,6 @@ D400 First line should end with a period 513 | def valid_google_string(): # noqa: D400 514 | """Test a valid something!""" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Add period D400 [*] First line should end with a period @@ -190,7 +185,6 @@ D400 [*] First line should end with a period 519 | def bad_google_string(): # noqa: D400 520 | """Test a valid something""" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Add period | 519 | def bad_google_string(): # noqa: D400 @@ -207,7 +201,6 @@ D400 [*] First line should end with a period 580 | def endswith_quote(): 581 | """Whitespace at the end, but also a quote" """ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Add period | 580 | def endswith_quote(): @@ -226,7 +219,6 @@ D400 [*] First line should end with a period 616 | | 617 | | """ | |_______^ - | help: Add period | 614 | def one_liner(): @@ -260,7 +252,6 @@ D400 [*] First line should end with a period 640 | 641 | def same_line(): """This is a docstring on the same line""" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Add period | 640 | @@ -277,7 +268,6 @@ D400 [*] First line should end with a period 664 | / "We enforce a newline after the closing quote for a multi-line docstring \ 665 | | but continuations shouldn't be considered multi-line" | |_________________________________________________________^ - | help: Add period | 664 | "We enforce a newline after the closing quote for a multi-line docstring \ diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D400.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D400.py.snap index b41376170d3851..dc4d4c64e99e19 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D400.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D400_D400.py.snap @@ -230,7 +230,6 @@ D400 [*] First line should end with a period 101 | | My example explanation 102 | | """ | |_______^ - | help: Add period | 97 | """ diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D401_D401.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D401_D401.py.snap index 55f509319cd547..7b27950eb28c9b 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D401_D401.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D401_D401.py.snap @@ -7,7 +7,6 @@ D401 First line of docstring should be in imperative mood: "Returns foo." 9 | def bad_liouiwnlkjl(): 10 | """Returns foo.""" | ^^^^^^^^^^^^^^^^^^ - | D401 First line of docstring should be in imperative mood: "Constructor for a foo." --> D401.py:14:5 @@ -15,7 +14,6 @@ D401 First line of docstring should be in imperative mood: "Constructor for a fo 13 | def bad_sdgfsdg23245(): 14 | """Constructor for a foo.""" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | D401 First line of docstring should be in imperative mood: "Constructor for a boa." --> D401.py:18:5 @@ -27,7 +25,6 @@ D401 First line of docstring should be in imperative mood: "Constructor for a bo 21 | | 22 | | """ | |_______^ - | D401 First line of docstring should be in imperative mood: "Runs something" --> D401.py:26:5 @@ -57,7 +54,6 @@ D401 First line of docstring should be in imperative mood: "Writes a logical lin 36 | | extends to two physical lines. 37 | | """ | |_______^ - | D401 First line of docstring should be in imperative mood: "This method docstring should be written in imperative mood." --> D401.py:74:9 diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D402_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D402_D.py.snap index 0f51d90a4ff1fa..2919868e4f1be2 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D402_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D402_D.py.snap @@ -8,4 +8,3 @@ D402 First line should not be the function's signature 377 | def foobar(): 378 | """Signature: foobar().""" | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D402_D402.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D402_D402.py.snap index f6048d4fb5fd8d..d2c56dbeeddcdb 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D402_D402.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D402_D402.py.snap @@ -17,4 +17,3 @@ D402 First line should not be the function's signature 7 | def foo(): 8 | """"Use this function; foo().""" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D403_D403.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D403_D403.py.snap index b5f18422ac8afa..b50c3780727d06 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D403_D403.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D403_D403.py.snap @@ -223,7 +223,6 @@ D403 [*] First word of the docstring should be capitalized: `singleword` -> `Sin 88 | | This is more text. 89 | | """ | |_______^ - | help: Capitalize `singleword` to `Singleword` | 85 | """ diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D404_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D404_D.py.snap index d9f57c68d3371e..202367966d2bc5 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D404_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D404_D.py.snap @@ -8,7 +8,6 @@ D404 First word of the docstring should not be "This" 630 | def starts_with_this(): 631 | """This is a docstring.""" | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | D404 First word of the docstring should not be "This" --> D.py:636:5 @@ -17,7 +16,6 @@ D404 First word of the docstring should not be "This" 635 | def starts_with_space_then_this(): 636 | """ This is a docstring that starts with a space.""" # noqa: D210 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | D404 First word of the docstring should not be "This" --> D.py:639:17 @@ -35,4 +33,3 @@ D404 First word of the docstring should not be "This" 640 | 641 | def same_line(): """This is a docstring on the same line""" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D407_sections.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D407_sections.py.snap index a02665f5ed911b..90e97c63ea063b 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D407_sections.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D407_sections.py.snap @@ -41,7 +41,6 @@ D407 [*] Missing dashed underline after section ("Returns") 66 | 67 | Returns""" | ^^^^^^^ - | help: Add dashed line under "Returns" | 66 | diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D412_sphinx.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D412_sphinx.py.snap index e4fcd33d5707d2..b3668e3c29bc1c 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D412_sphinx.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D412_sphinx.py.snap @@ -8,7 +8,6 @@ D412 [*] No blank lines allowed between a section header and its content ("Examp 12 | """ 13 | Example: | ^^^^^^^ - | help: Remove blank line(s) | 14 | @@ -23,7 +22,6 @@ D412 [*] No blank lines allowed between a section header and its content ("Examp 23 | """ 24 | Example: | ^^^^^^^ - | help: Remove blank line(s) | 25 | diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D413_sections.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D413_sections.py.snap index 014932de86789c..4f65203e47b1e8 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D413_sections.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D413_sections.py.snap @@ -8,7 +8,6 @@ D413 [*] Missing blank line after last section ("Returns") 66 | 67 | Returns""" | ^^^^^^^ - | help: Add blank line after "Returns" | 66 | diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D414_sections.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D414_sections.py.snap index 75860e3dc3107f..2ad9c45caffd89 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D414_sections.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D414_sections.py.snap @@ -19,7 +19,6 @@ D414 Section has no content ("Returns") 66 | 67 | Returns""" | ^^^^^^^ - | D414 Section has no content ("Returns") --> sections.py:78:5 diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D415_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D415_D.py.snap index 7d30b13fa2a61a..1b2f8c941d9b94 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D415_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D415_D.py.snap @@ -8,7 +8,6 @@ D415 [*] First line should end with a period, question mark, or exclamation poin 354 | def lwnlkjl(): 355 | """Summary""" | ^^^^^^^^^^^^^ - | help: Add closing punctuation | 354 | def lwnlkjl(): @@ -25,7 +24,6 @@ D415 [*] First line should end with a period, question mark, or exclamation poin 405 | " or exclamation point (not 'r')") 406 | def oneliner_withdoc(): """One liner""" | ^^^^^^^^^^^^^^^ - | help: Add closing punctuation | 405 | " or exclamation point (not 'r')") @@ -77,7 +75,6 @@ D415 [*] First line should end with a period, question mark, or exclamation poin 421 | @ignored_decorator 422 | def oneliner_ignored_decorator(): """One liner""" | ^^^^^^^^^^^^^^^ - | help: Add closing punctuation | 421 | @ignored_decorator @@ -94,7 +91,6 @@ D415 [*] First line should end with a period, question mark, or exclamation poin 428 | " or exclamation point (not 'r')") 429 | def oneliner_with_decorator_expecting_errors(): """One liner""" | ^^^^^^^^^^^^^^^ - | help: Add closing punctuation | 428 | " or exclamation point (not 'r')") @@ -181,7 +177,6 @@ D415 [*] First line should end with a period, question mark, or exclamation poin 519 | def bad_google_string(): # noqa: D400 520 | """Test a valid something""" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Add closing punctuation | 519 | def bad_google_string(): # noqa: D400 @@ -198,7 +193,6 @@ D415 [*] First line should end with a period, question mark, or exclamation poin 580 | def endswith_quote(): 581 | """Whitespace at the end, but also a quote" """ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Add closing punctuation | 580 | def endswith_quote(): @@ -217,7 +211,6 @@ D415 [*] First line should end with a period, question mark, or exclamation poin 616 | | 617 | | """ | |_______^ - | help: Add closing punctuation | 614 | def one_liner(): @@ -251,7 +244,6 @@ D415 [*] First line should end with a period, question mark, or exclamation poin 640 | 641 | def same_line(): """This is a docstring on the same line""" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Add closing punctuation | 640 | @@ -268,7 +260,6 @@ D415 [*] First line should end with a period, question mark, or exclamation poin 664 | / "We enforce a newline after the closing quote for a multi-line docstring \ 665 | | but continuations shouldn't be considered multi-line" | |_________________________________________________________^ - | help: Add closing punctuation | 664 | "We enforce a newline after the closing quote for a multi-line docstring \ diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D419_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D419_D.py.snap index e6077f93ad4047..874f4eb8c21d70 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D419_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D419_D.py.snap @@ -29,4 +29,3 @@ D419 Docstring is empty 79 | def nested(): 80 | '' | ^^ - | diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__bom.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__bom.snap index 5bef0800c2a45b..828ef679e34aaf 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__bom.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__bom.snap @@ -6,7 +6,6 @@ D300 [*] Use triple double quotes `"""` | 1 | ''' SAM macro definitions ''' | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Convert to triple double quotes | - ''' SAM macro definitions ''' diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d209_d400.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d209_d400.snap index a7926e3114fafe..59e45c5e0bd671 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d209_d400.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__d209_d400.snap @@ -8,7 +8,6 @@ D209 [*] Multi-line docstring closing quotes should be on a separate line 2 | / """lorem ipsum dolor sit amet consectetur adipiscing elit 3 | | sed do eiusmod tempor incididunt ut labore et dolore magna aliqua""" | |________________________________________________________________________^ - | help: Move closing quotes to new line | 2 | """lorem ipsum dolor sit amet consectetur adipiscing elit @@ -24,7 +23,6 @@ D400 [*] First line should end with a period 2 | / """lorem ipsum dolor sit amet consectetur adipiscing elit 3 | | sed do eiusmod tempor incididunt ut labore et dolore magna aliqua""" | |________________________________________________________________________^ - | help: Add period | 2 | """lorem ipsum dolor sit amet consectetur adipiscing elit diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_0.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_0.py.snap index 8b81e796ff64f5..d000f803e9ba65 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_0.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_0.py.snap @@ -107,7 +107,6 @@ F401 [*] `pickle` imported but unused 51 | def b(self) -> None: 52 | import pickle | ^^^^^^ - | help: Remove unused import: `pickle` | 51 | def b(self) -> None: @@ -139,7 +138,6 @@ F401 [*] `y` imported but unused 93 | import x 94 | import y | ^ - | help: Remove unused import: `y` | 93 | import x @@ -188,7 +186,6 @@ F401 [*] `a2` imported but unused 106 | 107 | import a2 | ^^ - | help: Remove unused import: `a2` | 106 | @@ -220,7 +217,6 @@ F401 [*] `b2` imported but unused 113 | 114 | import b2 | ^^ - | help: Remove unused import: `b2` | 113 | @@ -234,7 +230,6 @@ F401 [*] `datameta_client_lib.model_helpers.noqa` imported but unused 121 | from datameta_client_lib.model_helpers import ( 122 | noqa ) | ^^^^ - | help: Remove unused import: `datameta_client_lib.model_helpers.noqa` | 120 | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_11.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_11.py.snap index 6a0a8c3aeed51f..7bedc926b31bc3 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_11.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_11.py.snap @@ -7,7 +7,6 @@ F401 [*] `pathlib.PurePath` imported but unused 3 | from typing import List 4 | from pathlib import Path, PurePath | ^^^^^^^^ - | help: Remove unused import: `pathlib.PurePath` | 3 | from typing import List diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_15.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_15.py.snap index 00e0a293867f21..cba2cf8fea290b 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_15.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_15.py.snap @@ -7,7 +7,6 @@ F401 [*] `pathlib.Path` imported but unused 4 | if TYPE_CHECKING: 5 | from pathlib import Path | ^^^^ - | help: Remove unused import: `pathlib.Path` | 4 | if TYPE_CHECKING: diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_18.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_18.py.snap index 89a6f6e524485c..b2901bdbc27f0d 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_18.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_18.py.snap @@ -7,7 +7,6 @@ F401 [*] `__future__` imported but unused 4 | def f(): 5 | import __future__ | ^^^^^^^^^^ - | help: Remove unused import: `__future__` | 4 | def f(): diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_5.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_5.py.snap index 5fc6f974af4446..b6483be2edee79 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_5.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_5.py.snap @@ -57,7 +57,6 @@ F401 [*] `j.k` imported but unused 4 | import h.i 5 | import j.k as l | ^ - | help: Remove unused import: `j.k` | 4 | import h.i diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_6.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_6.py.snap index 5bcdd0e8cb50c2..cf985888c0925b 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_6.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_6.py.snap @@ -55,7 +55,6 @@ F401 [*] `datastructures` imported but unused 18 | # F401 `datastructures` imported but unused 19 | import datastructures as structures | ^^^^^^^^^^ - | help: Remove unused import: `datastructures` | 18 | # F401 `datastructures` imported but unused diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_7.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_7.py.snap index 794bc0195d7561..94f60b328ee387 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_7.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_7.py.snap @@ -25,7 +25,6 @@ F401 [*] `typing.Awaitable` imported but unused 65 | # This should mark F501 as unused. 66 | from typing import Awaitable, AwaitableGenerator # noqa: F501 | ^^^^^^^^^ - | help: Remove unused import | 65 | # This should mark F501 as unused. @@ -38,7 +37,6 @@ F401 [*] `typing.AwaitableGenerator` imported but unused 65 | # This should mark F501 as unused. 66 | from typing import Awaitable, AwaitableGenerator # noqa: F501 | ^^^^^^^^^^^^^^^^^^ - | help: Remove unused import | 65 | # This should mark F501 as unused. diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_9.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_9.py.snap index ab5db54e01fe0b..9fcfd335725c4a 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_9.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_F401_9.py.snap @@ -7,7 +7,6 @@ F401 [*] `foo.baz` imported but unused 3 | __all__ = ("bar",) 4 | from foo import bar, baz | ^^^ - | help: Remove unused import: `foo.baz` | 3 | __all__ = ("bar",) diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_24____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_24____init__.py.snap index 420d20442e32b2..b22638490d3180 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_24____init__.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_24____init__.py.snap @@ -6,7 +6,6 @@ F401 [*] `sys` imported but unused | 19 | import sys # F401: remove unused | ^^^ - | help: Remove unused import: `sys` | 18 | @@ -20,7 +19,6 @@ F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, | 33 | from . import unused # F401: change to redundant alias | ^^^^^^ - | help: Remove unused import: `.unused` | 32 | @@ -34,7 +32,6 @@ F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, | 36 | from . import renamed as bees # F401: no fix | ^^^^ - | help: Remove unused import: `.renamed` | 35 | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_25__all_nonempty____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_25__all_nonempty____init__.py.snap index 18f4794f6ccf71..7816a422e629b9 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_25__all_nonempty____init__.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_25__all_nonempty____init__.py.snap @@ -6,7 +6,6 @@ F401 [*] `sys` imported but unused | 19 | import sys # F401: remove unused | ^^^ - | help: Remove unused import: `sys` | 18 | @@ -20,7 +19,6 @@ F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, | 36 | from . import unused # F401: add to __all__ | ^^^^^^ - | help: Remove unused import: `.unused` | 35 | @@ -34,7 +32,6 @@ F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, | 39 | from . import renamed as bees # F401: add to __all__ | ^^^^ - | help: Remove unused import: `.renamed` | 38 | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_26__all_empty____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_26__all_empty____init__.py.snap index 516626dbdcb254..21fc5fb21f461f 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_26__all_empty____init__.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_26__all_empty____init__.py.snap @@ -6,7 +6,6 @@ F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, | 5 | from . import unused # F401: add to __all__ | ^^^^^^ - | help: Remove unused import: `.unused` | 4 | @@ -20,7 +19,6 @@ F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, | 8 | from . import renamed as bees # F401: add to __all__ | ^^^^ - | help: Remove unused import: `.renamed` | 7 | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_27__all_mistyped____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_27__all_mistyped____init__.py.snap index e88d779f9171af..8d7f2d9e1454ce 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_27__all_mistyped____init__.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_27__all_mistyped____init__.py.snap @@ -6,7 +6,6 @@ F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, | 5 | from . import unused # F401: recommend add to all w/o fix | ^^^^^^ - | help: Remove unused import: `.unused` | 4 | @@ -20,7 +19,6 @@ F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, | 8 | from . import renamed as bees # F401: recommend add to all w/o fix | ^^^^ - | help: Remove unused import: `.renamed` | 7 | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_28__all_multiple____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_28__all_multiple____init__.py.snap index addc9a5aaebf67..16ba6bec64de1e 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_28__all_multiple____init__.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_28__all_multiple____init__.py.snap @@ -6,7 +6,6 @@ F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, | 5 | from . import unused, renamed as bees # F401: add to __all__ | ^^^^^^ - | help: Remove unused import | 4 | @@ -20,7 +19,6 @@ F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, | 5 | from . import unused, renamed as bees # F401: add to __all__ | ^^^^ - | help: Remove unused import | 4 | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_30.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_30.py.snap index 790c201d634d79..4890e7032d02a2 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_30.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_deprecated_option_F401_30.py.snap @@ -8,7 +8,6 @@ F401 [*] `.main.MaμToMan` imported but unused 5 | 6 | from .main import MaµToMan | ^^^^^^^^ - | help: Remove unused import: `.main.MaμToMan` | 5 | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_24____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_24____init__.py.snap index e1c221c259036a..3f177105c64055 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_24____init__.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_24____init__.py.snap @@ -6,7 +6,6 @@ F401 `sys` imported but unused | 19 | import sys # F401: remove unused | ^^^ - | help: Remove unused import: `sys` F401 `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias @@ -14,7 +13,6 @@ F401 `.unused` imported but unused; consider removing, adding to `__all__`, or u | 33 | from . import unused # F401: change to redundant alias | ^^^^^^ - | help: Use an explicit re-export: `unused as unused` F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias @@ -22,5 +20,4 @@ F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or | 36 | from . import renamed as bees # F401: no fix | ^^^^ - | help: Use an explicit re-export: `renamed as renamed` diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_25__all_nonempty____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_25__all_nonempty____init__.py.snap index 778c49ba2dd781..83adc9af29c6be 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_25__all_nonempty____init__.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_25__all_nonempty____init__.py.snap @@ -6,7 +6,6 @@ F401 `sys` imported but unused | 19 | import sys # F401: remove unused | ^^^ - | help: Remove unused import: `sys` F401 `.unused` imported but unused; consider removing, adding to `__all__`, or using a redundant alias @@ -14,7 +13,6 @@ F401 `.unused` imported but unused; consider removing, adding to `__all__`, or u | 36 | from . import unused # F401: add to __all__ | ^^^^^^ - | help: Add unused import `unused` to __all__ F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias @@ -22,5 +20,4 @@ F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or | 39 | from . import renamed as bees # F401: add to __all__ | ^^^^ - | help: Add unused import `bees` to __all__ diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_26__all_empty____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_26__all_empty____init__.py.snap index 24e342c8ae9aaa..1af39f649f861f 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_26__all_empty____init__.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_26__all_empty____init__.py.snap @@ -6,7 +6,6 @@ F401 `.unused` imported but unused; consider removing, adding to `__all__`, or u | 5 | from . import unused # F401: add to __all__ | ^^^^^^ - | help: Add unused import `unused` to __all__ F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias @@ -14,5 +13,4 @@ F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or | 8 | from . import renamed as bees # F401: add to __all__ | ^^^^ - | help: Add unused import `bees` to __all__ diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_27__all_mistyped____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_27__all_mistyped____init__.py.snap index f74e91a35b07fb..ecf9aa9a4c87d0 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_27__all_mistyped____init__.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_27__all_mistyped____init__.py.snap @@ -6,7 +6,6 @@ F401 `.unused` imported but unused; consider removing, adding to `__all__`, or u | 5 | from . import unused # F401: recommend add to all w/o fix | ^^^^^^ - | help: Add unused import `unused` to __all__ F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias @@ -14,5 +13,4 @@ F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or | 8 | from . import renamed as bees # F401: recommend add to all w/o fix | ^^^^ - | help: Add unused import `bees` to __all__ diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_28__all_multiple____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_28__all_multiple____init__.py.snap index 011604a75cacc9..8ad4915685ac5f 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_28__all_multiple____init__.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F401_stable_F401_28__all_multiple____init__.py.snap @@ -6,7 +6,6 @@ F401 `.unused` imported but unused; consider removing, adding to `__all__`, or u | 5 | from . import unused, renamed as bees # F401: add to __all__ | ^^^^^^ - | help: Add unused import `unused` to __all__ F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias @@ -14,5 +13,4 @@ F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or | 5 | from . import unused, renamed as bees # F401: add to __all__ | ^^^^ - | help: Add unused import `bees` to __all__ diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F404_F404_1.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F404_F404_1.py.snap index af21b5f916cea5..3fe4b7633c5e7b 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F404_F404_1.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F404_F404_1.py.snap @@ -8,4 +8,3 @@ F404 `from __future__` imports must occur at the beginning of the file 4 | 5 | from __future__ import absolute_import | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F405_F405.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F405_F405.py.snap index 382d83dce7e8a6..3a6dad16aa0e00 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F405_F405.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F405_F405.py.snap @@ -7,7 +7,6 @@ F405 `name` may be undefined, or defined from star imports 4 | def print_name(): 5 | print(name) | ^^^^ - | F405 `a` may be undefined, or defined from star imports --> F405.py:11:12 @@ -16,4 +15,3 @@ F405 `a` may be undefined, or defined from star imports 10 | 11 | __all__ = ['a'] | ^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F406_F406.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F406_F406.py.snap index e09f491710c76e..140e3fc15fef8d 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F406_F406.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F406_F406.py.snap @@ -7,7 +7,6 @@ F406 `from F634 import *` only allowed at module level 4 | def f(): 5 | from F634 import * | ^^^^^^^^^^^^^^^^^^ - | F406 `from F634 import *` only allowed at module level --> F406.py:9:5 @@ -15,4 +14,3 @@ F406 `from F634 import *` only allowed at module level 8 | class F: 9 | from F634 import * | ^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F407_F407.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F407_F407.py.snap index 8354bd98846477..29d6963cb84252 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F407_F407.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F407_F407.py.snap @@ -7,4 +7,3 @@ F407 Future feature `non_existent_feature` is not defined 1 | from __future__ import print_function 2 | from __future__ import non_existent_feature | ^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F502_F502.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F502_F502.py.snap index 25dc86c08024e8..0d2d35cfe3af2b 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F502_F502.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F502_F502.py.snap @@ -73,4 +73,3 @@ F502 `%`-format string expected mapping but got sequence 12 | "%(bob)s" % ("bob" for _ in range(1)) # F202 13 | "%(bob)s" % {"bob" for _ in range(1)} # F202 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F504_F504.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F504_F504.py.snap index 6081ba998f2920..235818bb478dc2 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F504_F504.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F504_F504.py.snap @@ -97,7 +97,6 @@ F504 [*] `%`-format string has unused named argument(s): greeting 19 | # https://github.com/astral-sh/ruff/issues/18806 20 | "Hello, %(name)s" % {"greeting": print(1), "name": "World"} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove extra named arguments: greeting | 19 | # https://github.com/astral-sh/ruff/issues/18806 diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F522_F522.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F522_F522.py.snap index aeed0515b844be..a6145805a113e7 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F522_F522.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F522_F522.py.snap @@ -97,7 +97,6 @@ F522 [*] `.format` call has unused named argument(s): greeting 13 | # even though the used argument has a side effect 14 | "Hello, {name}".format(greeting="Pikachu", name=print(1)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove extra named arguments: greeting | 13 | # even though the used argument has a side effect diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F523_F523.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F523_F523.py.snap index f48432893c398b..2c19fe4263474a 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F523_F523.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F523_F523.py.snap @@ -308,7 +308,6 @@ F523 [*] `.format` call has unused arguments at position(s): 1 44 | # even though the used argument has a side effect 45 | "Hello, {0}".format(print(1), "Pikachu") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove extra positional arguments at position(s): 1 | 44 | # even though the used argument has a side effect diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F524_F524.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F524_F524.py.snap index fa097d75ffe81a..5404e9baac3200 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F524_F524.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F524_F524.py.snap @@ -70,4 +70,3 @@ F524 `.format` call is missing argument(s) for placeholder(s): 8 6 | "{bar} {0}".format() # F524 7 | "{1} {8}".format(0, 1) | ^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F525_F525.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F525_F525.py.snap index c6a8823ae10745..00c2da21e341ae 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F525_F525.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F525_F525.py.snap @@ -15,4 +15,3 @@ F525 `.format` string mixes automatic and manual numbering 1 | "{} {1}".format(1, 2) # F525 2 | "{0} {}".format(1, 2) # F523, F525 | ^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F541_F541.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F541_F541.py.snap index 7c9d0e3f86648e..07437d8d121af0 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F541_F541.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F541_F541.py.snap @@ -346,7 +346,6 @@ F541 [*] f-string without any placeholders 43 | f"{v:{f"0.2f"}}" 44 | f"\{{x}}" | ^^^^^^^^^ - | help: Remove extraneous `f` prefix | 43 | f"{v:{f"0.2f"}}" diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F601_F601.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F601_F601.py.snap index 578c2389f79776..bbf24bc6699220 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F601_F601.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F601_F601.py.snap @@ -457,5 +457,4 @@ F601 Dictionary key literal `-1 + 2j` repeated 81 | x = {-1 + 0j: 1, -1: 2} 82 | x = {-1 + 2j: 1, -1 + 2j: 2} | ^^^^^^^ - | help: Remove repeated key literal `-1 + 2j` diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F602_F602.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F602_F602.py.snap index bce704d0d61bd2..2e225de3318a91 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F602_F602.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F602_F602.py.snap @@ -237,7 +237,6 @@ F602 [*] Dictionary key `a` repeated 44 | x = {a: 1, a: 1} 45 | x = {a: 1, b: 2, a: 1} | ^ - | help: Remove repeated key `a` | 44 | x = {a: 1, a: 1} diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F632_F632.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F632_F632.py.snap index b508949bb4783f..e1df6b06eefd00 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F632_F632.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F632_F632.py.snap @@ -200,7 +200,6 @@ F632 [*] Use `!=` to compare constant literals 33 | # Regression test for https://github.com/astral-sh/ruff/issues/11736 34 | variable: "123 is not y" | ^^^^^^^^^^^^ - | help: Replace `is not` with `!=` | 33 | # Regression test for https://github.com/astral-sh/ruff/issues/11736 diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F633_F633.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F633_F633.py.snap index 3e06e1bd63818e..ffa298a8b9c6bc 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F633_F633.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F633_F633.py.snap @@ -8,4 +8,3 @@ F633 Use of `>>` is invalid with `print` function 3 | 4 | print >> sys.stderr, "Hello" | ^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F701_F701.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F701_F701.py.snap index cd32ed927cdece..0f0bc73ada147a 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F701_F701.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F701_F701.py.snap @@ -19,7 +19,6 @@ F701 `break` outside loop 15 | 16 | break | ^^^^^ - | F701 `break` outside loop --> F701.py:20:5 @@ -27,11 +26,9 @@ F701 `break` outside loop 19 | class Foo: 20 | break | ^^^^^ - | F701 `break` outside loop --> F701.py:23:1 | 23 | break | ^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F702_F702.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F702_F702.py.snap index 5e121ca2c767a7..08b50691c3611d 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F702_F702.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F702_F702.py.snap @@ -19,7 +19,6 @@ F702 `continue` not properly in loop 15 | 16 | continue | ^^^^^^^^ - | F702 `continue` not properly in loop --> F702.py:20:5 @@ -27,11 +26,9 @@ F702 `continue` not properly in loop 19 | class Foo: 20 | continue | ^^^^^^^^ - | F702 `continue` not properly in loop --> F702.py:23:1 | 23 | continue | ^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F704_F704.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F704_F704.py.snap index 8d3bff4284454f..5c2625256bc235 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F704_F704.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F704_F704.py.snap @@ -7,7 +7,6 @@ F704 `yield` statement outside of a function 5 | class Foo: 6 | yield 2 | ^^^^^^^ - | F704 `yield` statement outside of a function --> F704.py:9:1 diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F706_F706.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F706_F706.py.snap index a547bebd4fbaff..79dac06195acc9 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F706_F706.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F706_F706.py.snap @@ -7,11 +7,9 @@ F706 `return` statement outside of a function/method 5 | class Foo: 6 | return 2 | ^^^^^^^^ - | F706 `return` statement outside of a function/method --> F706.py:9:1 | 9 | return 3 | ^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F722_F722.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F722_F722.py.snap index 674c6f2bf292bc..64174f43f5ed81 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F722_F722.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F722_F722.py.snap @@ -72,4 +72,3 @@ F722 Syntax error in forward annotation: unexpected EOF while parsing 43 | | (int 44 | | """ | |___^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F722_F722_1.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F722_F722_1.py.snap index c01fb48cff15be..cab059100bf2a7 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F722_F722_1.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F722_F722_1.py.snap @@ -28,4 +28,3 @@ F722 Syntax error in forward annotation: Unexpected token at the end of an expre 8 | def f(self, arg: "this isn't python") -> "this isn't python either": 9 | x: "this also isn't python" = 1 | ^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_1.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_1.py.snap index 5b01c3bdc78396..212ac462492312 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_1.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_1.py.snap @@ -8,5 +8,4 @@ F811 Redefinition of unused `FU` from line 1 | -- ^^ `FU` redefined here | | | previous definition of `FU` here - | help: Remove definition: `FU` diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_15.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_15.py.snap index e48bf8e55ed591..01628182ea2b8a 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_15.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_15.py.snap @@ -12,5 +12,4 @@ F811 Redefinition of unused `fu` from line 1 | 1 | import fu | -- previous definition of `fu` here - | help: Remove definition: `fu` diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_16.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_16.py.snap index 704155bf81c735..da83aef0db0705 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_16.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_16.py.snap @@ -16,5 +16,4 @@ F811 Redefinition of unused `fu` from line 3 2 | 3 | import fu | -- previous definition of `fu` here - | help: Remove definition: `fu` diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_17.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_17.py.snap index 67cc97dd619cd7..14f6d26008f5e1 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_17.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_17.py.snap @@ -15,7 +15,6 @@ F811 [*] Redefinition of unused `fu` from line 2 1 | """Test that shadowing a global name with a nested function generates a warning.""" 2 | import fu | -- previous definition of `fu` here - | help: Remove definition: `fu` | 5 | def bar(): diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_2.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_2.py.snap index 7aa2e1019d4b60..e6309bb0ba9f6c 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_2.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_2.py.snap @@ -8,5 +8,4 @@ F811 Redefinition of unused `FU` from line 1 | -- ^^ `FU` redefined here | | | previous definition of `FU` here - | help: Remove definition: `FU` diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_23.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_23.py.snap index 46b25514272579..aa058c6d541cef 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_23.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_23.py.snap @@ -10,5 +10,4 @@ F811 Redefinition of unused `foo` from line 3 | --- previous definition of `foo` here 4 | import bar as foo | ^^^ `foo` redefined here - | help: Remove definition: `foo` diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_29.pyi.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_29.pyi.snap index a7e005d2693a0a..eb5061deba8162 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_29.pyi.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_29.pyi.snap @@ -14,5 +14,4 @@ F811 Redefinition of unused `Bar` from line 3 7 | 8 | Bar = 1 # F811 | ^^^ `Bar` redefined here - | help: Remove definition: `Bar` diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_3.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_3.py.snap index df164062ceadb6..ee44272684f1c9 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_3.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_3.py.snap @@ -8,5 +8,4 @@ F811 Redefinition of unused `fu` from line 1 | -- ^^ `fu` redefined here | | | previous definition of `fu` here - | help: Remove definition: `fu` diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_30.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_30.py.snap index d0de3c478622ba..0a74a323afc292 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_30.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_30.py.snap @@ -26,7 +26,6 @@ F811 Redefinition of unused `baz` from line 18 20 | 21 | baz = 1 | ^^^ `baz` redefined here - | help: Remove definition: `baz` F811 Redefinition of unused `foo` from line 26 @@ -40,5 +39,4 @@ F811 Redefinition of unused `foo` from line 26 28 | 29 | bar = (foo := 1) | ^^^ `foo` redefined here - | help: Remove definition: `foo` diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_35.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_35.py.snap index 1225c076660240..66cabac4c137ab 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_35.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_35.py.snap @@ -10,7 +10,6 @@ F811 Redefinition of unused `bar` from line 7 8 | 9 | def bar(self): ... | ^^^ `bar` redefined here - | help: Remove definition: `bar` F811 Redefinition of unused `bar` from line 3 @@ -25,5 +24,4 @@ F811 Redefinition of unused `bar` from line 3 2 | 3 | from foo import bar | --- previous definition of `bar` here - | help: Remove definition: `bar` diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_4.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_4.py.snap index 0148e0bde126ca..40ee8788a6e764 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_4.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_4.py.snap @@ -8,5 +8,4 @@ F811 Redefinition of unused `fu` from line 1 | -- ^^ `fu` redefined here | | | previous definition of `fu` here - | help: Remove definition: `fu` diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_5.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_5.py.snap index 420172d79e8a51..1b2aa78997ef76 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_5.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_5.py.snap @@ -8,5 +8,4 @@ F811 Redefinition of unused `fu` from line 1 | -- ^^ `fu` redefined here | | | previous definition of `fu` here - | help: Remove definition: `fu` diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_0.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_0.py.snap index fd16a708277618..f8851825ef5059 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_0.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_0.py.snap @@ -7,7 +7,6 @@ F821 Undefined name `self` 1 | def get_name(): 2 | return self.name | ^^^^ - | F821 Undefined name `self` --> F821_0.py:6:13 @@ -15,7 +14,6 @@ F821 Undefined name `self` 5 | def get_name(): 6 | return (self.name,) | ^^^^ - | F821 Undefined name `self` --> F821_0.py:10:9 @@ -23,7 +21,6 @@ F821 Undefined name `self` 9 | def get_name(): 10 | del self.name | ^^^^ - | F821 Undefined name `numeric_string` --> F821_0.py:21:12 @@ -31,7 +28,6 @@ F821 Undefined name `numeric_string` 20 | def randdec(maxprec, maxexp): 21 | return numeric_string(maxprec, maxexp) | ^^^^^^^^^^^^^^ - | F821 Undefined name `Bar` --> F821_0.py:58:5 diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_1.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_1.py.snap index 7df73254f352a3..9121c32648d037 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_1.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_1.py.snap @@ -7,7 +7,6 @@ F821 Undefined name `Model` 10 | # F821 Undefined name `Model` 11 | x = cast("Model", x) | ^^^^^ - | F821 Undefined name `Model` --> F821_1.py:18:18 @@ -15,7 +14,6 @@ F821 Undefined name `Model` 17 | # F821 Undefined name `Model` 18 | x = typing.cast("Model", x) | ^^^^^ - | F821 Undefined name `Model` --> F821_1.py:24:14 @@ -23,7 +21,6 @@ F821 Undefined name `Model` 23 | # F821 Undefined name `Model` 24 | x = Pattern["Model"] | ^^^^^ - | F821 Undefined name `Model` --> F821_1.py:30:12 @@ -31,4 +28,3 @@ F821 Undefined name `Model` 29 | # F821 Undefined name `Model` 30 | x = Match["Model"] | ^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_11.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_11.py.snap index 18a0d3e8591578..d1c26106f9dac7 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_11.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_11.py.snap @@ -15,4 +15,3 @@ F821 Undefined name `Baz` 22 | f(Callable[["Bar"], None]) 23 | f(Callable[["Baz"], None]) | ^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_12.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_12.py.snap index fda19cffaf832b..b4cb736957c098 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_12.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_12.py.snap @@ -15,4 +15,3 @@ F821 Undefined name `Baz` 24 | f(Callable[["Bar"], None]) 25 | f(Callable[["Baz"], None]) | ^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_13.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_13.py.snap index 0b977f22139359..f9612cabf92df0 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_13.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_13.py.snap @@ -8,4 +8,3 @@ F821 Undefined name `List` 7 | 8 | Z = TypeVar("X", "List[int]", "int") | ^^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_17.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_17.py.snap index fbbd1996366ce3..08f808b86e8d1e 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_17.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_17.py.snap @@ -48,7 +48,6 @@ F821 Undefined name `T` 41 | def foo[T](t: T) -> None: ... 42 | T # F821: Undefined name `T` - not accessible afterward function scope | ^ - | F821 Undefined name `T` --> F821_17.py:64:17 diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_18.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_18.py.snap index 95d305eb2b0f38..33774006166dea 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_18.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_18.py.snap @@ -8,4 +8,3 @@ F821 Undefined name `y` 18 | x: (y := 1) 19 | print(y) | ^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_19.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_19.py.snap index 022fe287ba3398..189c092931b9e9 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_19.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_19.py.snap @@ -8,4 +8,3 @@ F821 Undefined name `y` 20 | x: (y := 1) 21 | print(y) | ^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_21.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_21.py.snap index 4e5196ca9d3822..c4de7079812f2b 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_21.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_21.py.snap @@ -7,4 +7,3 @@ F821 Undefined name `display` 3 | x = 1 4 | display(x) | ^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_28.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_28.py.snap index 348d12a4386598..80ca1633f45f1c 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_28.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_28.py.snap @@ -8,4 +8,3 @@ F821 Undefined name `𝒟` 8 | 9 | print(𝒟) # F821 | ^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_31.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_31.py.snap index c1a10a41ff16ce..9965d0a78f3aaf 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_31.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_31.py.snap @@ -28,7 +28,6 @@ F821 Undefined name `B` 8 | def f(self, arg: "B") -> "S": 9 | x: "B" = 1 | ^ - | F821 Undefined name `A` --> F821_31.py:15:13 @@ -55,4 +54,3 @@ F821 Undefined name `A` 15 | def f(arg: "A") -> "R": 16 | x: "A" = 1 | ^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_34.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_34.py.snap index e4a8c02b7edf1a..74562ee54e8f12 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_34.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_34.py.snap @@ -8,7 +8,6 @@ F821 Undefined name `x` 8 | x: int 9 | print(x) | ^ - | F821 Undefined name `x` --> F821_34.py:17:16 diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_34.pyi.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_34.pyi.snap index 25d450303719a5..ecadafcf34f1ae 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_34.pyi.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_34.pyi.snap @@ -18,4 +18,3 @@ F821 Undefined name `Undefined` 21 | # Error: name that was never defined 22 | def g(x: Undefined) -> None: ... # F821 | ^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_4.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_4.py.snap index dc5ceec156822c..3592edd5ebcb32 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_4.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_4.py.snap @@ -8,7 +8,6 @@ F821 Undefined name `Model` 3 | 4 | _ = List["Model"] | ^^^^^ - | F821 Undefined name `Model` --> F821_4.py:9:12 @@ -17,7 +16,6 @@ F821 Undefined name `Model` 8 | 9 | _ = IList["Model"] | ^^^^^ - | F821 Undefined name `Model` --> F821_4.py:14:16 @@ -26,7 +24,6 @@ F821 Undefined name `Model` 13 | 14 | _ = ItemsView["Model"] | ^^^^^ - | F821 Undefined name `Model` --> F821_4.py:19:32 @@ -35,7 +32,6 @@ F821 Undefined name `Model` 18 | 19 | _ = collections.abc.ItemsView["Model"] | ^^^^^ - | F821 Undefined name `Model` --> F821_4.py:24:20 @@ -44,4 +40,3 @@ F821 Undefined name `Model` 23 | 24 | _ = abc.ItemsView["Model"] | ^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_7.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_7.py.snap index a818f1c1f98a47..fbb5f6f6903f14 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_7.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_7.py.snap @@ -28,4 +28,3 @@ F821 Undefined name `Undefined` 12 | _ = DefaultNamedArg(type="Undefined", name="some_prop_name") 13 | _ = DefaultNamedArg("Undefined", "some_prop_name") | ^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_9.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_9.py.snap index ce557ed224219d..988f9cd443dbd7 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_9.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F821_F821_9.py.snap @@ -8,4 +8,3 @@ F821 Undefined name `captured` 21 | case True: 22 | return captured # F821 | ^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_0.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_0.py.snap index f75fb59fddd9f6..65aa9fbc90fec4 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_0.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_0.py.snap @@ -8,4 +8,3 @@ F822 Undefined name `b` in `__all__` 2 | 3 | __all__ = ["a", "b"] | ^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_0.pyi.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_0.pyi.snap index 761c68b678d16a..6afb496308e6e6 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_0.pyi.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_0.pyi.snap @@ -8,4 +8,3 @@ F822 Undefined name `c` in `__all__` 3 | 4 | __all__ = ["a", "b", "c"] # c is flagged as missing; b is not | ^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_1.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_1.py.snap index ead94dbcaaec85..69aa7d0528418a 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_1.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_1.py.snap @@ -8,4 +8,3 @@ F822 Undefined name `b` in `__all__` 2 | 3 | __all__ = list(["a", "b"]) | ^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_1b.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_1b.py.snap index aa41c02a6f1ce6..b683b34ad93fb6 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_1b.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F822_F822_1b.py.snap @@ -8,4 +8,3 @@ F822 Undefined name `b` in `__all__` 3 | 4 | __all__ = builtins.list(["a", "b"]) | ^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F823_F823.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F823_F823.py.snap index 4fded2b2fba0ee..ba3860ea884582 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F823_F823.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F823_F823.py.snap @@ -7,7 +7,6 @@ F823 Local variable `my_var` referenced before assignment 5 | def foo(): 6 | my_var += 1 | ^^^^^^ - | F823 Local variable `my_var` referenced before assignment --> F823.py:32:15 diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_0.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_0.py.snap index 5a8ebc4758d50a..203edd2357aab0 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_0.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_0.py.snap @@ -25,7 +25,6 @@ F841 [*] Local variable `z` is assigned to but never used 15 | y = 2 16 | z = x + y | ^ - | help: Remove assignment to unused variable `z` | 15 | y = 2 @@ -96,7 +95,6 @@ F841 [*] Local variable `baz` is assigned to but never used 25 | 26 | (x, y) = baz = bar | ^^^ - | help: Remove assignment to unused variable `baz` | 25 | @@ -226,7 +224,6 @@ F841 [*] Local variable `__class__` is assigned to but never used 167 | def set_class(self, cls): 168 | __class__ = cls # F841 | ^^^^^^^^^ - | help: Remove assignment to unused variable `__class__` | 167 | def set_class(self, cls): @@ -243,7 +240,6 @@ F841 [*] Local variable `__class__` is assigned to but never used 173 | def set_class(self, cls): 174 | __class__ = cls # F841 | ^^^^^^^^^ - | help: Remove assignment to unused variable `__class__` | 173 | def set_class(self, cls): @@ -260,7 +256,6 @@ F841 [*] Local variable `__class__` is assigned to but never used 181 | def set_class(self, cls): 182 | __class__ = cls # F841 | ^^^^^^^^^ - | help: Remove assignment to unused variable `__class__` | 181 | def set_class(self, cls): diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_1.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_1.py.snap index 01d3b6b092275c..796f69c96d87f0 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_1.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_1.py.snap @@ -7,7 +7,6 @@ F841 [*] Local variable `x` is assigned to but never used 5 | def f(): 6 | x, y = 1, 2 # this triggers F841 as it's just a simple assignment where unpacking isn't needed | ^ - | help: Remove assignment to unused variable `x` | 5 | def f(): @@ -23,7 +22,6 @@ F841 [*] Local variable `y` is assigned to but never used 5 | def f(): 6 | x, y = 1, 2 # this triggers F841 as it's just a simple assignment where unpacking isn't needed | ^ - | help: Remove assignment to unused variable `y` | 5 | def f(): @@ -39,7 +37,6 @@ F841 [*] Local variable `coords` is assigned to but never used 15 | def f(): 16 | (x, y) = coords = 1, 2 | ^^^^^^ - | help: Remove assignment to unused variable `coords` | 15 | def f(): @@ -55,7 +52,6 @@ F841 [*] Local variable `coords` is assigned to but never used 19 | def f(): 20 | coords = (x, y) = 1, 2 | ^^^^^^ - | help: Remove assignment to unused variable `coords` | 19 | def f(): @@ -71,7 +67,6 @@ F841 [*] Local variable `a` is assigned to but never used 23 | def f(): 24 | (a, b) = (x, y) = 1, 2 # this triggers F841 on everything | ^ - | help: Remove assignment to unused variable `a` | 23 | def f(): @@ -86,7 +81,6 @@ F841 [*] Local variable `b` is assigned to but never used 23 | def f(): 24 | (a, b) = (x, y) = 1, 2 # this triggers F841 on everything | ^ - | help: Remove assignment to unused variable `b` | 23 | def f(): @@ -101,7 +95,6 @@ F841 [*] Local variable `x` is assigned to but never used 23 | def f(): 24 | (a, b) = (x, y) = 1, 2 # this triggers F841 on everything | ^ - | help: Remove assignment to unused variable `x` | 23 | def f(): @@ -116,7 +109,6 @@ F841 [*] Local variable `y` is assigned to but never used 23 | def f(): 24 | (a, b) = (x, y) = 1, 2 # this triggers F841 on everything | ^ - | help: Remove assignment to unused variable `y` | 23 | def f(): diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_3.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_3.py.snap index 519c1a35918dc2..50f8c9deb6906c 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_3.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F841_F841_3.py.snap @@ -201,7 +201,6 @@ F841 [*] Local variable `coords3` is assigned to but never used 33 | (x2, y2) = coords2 = (1, 2) 34 | coords3 = (x3, y3) = (1, 2) | ^^^^^^^ - | help: Remove assignment to unused variable `coords3` | 33 | (x2, y2) = coords2 = (1, 2) @@ -396,7 +395,6 @@ F841 [*] Local variable `toplevel` is assigned to but never used 97 | def f(): 98 | toplevel = tt = lexer.get_token() | ^^^^^^^^ - | help: Remove assignment to unused variable `toplevel` | 97 | def f(): @@ -412,7 +410,6 @@ F841 [*] Local variable `tt` is assigned to but never used 97 | def f(): 98 | toplevel = tt = lexer.get_token() | ^^ - | help: Remove assignment to unused variable `tt` | 97 | def f(): @@ -428,7 +425,6 @@ F841 [*] Local variable `toplevel` is assigned to but never used 101 | def f(): 102 | toplevel = (a, b) = lexer.get_token() | ^^^^^^^^ - | help: Remove assignment to unused variable `toplevel` | 101 | def f(): @@ -444,7 +440,6 @@ F841 [*] Local variable `toplevel` is assigned to but never used 105 | def f(): 106 | (a, b) = toplevel = lexer.get_token() | ^^^^^^^^ - | help: Remove assignment to unused variable `toplevel` | 105 | def f(): @@ -460,7 +455,6 @@ F841 [*] Local variable `toplevel` is assigned to but never used 109 | def f(): 110 | toplevel = tt = 1 | ^^^^^^^^ - | help: Remove assignment to unused variable `toplevel` | 109 | def f(): @@ -476,7 +470,6 @@ F841 [*] Local variable `tt` is assigned to but never used 109 | def f(): 110 | toplevel = tt = 1 | ^^ - | help: Remove assignment to unused variable `tt` | 109 | def f(): @@ -592,7 +585,6 @@ F841 [*] Local variable `y` is assigned to but never used 160 | x = 1 161 | y = 2 | ^ - | help: Remove assignment to unused variable `y` | 160 | x = 1 @@ -625,7 +617,6 @@ F841 [*] Local variable `y` is assigned to but never used 166 | 167 | y = 2 | ^ - | help: Remove assignment to unused variable `y` | 166 | @@ -641,7 +632,6 @@ F841 [*] Local variable `x` is assigned to but never used 172 | ((x)) = foo() 173 | (x) = (y.z) = foo() | ^ - | help: Remove assignment to unused variable `x` | 172 | ((x)) = foo() diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F842_F842.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F842_F842.py.snap index 49b28284d852fb..b81e3bd265812d 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F842_F842.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F842_F842.py.snap @@ -17,4 +17,3 @@ F842 Local variable `age` is annotated but never used 2 | name: str 3 | age: int | ^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F901_F901.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F901_F901.py.snap index 50ca752ceb41b6..a4bbb7c51fcfe3 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F901_F901.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F901_F901.py.snap @@ -7,7 +7,6 @@ F901 [*] `raise NotImplemented` should be `raise NotImplementedError` 1 | def f() -> None: 2 | raise NotImplemented() | ^^^^^^^^^^^^^^ - | help: Use `raise NotImplementedError` | 1 | def f() -> None: @@ -22,7 +21,6 @@ F901 [*] `raise NotImplemented` should be `raise NotImplementedError` 5 | def g() -> None: 6 | raise NotImplemented | ^^^^^^^^^^^^^^ - | help: Use `raise NotImplementedError` | 5 | def g() -> None: @@ -38,7 +36,6 @@ F901 [*] `raise NotImplemented` should be `raise NotImplementedError` 10 | NotImplementedError = "foo" 11 | raise NotImplemented | ^^^^^^^^^^^^^^ - | help: Use `raise NotImplementedError` | 1 + import builtins diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__augmented_assignment_after_del.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__augmented_assignment_after_del.snap index bebb61100629a1..06c954b7d4bd8b 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__augmented_assignment_after_del.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__augmented_assignment_after_del.snap @@ -8,7 +8,6 @@ F821 Undefined name `x` 9 | # error, because the name is defined in the scope, but unbound. 10 | x += 1 | ^ - | F841 Local variable `x` is assigned to but never used --> :10:5 @@ -17,5 +16,4 @@ F841 Local variable `x` is assigned to but never used 9 | # error, because the name is defined in the scope, but unbound. 10 | x += 1 | ^ - | help: Remove assignment to unused variable `x` diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__default_builtins.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__default_builtins.snap index 3f863c9e60495e..63b018cd5fc523 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__default_builtins.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__default_builtins.snap @@ -6,4 +6,3 @@ F821 Undefined name `_` | 1 | _("Translations") | ^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__double_del.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__double_del.snap index 51dc063477c43c..f37a84f0851abf 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__double_del.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__double_del.snap @@ -8,4 +8,3 @@ F821 Undefined name `x` 4 | del x 5 | del x | ^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__extra_typing_modules.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__extra_typing_modules.snap index 3fcb7752c85ec8..d73e83eaa736ef 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__extra_typing_modules.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__extra_typing_modules.snap @@ -7,4 +7,3 @@ F821 Undefined name `Class` 6 | X = Union[Literal[False], Literal["db"]] 7 | y = Optional["Class"] | ^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_allowed_unused_imports_option.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_allowed_unused_imports_option.snap index 97bb10e95d1bf4..52fe179d2b6aec 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_allowed_unused_imports_option.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_allowed_unused_imports_option.snap @@ -7,7 +7,6 @@ F401 [*] `hvplot.pandas_alias.scatter_matrix` imported but unused 11 | # Errors 12 | from hvplot.pandas_alias import scatter_matrix | ^^^^^^^^^^^^^^ - | help: Remove unused import: `hvplot.pandas_alias.scatter_matrix` | 11 | # Errors diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_multiple_unused_submodules.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_multiple_unused_submodules.snap index e71f1d6489f188..b6107c54f5c58a 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_multiple_unused_submodules.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_multiple_unused_submodules.snap @@ -38,7 +38,6 @@ F401 [*] `a.c` imported but unused 3 | import a.b 4 | import a.c | ^^^ - | help: Remove unused import: `a.c` | 3 | import a.b diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_preview_first_party_submodule_no_dunder_all.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_preview_first_party_submodule_no_dunder_all.snap index 1c463aa7e2ed74..a3bee1b71bd907 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_preview_first_party_submodule_no_dunder_all.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_preview_first_party_submodule_no_dunder_all.snap @@ -6,5 +6,4 @@ F401 `submodule.a` imported but unused; consider removing, adding to `__all__`, | 1 | import submodule.a | ^^^^^^^^^^^ - | help: Use an explicit re-export: `import submodule as submodule; import submodule.a` diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_type_checking.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_type_checking.snap index 58dd09d89ef864..5a4fdbc283418e 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_type_checking.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f401_type_checking.snap @@ -54,7 +54,6 @@ F401 [*] `mlflow.pyfunc.loaders.responses_agent` imported but unused 7 | if IS_PYDANTIC_V2_OR_NEWER: 8 | import mlflow.pyfunc.loaders.responses_agent | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove unused import: `mlflow.pyfunc.loaders.responses_agent` | 7 | if IS_PYDANTIC_V2_OR_NEWER: diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f821_frozendict_pre_py315_undefined.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f821_frozendict_pre_py315_undefined.snap index 544b0efd4acfb0..4a6ea72cda1fc2 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f821_frozendict_pre_py315_undefined.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f821_frozendict_pre_py315_undefined.snap @@ -6,4 +6,3 @@ F821 Undefined name `frozendict`. Consider specifying `requires-python = ">= 3.1 | 1 | frozendict | ^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f821_with_builtin_added_on_new_py_version_but_old_target_version_specified.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f821_with_builtin_added_on_new_py_version_but_old_target_version_specified.snap index 072e06e5ef2575..95e471d5a4b5fb 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f821_with_builtin_added_on_new_py_version_but_old_target_version_specified.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f821_with_builtin_added_on_new_py_version_but_old_target_version_specified.snap @@ -6,4 +6,3 @@ F821 Undefined name `PythonFinalizationError`. Consider specifying `requires-pyt | 1 | PythonFinalizationError | ^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f841_dummy_variable_rgx.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f841_dummy_variable_rgx.snap index d798a874916a39..c0080449f792e0 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f841_dummy_variable_rgx.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f841_dummy_variable_rgx.snap @@ -65,7 +65,6 @@ F841 [*] Local variable `baz` is assigned to but never used 25 | 26 | (x, y) = baz = bar | ^^^ - | help: Remove assignment to unused variable `baz` | 25 | @@ -116,7 +115,6 @@ F841 [*] Local variable `_discarded` is assigned to but never used 36 | __ = 1 37 | _discarded = 1 | ^^^^^^^^^^ - | help: Remove assignment to unused variable `_discarded` | 36 | __ = 1 @@ -262,7 +260,6 @@ F841 [*] Local variable `__class__` is assigned to but never used 167 | def set_class(self, cls): 168 | __class__ = cls # F841 | ^^^^^^^^^ - | help: Remove assignment to unused variable `__class__` | 167 | def set_class(self, cls): @@ -279,7 +276,6 @@ F841 [*] Local variable `__class__` is assigned to but never used 173 | def set_class(self, cls): 174 | __class__ = cls # F841 | ^^^^^^^^^ - | help: Remove assignment to unused variable `__class__` | 173 | def set_class(self, cls): @@ -296,7 +292,6 @@ F841 [*] Local variable `__class__` is assigned to but never used 181 | def set_class(self, cls): 182 | __class__ = cls # F841 | ^^^^^^^^^ - | help: Remove assignment to unused variable `__class__` | 181 | def set_class(self, cls): diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__load_after_unbind_from_class_scope.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__load_after_unbind_from_class_scope.snap index 92d61b65c5f88b..40050a846a5f9d 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__load_after_unbind_from_class_scope.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__load_after_unbind_from_class_scope.snap @@ -25,4 +25,3 @@ F821 Undefined name `x` 12 | # `x` in `x = 1`. 13 | print(x) | ^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__multi_statement_lines.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__multi_statement_lines.snap index 6901f7080a4b2c..7a2cac0005110c 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__multi_statement_lines.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__multi_statement_lines.snap @@ -75,7 +75,6 @@ F401 [*] `foo5` imported but unused 13 | if True: 14 | x = 1; import foo5 | ^^^^ - | help: Remove unused import: `foo5` | 13 | if True: @@ -216,7 +215,6 @@ F401 [*] `foo13` imported but unused 46 | \ 47 | import foo13 | ^^^^^ - | help: Remove unused import: `foo13` | 44 | if True: @@ -270,7 +268,6 @@ F401 [*] `foo16` imported but unused 61 | x = 1; \ 62 | import foo16 | ^^^^^ - | help: Remove unused import: `foo16` | 60 | # error.) diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__nested_relative_typing_module.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__nested_relative_typing_module.snap index d9bbd4c321ab89..bc6c7578f7b476 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__nested_relative_typing_module.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__nested_relative_typing_module.snap @@ -7,7 +7,6 @@ F821 Undefined name `foo` 25 | # F821 26 | x: Literal["foo"] | ^^^ - | F821 Undefined name `foo` --> baz.py:33:17 @@ -15,4 +14,3 @@ F821 Undefined name `foo` 32 | # F821 33 | x: Literal["foo"] | ^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_24____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_24____init__.py.snap index 70a444af06a7cc..b5dc23d607b5cc 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_24____init__.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_24____init__.py.snap @@ -6,7 +6,6 @@ F401 [*] `sys` imported but unused | 19 | import sys # F401: remove unused | ^^^ - | help: Remove unused import: `sys` | 18 | @@ -20,7 +19,6 @@ F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, | 33 | from . import unused # F401: change to redundant alias | ^^^^^^ - | help: Use an explicit re-export: `unused as unused` | 32 | @@ -34,5 +32,4 @@ F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or | 36 | from . import renamed as bees # F401: no fix | ^^^^ - | help: Use an explicit re-export: `renamed as renamed` diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_25__all_nonempty____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_25__all_nonempty____init__.py.snap index 3c2df7928880ef..23c50e1af716d6 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_25__all_nonempty____init__.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_25__all_nonempty____init__.py.snap @@ -6,7 +6,6 @@ F401 [*] `sys` imported but unused | 19 | import sys # F401: remove unused | ^^^ - | help: Remove unused import: `sys` | 18 | @@ -20,7 +19,6 @@ F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, | 36 | from . import unused # F401: add to __all__ | ^^^^^^ - | help: Add unused import `unused` to __all__ | 41 | @@ -33,7 +31,6 @@ F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, | 39 | from . import renamed as bees # F401: add to __all__ | ^^^^ - | help: Add unused import `bees` to __all__ | 41 | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_26__all_empty____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_26__all_empty____init__.py.snap index 1a89b8c282e9aa..83b777d7788e34 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_26__all_empty____init__.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_26__all_empty____init__.py.snap @@ -6,7 +6,6 @@ F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, | 5 | from . import unused # F401: add to __all__ | ^^^^^^ - | help: Add unused import `unused` to __all__ | 10 | @@ -19,7 +18,6 @@ F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, | 8 | from . import renamed as bees # F401: add to __all__ | ^^^^ - | help: Add unused import `bees` to __all__ | 10 | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_27__all_mistyped____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_27__all_mistyped____init__.py.snap index f74e91a35b07fb..ecf9aa9a4c87d0 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_27__all_mistyped____init__.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_27__all_mistyped____init__.py.snap @@ -6,7 +6,6 @@ F401 `.unused` imported but unused; consider removing, adding to `__all__`, or u | 5 | from . import unused # F401: recommend add to all w/o fix | ^^^^^^ - | help: Add unused import `unused` to __all__ F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or using a redundant alias @@ -14,5 +13,4 @@ F401 `.renamed` imported but unused; consider removing, adding to `__all__`, or | 8 | from . import renamed as bees # F401: recommend add to all w/o fix | ^^^^ - | help: Add unused import `bees` to __all__ diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_28__all_multiple____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_28__all_multiple____init__.py.snap index f10b248c21e996..40f374f67158d0 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_28__all_multiple____init__.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_28__all_multiple____init__.py.snap @@ -6,7 +6,6 @@ F401 [*] `.unused` imported but unused; consider removing, adding to `__all__`, | 5 | from . import unused, renamed as bees # F401: add to __all__ | ^^^^^^ - | help: Add unused import `unused` to __all__ | 7 | @@ -19,7 +18,6 @@ F401 [*] `.renamed` imported but unused; consider removing, adding to `__all__`, | 5 | from . import unused, renamed as bees # F401: add to __all__ | ^^^^ - | help: Add unused import `bees` to __all__ | 7 | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_33____init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_33____init__.py.snap index a318d4b91d32ef..683e0d1da5f012 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_33____init__.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F401_F401_33____init__.py.snap @@ -8,7 +8,6 @@ F401 [*] `F401_33.other.Ham` imported but unused 7 | def __init__(self) -> None: 8 | from F401_33.other import Ham | ^^^ - | help: Remove unused import: `F401_33.other.Ham` | 7 | def __init__(self) -> None: diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F822___init__.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F822___init__.py.snap index fc93eac03eb5d0..3592f543aa0e3a 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F822___init__.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F822___init__.py.snap @@ -8,7 +8,6 @@ F822 Undefined name `a` in `__all__` 4 | 5 | __all__ = ["a", "b", "c"] | ^^^ - | F822 Undefined name `b` in `__all__` --> __init__.py:5:17 @@ -17,7 +16,6 @@ F822 Undefined name `b` in `__all__` 4 | 5 | __all__ = ["a", "b", "c"] | ^^^ - | F822 Undefined name `c` in `__all__` --> __init__.py:5:22 @@ -26,4 +24,3 @@ F822 Undefined name `c` in `__all__` 4 | 5 | __all__ = ["a", "b", "c"] | ^^^ - | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__relative_typing_module.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__relative_typing_module.snap index bb3c7028efba5c..bd00f6611e4be7 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__relative_typing_module.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__relative_typing_module.snap @@ -7,4 +7,3 @@ F821 Undefined name `foo` 25 | # F821 26 | x: Literal["foo"] | ^^^ - | diff --git a/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH004_PGH004_1.py.snap b/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH004_PGH004_1.py.snap index 5edca0674a3f0e..4ceb60c3033fa8 100644 --- a/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH004_PGH004_1.py.snap +++ b/crates/ruff_linter/src/rules/pygrep_hooks/snapshots/ruff_linter__rules__pygrep_hooks__tests__PGH004_PGH004_1.py.snap @@ -6,4 +6,3 @@ PGH004 Use specific rule codes when using `noqa` | 1 | #noqa | ^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0207_missing_maxsplit_arg.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0207_missing_maxsplit_arg.py.snap index 02ede363e5e71a..9909ef3078a4ae 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0207_missing_maxsplit_arg.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0207_missing_maxsplit_arg.py.snap @@ -621,7 +621,6 @@ PLC0207 [*] String is split more times than necessary 62 | SEQ.split("(")[0].split("[")[-1] # [missing-maxsplit-arg] 63 | SEQ.split("(")[0].split("[")[0].split(".")[-1] # [missing-maxsplit-arg] | ^^^^^^^^^^^^^^^^^ - | help: Pass `maxsplit=1` into `str.split()` | 62 | SEQ.split("(")[0].split("[")[-1] # [missing-maxsplit-arg] @@ -637,7 +636,6 @@ PLC0207 [*] String is split more times than necessary 62 | SEQ.split("(")[0].split("[")[-1] # [missing-maxsplit-arg] 63 | SEQ.split("(")[0].split("[")[0].split(".")[-1] # [missing-maxsplit-arg] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Pass `maxsplit=1` into `str.split()` | 62 | SEQ.split("(")[0].split("[")[-1] # [missing-maxsplit-arg] @@ -653,7 +651,6 @@ PLC0207 [*] String is split more times than necessary 62 | SEQ.split("(")[0].split("[")[-1] # [missing-maxsplit-arg] 63 | SEQ.split("(")[0].split("[")[0].split(".")[-1] # [missing-maxsplit-arg] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `str.rsplit()` and pass `maxsplit=1` | 62 | SEQ.split("(")[0].split("[")[-1] # [missing-maxsplit-arg] @@ -707,7 +704,6 @@ PLC0207 [*] String is split more times than necessary 188 | kwargs_with_maxsplit = {"sep": ",", "maxsplit": 1} 189 | "1,2,3".split(**kwargs_with_maxsplit)[0] # TODO: false positive | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Pass `maxsplit=1` into `str.split()` | 188 | kwargs_with_maxsplit = {"sep": ",", "maxsplit": 1} @@ -743,7 +739,6 @@ PLC0207 [*] String is split more times than necessary 198 | args_list = [-1] 199 | "1,2,3".split(",", *args_list)[0] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Pass `maxsplit=1` into `str.split()` | 198 | args_list = [-1] diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0415_import_outside_top_level.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0415_import_outside_top_level.py.snap index 7c8239ba65eaa0..d1af440947dd4a 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0415_import_outside_top_level.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC0415_import_outside_top_level.py.snap @@ -61,7 +61,6 @@ PLC0415 `import` should be at the top-level of a file 14 | from collections import defaultdict # [import-outside-toplevel] 15 | from math import sin as sign, cos as cosplay # [import-outside-toplevel] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | PLC0415 `import` should be at the top-level of a file --> import_outside_top_level.py:19:5 @@ -79,4 +78,3 @@ PLC0415 `import` should be at the top-level of a file 21 | def __init__(self): 22 | import trace # [import-outside-toplevel] | ^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC1802_len_as_condition.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC1802_len_as_condition.py.snap index 80837892aaabc4..ce9ddb0d291752 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC1802_len_as_condition.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC1802_len_as_condition.py.snap @@ -329,7 +329,6 @@ PLC1802 [*] `len(set((w + 1) for w in set()))` used as condition without compari 129 | assert len({"1":(v + 1) for v in {}}) # [PLC1802] 130 | assert len(set((w + 1) for w in set())) # [PLC1802] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove `len` | 129 | assert len({"1":(v + 1) for v in {}}) # [PLC1802] diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2401_non_ascii_name.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2401_non_ascii_name.py.snap index e5e08000a6ce96..17ecc83542c244 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2401_non_ascii_name.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2401_non_ascii_name.py.snap @@ -40,7 +40,6 @@ PLC2401 Variable name `ápple_count` contains a non-ASCII character 4 | 5 | (ápple_count for ápple_count in y) | ^^^^^^^^^^^ - | help: Rename the variable using ASCII characters PLC2401 Argument name `ápple_count` contains a non-ASCII character diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2701_import_private_name__submodule____main__.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2701_import_private_name__submodule____main__.py.snap index eba20b55cd0c69..4b0c5270881637 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2701_import_private_name__submodule____main__.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2701_import_private_name__submodule____main__.py.snap @@ -84,4 +84,3 @@ PLC2701 Private name import `_bar` from external module `foo` 51 | 52 | from foo. _bar import baz | ^^^^ - | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2801_unnecessary_dunder_call.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2801_unnecessary_dunder_call.py.snap index 7616229e7f9ae4..fb62b5f0f3b707 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2801_unnecessary_dunder_call.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC2801_unnecessary_dunder_call.py.snap @@ -693,7 +693,6 @@ PLC2801 [*] Unnecessary dunder call to `__add__`. Use `+` operator. 62 | foo = Foo(1) 63 | foo.__add__(2).get_v() # PLC2801 | ^^^^^^^^^^^^^^ - | help: Use `+` operator | 62 | foo = Foo(1) @@ -1208,7 +1207,6 @@ PLC2801 [*] Unnecessary dunder call to `__imatmul__`. Use `@=` operator. 142 | foo.__rmatmul__(a) # PLC2801 143 | foo.__imatmul__(foo) # PLC2801 | ^^^^^^^^^^^^^^^^^^^^ - | help: Use `@=` operator | 142 | foo.__rmatmul__(a) # PLC2801 diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC3002_unnecessary_direct_lambda_call.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC3002_unnecessary_direct_lambda_call.py.snap index 59968f3620a194..decb43dc5b00d7 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC3002_unnecessary_direct_lambda_call.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLC3002_unnecessary_direct_lambda_call.py.snap @@ -17,7 +17,6 @@ PLC3002 Lambda expression called directly. Execute the expression inline instead 4 | y = (lambda x: x**2 + 2*x + 1)(a) # [unnecessary-direct-lambda-call] 5 | y = max((lambda x: x**2)(a), (lambda x: x+1)(a)) # [unnecessary-direct-lambda-call,unnecessary-direct-lambda-call] | ^^^^^^^^^^^^^^^^^^^ - | PLC3002 Lambda expression called directly. Execute the expression inline instead. --> unnecessary_direct_lambda_call.py:5:30 @@ -25,4 +24,3 @@ PLC3002 Lambda expression called directly. Execute the expression inline instead 4 | y = (lambda x: x**2 + 2*x + 1)(a) # [unnecessary-direct-lambda-call] 5 | y = max((lambda x: x**2)(a), (lambda x: x+1)(a)) # [unnecessary-direct-lambda-call,unnecessary-direct-lambda-call] | ^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0100_yield_in_init.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0100_yield_in_init.py.snap index 19a74bf16b21f8..7165c733a5791b 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0100_yield_in_init.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0100_yield_in_init.py.snap @@ -8,7 +8,6 @@ PLE0100 `__init__` method is a generator 8 | def __init__(self): 9 | yield | ^^^^^ - | PLE0100 `__init__` method is a generator --> yield_in_init.py:14:9 diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0115_nonlocal_and_global.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0115_nonlocal_and_global.py.snap index 94d0f24d685f18..10139141955bcd 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0115_nonlocal_and_global.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0115_nonlocal_and_global.py.snap @@ -28,7 +28,6 @@ PLE0115 Name `counter` is both `nonlocal` and `global` 30 | counter += 1 31 | global counter | ^^^^^^^ - | PLE0115 Name `counter` is both `nonlocal` and `global` --> nonlocal_and_global.py:36:12 diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0117_nonlocal_without_binding.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0117_nonlocal_without_binding.py.snap index 70e4d1609d41e5..245e58256494e4 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0117_nonlocal_without_binding.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0117_nonlocal_without_binding.py.snap @@ -7,7 +7,6 @@ PLE0117 Nonlocal name `x` found without binding 4 | def f(): 5 | nonlocal x | ^ - | PLE0117 Nonlocal name `y` found without binding --> nonlocal_without_binding.py:9:14 @@ -15,7 +14,6 @@ PLE0117 Nonlocal name `y` found without binding 8 | def f(): 9 | nonlocal y | ^ - | PLE0117 Nonlocal name `y` found without binding --> nonlocal_without_binding.py:19:18 @@ -23,4 +21,3 @@ PLE0117 Nonlocal name `y` found without binding 18 | def f(): 19 | nonlocal y | ^ - | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0303_invalid_return_type_length.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0303_invalid_return_type_length.py.snap index 55b8ad7aa0b820..f1b30e4fc7c5e5 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0303_invalid_return_type_length.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0303_invalid_return_type_length.py.snap @@ -8,7 +8,6 @@ PLE0303 `__len__` does not return a non-negative integer 5 | def __len__(self): 6 | return True # [invalid-length-return] | ^^^^ - | PLE0303 `__len__` does not return a non-negative integer --> invalid_return_type_length.py:11:16 @@ -17,7 +16,6 @@ PLE0303 `__len__` does not return a non-negative integer 10 | def __len__(self): 11 | return 3.05 # [invalid-length-return] | ^^^^ - | PLE0303 `__len__` does not return a non-negative integer --> invalid_return_type_length.py:16:16 @@ -26,7 +24,6 @@ PLE0303 `__len__` does not return a non-negative integer 15 | def __len__(self): 16 | return "ruff" # [invalid-length-return] | ^^^^^^ - | PLE0303 `__len__` does not return a non-negative integer --> invalid_return_type_length.py:20:9 @@ -44,4 +41,3 @@ PLE0303 `__len__` does not return a non-negative integer 25 | def __len__(self): 26 | return -42 # [invalid-length-return] | ^^^ - | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0304_invalid_return_type_bool.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0304_invalid_return_type_bool.py.snap index efbea371b0ec72..226c068e33a74b 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0304_invalid_return_type_bool.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0304_invalid_return_type_bool.py.snap @@ -19,4 +19,3 @@ PLE0304 `__bool__` does not return `bool` 8 | def __bool__(self): 9 | return 0 # [invalid-bool-return] | ^ - | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0305_invalid_return_type_index.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0305_invalid_return_type_index.py.snap index 6e707341df8e62..8be422572fc799 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0305_invalid_return_type_index.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0305_invalid_return_type_index.py.snap @@ -7,7 +7,6 @@ PLE0305 `__index__` does not return an integer 7 | def __index__(self): 8 | return True # [invalid-index-return] | ^^^^ - | PLE0305 `__index__` does not return an integer --> invalid_return_type_index.py:13:16 @@ -16,7 +15,6 @@ PLE0305 `__index__` does not return an integer 12 | def __index__(self): 13 | return 3.05 # [invalid-index-return] | ^^^^ - | PLE0305 `__index__` does not return an integer --> invalid_return_type_index.py:18:16 @@ -25,7 +23,6 @@ PLE0305 `__index__` does not return an integer 17 | def __index__(self): 18 | return {"1": "1"} # [invalid-index-return] | ^^^^^^^^^^ - | PLE0305 `__index__` does not return an integer --> invalid_return_type_index.py:23:16 @@ -34,7 +31,6 @@ PLE0305 `__index__` does not return an integer 22 | def __index__(self): 23 | return "ruff" # [invalid-index-return] | ^^^^^^ - | PLE0305 `__index__` does not return an integer --> invalid_return_type_index.py:27:9 diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0307_invalid_return_type_str.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0307_invalid_return_type_str.py.snap index 779d6da34a0d68..1704e50eaff8d5 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0307_invalid_return_type_str.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0307_invalid_return_type_str.py.snap @@ -8,7 +8,6 @@ PLE0307 `__str__` does not return `str` 5 | def __str__(self): 6 | return 3.05 | ^^^^ - | PLE0307 `__str__` does not return `str` --> invalid_return_type_str.py:11:16 @@ -17,7 +16,6 @@ PLE0307 `__str__` does not return `str` 10 | def __str__(self): 11 | return 1 | ^ - | PLE0307 `__str__` does not return `str` --> invalid_return_type_str.py:16:16 @@ -26,7 +24,6 @@ PLE0307 `__str__` does not return `str` 15 | def __str__(self): 16 | return 0 | ^ - | PLE0307 `__str__` does not return `str` --> invalid_return_type_str.py:21:16 @@ -35,7 +32,6 @@ PLE0307 `__str__` does not return `str` 20 | def __str__(self): 21 | return False | ^^^^^ - | PLE0307 `__str__` does not return `str` --> invalid_return_type_str.py:58:9 diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0308_invalid_return_type_bytes.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0308_invalid_return_type_bytes.py.snap index 597bc48971a66c..d027b5eaaedf6f 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0308_invalid_return_type_bytes.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0308_invalid_return_type_bytes.py.snap @@ -8,7 +8,6 @@ PLE0308 `__bytes__` does not return `bytes` 5 | def __bytes__(self): 6 | return 3.05 # [invalid-bytes-return] | ^^^^ - | PLE0308 `__bytes__` does not return `bytes` --> invalid_return_type_bytes.py:11:16 @@ -17,7 +16,6 @@ PLE0308 `__bytes__` does not return `bytes` 10 | def __bytes__(self): 11 | return 0 # [invalid-bytes-return] | ^ - | PLE0308 `__bytes__` does not return `bytes` --> invalid_return_type_bytes.py:16:16 @@ -26,7 +24,6 @@ PLE0308 `__bytes__` does not return `bytes` 15 | def __bytes__(self): 16 | return "some bytes" # [invalid-bytes-return] | ^^^^^^^^^^^^ - | PLE0308 `__bytes__` does not return `bytes` --> invalid_return_type_bytes.py:20:9 diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0309_invalid_return_type_hash.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0309_invalid_return_type_hash.py.snap index 466ddc53bb9dc0..cd21af10bc18c9 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0309_invalid_return_type_hash.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0309_invalid_return_type_hash.py.snap @@ -8,7 +8,6 @@ PLE0309 `__hash__` does not return an integer 5 | def __hash__(self): 6 | return True # [invalid-hash-return] | ^^^^ - | PLE0309 `__hash__` does not return an integer --> invalid_return_type_hash.py:11:16 @@ -17,7 +16,6 @@ PLE0309 `__hash__` does not return an integer 10 | def __hash__(self): 11 | return 3.05 # [invalid-hash-return] | ^^^^ - | PLE0309 `__hash__` does not return an integer --> invalid_return_type_hash.py:16:16 @@ -26,7 +24,6 @@ PLE0309 `__hash__` does not return an integer 15 | def __hash__(self): 16 | return "ruff" # [invalid-hash-return] | ^^^^^^ - | PLE0309 `__hash__` does not return an integer --> invalid_return_type_hash.py:20:9 diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0604_invalid_all_object.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0604_invalid_all_object.py.snap index ade9450cefc78a..53911e8f0f02fe 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0604_invalid_all_object.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0604_invalid_all_object.py.snap @@ -17,4 +17,3 @@ PLE0604 Invalid object in `__all__`, must contain only strings 6 | 7 | __all__ = list([None, "Fruit", "Worm"]) # [invalid-all-object] | ^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0704_misplaced_bare_raise.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0704_misplaced_bare_raise.py.snap index 5d3ee1f40678ad..08da78a7140c65 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0704_misplaced_bare_raise.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE0704_misplaced_bare_raise.py.snap @@ -94,4 +94,3 @@ PLE0704 Bare `raise` statement is not inside an exception handler 70 | finally: 71 | raise # [misplaced-bare-raise] | ^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1132_repeated_keyword_argument.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1132_repeated_keyword_argument.py.snap index 8c677630f18cda..0c08b9d9c2e779 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1132_repeated_keyword_argument.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1132_repeated_keyword_argument.py.snap @@ -83,4 +83,3 @@ PLE1132 Repeated keyword argument: `c` 19 | func(a=11, b=21, **{"c": 31}, **{"c": 32}) 20 | func(a=11, b=21, **{"c": 31, "c": 32}) | ^^^ - | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1142_await_outside_async.ipynb.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1142_await_outside_async.ipynb.snap index 67bd86f7de972e..8d39dfd315988c 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1142_await_outside_async.ipynb.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1142_await_outside_async.ipynb.snap @@ -7,4 +7,3 @@ PLE1142 `await` should be used within an async function 8 | def foo(): 9 | await asyncio.sleep(1) # # [await-outside-async] | ^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1142_await_outside_async.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1142_await_outside_async.py.snap index 5427508ed81fb7..e9a09eda19ba6a 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1142_await_outside_async.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1142_await_outside_async.py.snap @@ -7,7 +7,6 @@ PLE1142 `await` should be used within an async function 14 | def not_async(): 15 | print(await nested()) # [await-outside-async] | ^^^^^^^^^^^^^^ - | PLE1142 `await` should be used within an async function --> await_outside_async.py:29:9 @@ -16,7 +15,6 @@ PLE1142 `await` should be used within an async function 28 | def inner_func(): 29 | await asyncio.sleep(1) # [await-outside-async] | ^^^^^^^^^^^^^^^^^^^^^^ - | PLE1142 `await` should be used within an async function --> await_outside_async.py:38:5 @@ -25,7 +23,6 @@ PLE1142 `await` should be used within an async function 38 | / async for x in foo(): 39 | | pass | |____________^ - | PLE1142 `await` should be used within an async function --> await_outside_async.py:43:5 @@ -34,7 +31,6 @@ PLE1142 `await` should be used within an async function 43 | / async with foo(): 44 | | pass | |____________^ - | PLE1142 `await` should be used within an async function --> await_outside_async.py:54:6 @@ -43,7 +39,6 @@ PLE1142 `await` should be used within an async function 53 | def async_for_list_comprehension_elt(): 54 | [await x for x in foo()] | ^^^^^^^ - | PLE1142 `await` should be used within an async function --> await_outside_async.py:59:8 @@ -52,7 +47,6 @@ PLE1142 `await` should be used within an async function 58 | def async_for_list_comprehension(): 59 | [x async for x in foo()] | ^^^^^^^^^^^^^^^^^^^^ - | PLE1142 `await` should be used within an async function --> await_outside_async.py:64:17 @@ -61,7 +55,6 @@ PLE1142 `await` should be used within an async function 63 | def await_generator_iter(): 64 | (x for x in await foo()) | ^^^^^^^^^^^ - | PLE1142 `await` should be used within an async function --> await_outside_async.py:74:17 @@ -70,7 +63,6 @@ PLE1142 `await` should be used within an async function 73 | def async_for_list_comprehension_target(): 74 | [x for x in await foo()] | ^^^^^^^^^^^ - | PLE1142 `await` should be used within an async function --> await_outside_async.py:78:6 @@ -78,7 +70,6 @@ PLE1142 `await` should be used within an async function 77 | def async_for_dictionary_comprehension_key(): 78 | {await x: y for x, y in foo()} | ^^^^^^^ - | PLE1142 `await` should be used within an async function --> await_outside_async.py:82:9 @@ -86,7 +77,6 @@ PLE1142 `await` should be used within an async function 81 | def async_for_dictionary_comprehension_value(): 82 | {y: await x for x, y in foo()} | ^^^^^^^ - | PLE1142 `await` should be used within an async function --> await_outside_async.py:86:11 @@ -94,4 +84,3 @@ PLE1142 `await` should be used within an async function 85 | def async_for_dict_comprehension(): 86 | {x: y async for x, y in foo()} | ^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1310_bad_str_strip_call.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1310_bad_str_strip_call.py.snap index 5c2872ae8b40b5..968e9f1205f03c 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1310_bad_str_strip_call.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1310_bad_str_strip_call.py.snap @@ -229,4 +229,3 @@ PLE1310 String `lstrip` call contains duplicate characters (did you mean `remove 89 | foo.rstrip("//") 90 | bar.lstrip(b"//") | ^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1700_yield_from_in_async_function.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1700_yield_from_in_async_function.py.snap index 1b6adf63166682..b2ddc2d81dc56f 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1700_yield_from_in_async_function.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE1700_yield_from_in_async_function.py.snap @@ -8,4 +8,3 @@ PLE1700 `yield from` statement in async function; use `async for` instead 6 | l = (1, 2, 3) 7 | yield from l | ^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE2510_invalid_characters_syntax_error.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE2510_invalid_characters_syntax_error.py.snap index 4ae66b4a4a7d14..cefc944be4b933 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE2510_invalid_characters_syntax_error.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE2510_invalid_characters_syntax_error.py.snap @@ -100,7 +100,6 @@ PLE2510 Invalid unescaped character backspace, use "\b" instead 12 | # Implicitly concatenated 13 | b = '␈' f'␈' '␈ | ^ - | help: Replace with escape sequence PLE2510 Invalid unescaped character backspace, use "\b" instead @@ -110,7 +109,6 @@ PLE2510 Invalid unescaped character backspace, use "\b" instead 12 | # Implicitly concatenated 13 | b = '␈' f'␈' '␈ | ^ - | help: Replace with escape sequence invalid-syntax: missing closing quote in string literal @@ -120,7 +118,6 @@ invalid-syntax: missing closing quote in string literal 12 | # Implicitly concatenated 13 | b = '␈' f'␈' '␈ | ^^ - | PLE2510 Invalid unescaped character backspace, use "\b" instead --> invalid_characters_syntax_error.py:13:15 @@ -129,5 +126,4 @@ PLE2510 Invalid unescaped character backspace, use "\b" instead 12 | # Implicitly concatenated 13 | b = '␈' f'␈' '␈ | ^ - | help: Replace with escape sequence diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1708_stop_iteration_return.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1708_stop_iteration_return.py.snap index a6775f05d7832e..89d96729818be9 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1708_stop_iteration_return.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1708_stop_iteration_return.py.snap @@ -8,7 +8,6 @@ PLR1708 Explicit `raise StopIteration` in generator 37 | yield 2 38 | raise StopIteration # Should trigger | ^^^^^^^^^^^^^^^^^^^ - | help: Use `return` instead PLR1708 Explicit `raise StopIteration` in generator @@ -18,7 +17,6 @@ PLR1708 Explicit `raise StopIteration` in generator 43 | yield 2 44 | raise StopIteration("finished") # Should trigger | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `return` instead PLR1708 Explicit `raise StopIteration` in generator @@ -28,7 +26,6 @@ PLR1708 Explicit `raise StopIteration` in generator 49 | yield 2 50 | raise StopIteration(1 + 2) # Should trigger | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `return` instead PLR1708 Explicit `raise StopIteration` in generator @@ -38,7 +35,6 @@ PLR1708 Explicit `raise StopIteration` in generator 55 | yield 2 56 | raise StopIteration("async") # Should trigger | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `return` instead PLR1708 Explicit `raise StopIteration` in generator @@ -95,7 +91,6 @@ PLR1708 Explicit `raise StopIteration` in generator 97 | yield 1 98 | raise StopIteration # Should trigger (no arguments) | ^^^^^^^^^^^^^^^^^^^ - | help: Use `return` instead PLR1708 Explicit `raise StopIteration` in generator @@ -105,7 +100,6 @@ PLR1708 Explicit `raise StopIteration` in generator 104 | if i == 3: 105 | raise StopIteration("loop") # Should trigger | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `return` instead PLR1708 Explicit `raise StopIteration` in generator @@ -126,5 +120,4 @@ PLR1708 Explicit `raise StopIteration` in generator 153 | def foo(): 154 | raise StopIteration((yield 1)) # Should trigger | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `return` instead diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1711_useless_return.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1711_useless_return.py.snap index 8f605bc56af2f0..bb66211d8fc876 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1711_useless_return.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1711_useless_return.py.snap @@ -8,7 +8,6 @@ PLR1711 [*] Useless `return` statement at end of function 5 | print(sys.version) 6 | return None # [useless-return] | ^^^^^^^^^^^ - | help: Remove useless `return` statement | 5 | print(sys.version) @@ -23,7 +22,6 @@ PLR1711 [*] Useless `return` statement at end of function 10 | print(sys.version) 11 | return None # [useless-return] | ^^^^^^^^^^^ - | help: Remove useless `return` statement | 10 | print(sys.version) @@ -38,7 +36,6 @@ PLR1711 [*] Useless `return` statement at end of function 15 | print(sys.version) 16 | return None # [useless-return] | ^^^^^^^^^^^ - | help: Remove useless `return` statement | 15 | print(sys.version) @@ -53,7 +50,6 @@ PLR1711 [*] Useless `return` statement at end of function 21 | print(sys.version) 22 | return None # [useless-return] | ^^^^^^^^^^^ - | help: Remove useless `return` statement | 21 | print(sys.version) @@ -68,7 +64,6 @@ PLR1711 [*] Useless `return` statement at end of function 49 | print(sys.version) 50 | return None # [useless-return] | ^^^^^^^^^^^ - | help: Remove useless `return` statement | 49 | print(sys.version) @@ -83,7 +78,6 @@ PLR1711 [*] Useless `return` statement at end of function 59 | print(f"{key} not found") 60 | return None | ^^^^^^^^^^^ - | help: Remove useless `return` statement | 59 | print(f"{key} not found") diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1712_swap_with_temporary_variable.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1712_swap_with_temporary_variable.py.snap index e24fdc6ec8eee2..9df056a3ac0c00 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1712_swap_with_temporary_variable.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1712_swap_with_temporary_variable.py.snap @@ -10,7 +10,6 @@ PLR1712 [*] Unnecessary temporary variable 4 | | x = y 5 | | y = temp | |____________^ - | help: Use `x, y = y, x` instead | 2 | def foo(x: int, y: int): @@ -30,7 +29,6 @@ PLR1712 [*] Unnecessary temporary variable 12 | | x = y 13 | | y = temp | |________________^ - | help: Use `x, y = y, x` instead | 10 | if x > 5: @@ -50,7 +48,6 @@ PLR1712 [*] Unnecessary temporary variable 19 | | x = y 20 | | y = temp | |____________^ - | help: Use `x, y = y, x` instead | 17 | def bar(x: int, y: int): diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1714_repeated_equality_comparison.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1714_repeated_equality_comparison.py.snap index fb21bca8fdccb2..e1284b355c192b 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1714_repeated_equality_comparison.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1714_repeated_equality_comparison.py.snap @@ -425,7 +425,6 @@ PLR1714 [*] Consider merging multiple comparisons: `foo in {"bar", "bar", "buzz" 78 | 79 | foo == "bar" or foo == "bar" or foo == "buzz" # All but one members identical | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Merge multiple comparisons | 78 | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1716_boolean_chained_comparison.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1716_boolean_chained_comparison.py.snap index 16032c7afb75d0..3e6d4093a73932 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1716_boolean_chained_comparison.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1716_boolean_chained_comparison.py.snap @@ -415,7 +415,6 @@ PLR1716 [*] Contains chained boolean comparison that can be simplified 147 | 148 | a < (b) and (((b)) < c) | ^^^^^^^^^^^^^^^^^^^^^^ - | help: Use a single compare expression | 147 | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_0.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_0.py.snap index de87067f7e552b..8b8dec2666422e 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_0.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_0.py.snap @@ -23,7 +23,6 @@ PLR1722 [*] Use `sys.exit()` instead of `quit` 1 | exit(0) 2 | quit(0) | ^^^^ - | help: Replace `quit` with `sys.exit()` | 1 + import sys @@ -61,7 +60,6 @@ PLR1722 [*] Use `sys.exit()` instead of `quit` 6 | exit(2) 7 | quit(2) | ^^^^ - | help: Replace `quit` with `sys.exit()` | 1 + import sys diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_1.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_1.py.snap index ac72b8fe8f1fde..fd44455ca82918 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_1.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_1.py.snap @@ -25,7 +25,6 @@ PLR1722 [*] Use `sys.exit()` instead of `quit` 3 | exit(0) 4 | quit(0) | ^^^^ - | help: Replace `quit` with `sys.exit()` | 3 | exit(0) @@ -59,7 +58,6 @@ PLR1722 [*] Use `sys.exit()` instead of `quit` 8 | exit(1) 9 | quit(1) | ^^^^ - | help: Replace `quit` with `sys.exit()` | 8 | exit(1) @@ -86,5 +84,4 @@ PLR1722 Use `sys.exit()` instead of `quit` 15 | exit(1) 16 | quit(1) | ^^^^ - | help: Replace `quit` with `sys.exit()` diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_10.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_10.py.snap index c6481fa7434820..cd58284dba955c 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_10.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_10.py.snap @@ -7,5 +7,4 @@ PLR1722 Use `sys.exit()` instead of `exit` 7 | def main(): 8 | exit(0) | ^^^^ - | help: Replace `exit` with `sys.exit()` diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_11.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_11.py.snap index 2f6f7be5ea0562..e6dd0ff9c4f4ee 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_11.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_11.py.snap @@ -8,7 +8,6 @@ PLR1722 [*] Use `sys.exit()` instead of `exit` 2 | 3 | exit(0) | ^^^^ - | help: Replace `exit` with `sys.exit()` | 1 | from sys import * diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_12.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_12.py.snap index 453d5bb264633f..29ae1851cc1c04 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_12.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_12.py.snap @@ -8,7 +8,6 @@ PLR1722 [*] Use `sys.exit()` instead of `exit` 2 | 3 | exit(0) | ^^^^ - | help: Replace `exit` with `sys.exit()` | - import os \ diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_13.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_13.py.snap index 235983f89c0344..665bec6c9e4070 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_13.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_13.py.snap @@ -6,7 +6,6 @@ PLR1722 [*] Use `sys.exit()` instead of `exit` | 1 | exit(code=2) | ^^^^ - | help: Replace `exit` with `sys.exit()` | - exit(code=2) diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_14.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_14.py.snap index e19000544995b5..abd4d99f49018f 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_14.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_14.py.snap @@ -7,5 +7,4 @@ PLR1722 Use `sys.exit()` instead of `exit` 1 | code = {"code": 2} 2 | exit(**code) | ^^^^ - | help: Replace `exit` with `sys.exit()` diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_15.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_15.py.snap index 38cca3c033b418..a704ab290d1abc 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_15.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_15.py.snap @@ -8,7 +8,6 @@ PLR1722 [*] Use `sys.exit()` instead of `exit` 5 | code = 1 6 | exit(code) | ^^^^ - | help: Replace `exit` with `sys.exit()` | 1 + import sys diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_16.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_16.py.snap index c2b96562d53d4c..e5afb4da806fce 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_16.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_16.py.snap @@ -53,7 +53,6 @@ PLR1722 Use `sys.exit()` instead of `exit` 16 | # no diagnostic for multiple arguments 17 | exit(2, 3, 4) | ^^^^ - | help: Replace `exit` with `sys.exit()` PLR1722 [*] Use `sys.exit()` instead of `exit` @@ -63,7 +62,6 @@ PLR1722 [*] Use `sys.exit()` instead of `exit` 22 | codes = [1] 23 | exit(*codes) | ^^^^ - | help: Replace `exit` with `sys.exit()` | 1 + import sys diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_2.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_2.py.snap index 9d18e37bcf544a..9397b6aebbc3e5 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_2.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_2.py.snap @@ -25,7 +25,6 @@ PLR1722 [*] Use `sys.exit()` instead of `quit` 3 | exit(0) 4 | quit(0) | ^^^^ - | help: Replace `quit` with `sys.exit()` | 3 | exit(0) @@ -59,7 +58,6 @@ PLR1722 [*] Use `sys.exit()` instead of `quit` 8 | exit(1) 9 | quit(1) | ^^^^ - | help: Replace `quit` with `sys.exit()` | 8 | exit(1) diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_3.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_3.py.snap index 1764a2f47da48a..7ffc90f08f2956 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_3.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_3.py.snap @@ -7,7 +7,6 @@ PLR1722 [*] Use `sys.exit()` instead of `quit` 3 | exit(0) 4 | quit(0) | ^^^^ - | help: Replace `quit` with `sys.exit()` | 3 | exit(0) @@ -24,7 +23,6 @@ PLR1722 [*] Use `sys.exit()` instead of `quit` 8 | exit(1) 9 | quit(1) | ^^^^ - | help: Replace `quit` with `sys.exit()` | 8 | exit(1) @@ -40,5 +38,4 @@ PLR1722 Use `sys.exit()` instead of `quit` 15 | exit(1) 16 | quit(1) | ^^^^ - | help: Replace `quit` with `sys.exit()` diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_4.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_4.py.snap index 38e6973e88861f..4bdd3ae17dd26d 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_4.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_4.py.snap @@ -25,7 +25,6 @@ PLR1722 [*] Use `sys.exit()` instead of `quit` 3 | exit(0) 4 | quit(0) | ^^^^ - | help: Replace `quit` with `sys.exit()` | 3 | exit(0) @@ -59,7 +58,6 @@ PLR1722 [*] Use `sys.exit()` instead of `quit` 8 | exit(1) 9 | quit(1) | ^^^^ - | help: Replace `quit` with `sys.exit()` | 8 | exit(1) diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_5.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_5.py.snap index 60af85491fc5d3..7d3d509cfa99c8 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_5.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_5.py.snap @@ -27,7 +27,6 @@ PLR1722 [*] Use `sys.exit()` instead of `quit` 3 | exit(0) 4 | quit(0) | ^^^^ - | help: Replace `quit` with `sys.exit()` | 1 | from sys import * @@ -68,7 +67,6 @@ PLR1722 [*] Use `sys.exit()` instead of `quit` 8 | exit(1) 9 | quit(1) | ^^^^ - | help: Replace `quit` with `sys.exit()` | 1 | from sys import * diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_6.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_6.py.snap index 2d624b367ec437..440149c059d154 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_6.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_6.py.snap @@ -23,7 +23,6 @@ PLR1722 [*] Use `sys.exit()` instead of `quit` 1 | exit(0) 2 | quit(0) | ^^^^ - | help: Replace `quit` with `sys.exit()` | 1 + import sys diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_7.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_7.py.snap index 61d707e153ca11..60d5d65e134a22 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_7.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_7.py.snap @@ -7,7 +7,6 @@ PLR1722 [*] Use `sys.exit()` instead of `exit` 1 | def main(): 2 | exit(0) | ^^^^ - | help: Replace `exit` with `sys.exit()` | 1 + import sys diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_8.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_8.py.snap index 7f52bd45a2b698..056475d8ec6681 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_8.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_8.py.snap @@ -7,7 +7,6 @@ PLR1722 [*] Use `sys.exit()` instead of `exit` 4 | def main(): 5 | exit(0) | ^^^^ - | help: Replace `exit` with `sys.exit()` | - from sys import argv diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_9.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_9.py.snap index f0117930867485..c88151f1f0b715 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_9.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1722_sys_exit_alias_9.py.snap @@ -7,7 +7,6 @@ PLR1722 [*] Use `sys.exit()` instead of `exit` 1 | def main(): 2 | exit(0) | ^^^^ - | help: Replace `exit` with `sys.exit()` | 1 + import sys diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1730_if_stmt_min_max.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1730_if_stmt_min_max.py.snap index 66fb42986fa751..4e1050ac1aa87e 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1730_if_stmt_min_max.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1730_if_stmt_min_max.py.snap @@ -141,7 +141,6 @@ PLR1730 [*] Replace `if` statement with `b = max(b, a)` 49 | / if a > b: 50 | | b = a | |_________^ - | help: Replace with `b = max(b, a)` | 48 | # case 8: b = max(b, a) @@ -253,7 +252,6 @@ PLR1730 [*] Replace `if` statement with `value = min(value, value2)` 79 | / if value > value2: 80 | | value = value2 | |__________________^ - | help: Replace with `value = min(value, value2)` | 78 | # base case 5: value = min(value, value2) @@ -289,7 +287,6 @@ PLR1730 [*] Replace `if` statement with `A1.value = min(A1.value, 10)` 95 | / if A1.value > 10: 96 | | A1.value = 10 | |_________________^ - | help: Replace with `A1.value = min(A1.value, 10)` | 94 | @@ -556,7 +553,6 @@ PLR1730 [*] Replace `if` statement with `self._max = min(value, self._max)` 219 | / if self._max >= value: 220 | | self._max = value | |_____________________________^ - | help: Replace with `self._max = min(value, self._max)` | 218 | self._min = value @@ -672,7 +668,6 @@ PLR1730 [*] Replace `if` statement with `a = min(b, a)` 250 | / if a >= b: 251 | | a = b # very important comment | |_________^ - | help: Replace with `a = min(b, a)` | 249 | # fix marked safe as preserve comments diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1733_unnecessary_dict_index_lookup.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1733_unnecessary_dict_index_lookup.py.snap index 962e253b45c13f..987539e90e8484 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1733_unnecessary_dict_index_lookup.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1733_unnecessary_dict_index_lookup.py.snap @@ -94,7 +94,6 @@ PLR1733 [*] Unnecessary lookup of dictionary value by key 10 | blah = FRUITS[fruit_name] # PLR1733 11 | assert FRUITS[fruit_name] == "pear" # PLR1733 | ^^^^^^^^^^^^^^^^^^ - | help: Use existing variable | 10 | blah = FRUITS[fruit_name] # PLR1733 diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1736_unnecessary_list_index_lookup.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1736_unnecessary_list_index_lookup.py.snap index 790c9c7e36f861..837f1e65d4d5d3 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1736_unnecessary_list_index_lookup.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1736_unnecessary_list_index_lookup.py.snap @@ -146,7 +146,6 @@ PLR1736 [*] List index lookup in `enumerate()` loop 18 | blah = letters[index] # PLR1736 19 | assert letters[index] == "d" # PLR1736 | ^^^^^^^^^^^^^^ - | help: Use the loop variable directly | 18 | blah = letters[index] # PLR1736 @@ -180,7 +179,6 @@ PLR1736 [*] List index lookup in `enumerate()` loop 77 | for index, list_item in enumerate(some_list): 78 | print(some_list[index]) | ^^^^^^^^^^^^^^^^ - | help: Use the loop variable directly | 77 | for index, list_item in enumerate(some_list): @@ -196,7 +194,6 @@ PLR1736 [*] List index lookup in `enumerate()` loop 84 | for index, column_name in enumerate(column_names): 85 | _ = data[column_names[index]] # PLR1736 | ^^^^^^^^^^^^^^^^^^^ - | help: Use the loop variable directly | 84 | for index, column_name in enumerate(column_names): diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR2044_empty_comment.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR2044_empty_comment.py.snap index 7637d1a5601357..da0769a5219031 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR2044_empty_comment.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR2044_empty_comment.py.snap @@ -57,7 +57,6 @@ PLR2044 [*] Line with empty comment 17 | def foo(): # this comment is OK, the one below is not 18 | pass # | ^ - | help: Delete the empty comment | 17 | def foo(): # this comment is OK, the one below is not @@ -104,7 +103,6 @@ PLR2044 [*] Line with empty comment 57 | α = 1 58 | α# | ^ - | help: Delete the empty comment | 57 | α = 1 diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR6104_non_augmented_assignment.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR6104_non_augmented_assignment.py.snap index 60f426f661c3c8..f690326bdca9bd 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR6104_non_augmented_assignment.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR6104_non_augmented_assignment.py.snap @@ -441,7 +441,6 @@ PLR6104 [*] Use `*=` to perform an augmented assignment directly 41 | 42 | index = index * (index + 10) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with augmented assignment | 41 | @@ -458,7 +457,6 @@ PLR6104 [*] Use `+=` to perform an augmented assignment directly 46 | def t(self): 47 | self.a = self.a + 1 | ^^^^^^^^^^^^^^^^^^^ - | help: Replace with augmented assignment | 46 | def t(self): @@ -474,7 +472,6 @@ PLR6104 [*] Use `+=` to perform an augmented assignment directly 50 | obj = T() 51 | obj.a = obj.a + 1 | ^^^^^^^^^^^^^^^^^ - | help: Replace with augmented assignment | 50 | obj = T() @@ -660,7 +657,6 @@ PLR6104 [*] Use `+=` to perform an augmented assignment directly 93 | | \ 94 | | test8 | |_________^ - | help: Replace with augmented assignment | 89 | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0101_unreachable.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0101_unreachable.py.snap index 87c0c9c471274f..feb106dd80980a 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0101_unreachable.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0101_unreachable.py.snap @@ -34,4 +34,3 @@ PLW0101 Unreachable code in `multiple_returns` 29 | | return 2 30 | | print("unreachable range should include above return") | |__________________________________________________________^ - | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0108_unnecessary_lambda.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0108_unnecessary_lambda.py.snap index 928ac245574111..5fbe8caa9b7569 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0108_unnecessary_lambda.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0108_unnecessary_lambda.py.snap @@ -168,5 +168,4 @@ PLW0108 Lambda may be unnecessary; consider inlining inner function 62 | _ = lambda x: (string := str)(x) 63 | _ = lambda x: ((x := 1) and str)(x) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Inline function call diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0129_assert_on_string_literal.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0129_assert_on_string_literal.py.snap index f840a788e5655f..0f3bfbb7810b9a 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0129_assert_on_string_literal.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0129_assert_on_string_literal.py.snap @@ -8,7 +8,6 @@ PLW0129 Asserting on a non-empty string literal will always pass 2 | a = 9 / 3 3 | assert "No ZeroDivisionError were raised" # [assert-on-string-literal] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | PLW0129 Asserting on a non-empty string literal will always pass --> assert_on_string_literal.py:12:12 diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0131_named_expr_without_context.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0131_named_expr_without_context.py.snap index 4306ba4fc7fcd6..193dc8f4646bf5 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0131_named_expr_without_context.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0131_named_expr_without_context.py.snap @@ -18,7 +18,6 @@ PLW0131 Named expression used without context 3 | if True: 4 | (b := 1) | ^^^^^^ - | PLW0131 Named expression used without context --> named_expr_without_context.py:8:6 @@ -26,4 +25,3 @@ PLW0131 Named expression used without context 7 | class Foo: 8 | (c := 1) | ^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0177_nan_comparison.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0177_nan_comparison.py.snap index 538f8dbb9c2a4e..b151cc566bceae 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0177_nan_comparison.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0177_nan_comparison.py.snap @@ -138,4 +138,3 @@ PLW0177 Comparing against a NaN value; use `math.isnan` instead 98 | assert x == float("-NaN ") 99 | assert x == float(" \n+nan \t") | ^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0244_redefined_slots_in_subclass.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0244_redefined_slots_in_subclass.py.snap index aca4d1ddf47fd8..6b81a1b74421d0 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0244_redefined_slots_in_subclass.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0244_redefined_slots_in_subclass.py.snap @@ -27,7 +27,6 @@ PLW0244 Slot `a` redefined from base class `AnotherBase` 22 | class AnotherChild(AnotherBase): 23 | __slots__ = ["a","b","e","f"] | ^^^ - | PLW0244 Slot `b` redefined from base class `AnotherBase` --> redefined_slots_in_subclass.py:23:22 @@ -35,4 +34,3 @@ PLW0244 Slot `b` redefined from base class `AnotherBase` 22 | class AnotherChild(AnotherBase): 23 | __slots__ = ["a","b","e","f"] | ^^^ - | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0406_import_self__module.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0406_import_self__module.py.snap index 741e604b570685..cfab103c2d02b8 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0406_import_self__module.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0406_import_self__module.py.snap @@ -26,4 +26,3 @@ PLW0406 Module `import_self.module` imports itself 2 | from import_self import module 3 | from . import module | ^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0602_global_variable_not_assigned.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0602_global_variable_not_assigned.py.snap index 8b06cc77f527fb..a5fdf4e1ced83e 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0602_global_variable_not_assigned.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0602_global_variable_not_assigned.py.snap @@ -8,7 +8,6 @@ PLW0602 Using global for `X` but no assignment is done 4 | def f(): 5 | global X | ^ - | PLW0602 Using global for `X` but no assignment is done --> global_variable_not_assigned.py:9:12 diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0642_self_or_cls_assignment.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0642_self_or_cls_assignment.py.snap index 360984514fae67..27df39b7d20a8c 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0642_self_or_cls_assignment.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW0642_self_or_cls_assignment.py.snap @@ -172,5 +172,4 @@ PLW0642 Reassigned `cls` variable in `__new__` method 49 | def __new__(cls): 50 | cls = "apple" # PLW0642 | ^^^ - | help: Consider using a different variable name diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW1501_bad_open_mode.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW1501_bad_open_mode.py.snap index 0566155cc3a160..85c95f9b1a4e92 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW1501_bad_open_mode.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW1501_bad_open_mode.py.snap @@ -127,4 +127,3 @@ PLW1501 `Ua` is not a valid mode for `open` 36 | import builtins 37 | builtins.open(NAME, "Ua", encoding="utf-8") | ^^^^ - | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW1507_shallow_copy_environ.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW1507_shallow_copy_environ.py.snap index c5c4a85e619b6b..c616da9775577f 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW1507_shallow_copy_environ.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW1507_shallow_copy_environ.py.snap @@ -8,7 +8,6 @@ PLW1507 [*] Shallow copy of `os.environ` via `copy.copy(os.environ)` 3 | 4 | copied_env = copy.copy(os.environ) # [shallow-copy-environ] | ^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `os.environ.copy()` | 3 | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW2901_redefined_loop_name.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW2901_redefined_loop_name.py.snap index 4a37f5facd13e8..e639eb3059c152 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW2901_redefined_loop_name.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW2901_redefined_loop_name.py.snap @@ -274,4 +274,3 @@ PLW2901 `for` loop variable `a.i` overwritten by assignment target 179 | for a. i in []: 180 | a.i = 2 # error | ^^^ - | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW3301_nested_min_max.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW3301_nested_min_max.py.snap index 55c6aef7417810..564dee97b670e4 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW3301_nested_min_max.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLW3301_nested_min_max.py.snap @@ -291,7 +291,6 @@ PLW3301 [*] Nested `min` calls can be flattened 43 | import builtins 44 | builtins.min(1, min(2, 3)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Flatten nested `min` calls | 43 | import builtins diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__conflict_with_definition_rules.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__conflict_with_definition_rules.snap index 41c104b0363182..b02e55bb9e71b1 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__conflict_with_definition_rules.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__conflict_with_definition_rules.snap @@ -9,7 +9,6 @@ PLR1712 [*] Unnecessary temporary variable 7 | | x = y 8 | | y = temp | |________^ - | help: Use `x, y = y, x` instead | 5 | x, y = 1, 2 diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__continue_in_finally.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__continue_in_finally.snap index d76dcc4236a562..fc851db8256a04 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__continue_in_finally.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__continue_in_finally.snap @@ -72,7 +72,6 @@ PLE0116 `continue` not supported inside `finally` clause 48 | finally: 49 | continue # [continue-in-finally] | ^^^^^^^^ - | PLE0116 `continue` not supported inside `finally` clause --> continue_in_finally.py:56:9 @@ -136,4 +135,3 @@ PLE0116 `continue` not supported inside `finally` clause 94 | else: 95 | continue # [continue-in-finally] | ^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__import_outside_top_level_with_banned.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__import_outside_top_level_with_banned.snap index f433c3ce4bddaa..84ac47d4417e48 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__import_outside_top_level_with_banned.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__import_outside_top_level_with_banned.snap @@ -101,4 +101,3 @@ PLC0415 `import` should be at the top-level of a file 39 | # this should still trigger an error due to multiple imports 40 | from pkg import foo_allowed, bar_banned # [import-outside-toplevel] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__preview__PLW0133_useless_exception_statement.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__preview__PLW0133_useless_exception_statement.py.snap index 5e10f7ca81f31c..3bc3b056b20917 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__preview__PLW0133_useless_exception_statement.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__preview__PLW0133_useless_exception_statement.py.snap @@ -56,7 +56,6 @@ PLW0133 [*] Missing `raise` statement on exception 28 | MySubError("This is a custom error") # PLW0133 29 | MyValueError("This is a custom value error") # PLW0133 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Add `raise` keyword | 28 | MySubError("This is a custom error") # PLW0133 @@ -173,7 +172,6 @@ PLW0133 [*] Missing `raise` statement on exception 48 | MySubError("This is an exception") # PLW0133 49 | MyValueError("This is an exception") # PLW0133 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Add `raise` keyword | 48 | MySubError("This is an exception") # PLW0133 @@ -230,7 +228,6 @@ PLW0133 [*] Missing `raise` statement on exception 58 | MySubError("This is an exception") # PLW0133 59 | MyValueError("This is an exception") # PLW0133 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Add `raise` keyword | 58 | MySubError("This is an exception") # PLW0133 @@ -346,7 +343,6 @@ PLW0133 [*] Missing `raise` statement on exception 78 | MySubError("This is an exception") # PLW0133 79 | MyValueError("This is an exception") # PLW0133 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Add `raise` keyword | 78 | MySubError("This is an exception") # PLW0133 @@ -403,7 +399,6 @@ PLW0133 [*] Missing `raise` statement on exception 89 | MySubError("This is an exception") # PLW0133 90 | MyValueError("This is an exception") # PLW0133 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Add `raise` keyword | 89 | MySubError("This is an exception") # PLW0133 @@ -460,7 +455,6 @@ PLW0133 [*] Missing `raise` statement on exception 98 | MySubError("This is an exception") # PLW0133 99 | MyValueError("This is an exception") # PLW0133 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Add `raise` keyword | 98 | MySubError("This is an exception") # PLW0133 @@ -517,7 +511,6 @@ PLW0133 [*] Missing `raise` statement on exception 106 | (MySubError("This is an exception")) # PLW0133 107 | (MyValueError("This is an exception")) # PLW0133 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Add `raise` keyword | 106 | (MySubError("This is an exception")) # PLW0133 @@ -574,7 +567,6 @@ PLW0133 [*] Missing `raise` statement on exception 114 | x = 1; (MySubError("This is an exception")); y = 2 # PLW0133 115 | x = 1; (MyValueError("This is an exception")); y = 2 # PLW0133 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Add `raise` keyword | 114 | x = 1; (MySubError("This is an exception")); y = 2 # PLW0133 @@ -592,7 +584,6 @@ PLW0133 [*] Missing `raise` statement on exception 120 | UserWarning("This is a user warning") # PLW0133 121 | MyUserWarning("This is a custom user warning") # PLW0133 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Add `raise` keyword | 120 | UserWarning("This is a user warning") # PLW0133 @@ -670,7 +661,6 @@ PLW0133 [*] Missing `raise` statement on exception 138 | 139 | MyUserWarning("This is a custom user warning") # PLW0133 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Add `raise` keyword | 138 | diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__too_many_public_methods.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__too_many_public_methods.snap index 8fdb140f3f0580..531340ccd80de6 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__too_many_public_methods.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__too_many_public_methods.snap @@ -40,4 +40,3 @@ PLR0904 Too many public methods (10 > 7) 37 | | def method9(self): 38 | | pass | |____________^ - | diff --git a/crates/ruff_linter/src/rules/pyupgrade/mod.rs b/crates/ruff_linter/src/rules/pyupgrade/mod.rs index fa3ff8ff497eb7..0faa253c6e025c 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/mod.rs +++ b/crates/ruff_linter/src/rules/pyupgrade/mod.rs @@ -482,7 +482,6 @@ mod tests { | 1 | from pipes import quote, Template | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Import from `shlex` | - from pipes import quote, Template diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP001.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP001.py.snap index 15420b219792fe..aad9e7efda7dc5 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP001.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP001.py.snap @@ -7,7 +7,6 @@ UP001 [*] `__metaclass__ = type` is implied 1 | class A: 2 | __metaclass__ = type | ^^^^^^^^^^^^^^^^^^^^ - | help: Remove `__metaclass__ = type` | 1 | class A: diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP003.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP003.py.snap index abcdc9c7f31c96..ecd903ccaeb6a7 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP003.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP003.py.snap @@ -92,7 +92,6 @@ UP003 [*] Use `str` instead of `type(...)` 13 | # Regression test for: https://github.com/astral-sh/ruff/issues/7455#issuecomment-1722459841 14 | assert isinstance(fullname, type("")is not True) | ^^^^^^^^ - | help: Replace `type(...)` with `str` | 13 | # Regression test for: https://github.com/astral-sh/ruff/issues/7455#issuecomment-1722459841 diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP005.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP005.py.snap index 164ee92e96c571..14eddffa1e20ed 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP005.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP005.py.snap @@ -61,7 +61,6 @@ UP005 [*] `assertNotRegexpMatches` is deprecated, use `assertNotRegex` 9 | self.failUnlessAlmostEqual(1, 1.1) 10 | self.assertNotRegexpMatches("a", "b") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace `assertNotRegex` with `assertNotRegexpMatches` | 9 | self.failUnlessAlmostEqual(1, 1.1) diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP007_1.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP007_1.py.snap index bdd77d7776a90e..de174b1edeccc9 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP007_1.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP007_1.py.snap @@ -216,7 +216,6 @@ UP007 [*] Use `X | Y` for type annotations 48 | x: Union[str, int] 49 | x: Union["str", "int"] | ^^^^^^^^^^^^^^^^^^^ - | help: Convert to `X | Y` | 48 | x: Union[str, int] @@ -324,7 +323,6 @@ UP007 [*] Use `X | Y` for type annotations 154 | | | Literal["LongLiteralNumberThree"] 155 | | ] | |_____^ - | help: Convert to `X | Y` | 150 | diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP008.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP008.py.snap index d84e4c2caab0a3..ab341e4a982074 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP008.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP008.py.snap @@ -47,7 +47,6 @@ UP008 [*] Use `super()` instead of `super(__class__, self)` 21 | | self, 22 | | ).method() # wrong | |_________^ - | help: Remove `super()` parameters | 18 | super(Child, self).method # wrong @@ -116,7 +115,6 @@ UP008 [*] Use `super()` instead of `super(__class__, self)` 115 | def bar(self): 116 | super(__class__, self).foo() | ^^^^^^^^^^^^^^^^^ - | help: Remove `super()` parameters | 115 | def bar(self): @@ -193,7 +191,6 @@ UP008 [*] Use `super()` instead of `super(__class__, self)` 150 | | # also a comment 151 | | ).f() | |_________^ - | help: Remove `super()` parameters | 146 | ).f() @@ -426,7 +423,6 @@ UP008 [*] Use `super()` instead of `super(__class__, self)` 232 | super # Python injects __class__ into scope 233 | builtins.super(ChildD10, self).f() | ^^^^^^^^^^^^^^^^ - | help: Remove `super()` parameters | 232 | super # Python injects __class__ into scope @@ -442,7 +438,6 @@ UP008 [*] Use `super()` instead of `super(__class__, self)` 341 | def __init__(self, foo): 342 | super(Outer.Inner, self).__init__(foo) # UP008: matches enclosing class chain | ^^^^^^^^^^^^^^^^^^^ - | help: Remove `super()` parameters | 341 | def __init__(self, foo): @@ -476,7 +471,6 @@ UP008 [*] Use `super()` instead of `super(__class__, self)` 387 | def f(self): 388 | super (Whitespace, self).f() # can use super() | ^^^^^^^^^^^^^^^^^^ - | help: Remove `super()` parameters | 387 | def f(self): @@ -492,7 +486,6 @@ UP008 [*] Use `super()` instead of `super(__class__, self)` 394 | def f(self): 395 | super(LocalOuter.LocalInner, self).f() # can use super() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove `super()` parameters | 394 | def f(self): @@ -507,7 +500,6 @@ UP008 [*] Use `super()` instead of `super(__class__, self)` 398 | class LambdaMethod(BaseClass): 399 | f = lambda self: super(LambdaMethod, self).f() # can use super() | ^^^^^^^^^^^^^^^^^^^^ - | help: Remove `super()` parameters | 398 | class LambdaMethod(BaseClass): @@ -523,7 +515,6 @@ UP008 [*] Use `super()` instead of `super(__class__, self)` 404 | def f(cls): 405 | super(ClassMethod, cls).f() # can use super() | ^^^^^^^^^^^^^^^^^^ - | help: Remove `super()` parameters | 404 | def f(cls): @@ -539,7 +530,6 @@ UP008 [*] Use `super()` instead of `super(__class__, self)` 409 | async def f(self): 410 | super(AsyncMethod, self).f() # can use super() | ^^^^^^^^^^^^^^^^^^^ - | help: Remove `super()` parameters | 409 | async def f(self): @@ -555,7 +545,6 @@ UP008 [*] Use `super()` instead of `super(__class__, self)` 415 | def f(self): 416 | super (OuterWithWhitespace.Inner, self).f() # can use super() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove `super()` parameters | 415 | def f(self): diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP010_0.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP010_0.py.snap index 6515184e9c011a..1eba176457d718 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP010_0.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP010_0.py.snap @@ -171,7 +171,6 @@ UP010 [*] Unnecessary `__future__` import `generators` for target Python version 14 | from __future__ import invalid_module, generators 15 | from __future__ import generators # comment | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove unnecessary `__future__` import | 14 | from __future__ import invalid_module, generators diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP012.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP012.py.snap index 39afd57a55842a..a0adc52d17031a 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP012.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP012.py.snap @@ -468,7 +468,6 @@ UP012 [*] Unnecessary UTF-8 `encoding` argument to `encode` 76 | ("unicode text©").encode("utf-8") 77 | ("unicode text©").encode(encoding="utf-8") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove unnecessary `encoding` argument | 76 | ("unicode text©").encode("utf-8") @@ -800,7 +799,6 @@ UP012 [*] Unnecessary call to `encode` as UTF-8 119 | 120 | '\\ u0000 '.encode() | ^^^^^^^^^^^^^^^^^^^^ - | help: Rewrite as bytes literal | 119 | diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP014.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP014.py.snap index 3a508e0f3707ed..7bf610bcde8b89 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP014.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP014.py.snap @@ -102,7 +102,6 @@ UP014 [*] Convert `X` from `NamedTuple` functional to class syntax 37 | | ("some_config", int), # important 38 | | ]) | |__^ - | help: Convert `X` to class syntax | 35 | # Unsafe fix if comments are present diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP015_1.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP015_1.py.snap index 2f519d37693e80..76b4fe2b95c7a4 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP015_1.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP015_1.py.snap @@ -8,7 +8,6 @@ UP015 [*] Unnecessary mode argument 2 | # Refer: https://github.com/astral-sh/ruff/issues/11736 3 | x: 'open("foo", "r")' | ^^^ - | help: Remove mode argument | 2 | # Refer: https://github.com/astral-sh/ruff/issues/11736 diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP018.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP018.py.snap index c81ba0a928105c..a331620e672b7b 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP018.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP018.py.snap @@ -389,7 +389,6 @@ UP018 [*] Unnecessary `float` call (rewrite as a literal) 60 | float(+1.0) 61 | float(-1.0) | ^^^^^^^^^^^ - | help: Replace with float literal | 60 | float(+1.0) @@ -525,7 +524,6 @@ UP018 [*] Unnecessary `int` call (rewrite as a literal) 75 | 76 | await int(-1) # await (-1) | ^^^^^^^ - | help: Replace with integer literal | 75 | @@ -555,7 +553,6 @@ UP018 [*] Unnecessary `float` call (rewrite as a literal) 79 | int(+1) ** 0 80 | float(+1.0)() | ^^^^^^^^^^^ - | help: Replace with float literal | 79 | int(+1) ** 0 @@ -647,7 +644,6 @@ UP018 [*] Unnecessary `bool` call (rewrite as a literal) 91 | float(1.)and None 92 | bool(True)and() | ^^^^^^^^^^ - | help: Replace with boolean literal | 91 | float(1.)and None @@ -866,7 +862,6 @@ UP018 [*] Unnecessary `complex` call (rewrite as a literal) 112 | complex(1j).real 113 | complex(real=1j).real | ^^^^^^^^^^^^^^^^ - | help: Replace with complex literal | 112 | complex(1j).real diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP018_CR.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP018_CR.py.snap index cd055167525cbf..b16bc7a8bf7cfc 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP018_CR.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP018_CR.py.snap @@ -23,7 +23,6 @@ UP018 [*] Unnecessary `int` call (rewrite as a literal) 4 | / int(+ 5 | | 1) | |______^ - | help: Replace with integer literal | 3 | 1) - int(+ 4 + (+ 5 | 1) diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP018_LF.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP018_LF.py.snap index 5b3d30c93f8ba4..3f367e591faebf 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP018_LF.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP018_LF.py.snap @@ -28,7 +28,6 @@ UP018 [*] Unnecessary `int` call (rewrite as a literal) 6 | / int(+ 7 | | 1) | |______^ - | help: Replace with integer literal | 5 | diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP024_2.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP024_2.py.snap index 3f999e9d4e3c7a..bd02547a500079 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP024_2.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP024_2.py.snap @@ -391,7 +391,6 @@ UP024 [*] Replace aliased errors with `OSError` 54 | raise EnvironmentError(1) 55 | raise IOError(1, 2) | ^^^^^^^ - | help: Replace `IOError` with builtin `OSError` | 54 | raise EnvironmentError(1) diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP025.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP025.py.snap index 087db8f6f9b849..a3315333bfee74 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP025.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP025.py.snap @@ -323,7 +323,6 @@ UP025 [*] Remove unicode literals from strings 33 | """"""""""""""""""""u"hi" 34 | ""U"helloooo" | ^^^^^^^^^^^ - | help: Remove unicode prefix | 33 | """"""""""""""""""""u"hi" diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP026.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP026.py.snap index 6ffb0e6bf48354..0a8c718d06276b 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP026.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP026.py.snap @@ -503,7 +503,6 @@ UP026 [*] `mock` is deprecated, use `unittest.mock` 85 | # This should yield multiple, aliased imports. 86 | from mock import mock as foo, mock as bar, mock | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Import from `unittest.mock` instead | 85 | # This should yield multiple, aliased imports. @@ -520,7 +519,6 @@ UP026 [*] `mock` is deprecated, use `unittest.mock` 92 | # Error (`mock.Mock()`). 93 | x = mock.mock.Mock() | ^^^^^^^^^ - | help: Replace `mock.mock` with `mock` | 92 | # Error (`mock.Mock()`). diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP028_0.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP028_0.py.snap index ad2c71231e97eb..c8e7dca2fe1510 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP028_0.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP028_0.py.snap @@ -8,7 +8,6 @@ UP028 [*] Replace `yield` over `for` loop with `yield from` 2 | / for x in y: 3 | | yield x | |_______________^ - | help: Replace with `yield from` | 1 | def f(): @@ -26,7 +25,6 @@ UP028 [*] Replace `yield` over `for` loop with `yield from` 7 | / for x, y in z: 8 | | yield (x, y) | |____________________^ - | help: Replace with `yield from` | 6 | def g(): @@ -44,7 +42,6 @@ UP028 [*] Replace `yield` over `for` loop with `yield from` 12 | / for x in [1, 2, 3]: 13 | | yield x | |_______________^ - | help: Replace with `yield from` | 11 | def h(): @@ -62,7 +59,6 @@ UP028 [*] Replace `yield` over `for` loop with `yield from` 17 | / for x in {x for x in y}: 18 | | yield x | |_______________^ - | help: Replace with `yield from` | 16 | def i(): @@ -80,7 +76,6 @@ UP028 [*] Replace `yield` over `for` loop with `yield from` 22 | / for x in (1, 2, 3): 23 | | yield x | |_______________^ - | help: Replace with `yield from` | 21 | def j(): @@ -98,7 +93,6 @@ UP028 [*] Replace `yield` over `for` loop with `yield from` 27 | / for x, y in {3: "x", 6: "y"}: 28 | | yield x, y | |__________________^ - | help: Replace with `yield from` | 26 | def k(): @@ -147,7 +141,6 @@ UP028 [*] Replace `yield` over `for` loop with `yield from` 44 | / for x, y in [{3: (3, [44, "long ss"]), 6: "y"}]: 45 | | yield x, y | |__________________^ - | help: Replace with `yield from` | 43 | def f(): @@ -209,7 +202,6 @@ UP028 [*] Replace `yield` over `for` loop with `yield from` 67 | / for z in x: 68 | | yield z | |_______________^ - | help: Replace with `yield from` | 66 | yield x @@ -250,7 +242,6 @@ UP028 [*] Replace `yield` over `for` loop with `yield from` 82 | | ): 83 | | yield h | |_______________^ - | help: Replace with `yield from` | 78 | def _serve_method(fn): @@ -357,7 +348,6 @@ UP028 [*] Replace `yield` over `for` loop with `yield from` 170 | / for a in 1,: 171 | | yield a | |_______________^ - | help: Replace with `yield from` | 169 | def f(): @@ -389,5 +379,4 @@ UP028 Replace `yield` over `for` loop with `yield from` 187 | / for some_non_local in iterable: 188 | | yield some_non_local | |________________________________^ - | help: Replace with `yield from` diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP029_1.py_skip_required_imports.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP029_1.py_skip_required_imports.snap index 52bc289d48dd5c..69d538baef1c7f 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP029_1.py_skip_required_imports.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP029_1.py_skip_required_imports.snap @@ -6,7 +6,6 @@ UP029 [*] Unnecessary builtin import: `int` | 1 | from builtins import str, int | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove unnecessary builtin import | - from builtins import str, int diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP030_0.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP030_0.py.snap index 207e3e6b2bc756..1a6e2d88d42978 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP030_0.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP030_0.py.snap @@ -486,7 +486,6 @@ UP030 [*] Use implicit references for positional format fields 64 | 65 | "{{{0}}}".format(123) | ^^^^^^^^^^^^^^^^^^^^^ - | help: Remove explicit positional indices | 64 | diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP031_0.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP031_0.py.snap index e578ccf4a07a5f..c521ec1aa2bad8 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP031_0.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP031_0.py.snap @@ -455,7 +455,6 @@ UP031 [*] Use format specifiers instead of percent format 57 | 58 | print("%(a)s" % {"a" : 1}) | ^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with format specifiers | 57 | @@ -815,7 +814,6 @@ UP031 [*] Use format specifiers instead of percent format 112 | | x, # comment 113 | | ) | |_^ - | help: Replace with format specifiers | 110 | @@ -1214,5 +1212,4 @@ UP031 Use format specifiers instead of percent format 170 | 171 | "%(and)s" % {"and": 2} | ^^^^^^^^^ - | help: Replace with format specifiers diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_0.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_0.py.snap index 6173f60104463f..774ff321e98099 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_0.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_0.py.snap @@ -713,7 +713,6 @@ UP032 [*] Use f-string instead of `format` call 106 | | "b" 107 | | ).format(a=1) | |_____________^ - | help: Convert to f-string | 104 | ( @@ -731,7 +730,6 @@ UP032 [*] Use f-string instead of `format` call 110 | def d(osname, version, release): 111 | return"{}-{}.{}".format(osname, version, release) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Convert to f-string | 110 | def d(osname, version, release): @@ -746,7 +744,6 @@ UP032 [*] Use f-string instead of `format` call 114 | def e(): 115 | yield"{}".format(1) | ^^^^^^^^^^^^^^ - | help: Convert to f-string | 114 | def e(): @@ -760,7 +757,6 @@ UP032 [*] Use f-string instead of `format` call | 118 | assert"{}".format(1) | ^^^^^^^^^^^^^^ - | help: Convert to f-string | 117 | @@ -775,7 +771,6 @@ UP032 [*] Use f-string instead of `format` call 121 | async def c(): 122 | return "{}".format(await 3) | ^^^^^^^^^^^^^^^^^^^^ - | help: Convert to f-string | 121 | async def c(): @@ -790,7 +785,6 @@ UP032 [*] Use f-string instead of `format` call 125 | async def c(): 126 | return "{}".format(1 + await 3) | ^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Convert to f-string | 125 | async def c(): @@ -927,7 +921,6 @@ UP032 Use f-string instead of `format` call 202 | | 1 # comment 203 | | ) | |_^ - | help: Convert to f-string UP032 [*] Use f-string instead of `format` call @@ -1056,7 +1049,6 @@ UP032 [*] Use f-string instead of `format` call 234 | 235 | ("{}" "{{}}").format(a) | ^^^^^^^^^^^^^^^^^^^^^^^ - | help: Convert to f-string | 234 | @@ -1267,7 +1259,6 @@ UP032 [*] Use f-string instead of `format` call 282 | # Raw string with \N{...} 283 | r"\N{angle}AOB = {angle}°".format(angle=180) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Convert to f-string | 282 | # Raw string with \N{...} diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_1.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_1.py.snap index 51eeb109654cc3..0480f71b84e28d 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_1.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_1.py.snap @@ -6,7 +6,6 @@ UP032 [*] Use f-string instead of `format` call | 1 | "{} {}".format(a, b) # Intentionally at start-of-file, to ensure graceful handling. | ^^^^^^^^^^^^^^^^^^^^ - | help: Convert to f-string | - "{} {}".format(a, b) # Intentionally at start-of-file, to ensure graceful handling. diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_2.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_2.py.snap index d9e8d40d7adbce..3c6fa7aee74e8b 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_2.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP032_2.py.snap @@ -426,7 +426,6 @@ UP032 [*] Use f-string instead of `format` call 32 | "{0.real}".format(1_2) 33 | "{a.real}".format(a=1_2) | ^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Convert to f-string | 32 | "{0.real}".format(1_2) diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP035.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP035.py.snap index fe100e44bfa5c9..b84ae75f6a71aa 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP035.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP035.py.snap @@ -1130,7 +1130,6 @@ UP035 [*] Import from `re` instead: `Pattern` 133 | # UP035 on py37+ only 134 | from typing.re import Pattern | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Import from `re` | 133 | # UP035 on py37+ only diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP037_0.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP037_0.py.snap index d0bce0c8a3fcb3..a9c1dba916fabe 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP037_0.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP037_0.py.snap @@ -37,7 +37,6 @@ UP037 [*] Remove quotes from type annotation 18 | def foo(var: "MyClass") -> "MyClass": 19 | x: "MyClass" | ^^^^^^^^^ - | help: Remove quotes | 18 | def foo(var: "MyClass") -> "MyClass": @@ -114,7 +113,6 @@ UP037 [*] Remove quotes from type annotation 31 | 32 | x: Callable[["MyClass"], None] | ^^^^^^^^^ - | help: Remove quotes | 31 | @@ -129,7 +127,6 @@ UP037 [*] Remove quotes from type annotation 35 | class Foo(NamedTuple): 36 | x: "MyClass" | ^^^^^^^^^ - | help: Remove quotes | 35 | class Foo(NamedTuple): @@ -144,7 +141,6 @@ UP037 [*] Remove quotes from type annotation 39 | class D(TypedDict): 40 | E: TypedDict("E", foo="int", total=False) | ^^^^^ - | help: Remove quotes | 39 | class D(TypedDict): @@ -159,7 +155,6 @@ UP037 [*] Remove quotes from type annotation 43 | class D(TypedDict): 44 | E: TypedDict("E", {"foo": "int"}) | ^^^^^ - | help: Remove quotes | 43 | class D(TypedDict): @@ -559,7 +554,6 @@ UP037 [*] Remove quotes from type annotation 125 | def foo(bar: "A\n#"): ... 126 | def foo(bar: "A\n#\n"): ... | ^^^^^^^^ - | help: Remove quotes | 125 | def foo(bar: "A\n#"): ... diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP037_1.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP037_1.py.snap index 3e8587c3a4e6d4..09e59a880d1ef8 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP037_1.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP037_1.py.snap @@ -24,7 +24,6 @@ UP037 [*] Remove quotes from type annotation 13 | # OK 14 | X: "Tuple[int, int]" = (0, 0) | ^^^^^^^^^^^^^^^^^ - | help: Remove quotes | 13 | # OK diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP037_2.pyi.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP037_2.pyi.snap index 645b89f4837ef1..5ef03783a7fa31 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP037_2.pyi.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP037_2.pyi.snap @@ -8,7 +8,6 @@ UP037 [*] Remove quotes from type annotation 2 | 3 | def f(a: Foo['SingleLine # Comment']): ... | ^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove quotes | 2 | @@ -26,7 +25,6 @@ UP037 [*] Remove quotes from type annotation 7 | | Multi | 8 | | Line]''']): ... | |____________^ - | help: Remove quotes | 5 | @@ -47,7 +45,6 @@ UP037 [*] Remove quotes from type annotation 13 | | Line # Comment 14 | | ]''']): ... | |____^ - | help: Remove quotes | 10 | @@ -68,7 +65,6 @@ UP037 [*] Remove quotes from type annotation 18 | | Multi | 19 | | Line] # Comment''']): ... | |_______________________^ - | help: Remove quotes | 16 | @@ -90,7 +86,6 @@ UP037 [*] Remove quotes from type annotation 24 | | Multi | 25 | | Line] # Comment''']): ... | |_______________________^ - | help: Remove quotes | 21 | @@ -111,7 +106,6 @@ UP037 [*] Remove quotes from type annotation | __________^ 29 | | ''' = []): ... | |_______^ - | help: Remove quotes | 27 | @@ -129,7 +123,6 @@ UP037 [*] Remove quotes from type annotation | ____^ 33 | | list[int]''' = [42] | |____________^ - | help: Remove quotes | 31 | @@ -148,7 +141,6 @@ UP037 [*] Remove quotes from type annotation 37 | | list[int] 38 | | ''' = []): ... | |_______^ - | help: Remove quotes | 35 | @@ -171,7 +163,6 @@ UP037 [*] Remove quotes from type annotation 45 | | Line 46 | | ] # Comment''']): ... | |___________________^ - | help: Remove quotes | 40 | @@ -194,7 +185,6 @@ UP037 [*] Remove quotes from type annotation | ____^ 50 | | [int]''' = [42] | |________^ - | help: Remove quotes | 48 | diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP037_3.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP037_3.py.snap index 7094914f7f3742..f16c938d508b94 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP037_3.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP037_3.py.snap @@ -26,7 +26,6 @@ UP037 [*] Remove quotes from type annotation 16 | # the behavior of _singleton above should match a non-ClassVar 17 | _doubleton: "EmptyCell" | ^^^^^^^^^^^ - | help: Remove quotes | 16 | # the behavior of _singleton above should match a non-ClassVar diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP039.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP039.py.snap index be76b72ac4b11d..29e0906293c7c8 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP039.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP039.py.snap @@ -89,7 +89,6 @@ UP039 [*] Unnecessary parentheses after class definition 47 | | # text 48 | | ): ... | |_^ - | help: Remove parentheses | 45 | diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP040.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP040.py.snap index e3acbbb7a55f47..2baabf904c2676 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP040.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP040.py.snap @@ -215,7 +215,6 @@ UP040 [*] Type alias `Decorator` uses `TypeAlias` annotation instead of the `typ 56 | T = typing.TypeVar["T"] 57 | Decorator: TypeAlias = typing.Callable[[T], T] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use the `type` keyword | 56 | T = typing.TypeVar["T"] @@ -352,7 +351,6 @@ UP040 [*] Type alias `PositiveList` uses `TypeAliasType` assignment instead of t 105 | | "PositiveList", list[Annotated[T, Gt(0)]], type_params=(T,) 106 | | ) # this comment should be okay | |_^ - | help: Use the `type` keyword | 103 | T = TypeVar("T") diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP040.py__preview_diff.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP040.py__preview_diff.snap index f2eed99224205d..81fb3d356d6262 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP040.py__preview_diff.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP040.py__preview_diff.snap @@ -56,7 +56,6 @@ UP040 [*] Type alias `DefaultList` uses `TypeAlias` annotation instead of the `t 133 | T_default = TypeVar("T_default", default=int) 134 | DefaultList: TypeAlias = list[T_default] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use the `type` keyword | 133 | T_default = TypeVar("T_default", default=int) diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP040.pyi.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP040.pyi.snap index 5ce1224285c4ab..c37220ce2a1596 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP040.pyi.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP040.pyi.snap @@ -25,7 +25,6 @@ UP040 [*] Type alias `x` uses `TypeAlias` annotation instead of the `type` keywo 6 | x: typing.TypeAlias = int 7 | x: TypeAlias = int | ^^^^^^^^^^^^^^^^^^ - | help: Use the `type` keyword | 6 | x: typing.TypeAlias = int @@ -69,7 +68,6 @@ UP040 [*] Type alias `T` uses `TypeAlias` annotation instead of the `type` keywo 23 | | # comment7 24 | | ) # comment8 | |_^ - | help: Use the `type` keyword | 15 | diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP042.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP042.py.snap index 2016e4aea4eae3..dae543a0e80997 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP042.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP042.py.snap @@ -6,7 +6,6 @@ UP042 [*] Class A inherits from both `str` and `enum.Enum` | 4 | class A(str, Enum): ... | ^ - | help: Inherit from `enum.StrEnum` | - from enum import Enum @@ -24,7 +23,6 @@ UP042 [*] Class B inherits from both `str` and `enum.Enum` | 7 | class B(Enum, str): ... | ^ - | help: Inherit from `enum.StrEnum` | - from enum import Enum @@ -43,7 +41,6 @@ UP042 Class D inherits from both `str` and `enum.Enum` | 10 | class D(int, str, Enum): ... | ^ - | help: Inherit from `enum.StrEnum` UP042 Class E inherits from both `str` and `enum.Enum` @@ -51,5 +48,4 @@ UP042 Class E inherits from both `str` and `enum.Enum` | 13 | class E(str, int, Enum): ... | ^ - | help: Inherit from `enum.StrEnum` diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP045_1.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP045_1.py.snap index 8dd4852157bb59..55a22140f422b9 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP045_1.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP045_1.py.snap @@ -54,7 +54,6 @@ UP045 Use `X | None` for type annotations 14 | x: Optional[str] 15 | x = Optional[str] | ^^^^^^^^^^^^^ - | help: Convert to `X | None` UP045 [*] Use `X | None` for type annotations @@ -110,7 +109,6 @@ UP045 [*] Use `X | None` for type annotations 38 | | | list[ServiceSpecification] 39 | | ] = None | |_____^ - | help: Convert to `X | None` | 35 | class ServiceRefOrValue: @@ -129,7 +127,6 @@ UP045 [*] Use `X | None` for type annotations 43 | class ServiceRefOrValue: 44 | service_specification: Optional[str]is not True = None | ^^^^^^^^^^^^^ - | help: Convert to `X | None` | 43 | class ServiceRefOrValue: @@ -145,7 +142,6 @@ UP045 Use `X | None` for type annotations 48 | # Optional[None] should not be offered a fix 49 | foo: Optional[None] = None | ^^^^^^^^^^^^^^ - | help: Convert to `X | None` UP045 [*] Use `X | None` for type annotations @@ -225,7 +221,6 @@ UP045 [*] Use `X | None` for type annotations 77 | nested_optional_typing: typing.Optional[Optional[int]] = None 78 | triple_nested_optional: Optional[Optional[Optional[str]]] = None | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Convert to `X | None` | 77 | nested_optional_typing: typing.Optional[Optional[int]] = None @@ -241,7 +236,6 @@ UP045 [*] Use `X | None` for type annotations 77 | nested_optional_typing: typing.Optional[Optional[int]] = None 78 | triple_nested_optional: Optional[Optional[Optional[str]]] = None | ^^^^^^^^^^^^^^^^^^^^^^^ - | help: Convert to `X | None` | 77 | nested_optional_typing: typing.Optional[Optional[int]] = None @@ -257,7 +251,6 @@ UP045 [*] Use `X | None` for type annotations 77 | nested_optional_typing: typing.Optional[Optional[int]] = None 78 | triple_nested_optional: Optional[Optional[Optional[str]]] = None | ^^^^^^^^^^^^^ - | help: Convert to `X | None` | 77 | nested_optional_typing: typing.Optional[Optional[int]] = None @@ -275,7 +268,6 @@ UP045 [*] Use `X | None` for type annotations 83 | | # text 84 | | ] = None | |_^ - | help: Convert to `X | None` | 80 | @@ -366,5 +358,4 @@ UP045 Use `X | None` for type annotations 92 | bar: Optional[None | int | str] = None 93 | bar: Optional[None | None] = None | ^^^^^^^^^^^^^^^^^^^^^ - | help: Convert to `X | None` diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP046_0.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP046_0.py.snap index dc9ec5102188cb..0dcc52d70435bc 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP046_0.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP046_0.py.snap @@ -167,7 +167,6 @@ UP046 [*] Generic class `A` uses `Generic` subclass instead of type parameters | 73 | class A(Generic[T]): ... | ^^^^^^^^^^ - | help: Use type parameters | 72 | diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP049_1.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP049_1.py.snap index 3a59718287df7a..36991658e00d17 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP049_1.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP049_1.py.snap @@ -203,7 +203,6 @@ UP049 Generic class uses private type parameters 38 | # offer a diagnostic 39 | class F[_async]: ... | ^^^^^^ - | help: Rename type parameter to remove leading underscores UP049 Generic class uses private type parameters @@ -223,7 +222,6 @@ UP049 Generic class uses private type parameters | 64 | class C[_0]: ... | ^^ - | help: Rename type parameter to remove leading underscores UP049 Generic class uses private type parameters @@ -241,7 +239,6 @@ UP049 Generic class uses private type parameters 67 | class C[T, _T]: ... 68 | class C[_T, T]: ... | ^^ - | help: Rename type parameter to remove leading underscores UP049 [*] Generic class uses private type parameters diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__add_future_annotation_UP037_0.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__add_future_annotation_UP037_0.py.snap index d0bce0c8a3fcb3..a9c1dba916fabe 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__add_future_annotation_UP037_0.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__add_future_annotation_UP037_0.py.snap @@ -37,7 +37,6 @@ UP037 [*] Remove quotes from type annotation 18 | def foo(var: "MyClass") -> "MyClass": 19 | x: "MyClass" | ^^^^^^^^^ - | help: Remove quotes | 18 | def foo(var: "MyClass") -> "MyClass": @@ -114,7 +113,6 @@ UP037 [*] Remove quotes from type annotation 31 | 32 | x: Callable[["MyClass"], None] | ^^^^^^^^^ - | help: Remove quotes | 31 | @@ -129,7 +127,6 @@ UP037 [*] Remove quotes from type annotation 35 | class Foo(NamedTuple): 36 | x: "MyClass" | ^^^^^^^^^ - | help: Remove quotes | 35 | class Foo(NamedTuple): @@ -144,7 +141,6 @@ UP037 [*] Remove quotes from type annotation 39 | class D(TypedDict): 40 | E: TypedDict("E", foo="int", total=False) | ^^^^^ - | help: Remove quotes | 39 | class D(TypedDict): @@ -159,7 +155,6 @@ UP037 [*] Remove quotes from type annotation 43 | class D(TypedDict): 44 | E: TypedDict("E", {"foo": "int"}) | ^^^^^ - | help: Remove quotes | 43 | class D(TypedDict): @@ -559,7 +554,6 @@ UP037 [*] Remove quotes from type annotation 125 | def foo(bar: "A\n#"): ... 126 | def foo(bar: "A\n#\n"): ... | ^^^^^^^^ - | help: Remove quotes | 125 | def foo(bar: "A\n#"): ... diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__add_future_annotation_UP037_1.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__add_future_annotation_UP037_1.py.snap index 3e8587c3a4e6d4..09e59a880d1ef8 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__add_future_annotation_UP037_1.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__add_future_annotation_UP037_1.py.snap @@ -24,7 +24,6 @@ UP037 [*] Remove quotes from type annotation 13 | # OK 14 | X: "Tuple[int, int]" = (0, 0) | ^^^^^^^^^^^^^^^^^ - | help: Remove quotes | 13 | # OK diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__add_future_annotation_UP037_2.pyi.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__add_future_annotation_UP037_2.pyi.snap index 645b89f4837ef1..5ef03783a7fa31 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__add_future_annotation_UP037_2.pyi.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__add_future_annotation_UP037_2.pyi.snap @@ -8,7 +8,6 @@ UP037 [*] Remove quotes from type annotation 2 | 3 | def f(a: Foo['SingleLine # Comment']): ... | ^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove quotes | 2 | @@ -26,7 +25,6 @@ UP037 [*] Remove quotes from type annotation 7 | | Multi | 8 | | Line]''']): ... | |____________^ - | help: Remove quotes | 5 | @@ -47,7 +45,6 @@ UP037 [*] Remove quotes from type annotation 13 | | Line # Comment 14 | | ]''']): ... | |____^ - | help: Remove quotes | 10 | @@ -68,7 +65,6 @@ UP037 [*] Remove quotes from type annotation 18 | | Multi | 19 | | Line] # Comment''']): ... | |_______________________^ - | help: Remove quotes | 16 | @@ -90,7 +86,6 @@ UP037 [*] Remove quotes from type annotation 24 | | Multi | 25 | | Line] # Comment''']): ... | |_______________________^ - | help: Remove quotes | 21 | @@ -111,7 +106,6 @@ UP037 [*] Remove quotes from type annotation | __________^ 29 | | ''' = []): ... | |_______^ - | help: Remove quotes | 27 | @@ -129,7 +123,6 @@ UP037 [*] Remove quotes from type annotation | ____^ 33 | | list[int]''' = [42] | |____________^ - | help: Remove quotes | 31 | @@ -148,7 +141,6 @@ UP037 [*] Remove quotes from type annotation 37 | | list[int] 38 | | ''' = []): ... | |_______^ - | help: Remove quotes | 35 | @@ -171,7 +163,6 @@ UP037 [*] Remove quotes from type annotation 45 | | Line 46 | | ] # Comment''']): ... | |___________________^ - | help: Remove quotes | 40 | @@ -194,7 +185,6 @@ UP037 [*] Remove quotes from type annotation | ____^ 50 | | [int]''' = [42] | |________^ - | help: Remove quotes | 48 | diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__datetime_utc_alias_py311.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__datetime_utc_alias_py311.snap index 557f7680463dca..1759a22bd95940 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__datetime_utc_alias_py311.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__datetime_utc_alias_py311.snap @@ -8,7 +8,6 @@ UP017 [*] Use `datetime.UTC` alias 9 | 10 | print(timezone.utc) | ^^^^^^^^^^^^ - | help: Convert to `datetime.UTC` alias | 1 + from datetime import UTC @@ -27,7 +26,6 @@ UP017 [*] Use `datetime.UTC` alias 15 | 16 | print(tz.utc) | ^^^^^^ - | help: Convert to `datetime.UTC` alias | 1 + from datetime import UTC @@ -46,7 +44,6 @@ UP017 [*] Use `datetime.UTC` alias 21 | 22 | print(datetime.timezone.utc) | ^^^^^^^^^^^^^^^^^^^^^ - | help: Convert to `datetime.UTC` alias | 21 | @@ -62,7 +59,6 @@ UP017 [*] Use `datetime.UTC` alias 27 | 28 | print(dt.timezone.utc) | ^^^^^^^^^^^^^^^ - | help: Convert to `datetime.UTC` alias | 27 | diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__future_annotations_keep_runtime_typing_p310.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__future_annotations_keep_runtime_typing_p310.snap index bc78e199be5991..408d6ee9cb4df1 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__future_annotations_keep_runtime_typing_p310.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__future_annotations_keep_runtime_typing_p310.snap @@ -41,7 +41,6 @@ UP006 [*] Use `list` instead of `List` for type annotation 41 | 42 | MyList: TypeAlias = Union[List[int], List[str]] | ^^^^ - | help: Replace with `list` | 41 | @@ -56,7 +55,6 @@ UP006 [*] Use `list` instead of `List` for type annotation 41 | 42 | MyList: TypeAlias = Union[List[int], List[str]] | ^^^^ - | help: Replace with `list` | 41 | diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__future_annotations_pep_585_py310.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__future_annotations_pep_585_py310.snap index bc78e199be5991..408d6ee9cb4df1 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__future_annotations_pep_585_py310.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__future_annotations_pep_585_py310.snap @@ -41,7 +41,6 @@ UP006 [*] Use `list` instead of `List` for type annotation 41 | 42 | MyList: TypeAlias = Union[List[int], List[str]] | ^^^^ - | help: Replace with `list` | 41 | @@ -56,7 +55,6 @@ UP006 [*] Use `list` instead of `List` for type annotation 41 | 42 | MyList: TypeAlias = Union[List[int], List[str]] | ^^^^ - | help: Replace with `list` | 41 | diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__future_annotations_pep_604_py310.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__future_annotations_pep_604_py310.snap index 1f3bf23257955e..f1291f2cf3ec71 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__future_annotations_pep_604_py310.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__future_annotations_pep_604_py310.snap @@ -24,7 +24,6 @@ UP007 [*] Use `X | Y` for type annotations 41 | 42 | MyList: TypeAlias = Union[List[int], List[str]] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Convert to `X | Y` | 41 | diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB105_FURB105.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB105_FURB105.py.snap index 81628ae9e230fa..3b5583ab03894b 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB105_FURB105.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB105_FURB105.py.snap @@ -422,7 +422,6 @@ FURB105 [*] Unnecessary empty string passed to `print` 48 | | "" 49 | | ) | |_^ - | help: Remove empty string | 45 | diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB113_FURB113.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB113_FURB113.py.snap index c096f7886cbe43..346998d67ea50e 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB113_FURB113.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB113_FURB113.py.snap @@ -132,7 +132,6 @@ FURB113 [*] Use `nums.extend((1, 2, 3))` instead of repeatedly calling `nums.app 63 | | nums.append(2) 64 | | nums.append(3) | |______________^ - | help: Replace with `nums.extend((1, 2, 3))` | 61 | # FURB113 @@ -152,7 +151,6 @@ FURB113 [*] Use `nums.extend((1, 2))` instead of repeatedly calling `nums.append 69 | / nums.append(1) 70 | | nums.append(2) | |__________________^ - | help: Replace with `nums.extend((1, 2))` | 68 | # FURB113 @@ -193,7 +191,6 @@ FURB113 Use `nums.extend((1, 2, 3))` instead of repeatedly calling `nums.append( 84 | | nums.append(2) 85 | | nums.append(3) | |__________________^ - | help: Replace with `nums.extend((1, 2, 3))` FURB113 [*] Use `x.extend((1, 2))` instead of repeatedly calling `x.append()` @@ -204,7 +201,6 @@ FURB113 [*] Use `x.extend((1, 2))` instead of repeatedly calling `x.append()` 90 | / x.append(1) 91 | | x.append(2) | |_______________^ - | help: Replace with `x.extend((1, 2))` | 89 | # FURB113 @@ -223,7 +219,6 @@ FURB113 [*] Use `x.extend((1, 2))` instead of repeatedly calling `x.append()` 96 | / x.append(1) 97 | | x.append(2) | |_______________^ - | help: Replace with `x.extend((1, 2))` | 95 | # FURB113 @@ -242,7 +237,6 @@ FURB113 [*] Use `x.extend((1, 2))` instead of repeatedly calling `x.append()` 102 | / x.append(1) 103 | | x.append(2) | |_______________^ - | help: Replace with `x.extend((1, 2))` | 101 | # FURB113 @@ -261,7 +255,6 @@ FURB113 [*] Use `x.extend((1, 2))` instead of repeatedly calling `x.append()` 108 | / x.append(1) 109 | | x.append(2) | |_______________^ - | help: Replace with `x.extend((1, 2))` | 107 | # FURB113 @@ -282,7 +275,6 @@ FURB113 Use `x.extend((1, 2, 3))` instead of repeatedly calling `x.append()` 116 | | y.append(1) 117 | | x.append(3) | |_______________^ - | help: Replace with `x.extend((1, 2, 3))` FURB113 [*] Use `x.extend((1, 2))` instead of repeatedly calling `x.append()` @@ -293,7 +285,6 @@ FURB113 [*] Use `x.extend((1, 2))` instead of repeatedly calling `x.append()` 122 | / x.append(1) 123 | | x.append(2) | |_______________^ - | help: Replace with `x.extend((1, 2))` | 121 | # FURB113 @@ -315,5 +306,4 @@ FURB113 Use `nums.extend((1, 2, 3))` instead of repeatedly calling `nums.append( 131 | | # comment 132 | | nums.append(3) | |__________________^ - | help: Replace with `nums.extend((1, 2, 3))` diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB116_FURB116.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB116_FURB116.py.snap index 7b038caeef20f6..fe95ed16e7fd56 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB116_FURB116.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB116_FURB116.py.snap @@ -252,7 +252,6 @@ FURB116 [*] Replace `bin` call with `f"{-1:b}"` 43 | # for negatives numbers autofix is display-only 44 | print(bin(-1)[2:]) | ^^^^^^^^^^^ - | help: Replace with `f"{-1:b}"` | 43 | # for negatives numbers autofix is display-only diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB118_FURB118.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB118_FURB118.py.snap index fc66bbb6d32d58..306415bd82ed8d 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB118_FURB118.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB118_FURB118.py.snap @@ -709,7 +709,6 @@ FURB118 [*] Use `operator.itemgetter((0, 1))` instead of defining a lambda 34 | op_itemgetter = lambda x: x[0, 1] 35 | op_itemgetter = lambda x: x[(0, 1)] | ^^^^^^^^^^^^^^^^^^^ - | help: Replace with `operator.itemgetter((0, 1))` | 1 | # Errors. @@ -813,7 +812,6 @@ FURB118 [*] Use `operator.itemgetter((1, 2))` instead of defining a lam 94 | # Without a slice, trivia is retained 95 | op_itemgetter = lambda x: x[1, 2] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `operator.itemgetter((1, 2))` | 1 | # Errors. diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB122_FURB122.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB122_FURB122.py.snap index 78c5e04094593a..126ca055740d09 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB122_FURB122.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB122_FURB122.py.snap @@ -9,7 +9,6 @@ FURB122 [*] Use of `f.write` in a for loop 10 | / for line in lines: 11 | | f.write(line) | |_________________________^ - | help: Replace with `f.writelines` | 9 | with open("file", "w") as f: @@ -27,7 +26,6 @@ FURB122 [*] Use of `f.write` in a for loop 17 | / for line in lines: 18 | | f.write(other_line) | |_______________________________^ - | help: Replace with `f.writelines` | 16 | with Path("file").open("w") as f: @@ -45,7 +43,6 @@ FURB122 [*] Use of `f.write` in a for loop 23 | / for line in lines: 24 | | f.write(line) | |_________________________^ - | help: Replace with `f.writelines` | 22 | with Path("file").open("w") as f: @@ -63,7 +60,6 @@ FURB122 [*] Use of `f.write` in a for loop 29 | / for line in lines: 30 | | f.write(line.encode()) | |__________________________________^ - | help: Replace with `f.writelines` | 28 | with Path("file").open("wb") as f: @@ -81,7 +77,6 @@ FURB122 [*] Use of `f.write` in a for loop 35 | / for line in lines: 36 | | f.write(line.upper()) | |_________________________________^ - | help: Replace with `f.writelines` | 34 | with Path("file").open("w") as f: @@ -99,7 +94,6 @@ FURB122 [*] Use of `f.write` in a for loop 43 | / for line in lines: 44 | | f.write(line) | |_________________________^ - | help: Replace with `f.writelines` | 42 | @@ -118,7 +112,6 @@ FURB122 [*] Use of `f.write` in a for loop 51 | | # a really important comment 52 | | f.write(line) | |_________________________^ - | help: Replace with `f.writelines` | 49 | with open("file","w") as f: @@ -138,7 +131,6 @@ FURB122 [*] Use of `f.write` in a for loop 57 | / for () in a: 58 | | f.write(()) | |_______________________^ - | help: Replace with `f.writelines` | 56 | with open("file", "w") as f: @@ -156,7 +148,6 @@ FURB122 [*] Use of `f.write` in a for loop 63 | / for a, b, c in d: 64 | | f.write((a, b)) | |___________________________^ - | help: Replace with `f.writelines` | 62 | with open("file", "w") as f: @@ -174,7 +165,6 @@ FURB122 [*] Use of `f.write` in a for loop 69 | / for [(), [a.b], (c,)] in d: 70 | | f.write(()) | |_______________________^ - | help: Replace with `f.writelines` | 68 | with open("file", "w") as f: @@ -192,7 +182,6 @@ FURB122 [*] Use of `f.write` in a for loop 75 | / for [([([a[b]],)],), [], (c[d],)] in e: 76 | | f.write(()) | |_______________________^ - | help: Replace with `f.writelines` | 74 | with open("file", "w") as f: @@ -253,7 +242,6 @@ FURB122 [*] Use of `f.write` in a for loop 96 | | ): 97 | | f.write(f"{char}") | |______________________________^ - | help: Replace with `f.writelines` | 92 | with open("file", "w") as f: @@ -276,7 +264,6 @@ FURB122 [*] Use of `f.write` in a for loop 183 | / for l in lambda: 0: 184 | | f.write(f"[{l}]") | |_____________________________^ - | help: Replace with `f.writelines` | 182 | with Path("file.txt").open("w", encoding="utf-8") as f: @@ -294,7 +281,6 @@ FURB122 [*] Use of `f.write` in a for loop 189 | / for l in (1,) if True else (2,): 190 | | f.write(f"[{l}]") | |_____________________________^ - | help: Replace with `f.writelines` | 188 | with Path("file.txt").open("w", encoding="utf-8") as f: @@ -312,7 +298,6 @@ FURB122 [*] Use of `f.write` in a for loop 196 | / for line in lambda: 0: 197 | | f.write(line) | |_________________________^ - | help: Replace with `f.writelines` | 195 | with open("file", "w") as f: @@ -330,7 +315,6 @@ FURB122 [*] Use of `f.write` in a for loop 202 | / for line in (1,) if True else (2,): 203 | | f.write(line) | |_________________________^ - | help: Replace with `f.writelines` | 201 | with open("file", "w") as f: @@ -348,7 +332,6 @@ FURB122 [*] Use of `f.write` in a for loop 209 | / for line in (lambda: 0): 210 | | f.write(f"{line}") | |______________________________^ - | help: Replace with `f.writelines` | 208 | with open("file", "w") as f: @@ -366,7 +349,6 @@ FURB122 [*] Use of `f.write` in a for loop 215 | / for line in ((1,) if True else (2,)): 216 | | f.write(f"{line}") | |______________________________^ - | help: Replace with `f.writelines` | 214 | with open("file", "w") as f: diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB129_FURB129.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB129_FURB129.py.snap index 377dd38e573b1f..8adcea8b87a99a 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB129_FURB129.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB129_FURB129.py.snap @@ -229,7 +229,6 @@ FURB129 [*] Instead of calling `readlines()`, iterate over file object directly 96 | with open("furb129.py") as f: 97 | [line for line in (f).readlines()] | ^^^^^^^^^^^^^^^ - | help: Remove `readlines()` | 96 | with open("furb129.py") as f: diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB131_FURB131.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB131_FURB131.py.snap index 547da9b559c6d7..eed82175cc2023 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB131_FURB131.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB131_FURB131.py.snap @@ -7,7 +7,6 @@ FURB131 [*] Prefer `clear` over deleting a full slice 10 | # FURB131 11 | del nums[:] | ^^^^^^^^^^^ - | help: Replace with `clear()` | 10 | # FURB131 @@ -23,7 +22,6 @@ FURB131 [*] Prefer `clear` over deleting a full slice 14 | # FURB131 15 | del names[:] | ^^^^^^^^^^^^ - | help: Replace with `clear()` | 14 | # FURB131 @@ -39,7 +37,6 @@ FURB131 Prefer `clear` over deleting a full slice 18 | # FURB131 19 | del x, nums[:] | ^^^^^^^^^^^^^^ - | help: Replace with `clear()` FURB131 Prefer `clear` over deleting a full slice @@ -48,7 +45,6 @@ FURB131 Prefer `clear` over deleting a full slice 22 | # FURB131 23 | del y, names[:], x | ^^^^^^^^^^^^^^^^^^ - | help: Replace with `clear()` FURB131 [*] Prefer `clear` over deleting a full slice @@ -58,7 +54,6 @@ FURB131 [*] Prefer `clear` over deleting a full slice 27 | # FURB131 28 | del x[:] | ^^^^^^^^ - | help: Replace with `clear()` | 27 | # FURB131 @@ -75,7 +70,6 @@ FURB131 [*] Prefer `clear` over deleting a full slice 32 | # FURB131 33 | del x[:] | ^^^^^^^^ - | help: Replace with `clear()` | 32 | # FURB131 @@ -92,7 +86,6 @@ FURB131 [*] Prefer `clear` over deleting a full slice 37 | # FURB131 38 | del x[:] | ^^^^^^^^ - | help: Replace with `clear()` | 37 | # FURB131 @@ -109,7 +102,6 @@ FURB131 [*] Prefer `clear` over deleting a full slice 42 | # FURB131 43 | del x[:] | ^^^^^^^^ - | help: Replace with `clear()` | 42 | # FURB131 diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB132_FURB132.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB132_FURB132.py.snap index d58bfdb288b08b..e7e76f38b713b3 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB132_FURB132.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB132_FURB132.py.snap @@ -8,7 +8,6 @@ FURB132 [*] Use `s.discard("x")` instead of check and `remove` 12 | / if "x" in s: 13 | | s.remove("x") | |_________________^ - | help: Replace with `s.discard("x")` | 11 | # FURB132 @@ -26,7 +25,6 @@ FURB132 [*] Use `s3.discard("x")` instead of check and `remove` 22 | / if "x" in s3: 23 | | s3.remove("x") | |__________________^ - | help: Replace with `s3.discard("x")` | 21 | # FURB132 @@ -45,7 +43,6 @@ FURB132 [*] Use `s.discard(var)` instead of check and `remove` 28 | / if var in s: 29 | | s.remove(var) | |_________________^ - | help: Replace with `s.discard(var)` | 27 | # FURB132 @@ -62,7 +59,6 @@ FURB132 [*] Use `s.discard(f"{var}:{var}")` instead of check and `remove` 32 | / if f"{var}:{var}" in s: 33 | | s.remove(f"{var}:{var}") | |____________________________^ - | help: Replace with `s.discard(f"{var}:{var}")` | 31 | diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB136_FURB136.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB136_FURB136.py.snap index 3cb5077164686b..64b885d1734a5a 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB136_FURB136.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB136_FURB136.py.snap @@ -155,7 +155,6 @@ FURB136 [*] Replace `if` expression with `max(y, x)` 24 | | > y 25 | | ) else y # FURB136 | |________^ - | help: Replace with `max(y, x)` | 21 | diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB140_FURB140.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB140_FURB140.py.snap index ad1625f5759c39..85c6cb9a1318a4 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB140_FURB140.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB140_FURB140.py.snap @@ -47,7 +47,6 @@ FURB140 [*] Use `itertools.starmap` instead of the generator 12 | # FURB140 13 | {print(x, y) for x, y in zipped()} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `itertools.starmap` | 1 + from itertools import starmap diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB142_FURB142.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB142_FURB142.py.snap index 8f8e6b03d1bbe8..3ed7c5780d55e4 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB142_FURB142.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB142_FURB142.py.snap @@ -231,7 +231,6 @@ FURB142 [*] Use of `set.add()` in a for loop 44 | | ): 45 | | s.add(f"{x}") | |_________________^ - | help: Replace with `.update()` | 40 | @@ -390,7 +389,6 @@ FURB142 [*] Use of `set.add()` in a for loop 108 | / for x in ("abc", "def"): 109 | | s.add((c for c in x)) | |_________________________^ - | help: Replace with `.update()` | 107 | # don't add extra parens for already parenthesized generators diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB145_FURB145.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB145_FURB145.py.snap index a0e851b790cff8..e0386246b4b320 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB145_FURB145.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB145_FURB145.py.snap @@ -116,7 +116,6 @@ FURB145 [*] Prefer `copy` method over slicing 26 | | : 27 | | ] | |_^ - | help: Replace with `copy()` | 23 | diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB152_FURB152.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB152_FURB152.py.snap index 2402ae2e96f32d..e8285f3b8929c9 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB152_FURB152.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB152_FURB152.py.snap @@ -302,7 +302,6 @@ FURB152 [*] Replace `2.7182000000000001` with `math.e` 44 | 45 | e = 2.7182000000000001 # FURB152 | ^^^^^^^^^^^^^^^^^^ - | help: Use `math.e` | 1 + import math diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB154_FURB154.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB154_FURB154.py.snap index d5c1416d797f91..61de91d4684a55 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB154_FURB154.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB154_FURB154.py.snap @@ -8,7 +8,6 @@ FURB154 [*] Use of repeated consecutive `global` 4 | / global x 5 | | global y | |____________^ - | help: Merge `global` statements | 3 | def f1(): @@ -26,7 +25,6 @@ FURB154 [*] Use of repeated consecutive `global` 10 | | global y 11 | | global z | |____________^ - | help: Merge `global` statements | 8 | def f3(): @@ -64,7 +62,6 @@ FURB154 [*] Use of repeated consecutive `global` 18 | / global x 19 | | global y | |____________^ - | help: Merge `global` statements | 17 | pass @@ -141,7 +138,6 @@ FURB154 [*] Use of repeated consecutive `nonlocal` 38 | / nonlocal x 39 | | nonlocal y | |__________________^ - | help: Merge `nonlocal` statements | 37 | pass @@ -198,7 +194,6 @@ FURB154 [*] Use of repeated consecutive `nonlocal` 53 | / nonlocal y 54 | | nonlocal z | |__________________^ - | help: Merge `nonlocal` statements | 52 | global x @@ -216,7 +211,6 @@ FURB154 [*] Use of repeated consecutive `global` 59 | | global a, b, c 60 | | global d, e, f | |__________________^ - | help: Merge `global` statements | 57 | def f6(): diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB157_FURB157.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB157_FURB157.py.snap index 34b408d739eb80..b23d38312d5fd1 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB157_FURB157.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB157_FURB157.py.snap @@ -680,7 +680,6 @@ FURB157 [*] Verbose expression in `Decimal` constructor 92 | Decimal("_+1") # Should flag as verbose 93 | Decimal("_-1_000") # Should flag as verbose | ^^^^^^^^^ - | help: Replace with `-1_000` | 92 | Decimal("_+1") # Should flag as verbose diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB162_FURB162.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB162_FURB162.py.snap index eb507c8a99baa1..4b040a8bb3a999 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB162_FURB162.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB162_FURB162.py.snap @@ -208,7 +208,6 @@ FURB162 [*] Unnecessary timezone replacement with zero offset 51 | # Edge case 52 | datetime.fromisoformat("Z2025-01-01T00:00:00Z".strip("Z") + "+00:00") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove `.replace()` call | 51 | # Edge case diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB163_FURB163.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB163_FURB163.py.snap index 8c84dd51fe408b..05dc04cac272b3 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB163_FURB163.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB163_FURB163.py.snap @@ -156,7 +156,6 @@ FURB163 [*] Prefer `math.log(yield)` over `math.log` with a redundant base 48 | def log(): 49 | yield math.log((yield), math.e) | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `math.log(yield)` | 48 | def log(): @@ -301,7 +300,6 @@ FURB163 [*] Prefer `math.log10(4.14e223)` over `math.log` with a redundant base 74 | math.log(4.13e223, 2) 75 | math.log(4.14e223, 10) | ^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `math.log10(4.14e223)` | 74 | math.log(4.13e223, 2) diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB164_FURB164.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB164_FURB164.py.snap index 93d0384f59cbc8..12431abb9bb720 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB164_FURB164.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB164_FURB164.py.snap @@ -699,7 +699,6 @@ FURB164 [*] Verbose method `from_float` in `Decimal` construction 81 | | float("inf") 82 | | ) | |_^ - | help: Replace with `Decimal` constructor | 78 | diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB166_FURB166.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB166_FURB166.py.snap index f87a780a8944b9..b21c9ec5c121df 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB166_FURB166.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB166_FURB166.py.snap @@ -100,7 +100,6 @@ FURB166 [*] Use of `int` with explicit `base=16` after removing prefix 11 | 12 | _ = int(b"0xFFFF"[2:], 16) | ^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `base=0` | 11 | diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB169_FURB169.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB169_FURB169.py.snap index 43cbe9f577affe..ba454f05e77032 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB169_FURB169.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB169_FURB169.py.snap @@ -293,7 +293,6 @@ FURB169 [*] When checking against `None`, use `is not` instead of comparison wit 42 | | a for a in range(0) 43 | | ) is not type(None) | |___________________^ - | help: Replace with `is not None` | 40 | diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB187_FURB187.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB187_FURB187.py.snap index 662129dd06dec6..24f1a54ecc1f4f 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB187_FURB187.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB187_FURB187.py.snap @@ -8,7 +8,6 @@ FURB187 [*] Use of assignment of `reversed` on list `l` 5 | l = [] 6 | l = reversed(l) | ^^^^^^^^^^^^^^^ - | help: Replace with `l.reverse()` | 5 | l = [] @@ -25,7 +24,6 @@ FURB187 [*] Use of assignment of `reversed` on list `l` 10 | l = [] 11 | l = list(reversed(l)) | ^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `l.reverse()` | 10 | l = [] @@ -42,7 +40,6 @@ FURB187 [*] Use of assignment of `reversed` on list `l` 15 | l = [] 16 | l = l[::-1] | ^^^^^^^^^^^ - | help: Replace with `l.reverse()` | 15 | l = [] diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB188_FURB188.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB188_FURB188.py.snap index c260010e790aa3..67c26ad968e9c1 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB188_FURB188.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB188_FURB188.py.snap @@ -45,7 +45,6 @@ FURB188 [*] Prefer `str.removesuffix()` over conditionally replacing with slice. 20 | def remove_extension_via_ternary(filename: str) -> str: 21 | return filename[:-4] if filename.endswith(".txt") else filename | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use removesuffix instead of ternary expression conditional upon endswith. | 20 | def remove_extension_via_ternary(filename: str) -> str: @@ -60,7 +59,6 @@ FURB188 [*] Prefer `str.removesuffix()` over conditionally replacing with slice. 24 | def remove_extension_via_ternary_with_len(filename: str, extension: str) -> str: 25 | return filename[:-len(extension)] if filename.endswith(extension) else filename | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use removesuffix instead of ternary expression conditional upon endswith. | 24 | def remove_extension_via_ternary_with_len(filename: str, extension: str) -> str: @@ -75,7 +73,6 @@ FURB188 [*] Prefer `str.removeprefix()` over conditionally replacing with slice. 28 | def remove_prefix(filename: str) -> str: 29 | return filename[4:] if filename.startswith("abc-") else filename | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use removeprefix instead of ternary expression conditional upon startswith. | 28 | def remove_prefix(filename: str) -> str: @@ -90,7 +87,6 @@ FURB188 [*] Prefer `str.removeprefix()` over conditionally replacing with slice. 32 | def remove_prefix_via_len(filename: str, prefix: str) -> str: 33 | return filename[len(prefix):] if filename.startswith(prefix) else filename | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use removeprefix instead of ternary expression conditional upon startswith. | 32 | def remove_prefix_via_len(filename: str, prefix: str) -> str: @@ -219,7 +215,6 @@ FURB188 [*] Prefer `str.removeprefix()` over conditionally replacing with slice. 183 | / if text.startswith("ř"): 184 | | text = text[1:] | |_______________________^ - | help: Use removeprefix instead of assignment conditional upon startswith. | 182 | text = "řetězec" diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB192_FURB192_1.py.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB192_FURB192_1.py.snap index df3c7a5b99f80d..5e5ec280ff19bf 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB192_FURB192_1.py.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__FURB192_FURB192_1.py.snap @@ -83,7 +83,6 @@ FURB192 [*] Prefer `min` over `sorted()` to compute the minimum value in a seque 16 | 17 | sorted((yield), reverse=True)[-1] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `min` | 16 | diff --git a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__fstring_number_format_python_311.snap b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__fstring_number_format_python_311.snap index 25c70b763622c5..830f08dc4fe1d5 100644 --- a/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__fstring_number_format_python_311.snap +++ b/crates/ruff_linter/src/rules/refurb/snapshots/ruff_linter__rules__refurb__tests__fstring_number_format_python_311.snap @@ -229,7 +229,6 @@ FURB116 [*] Replace `bin` call with `f"{-1:b}"` 43 | # for negatives numbers autofix is display-only 44 | print(bin(-1)[2:]) | ^^^^^^^^^^^ - | help: Replace with `f"{-1:b}"` | 43 | # for negatives numbers autofix is display-only diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__PY315_RUF015_RUF015_py315.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__PY315_RUF015_RUF015_py315.py.snap index dd82e47487fa45..79c3527454afe3 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__PY315_RUF015_RUF015_py315.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__PY315_RUF015_RUF015_py315.py.snap @@ -25,7 +25,6 @@ RUF015 [*] Prefer `next(*x for x in xs)` over single element slice 3 | [*x for x in xs][0] 4 | list(*x for x in xs)[0] | ^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `next(*x for x in xs)` | 3 | [*x for x in xs][0] diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__PY315_RUF017_RUF017_0.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__PY315_RUF017_RUF017_0.py.snap index 65191c8be031a5..08249804051f7c 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__PY315_RUF017_RUF017_0.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__PY315_RUF017_RUF017_0.py.snap @@ -104,7 +104,6 @@ RUF017 [*] Avoid quadratic list summation 20 | 21 | sum([x, y], []) | ^^^^^^^^^^^^^^^ - | help: Replace with a starred list comprehension | 20 | @@ -121,7 +120,6 @@ RUF017 [*] Avoid quadratic list summation 25 | def func(): 26 | sum((factor.dims for factor in bases), []) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with a starred list comprehension | 25 | def func(): diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF005_RUF005.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF005_RUF005.py.snap index bbe198bd82aee9..f3c41721a4bd0b 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF005_RUF005.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF005_RUF005.py.snap @@ -42,7 +42,6 @@ RUF005 Consider `[*first, 4, 5, 6]` instead of concatenation 22 | | 6, 23 | | ] | |_^ - | help: Replace with `[*first, 4, 5, 6]` RUF005 [*] Consider `[1, 2, 3, *foo]` instead of concatenation diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF006_RUF006.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF006_RUF006.py.snap index 65efeca6a0fa7e..9fb29c3cc6d117 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF006_RUF006.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF006_RUF006.py.snap @@ -8,7 +8,6 @@ RUF006 Store a reference to the return value of `asyncio.create_task` 5 | def f(): 6 | asyncio.create_task(coordinator.ws_connect()) # Error | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | RUF006 Store a reference to the return value of `asyncio.ensure_future` --> RUF006.py:11:5 @@ -17,7 +16,6 @@ RUF006 Store a reference to the return value of `asyncio.ensure_future` 10 | def f(): 11 | asyncio.ensure_future(coordinator.ws_connect()) # Error | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | RUF006 Store a reference to the return value of `asyncio.create_task` --> RUF006.py:68:12 @@ -26,7 +24,6 @@ RUF006 Store a reference to the return value of `asyncio.create_task` 67 | def f(): 68 | task = asyncio.create_task(coordinator.ws_connect()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | RUF006 Store a reference to the return value of `loop.create_task` --> RUF006.py:74:26 @@ -35,7 +32,6 @@ RUF006 Store a reference to the return value of `loop.create_task` 73 | loop = asyncio.get_running_loop() 74 | task: asyncio.Task = loop.create_task(coordinator.ws_connect()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | RUF006 Store a reference to the return value of `loop.create_task` --> RUF006.py:97:5 @@ -44,7 +40,6 @@ RUF006 Store a reference to the return value of `loop.create_task` 96 | loop = asyncio.get_running_loop() 97 | loop.create_task(coordinator.ws_connect()) # Error | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | RUF006 Store a reference to the return value of `asyncio.create_task` --> RUF006.py:152:13 diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF007_RUF007.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF007_RUF007.py.snap index 02a04f35660953..df6aeed6fe58d5 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF007_RUF007.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF007_RUF007.py.snap @@ -204,7 +204,6 @@ RUF007 [*] Prefer `itertools.pairwise()` over `zip()` when iterating over succes 24 | zip(foo[:-1], foo[1:], strict=False) 25 | zip(foo[:-1], foo[1:], strict=bool(foo)) | ^^^ - | help: Replace `zip()` with `itertools.pairwise()` | 1 + import itertools diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF008_RUF008.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF008_RUF008.py.snap index 790e5ff0d5184c..4289a1e0315479 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF008_RUF008.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF008_RUF008.py.snap @@ -52,4 +52,3 @@ RUF008 Do not use mutable default values for dataclass attributes 35 | perfectly_fine: 'list[int]' = field(default_factory=list) 36 | class_variable: 'typing.ClassVar[list[int]]'= [] | ^^ - | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF009_RUF009_attrs.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF009_RUF009_attrs.py.snap index c50c1d506a1e83..2e6fb7993330bb 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF009_RUF009_attrs.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF009_RUF009_attrs.py.snap @@ -51,7 +51,6 @@ RUF009 Do not perform function call `G` in dataclass defaults 108 | f: F = F() 109 | g: G = G() | ^^^ - | RUF009 Do not perform function call `F` in dataclass defaults --> RUF009_attrs.py:114:12 @@ -70,7 +69,6 @@ RUF009 Do not perform function call `G` in dataclass defaults 114 | f: F = F() 115 | g: G = G() | ^^^ - | RUF009 Do not perform function call `F` in dataclass defaults --> RUF009_attrs.py:120:12 @@ -89,7 +87,6 @@ RUF009 Do not perform function call `G` in dataclass defaults 120 | f: F = F() 121 | g: G = G() | ^^^ - | RUF009 Do not perform function call `F` in dataclass defaults --> RUF009_attrs.py:126:12 @@ -108,7 +105,6 @@ RUF009 Do not perform function call `G` in dataclass defaults 126 | f: F = F() 127 | g: G = G() | ^^^ - | RUF009 Do not perform function call `list` in dataclass defaults --> RUF009_attrs.py:144:20 @@ -117,4 +113,3 @@ RUF009 Do not perform function call `list` in dataclass defaults 143 | class TestAttrAttributes: 144 | x: list[int] = list() # RUF009 | ^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF010_RUF010.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF010_RUF010.py.snap index d65283c1b6e12f..a2064e5cc93c76 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF010_RUF010.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF010_RUF010.py.snap @@ -619,7 +619,6 @@ RUF010 [*] Use explicit conversion flag 121 | | 1 122 | | ))}" | |__^ - | help: Replace with conversion flag | 118 | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF012_RUF012.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF012_RUF012.py.snap index 8d0a78445e4875..5cc2fd8c41a52f 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF012_RUF012.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF012_RUF012.py.snap @@ -126,7 +126,6 @@ RUF012 Mutable default value for class attribute 133 | class_variable_without_subscript: 'ClassVar' = [] 134 | final_variable_without_subscript: 'Final' = [] | ^^ - | help: Consider initializing in `__init__` or annotating with `typing.ClassVar` RUF012 Mutable default value for class attribute diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF013_RUF013_4.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF013_RUF013_4.py.snap index ce92f8a32108b4..745e2f89b22a4d 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF013_RUF013_4.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF013_RUF013_4.py.snap @@ -6,7 +6,6 @@ RUF013 [*] PEP 484 prohibits implicit `Optional` | 15 | def multiple_2(arg1: Optional, arg2: Optional = None, arg3: int = None): ... | ^^^ - | help: Convert to `T | None` | 14 | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF015_RUF015.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF015_RUF015.py.snap index b95b8c76eee403..87d7c0c429ea4b 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF015_RUF015.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF015_RUF015.py.snap @@ -430,7 +430,6 @@ RUF015 [*] Prefer `next(iter(zip(x, y)))` over single element slice 72 | zip = list # Overwrite the builtin zip 73 | list(zip(x, y))[0] | ^^^^^^^^^^^^^^^^^^ - | help: Replace with `next(iter(zip(x, y)))` | 72 | zip = list # Overwrite the builtin zip diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF016_RUF016.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF016_RUF016.py.snap index 089bac11e01c07..1f37eb3b4c0197 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF016_RUF016.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF016_RUF016.py.snap @@ -453,4 +453,3 @@ RUF016 Slice in indexed access to type `list` uses type `str` instead of an inte 133 | x = "x" 134 | var = [1, 2, 3][x:"y"] | ^^^ - | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF017_RUF017_0.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF017_RUF017_0.py.snap index 2bcd9ba8f8dbcf..601c205bbdbea8 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF017_RUF017_0.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF017_RUF017_0.py.snap @@ -125,7 +125,6 @@ RUF017 [*] Avoid quadratic list summation 20 | 21 | sum([x, y], []) | ^^^^^^^^^^^^^^^ - | help: Replace with `functools.reduce` | 20 | @@ -142,7 +141,6 @@ RUF017 [*] Avoid quadratic list summation 25 | def func(): 26 | sum((factor.dims for factor in bases), []) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `functools.reduce` | 1 + import functools diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF017_RUF017_1.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF017_RUF017_1.py.snap index 66860484aa5ace..28a251a13f94c4 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF017_RUF017_1.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF017_RUF017_1.py.snap @@ -6,7 +6,6 @@ RUF017 [*] Avoid quadratic list summation | 1 | sum((factor.dims for factor in bases), []) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `functools.reduce` | - sum((factor.dims for factor in bases), []) diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF020_RUF020.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF020_RUF020.py.snap index d247be7190fe94..afecdbe964f8cd 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF020_RUF020.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF020_RUF020.py.snap @@ -113,7 +113,6 @@ RUF020 [*] `Union[NoReturn, T]` is equivalent to `T` 7 | Union[Union[Never, int], Union[NoReturn, int]] 8 | Union[NoReturn, int, float] | ^^^^^^^^ - | help: Remove `NoReturn` | 7 | Union[Union[Never, int], Union[NoReturn, int]] @@ -173,7 +172,6 @@ RUF020 `Never | T` is equivalent to `T` 16 | a: int | Never | None 17 | b: Never | Never | None | ^^^^^ - | help: Remove `Never` RUF020 `Never | T` is equivalent to `T` @@ -182,7 +180,6 @@ RUF020 `Never | T` is equivalent to `T` 16 | a: int | Never | None 17 | b: Never | Never | None | ^^^^^ - | help: Remove `Never` RUF020 [*] `Never | T` is equivalent to `T` diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF023_RUF023.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF023_RUF023.py.snap index b9b9da498e8e57..e798afe9251fbb 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF023_RUF023.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF023_RUF023.py.snap @@ -621,7 +621,6 @@ RUF023 [*] `BezierBuilder4.__slots__` is not sorted 192 | | "baz", "bingo" 193 | | } | |__________________^ - | help: Apply a natural sort to `BezierBuilder4.__slots__` | 190 | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF024_RUF024.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF024_RUF024.py.snap index ab2924d139ee25..8b12e431e1d7a1 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF024_RUF024.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF024_RUF024.py.snap @@ -140,7 +140,6 @@ RUF024 [*] Do not pass mutable objects as values to `dict.fromkeys` 38 | key_0 = "z" 39 | dict.fromkeys("ABC", list(key)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with comprehension | 38 | key_0 = "z" diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF026_RUF026.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF026_RUF026.py.snap index e8cc588cfaaa8a..b9a000ba5109de 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF026_RUF026.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF026_RUF026.py.snap @@ -7,7 +7,6 @@ RUF026 [*] `default_factory` is a positional-only argument to `defaultdict` 10 | def func(): 11 | defaultdict(default_factory=int) # RUF026 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `defaultdict(default_factory=int)` | 10 | def func(): @@ -23,7 +22,6 @@ RUF026 [*] `default_factory` is a positional-only argument to `defaultdict` 14 | def func(): 15 | defaultdict(default_factory=float) # RUF026 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `defaultdict(default_factory=float)` | 14 | def func(): @@ -39,7 +37,6 @@ RUF026 [*] `default_factory` is a positional-only argument to `defaultdict` 18 | def func(): 19 | defaultdict(default_factory=dict) # RUF026 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `defaultdict(default_factory=dict)` | 18 | def func(): @@ -55,7 +52,6 @@ RUF026 [*] `default_factory` is a positional-only argument to `defaultdict` 22 | def func(): 23 | defaultdict(default_factory=list) # RUF026 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `defaultdict(default_factory=list)` | 22 | def func(): @@ -71,7 +67,6 @@ RUF026 [*] `default_factory` is a positional-only argument to `defaultdict` 26 | def func(): 27 | defaultdict(default_factory=tuple) # RUF026 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `defaultdict(default_factory=tuple)` | 26 | def func(): @@ -88,7 +83,6 @@ RUF026 [*] `default_factory` is a positional-only argument to `defaultdict` 33 | 34 | defaultdict(default_factory=foo) # RUF026 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `defaultdict(default_factory=foo)` | 33 | @@ -104,7 +98,6 @@ RUF026 [*] `default_factory` is a positional-only argument to `defaultdict` 37 | def func(): 38 | defaultdict(default_factory=lambda: 1) # RUF026 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `defaultdict(default_factory=lambda: 1)` | 37 | def func(): @@ -121,7 +114,6 @@ RUF026 [*] `default_factory` is a positional-only argument to `defaultdict` 43 | 44 | defaultdict(default_factory=deque) # RUF026 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `defaultdict(default_factory=deque)` | 43 | @@ -138,7 +130,6 @@ RUF026 [*] `default_factory` is a positional-only argument to `defaultdict` 51 | 52 | defaultdict(default_factory=MyCallable()) # RUF026 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `defaultdict(default_factory=MyCallable())` | 51 | @@ -154,7 +145,6 @@ RUF026 [*] `default_factory` is a positional-only argument to `defaultdict` 55 | def func(): 56 | defaultdict(default_factory=tuple, member=1) # RUF026 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `defaultdict(default_factory=tuple)` | 55 | def func(): @@ -170,7 +160,6 @@ RUF026 [*] `default_factory` is a positional-only argument to `defaultdict` 59 | def func(): 60 | defaultdict(member=1, default_factory=tuple) # RUF026 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `defaultdict(default_factory=tuple)` | 59 | def func(): @@ -186,7 +175,6 @@ RUF026 [*] `default_factory` is a positional-only argument to `defaultdict` 63 | def func(): 64 | defaultdict(member=1, default_factory=tuple,) # RUF026 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `defaultdict(default_factory=tuple)` | 63 | def func(): @@ -205,7 +193,6 @@ RUF026 [*] `default_factory` is a positional-only argument to `defaultdict` 70 | | default_factory=tuple, 71 | | ) # RUF026 | |_____^ - | help: Replace with `defaultdict(default_factory=tuple)` | 68 | defaultdict( @@ -225,7 +212,6 @@ RUF026 [*] `default_factory` is a positional-only argument to `defaultdict` 77 | | member=1, 78 | | ) # RUF026 | |_____^ - | help: Replace with `defaultdict(default_factory=tuple)` | 75 | defaultdict( diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF027_RUF027_0.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF027_RUF027_0.py.snap index 3327181c229272..5c3d0ab42b529a 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF027_RUF027_0.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF027_RUF027_0.py.snap @@ -8,7 +8,6 @@ RUF027 [*] Possible f-string without an `f` prefix 4 | 5 | print("but don't ignore this: {val}") # RUF027 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Add `f` prefix | 4 | @@ -43,7 +42,6 @@ RUF027 [*] Possible f-string without an `f` prefix 10 | b = "{a}" # RUF027 11 | c = "{a} {b} f'{val}' " # RUF027 | ^^^^^^^^^^^^^^^^^^^ - | help: Add `f` prefix | 10 | b = "{a}" # RUF027 @@ -78,7 +76,6 @@ RUF027 [*] Possible f-string without an `f` prefix 21 | b = r"raw string with formatting: {a}" # RUF027 22 | c = r"raw string with \backslashes\ and \"escaped quotes\": {a}" # RUF027 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Add `f` prefix | 21 | b = r"raw string with formatting: {a}" # RUF027 @@ -113,7 +110,6 @@ RUF027 [*] Possible f-string without an `f` prefix 27 | print("Hello, {name}!") # RUF027 28 | print("The test value we're using today is {a}") # RUF027 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Add `f` prefix | 27 | print("Hello, {name}!") # RUF027 @@ -130,7 +126,6 @@ RUF027 [*] Possible f-string without an `f` prefix 32 | a = 4 33 | print(do_nothing(do_nothing("{a}"))) # RUF027 | ^^^^^ - | help: Add `f` prefix | 32 | a = 4 @@ -169,7 +164,6 @@ RUF027 [*] Possible f-string without an `f` prefix 42 | | c} d 43 | | """ | |_______^ - | help: Add `f` prefix | 40 | # RUF027 @@ -189,7 +183,6 @@ RUF027 [*] Possible f-string without an `f` prefix 50 | | a} \ 51 | | " | |_____^ - | help: Add `f` prefix | 48 | # RUF027 @@ -224,7 +217,6 @@ RUF027 [*] Possible f-string without an `f` prefix 56 | b = "{a}" "+" "{b}" r" \\ " # RUF027 for the first part only 57 | print(f"{a}" "{a}" f"{b}") # RUF027 | ^^^^^ - | help: Add `f` prefix | 56 | b = "{a}" "+" "{b}" r" \\ " # RUF027 for the first part only @@ -241,7 +233,6 @@ RUF027 [*] Possible f-string without an `f` prefix 61 | a = 4 62 | b = "\"not escaped:\" '{a}' \"escaped:\": '{{c}}'" # RUF027 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Add `f` prefix | 61 | a = 4 diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF028_RUF028.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF028_RUF028.py.snap index ae94b664fd5286..f32c717ea7edae 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF028_RUF028.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF028_RUF028.py.snap @@ -185,7 +185,6 @@ RUF028 [*] This suppression comment is invalid because it cannot be at the end o 62 | val = 5 # fmt: on 63 | pass # fmt: on | ^^^^^^^^^ - | help: Remove this comment | 62 | val = 5 # fmt: on diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF030_RUF030.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF030_RUF030.py.snap index 41b9366605be69..5da2b5d855f56a 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF030_RUF030.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF030_RUF030.py.snap @@ -350,7 +350,6 @@ RUF030 [*] `print()` call in `assert` statement is likely unintentional 107 | # - single StringLiteral 108 | assert True, builtins.print("This print should be removed.") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove `print` | 107 | # - single StringLiteral diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF032_RUF032.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF032_RUF032.py.snap index 7efec46017c69a..386dbed26c2daf 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF032_RUF032.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF032_RUF032.py.snap @@ -141,7 +141,6 @@ RUF032 [*] `Decimal()` called with float literal argument 57 | 58 | val = Decimal(-+--++--4.0) # Suggest `Decimal("-4.0")` | ^^^^^^^^^^^ - | help: Replace with string literal | 57 | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF033_RUF033.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF033_RUF033.py.snap index c920f3c4a3368a..4581b195a4406c 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF033_RUF033.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF033_RUF033.py.snap @@ -8,7 +8,6 @@ RUF033 `__post_init__` method with argument defaults 18 | 19 | def __post_init__(self, bar = 11, baz = 11) -> None: ... | ^^ - | help: Use `dataclasses.InitVar` instead RUF033 `__post_init__` method with argument defaults @@ -18,7 +17,6 @@ RUF033 `__post_init__` method with argument defaults 18 | 19 | def __post_init__(self, bar = 11, baz = 11) -> None: ... | ^^ - | help: Use `dataclasses.InitVar` instead RUF033 [*] `__post_init__` method with argument defaults @@ -28,7 +26,6 @@ RUF033 [*] `__post_init__` method with argument defaults 24 | class Foo: 25 | def __post_init__(self, bar = 11, baz = 11) -> None: ... | ^^ - | help: Use `dataclasses.InitVar` instead | 24 | class Foo: @@ -46,7 +43,6 @@ RUF033 [*] `__post_init__` method with argument defaults 24 | class Foo: 25 | def __post_init__(self, bar = 11, baz = 11) -> None: ... | ^^ - | help: Use `dataclasses.InitVar` instead | 24 | class Foo: @@ -64,7 +60,6 @@ RUF033 [*] `__post_init__` method with argument defaults 45 | class Foo: 46 | def __post_init__(self, bar: int = 11, baz: Something[Whatever | None] = 11) -> None: ... | ^^ - | help: Use `dataclasses.InitVar` instead | 45 | class Foo: @@ -82,7 +77,6 @@ RUF033 [*] `__post_init__` method with argument defaults 45 | class Foo: 46 | def __post_init__(self, bar: int = 11, baz: Something[Whatever | None] = 11) -> None: ... | ^^ - | help: Use `dataclasses.InitVar` instead | 45 | class Foo: @@ -100,7 +94,6 @@ RUF033 [*] `__post_init__` method with argument defaults 58 | 59 | def __post_init__(self, bar: int = 11, baz: int = 12) -> None: ... | ^^ - | help: Use `dataclasses.InitVar` instead | 58 | @@ -118,7 +111,6 @@ RUF033 [*] `__post_init__` method with argument defaults 58 | 59 | def __post_init__(self, bar: int = 11, baz: int = 12) -> None: ... | ^^ - | help: Use `dataclasses.InitVar` instead | 58 | @@ -136,7 +128,6 @@ RUF033 `__post_init__` method with argument defaults 66 | 67 | def __post_init__(self, bar: str = "ahhh", baz: str = "hmm") -> None: ... | ^^^^^^ - | help: Use `dataclasses.InitVar` instead RUF033 `__post_init__` method with argument defaults @@ -146,7 +137,6 @@ RUF033 `__post_init__` method with argument defaults 66 | 67 | def __post_init__(self, bar: str = "ahhh", baz: str = "hmm") -> None: ... | ^^^^^ - | help: Use `dataclasses.InitVar` instead RUF033 [*] `__post_init__` method with argument defaults diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF034_RUF034.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF034_RUF034.py.snap index 1ab0762fc7224f..5557b6c13ac364 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF034_RUF034.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF034_RUF034.py.snap @@ -27,4 +27,3 @@ RUF034 Useless `if`-`else` condition 10 | # Invalid 11 | x = 0.1 if False else 0.1 | ^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF037_RUF037.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF037_RUF037.py.snap index fff7cd66a2783d..a5b357425ca590 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF037_RUF037.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF037_RUF037.py.snap @@ -7,7 +7,6 @@ RUF037 [*] Unnecessary empty iterable within a deque call 5 | def f(): 6 | queue = collections.deque([]) # RUF037 | ^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `deque()` | 5 | def f(): @@ -22,7 +21,6 @@ RUF037 [*] Unnecessary empty iterable within a deque call 9 | def f(): 10 | queue = collections.deque([], maxlen=10) # RUF037 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `deque(maxlen=...)` | 9 | def f(): @@ -37,7 +35,6 @@ RUF037 [*] Unnecessary empty iterable within a deque call 13 | def f(): 14 | queue = deque([]) # RUF037 | ^^^^^^^^^ - | help: Replace with `deque()` | 13 | def f(): @@ -52,7 +49,6 @@ RUF037 [*] Unnecessary empty iterable within a deque call 17 | def f(): 18 | queue = deque(()) # RUF037 | ^^^^^^^^^ - | help: Replace with `deque()` | 17 | def f(): @@ -67,7 +63,6 @@ RUF037 [*] Unnecessary empty iterable within a deque call 21 | def f(): 22 | queue = deque({}) # RUF037 | ^^^^^^^^^ - | help: Replace with `deque()` | 21 | def f(): @@ -82,7 +77,6 @@ RUF037 [*] Unnecessary empty iterable within a deque call 25 | def f(): 26 | queue = deque(set()) # RUF037 | ^^^^^^^^^^^^ - | help: Replace with `deque()` | 25 | def f(): @@ -97,7 +91,6 @@ RUF037 [*] Unnecessary empty iterable within a deque call 29 | def f(): 30 | queue = collections.deque([], maxlen=10) # RUF037 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `deque(maxlen=...)` | 29 | def f(): @@ -112,7 +105,6 @@ RUF037 [*] Unnecessary empty iterable within a deque call 60 | def f(): 61 | x = 0 or(deque)([]) | ^^^^^^^^^^^ - | help: Replace with `deque()` | 60 | def f(): @@ -158,7 +150,6 @@ RUF037 [*] Unnecessary empty iterable within a deque call 67 | deque([], **{"maxlen": 10}) # RUF037 68 | deque([], foo=1) # RUF037 | ^^^^^^^^^^^^^^^^ - | help: Replace with `deque()` | 67 | deque([], **{"maxlen": 10}) # RUF037 @@ -179,7 +170,6 @@ RUF037 [*] Unnecessary empty iterable within a deque call 83 | | maxlen=10, # a comment on maxlen, deleted 84 | | ) # only this is preserved | |_________^ - | help: Replace with `deque(maxlen=...)` | 79 | def f(): @@ -200,7 +190,6 @@ RUF037 [*] Unnecessary empty iterable within a deque call 88 | def f(): 89 | deque([], 10) | ^^^^^^^^^^^^^ - | help: Replace with `deque(maxlen=...)` | 88 | def f(): diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF043_RUF043.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF043_RUF043.py.snap index f849446a0b8ac7..52f7c82d14fb4e 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF043_RUF043.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF043_RUF043.py.snap @@ -112,7 +112,6 @@ RUF043 Pattern passed to `match=` contains metacharacters but is neither escaped 21 | # https://github.com/astral-sh/ruff/issues/15316 22 | with pytest.raises(ClosingParenthesis, match="foo)"): ... | ^^^^^^ - | help: Use a raw string or `re.escape()` to make the intention explicit RUF043 Pattern passed to `match=` contains metacharacters but is neither escaped nor raw @@ -346,7 +345,6 @@ RUF043 Pattern passed to `match=` contains metacharacters but is neither escaped 46 | with pytest.raises(NonWordCharacter2, match="foobar\\W"): ... 47 | with pytest.raises(EndOfInput2, match="foobar\\z"): ... | ^^^^^^^^^^^ - | help: Use a raw string or `re.escape()` to make the intention explicit RUF043 Pattern passed to `match=` contains metacharacters but is neither escaped nor raw @@ -356,5 +354,4 @@ RUF043 Pattern passed to `match=` contains metacharacters but is neither escaped 51 | 52 | with pytest.raises(NameEscape, match="\\N{EN DASH}"): ... | ^^^^^^^^^^^^^^ - | help: Use a raw string or `re.escape()` to make the intention explicit diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF046_RUF046.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF046_RUF046.py.snap index 595a5ccc9f2907..cd45cd92f83b25 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF046_RUF046.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF046_RUF046.py.snap @@ -622,7 +622,6 @@ RUF046 [*] Value being cast to `int` is already an integer 52 | int(1 and 0) 53 | int(0 or -1) | ^^^^^^^^^^^^ - | help: Remove unnecessary `int` call | 52 | int(1 and 0) @@ -833,7 +832,6 @@ RUF046 [*] Value being cast to `int` is already an integer 75 | int(round(unknown)) 76 | int(round(unknown, None)) | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove unnecessary `int` call | 75 | int(round(unknown)) @@ -1081,7 +1079,6 @@ RUF046 [*] Value being cast to `int` is already an integer 207 | | # unsafe fix because of this comment 208 | | ) | |_^ - | help: Remove unnecessary `int` call | 202 | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF046_RUF046_CR.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF046_RUF046_CR.py.snap index 4c9542624ce3ce..1b56a758d3c313 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF046_RUF046_CR.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF046_RUF046_CR.py.snap @@ -7,7 +7,6 @@ RUF046 [*] Value being cast to `int` is already an integer 1 | / int(- 2 | | 1) # Carriage return as newline | |______^ - | help: Remove unnecessary `int` call | - int(- 1 + (- 2 | 1) # Carriage return as newline | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF046_RUF046_LF.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF046_RUF046_LF.py.snap index 6c8e85a1bafdbf..fc945a5b783cfd 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF046_RUF046_LF.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF046_RUF046_LF.py.snap @@ -8,7 +8,6 @@ RUF046 [*] Value being cast to `int` is already an integer 2 | / int(- 3 | | 1) | |______^ - | help: Remove unnecessary `int` call | 1 | # \n as newline diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF047_RUF047_for.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF047_RUF047_for.py.snap index 7dba401011c654..8d32c11f2f1c9a 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF047_RUF047_for.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF047_RUF047_for.py.snap @@ -9,7 +9,6 @@ RUF047 [*] Empty `else` clause 6 | / else: 7 | | pass | |________^ - | help: Remove the `else` clause | 5 | break @@ -26,7 +25,6 @@ RUF047 [*] Empty `else` clause 12 | / else: 13 | | ... | |_______^ - | help: Remove the `else` clause | 11 | belongs_to() # `for` diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF047_RUF047_if.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF047_RUF047_if.py.snap index 170cc865840d98..54b74d7ff33f49 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF047_RUF047_if.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF047_RUF047_if.py.snap @@ -9,7 +9,6 @@ RUF047 [*] Empty `else` clause 5 | / else: 6 | | pass | |________^ - | help: Remove the `else` clause | 4 | condition_is_not_evaluated() @@ -26,7 +25,6 @@ RUF047 [*] Empty `else` clause 11 | / else: 12 | | ... | |_______^ - | help: Remove the `else` clause | 10 | belongs_to() # `if` @@ -43,7 +41,6 @@ RUF047 [*] Empty `else` clause 19 | / else: 20 | | pass | |________^ - | help: Remove the `else` clause | 18 | as_if() @@ -79,7 +76,6 @@ RUF047 [*] Empty `else` clause 32 | / else: 33 | | pass | |________^ - | help: Remove the `else` clause | 31 | # `if` @@ -94,7 +90,6 @@ RUF047 [*] Empty `else` clause 43 | if of_course: this() 44 | else: ... | ^^^^^^^^^ - | help: Remove the `else` clause | 43 | if of_course: this() @@ -109,7 +104,6 @@ RUF047 [*] Empty `else` clause 48 | this() # comment 49 | else: ... | ^^^^^^^^^ - | help: Remove the `else` clause | 48 | this() # comment @@ -125,7 +119,6 @@ RUF047 [*] Empty `else` clause 55 | / else: 56 | | ... | |___________^ - | help: Remove the `else` clause | 54 | b() diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF047_RUF047_try.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF047_RUF047_try.py.snap index 6a61b7c63a8908..8e40273a77a18f 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF047_RUF047_try.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF047_RUF047_try.py.snap @@ -9,7 +9,6 @@ RUF047 [*] Empty `else` clause 7 | / else: 8 | | pass | |________^ - | help: Remove the `else` clause | 6 | pass @@ -26,7 +25,6 @@ RUF047 [*] Empty `else` clause 17 | / else: 18 | | ... | |_______^ - | help: Remove the `else` clause | 16 | to() # `except` diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF047_RUF047_while.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF047_RUF047_while.py.snap index 58f2ea145caf0d..e219f2ae8959c1 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF047_RUF047_while.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF047_RUF047_while.py.snap @@ -9,7 +9,6 @@ RUF047 [*] Empty `else` clause 6 | / else: 7 | | pass | |________^ - | help: Remove the `else` clause | 5 | break @@ -26,7 +25,6 @@ RUF047 [*] Empty `else` clause 12 | / else: 13 | | ... | |_______^ - | help: Remove the `else` clause | 11 | belongs_to() # `for` diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF050_RUF050.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF050_RUF050.py.snap index 8ef5ca160aa826..e36bfb7344a774 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF050_RUF050.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF050_RUF050.py.snap @@ -174,7 +174,6 @@ RUF050 [*] Empty `if` statement 43 | / if obj1: 44 | | pass | |____________^ - | help: Remove the `if` statement | 42 | with pytest.raises(ValueError, match=msg): @@ -339,7 +338,6 @@ RUF050 [*] Empty `if` statement 85 | / if foo(): 86 | | pass | |____________^ - | help: Remove the `if` statement | 84 | class Foo: diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF051_RUF051.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF051_RUF051.py.snap index 2badb4f69157a9..257e61a09ec351 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF051_RUF051.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF051_RUF051.py.snap @@ -514,7 +514,6 @@ RUF051 [*] Use `pop` instead of `key in dict` followed by `del dict[key]` 98 | if b'yt' b'es' in d: 99 | del d[rb"""ytes"""] # This should not make the fix unsafe | ^^^^^^^^^^^^^^^^^^^ - | help: Replace `if` statement with `.pop(..., None)` | 97 | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF053_RUF053.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF053_RUF053.py.snap index 8ee126b30c1039..ec5fcd2256cabc 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF053_RUF053.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF053_RUF053.py.snap @@ -147,7 +147,6 @@ RUF053 Class with type parameter list inherits from `Generic` 32 | class C[*Ts](Generic[Unpack[_Bs]], tuple[*Bs]): ... 33 | class C[*Ts](Callable[[*_Cs], tuple[*Ts]], Generic[_Cs]): ... # TODO: Type parameter defaults | ^^^^^^^^^^^^ - | help: Remove `Generic` base class RUF053 [*] Class with type parameter list inherits from `Generic` @@ -184,7 +183,6 @@ RUF053 Class with type parameter list inherits from `Generic` 37 | class C[**P](Generic[_P2]): ... 38 | class C[**P](Generic[_P3]): ... # TODO: Type parameter defaults | ^^^^^^^^^^^^ - | help: Remove `Generic` base class RUF053 [*] Class with type parameter list inherits from `Generic` @@ -192,7 +190,6 @@ RUF053 [*] Class with type parameter list inherits from `Generic` | 41 | class C[T](Generic[T, _A]): ... | ^^^^^^^^^^^^^^ - | help: Remove `Generic` base class | 40 | @@ -209,7 +206,6 @@ RUF053 Class with type parameter list inherits from `Generic` 46 | # only simple assignments, so there is no fix. 47 | class C[T: (_Z := TypeVar('_Z'))](Generic[_Z]): ... | ^^^^^^^^^^^ - | help: Remove `Generic` base class RUF053 [*] Class with type parameter list inherits from `Generic` @@ -218,7 +214,6 @@ RUF053 [*] Class with type parameter list inherits from `Generic` 50 | class C(Generic[_B]): 51 | class D[T](Generic[_B, T]): ... | ^^^^^^^^^^^^^^ - | help: Remove `Generic` base class | 50 | class C(Generic[_B]): @@ -234,7 +229,6 @@ RUF053 Class with type parameter list inherits from `Generic` 54 | class C[T]: 55 | class D[U](Generic[T, U]): ... | ^^^^^^^^^^^^^ - | help: Remove `Generic` base class RUF053 [*] Class with type parameter list inherits from `Generic` @@ -262,7 +256,6 @@ RUF053 Class with type parameter list inherits from `Generic` 60 | class C[T](Generic[_C], Generic[_D]): ... 61 | class C[T, _C: (str, bytes)](Generic[_D]): ... # TODO: Type parameter defaults | ^^^^^^^^^^^ - | help: Remove `Generic` base class RUF053 Class with type parameter list inherits from `Generic` @@ -272,7 +265,6 @@ RUF053 Class with type parameter list inherits from `Generic` 65 | T # Comment 66 | ](Generic[_E]): ... # TODO: Type parameter defaults | ^^^^^^^^^^^ - | help: Remove `Generic` base class RUF053 Class with type parameter list inherits from `Generic` @@ -338,7 +330,6 @@ RUF053 Class with type parameter list inherits from `Generic` 73 | class C[T](Generic[Unpack[*_As]]): ... 74 | class C[T](Generic[Unpack[_As, _Bs]]): ... | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove `Generic` base class RUF053 [*] Class with type parameter list inherits from `Generic` @@ -382,7 +373,6 @@ RUF053 [*] Class with type parameter list inherits from `Generic` 78 | class C[T](Generic[_A, Unpack[_As]]): ... 79 | class C[T](Generic[*_As, _A]): ... | ^^^^^^^^^^^^^^^^^ - | help: Remove `Generic` base class | 78 | class C[T](Generic[_A, Unpack[_As]]): ... @@ -409,7 +399,6 @@ RUF053 Class with type parameter list inherits from `Generic` 83 | class C[T](Generic[APublicTypeVar]): ... 84 | class C[T](Generic[APublicTypeVar, _A]): ... | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove `Generic` base class RUF053 [*] Class with type parameter list inherits from `Generic` @@ -419,7 +408,6 @@ RUF053 [*] Class with type parameter list inherits from `Generic` 90 | # See also the `_Z` example above. 91 | class C[T](Generic[_G]): ... # Should be moved down below eventually | ^^^^^^^^^^^ - | help: Remove `Generic` base class | 90 | # See also the `_Z` example above. @@ -453,7 +441,6 @@ RUF053 [*] Class with type parameter list inherits from `Generic` 95 | class C[T: (str,)](Generic[_A]): ... 96 | class C[T: [a]](Generic[_A]): ... | ^^^^^^^^^^^ - | help: Remove `Generic` base class | 95 | class C[T: (str,)](Generic[_A]): ... diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF056_RUF056.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF056_RUF056.py.snap index 2fa91d5f49c448..e5b79cbc856cb1 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF056_RUF056.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF056_RUF056.py.snap @@ -438,7 +438,6 @@ RUF056 [*] Avoid providing a falsy fallback to `dict.get()` in boolean test posi 190 | d = {} 191 | not d.get("key", (False)) | ^^^^^ - | help: Remove falsy fallback from `dict.get()` | 190 | d = {} diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF058_RUF058_0.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF058_RUF058_0.py.snap index 89bb8efba841e1..ef85a191e3d57b 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF058_RUF058_0.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF058_RUF058_0.py.snap @@ -24,7 +24,6 @@ RUF058 [*] `itertools.starmap` called on `zip` iterable 7 | starmap(func, zip()) 8 | starmap(func, zip([])) | ^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `map` instead | 7 | starmap(func, zip()) @@ -38,7 +37,6 @@ RUF058 [*] `itertools.starmap` called on `zip` iterable | 11 | starmap(func, zip(a, b, c,),) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `map` instead | 10 | @@ -183,7 +181,6 @@ RUF058 [*] `itertools.starmap` called on `zip` iterable 59 | | ) 60 | | ) | |_^ - | help: Use `map` instead | 50 | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF059_RUF059_0.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF059_RUF059_0.py.snap index 89691e783eaa0d..94b7f281dfb55b 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF059_RUF059_0.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF059_RUF059_0.py.snap @@ -44,7 +44,6 @@ RUF059 [*] Unpacked variable `x` is never used 25 | 26 | (x, y) = baz = bar | ^ - | help: Prefix it with an underscore or any other dummy variable pattern | 25 | @@ -61,7 +60,6 @@ RUF059 [*] Unpacked variable `y` is never used 25 | 26 | (x, y) = baz = bar | ^ - | help: Prefix it with an underscore or any other dummy variable pattern | 25 | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF059_RUF059_1.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF059_RUF059_1.py.snap index cd37d69f41af6b..487818493187a5 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF059_RUF059_1.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF059_RUF059_1.py.snap @@ -7,7 +7,6 @@ RUF059 [*] Unpacked variable `x` is never used 1 | def f(tup): 2 | x, y = tup | ^ - | help: Prefix it with an underscore or any other dummy variable pattern | 1 | def f(tup): @@ -23,7 +22,6 @@ RUF059 [*] Unpacked variable `y` is never used 1 | def f(tup): 2 | x, y = tup | ^ - | help: Prefix it with an underscore or any other dummy variable pattern | 1 | def f(tup): @@ -57,7 +55,6 @@ RUF059 [*] Unpacked variable `x` is never used 15 | def f(): 16 | (x, y) = coords = 1, 2 | ^ - | help: Prefix it with an underscore or any other dummy variable pattern | 15 | def f(): @@ -73,7 +70,6 @@ RUF059 [*] Unpacked variable `y` is never used 15 | def f(): 16 | (x, y) = coords = 1, 2 | ^ - | help: Prefix it with an underscore or any other dummy variable pattern | 15 | def f(): @@ -89,7 +85,6 @@ RUF059 [*] Unpacked variable `x` is never used 19 | def f(): 20 | coords = (x, y) = 1, 2 | ^ - | help: Prefix it with an underscore or any other dummy variable pattern | 19 | def f(): @@ -105,7 +100,6 @@ RUF059 [*] Unpacked variable `y` is never used 19 | def f(): 20 | coords = (x, y) = 1, 2 | ^ - | help: Prefix it with an underscore or any other dummy variable pattern | 19 | def f(): diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF059_RUF059_2.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF059_RUF059_2.py.snap index b8533e337af168..02a790a6f2945a 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF059_RUF059_2.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF059_RUF059_2.py.snap @@ -80,7 +80,6 @@ RUF059 [*] Unpacked variable `x3` is never used 17 | (x2, y2) = coords2 = (1, 2) 18 | coords3 = (x3, y3) = (1, 2) | ^^ - | help: Prefix it with an underscore or any other dummy variable pattern | 17 | (x2, y2) = coords2 = (1, 2) @@ -97,7 +96,6 @@ RUF059 [*] Unpacked variable `y3` is never used 17 | (x2, y2) = coords2 = (1, 2) 18 | coords3 = (x3, y3) = (1, 2) | ^^ - | help: Prefix it with an underscore or any other dummy variable pattern | 17 | (x2, y2) = coords2 = (1, 2) @@ -147,7 +145,6 @@ RUF059 [*] Unpacked variable `a` is never used 26 | def f(): 27 | toplevel = (a, b) = lexer.get_token() | ^ - | help: Prefix it with an underscore or any other dummy variable pattern | 26 | def f(): @@ -163,7 +160,6 @@ RUF059 [*] Unpacked variable `b` is never used 26 | def f(): 27 | toplevel = (a, b) = lexer.get_token() | ^ - | help: Prefix it with an underscore or any other dummy variable pattern | 26 | def f(): @@ -179,7 +175,6 @@ RUF059 [*] Unpacked variable `a` is never used 30 | def f(): 31 | (a, b) = toplevel = lexer.get_token() | ^ - | help: Prefix it with an underscore or any other dummy variable pattern | 30 | def f(): @@ -194,7 +189,6 @@ RUF059 [*] Unpacked variable `b` is never used 30 | def f(): 31 | (a, b) = toplevel = lexer.get_token() | ^ - | help: Prefix it with an underscore or any other dummy variable pattern | 30 | def f(): diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF059_RUF059_3.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF059_RUF059_3.py.snap index aceb3e4c6702e0..9897ceafd1f8da 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF059_RUF059_3.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF059_RUF059_3.py.snap @@ -8,7 +8,6 @@ RUF059 [*] Unpacked variable `b` is never used 12 | a = foo() 13 | b, c = foo() | ^ - | help: Prefix it with an underscore or any other dummy variable pattern | 12 | a = foo() @@ -25,7 +24,6 @@ RUF059 [*] Unpacked variable `c` is never used 12 | a = foo() 13 | b, c = foo() | ^ - | help: Prefix it with an underscore or any other dummy variable pattern | 12 | a = foo() diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF061_RUF061_deprecated_call.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF061_RUF061_deprecated_call.py.snap index da3217bed8cdc0..e55888ceaf029b 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF061_RUF061_deprecated_call.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF061_RUF061_deprecated_call.py.snap @@ -7,7 +7,6 @@ RUF061 [*] Use context-manager form of `pytest.deprecated_call()` 15 | def test_error_trivial(): 16 | pytest.deprecated_call(raise_deprecation_warning, "deprecated") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `pytest.deprecated_call()` as a context-manager | 15 | def test_error_trivial(): @@ -42,7 +41,6 @@ RUF061 [*] Use context-manager form of `pytest.deprecated_call()` 24 | def test_error_lambda(): 25 | pytest.deprecated_call(lambda: warnings.warn("", DeprecationWarning)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `pytest.deprecated_call()` as a context-manager | 24 | def test_error_lambda(): diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF061_RUF061_raises.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF061_RUF061_raises.py.snap index 269443d7706d30..64e072723cf958 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF061_RUF061_raises.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF061_RUF061_raises.py.snap @@ -7,7 +7,6 @@ RUF061 [*] Use context-manager form of `pytest.raises()` 18 | def test_error_trivial(): 19 | pytest.raises(ZeroDivisionError, func, 1, b=0) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `pytest.raises()` as a context-manager | 18 | def test_error_trivial(): @@ -24,7 +23,6 @@ RUF061 [*] Use context-manager form of `pytest.raises()` 22 | def test_error_match(): 23 | pytest.raises(ZeroDivisionError, func, 1, b=0).match("division by zero") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `pytest.raises()` as a context-manager | 22 | def test_error_match(): @@ -41,7 +39,6 @@ RUF061 [*] Use context-manager form of `pytest.raises()` 26 | def test_error_assign(): 27 | excinfo = pytest.raises(ZeroDivisionError, func, 1, b=0) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `pytest.raises()` as a context-manager | 26 | def test_error_assign(): @@ -58,7 +55,6 @@ RUF061 [*] Use context-manager form of `pytest.raises()` 30 | def test_error_kwargs(): 31 | pytest.raises(func=func, expected_exception=ZeroDivisionError) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `pytest.raises()` as a context-manager | 30 | def test_error_kwargs(): @@ -93,7 +89,6 @@ RUF061 [*] Use context-manager form of `pytest.raises()` 39 | def test_error_lambda(): 40 | pytest.raises(ZeroDivisionError, lambda: 1 / 0) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `pytest.raises()` as a context-manager | 39 | def test_error_lambda(): diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF061_RUF061_warns.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF061_RUF061_warns.py.snap index 41b11122549119..36dbf41a5fc069 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF061_RUF061_warns.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF061_RUF061_warns.py.snap @@ -7,7 +7,6 @@ RUF061 [*] Use context-manager form of `pytest.warns()` 15 | def test_error_trivial(): 16 | pytest.warns(UserWarning, raise_user_warning, "warning") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `pytest.warns()` as a context-manager | 15 | def test_error_trivial(): @@ -42,7 +41,6 @@ RUF061 [*] Use context-manager form of `pytest.warns()` 24 | def test_error_lambda(): 25 | pytest.warns(UserWarning, lambda: warnings.warn("", UserWarning)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `pytest.warns()` as a context-manager | 24 | def test_error_lambda(): diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF065_RUF065_0.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF065_RUF065_0.py.snap index 9ac438216a1a72..1d36fd310285f0 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF065_RUF065_0.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF065_RUF065_0.py.snap @@ -158,7 +158,6 @@ RUF065 Unnecessary `hex()` conversion when formatting with `%s`. Use `%#x` inste 56 | logging.info("Hex: %s", hex(42)) 57 | logging.warning("Hex: %s", hex(255)) | ^^^^^^^^ - | RUF065 Unnecessary `ascii()` conversion when formatting with `%s`. Use `%a` instead of `%s` --> RUF065_0.py:63:19 @@ -216,4 +215,3 @@ RUF065 Unnecessary `hex()` conversion when formatting with `%s`. Use `%#x` inste 69 | info("Hex: %s", hex(42)) 70 | log(logging.INFO, "Hex: %s", hex(255)) | ^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF065_RUF065_1.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF065_RUF065_1.py.snap index 56fa9ec243963e..a6d84c6e306be8 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF065_RUF065_1.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF065_RUF065_1.py.snap @@ -7,4 +7,3 @@ RUF065 Unnecessary `str()` conversion when formatting with `%s` 16 | # str() with single keyword argument - should be flagged (equivalent to str("!")) 17 | logging.warning("%s", str(object="!")) | ^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF067_RUF067__modules____init__.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF067_RUF067__modules____init__.py.snap index e0318db25129ed..00372ae7fa762d 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF067_RUF067__modules____init__.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF067_RUF067__modules____init__.py.snap @@ -18,7 +18,6 @@ RUF067 `__init__` module should only contain docstrings and re-exports 14 | 15 | os.environ["FOO"] = 1 | ^^^^^^^^^^^^^^^^^^^^^ - | RUF067 `__init__` module should only contain docstrings and re-exports --> __init__.py:18:1 diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF101_RUF101_0.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF101_RUF101_0.py.snap index a028111f87c7e4..2a62da7cde862b 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF101_RUF101_0.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF101_RUF101_0.py.snap @@ -94,7 +94,6 @@ RUF101 [*] `RUF940` is a redirect to `RUF950` 5 | x = 2 # noqa: RUF940, RUF950, RUF940 6 | x = 2 # noqa: RUF940, RUF950, RUF940, RUF950 | ^^^^^^ - | help: Replace with `RUF950` | 5 | x = 2 # noqa: RUF940, RUF950, RUF940 @@ -109,7 +108,6 @@ RUF101 [*] `RUF940` is a redirect to `RUF950` 5 | x = 2 # noqa: RUF940, RUF950, RUF940 6 | x = 2 # noqa: RUF940, RUF950, RUF940, RUF950 | ^^^^^^ - | help: Replace with `RUF950` | 5 | x = 2 # noqa: RUF940, RUF950, RUF940 diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF102_RUF102.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF102_RUF102.py.snap index 80d170421351d9..1f70be69ba4ef1 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF102_RUF102.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF102_RUF102.py.snap @@ -216,7 +216,6 @@ RUF102 [*] Invalid rule code in `# noqa`: INVALID123 21 | # Invalid code with trailing reason (single comment) 22 | import pathlib # noqa: INVALID123 some reason | ^^^^^^^^^^^^^^^^^^ - | help: Add non-Ruff rule codes to the `lint.external` configuration option help: Remove the `# noqa` comment | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF200_bleach.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF200_bleach.snap index 069209c9aaac5c..e3aee0ad72332a 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF200_bleach.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF200_bleach.snap @@ -13,4 +13,3 @@ tinycss2>=1.1.0<1.2 6 | | "tinycss2>=1.1.0<1.2", 7 | | ] | |_^ - | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF200_invalid_author.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF200_invalid_author.snap index 112f02367943c5..d5e48392159dc2 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF200_invalid_author.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF200_invalid_author.snap @@ -11,4 +11,3 @@ RUF200 Failed to parse pyproject.toml: a table with 'name' and/or 'email' keys 6 | | { name = "Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍A̴̵̜̰͔ͫ͗͢L̠ͨͧͩ͘G̴̻͈͍͔̹̑͗̎̅͛́Ǫ̵̹̻̝̳͂̌̌͘", email = 1 } 7 | | ] | |_^ - | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__add_future_import_RUF013_4.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__add_future_import_RUF013_4.py.snap index 1f5dd54e86abce..b84b79359bbb47 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__add_future_import_RUF013_4.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__add_future_import_RUF013_4.py.snap @@ -6,7 +6,6 @@ RUF013 [*] PEP 484 prohibits implicit `Optional` | 15 | def multiple_2(arg1: Optional, arg2: Optional = None, arg3: int = None): ... | ^^^ - | help: Convert to `T | None` | 2 | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__confusables_deferred_annotations_diff.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__confusables_deferred_annotations_diff.snap index 3411053a0d20f1..7f7cbe7e4eac18 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__confusables_deferred_annotations_diff.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__confusables_deferred_annotations_diff.snap @@ -16,4 +16,3 @@ RUF001 String contains ambiguous `ﮨ` (ARABIC LETTER HEH GOAL INITIAL FORM). Di 60 | from typing import Literal 61 | x: '''"""'Literal["ﮨ"]'"""''' | ^ - | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__invalid_rule_code_external_rules_ruff__RUF102.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__invalid_rule_code_external_rules_ruff__RUF102.py.snap index 430399d76a052a..2320e73ff96d8e 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__invalid_rule_code_external_rules_ruff__RUF102.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__invalid_rule_code_external_rules_ruff__RUF102.py.snap @@ -178,7 +178,6 @@ RUF102 [*] Invalid rule code in `# noqa`: INVALID123 21 | # Invalid code with trailing reason (single comment) 22 | import pathlib # noqa: INVALID123 some reason | ^^^^^^^^^^^^^^^^^^ - | help: Add non-Ruff rule codes to the `lint.external` configuration option help: Remove the `# noqa` comment | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__missing_fstring_syntax_backslash_py311.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__missing_fstring_syntax_backslash_py311.snap index f061820b4d3a9a..8b3cb6371bac55 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__missing_fstring_syntax_backslash_py311.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__missing_fstring_syntax_backslash_py311.snap @@ -20,7 +20,6 @@ RUF027 [*] Possible f-string without an `f` prefix 42 | | c} d 43 | | """ | |_______^ - | help: Add `f` prefix | 40 | # RUF027 @@ -41,7 +40,6 @@ RUF027 [*] Possible f-string without an `f` prefix 50 | | a} \ 51 | | " | |_____^ - | help: Add `f` prefix | 48 | # RUF027 diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__noqa.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__noqa.snap index 98bd42a03e567d..d8164e2f94455e 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__noqa.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__noqa.snap @@ -8,7 +8,6 @@ E741 Ambiguous variable name: `I` 23 | # logged to user 24 | I = 1 # noqa: E741.F841 | ^ - | F841 [*] Local variable `I` is assigned to but never used --> noqa.py:24:5 @@ -17,7 +16,6 @@ F841 [*] Local variable `I` is assigned to but never used 23 | # logged to user 24 | I = 1 # noqa: E741.F841 | ^ - | help: Remove assignment to unused variable `I` | 23 | # logged to user diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF008_RUF008.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF008_RUF008.py.snap index 04357c897d1597..075d1513881776 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF008_RUF008.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF008_RUF008.py.snap @@ -52,7 +52,6 @@ RUF008 Do not use mutable default values for dataclass attributes 35 | perfectly_fine: 'list[int]' = field(default_factory=list) 36 | class_variable: 'typing.ClassVar[list[int]]'= [] | ^^ - | RUF008 Do not use mutable default values for dataclass attributes --> RUF008.py:42:48 diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF039_RUF039.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF039_RUF039.py.snap index 38ceb0533e0fd5..81ec14c221918c 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF039_RUF039.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF039_RUF039.py.snap @@ -315,7 +315,6 @@ RUF039 [*] First argument to `regex.template()` is not raw string 28 | | l(?i:ne) 29 | | """, flags = regex.X) | |___^ - | help: Replace with raw string | 24 | @@ -435,5 +434,4 @@ RUF039 First argument to `re.compile()` is not raw string | ____________^ 68 | | b") # without fix | |__^ - | help: Replace with raw string diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF039_RUF039_concat.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF039_RUF039_concat.py.snap index 8e808d77fc769d..a2cb085e4018ce 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF039_RUF039_concat.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF039_RUF039_concat.py.snap @@ -189,7 +189,6 @@ RUF039 [*] First argument to `re.subn()` is not raw string 37 | ) 38 | re.subn("()"r' am I'"??") | ^^^^ - | help: Replace with raw string | 37 | ) @@ -205,7 +204,6 @@ RUF039 [*] First argument to `re.subn()` is not raw string 37 | ) 38 | re.subn("()"r' am I'"??") | ^^^^ - | help: Replace with raw string | 37 | ) @@ -402,7 +400,6 @@ RUF039 [*] First argument to `regex.subn()` is not raw string 77 | ) 78 | regex.subn("()"r' am I'"??") | ^^^^ - | help: Replace with raw string | 77 | ) @@ -418,7 +415,6 @@ RUF039 [*] First argument to `regex.subn()` is not raw string 77 | ) 78 | regex.subn("()"r' am I'"??") | ^^^^ - | help: Replace with raw string | 77 | ) diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF054_RUF054.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF054_RUF054.py.snap index 317a7a13421c36..487a17671c998a 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF054_RUF054.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF054_RUF054.py.snap @@ -38,5 +38,4 @@ RUF054 Indented form feed 16 | print('F') 17 | ␌print('T') | ^ - | help: Remove form feed diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF055_RUF055_0.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF055_RUF055_0.py.snap index c1fd12536f20b5..ac6a7f9132c92b 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF055_RUF055_0.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF055_RUF055_0.py.snap @@ -7,7 +7,6 @@ RUF055 [*] Plain string pattern passed to `re` function 5 | # this should be replaced with `s.replace("abc", "")` 6 | re.sub("abc", "", s) | ^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `s.replace("abc", "")` | 5 | # this should be replaced with `s.replace("abc", "")` diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF055_RUF055_1.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF055_RUF055_1.py.snap index d09b20edaf0d62..2d02880aef2f23 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF055_RUF055_1.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF055_RUF055_1.py.snap @@ -26,7 +26,6 @@ RUF055 [*] Plain string pattern passed to `re` function 16 | repl = "new" 17 | re.sub(r"abc", repl, haystack) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `haystack.replace(r"abc", repl)` | 16 | repl = "new" diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF055_RUF055_2.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF055_RUF055_2.py.snap index 9befa8492c8f87..65f47a6a8d4eba 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF055_RUF055_2.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF055_RUF055_2.py.snap @@ -7,7 +7,6 @@ RUF055 [*] Plain string pattern passed to `re` function 6 | # this should be replaced with `"abc" not in s` 7 | re.search("abc", s) is None | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `"abc" not in s` | 6 | # this should be replaced with `"abc" not in s` @@ -22,7 +21,6 @@ RUF055 [*] Plain string pattern passed to `re` function 10 | # this should be replaced with `"abc" in s` 11 | re.search("abc", s) is not None | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `"abc" in s` | 10 | # this should be replaced with `"abc" in s` @@ -37,7 +35,6 @@ RUF055 [*] Plain string pattern passed to `re` function 14 | # this should be replaced with `not s.startswith("abc")` 15 | re.match("abc", s) is None | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `not s.startswith("abc")` | 14 | # this should be replaced with `not s.startswith("abc")` @@ -52,7 +49,6 @@ RUF055 [*] Plain string pattern passed to `re` function 18 | # this should be replaced with `s.startswith("abc")` 19 | re.match("abc", s) is not None | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `s.startswith("abc")` | 18 | # this should be replaced with `s.startswith("abc")` @@ -67,7 +63,6 @@ RUF055 [*] Plain string pattern passed to `re` function 22 | # this should be replaced with `s != "abc"` 23 | re.fullmatch("abc", s) is None | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `s != "abc"` | 22 | # this should be replaced with `s != "abc"` @@ -82,7 +77,6 @@ RUF055 [*] Plain string pattern passed to `re` function 26 | # this should be replaced with `s == "abc"` 27 | re.fullmatch("abc", s) is not None | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `s == "abc"` | 26 | # this should be replaced with `s == "abc"` diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF069_RUF069.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF069_RUF069.py.snap index 0818caa0123d01..39486a6364ef59 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF069_RUF069.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF069_RUF069.py.snap @@ -39,7 +39,6 @@ RUF069 Unreliable floating point equality comparison `x == 0.42` 14 | if x == 0.3: ... 15 | if x == 0.42: ... | ^^^^^^^^^^^^^^^ - | RUF069 Unreliable floating point equality comparison `a == b - 0.1` --> RUF069.py:19:12 @@ -235,4 +234,3 @@ RUF069 Unreliable floating point equality comparison `0.3 if x > 0 else 1 == 0.1 47 | 48 | assert (0.3 if x > 0 else 1) == 0.1 + 0.2 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF070_RUF070.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF070_RUF070.py.snap index 1e156ce0ddc4bb..a7233c248bda3e 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF070_RUF070.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF070_RUF070.py.snap @@ -248,7 +248,6 @@ RUF070 [*] Unnecessary assignment to `x` before `yield` statement 62 | x = f.read() 63 | yield x # RUF070 | ^ - | help: Remove unnecessary assignment | 61 | with open("foo.txt") as f: diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF072_RUF072.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF072_RUF072.py.snap index c4c73661d338f3..fbb131c11363e4 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF072_RUF072.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__RUF072_RUF072.py.snap @@ -319,7 +319,6 @@ RUF072 [*] Empty `finally` clause 178 | / finally: 179 | | pass | |________^ - | help: Remove the `finally` clause | 174 | # Bare try finally with line starting with a formfeed @@ -341,7 +340,6 @@ RUF072 [*] Empty `finally` clause 186 | / finally: 187 | | pass | |________^ - | help: Remove the `finally` clause | 183 | # (`try` is preceded by a form feed below) diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__py37__RUF039_RUF039_py_version_sensitive.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__py37__RUF039_RUF039_py_version_sensitive.py.snap index 58f3127ce7b9f0..63463f809fa079 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__py37__RUF039_RUF039_py_version_sensitive.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__py37__RUF039_RUF039_py_version_sensitive.py.snap @@ -8,5 +8,4 @@ RUF039 First argument to `re.compile()` is not raw string 2 | 3 | re.compile("\N{Partial Differential}") # with unsafe fix if python target is 3.8 or higher, else without fix | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with raw string diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__py38__RUF039_RUF039_py_version_sensitive.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__py38__RUF039_RUF039_py_version_sensitive.py.snap index 2c96acbb9ea90d..db5e3c79f83261 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__py38__RUF039_RUF039_py_version_sensitive.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__preview__py38__RUF039_RUF039_py_version_sensitive.py.snap @@ -8,7 +8,6 @@ RUF039 [*] First argument to `re.compile()` is not raw string 2 | 3 | re.compile("\N{Partial Differential}") # with unsafe fix if python target is 3.8 or higher, else without fix | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with raw string | 2 | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__py314__RUF058_RUF058_2.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__py314__RUF058_RUF058_2.py.snap index 298d4b2eb8250e..3762a50a11a32c 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__py314__RUF058_RUF058_2.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__py314__RUF058_RUF058_2.py.snap @@ -42,7 +42,6 @@ RUF058 [*] `itertools.starmap` called on `zip` iterable 6 | starmap(func, zip(a, b, c, strict=False)) 7 | starmap(func, zip(a, b, c, strict=strict)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Use `map` instead | 6 | starmap(func, zip(a, b, c, strict=False)) diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__range_suppressions.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__range_suppressions.snap index 1c4cea3779e59e..c65ef006ef1b96 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__range_suppressions.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__range_suppressions.snap @@ -46,7 +46,6 @@ RUF103 [*] Invalid suppression comment: no matching 'disable' comment 18 | I = 1 19 | # ruff: enable[E741, F841] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove suppression comment | 18 | I = 1 @@ -111,7 +110,6 @@ RUF100 [*] Unused suppression (non-enabled: `E501`) 47 | I = 1 48 | # ruff: enable[E501] | -------------------- - | help: Remove unused suppression | 45 | # An unused suppression diagnostic should also be logged. @@ -302,7 +300,6 @@ RUF102 [*] Invalid rule code in suppression: YF829 96 | # ruff: enable[F841, RQW320] 97 | # ruff: enable[YF829] | ----- - | help: Add non-Ruff rule codes to the `lint.external` configuration option help: Remove the suppression comment | @@ -381,7 +378,6 @@ F841 [*] Local variable `bar` is assigned to but never used 117 | foo = 0 118 | bar = 0 | ^^^ - | help: Remove assignment to unused variable `bar` | 117 | foo = 0 @@ -397,7 +393,6 @@ F841 [*] Local variable `bar` is assigned to but never used 123 | foo = 0 # ruff: ignore[F841] 124 | bar = 0 | ^^^ - | help: Remove assignment to unused variable `bar` | 123 | foo = 0 # ruff: ignore[F841] @@ -413,7 +408,6 @@ F841 [*] Local variable `bar` is assigned to but never used 131 | """ # ruff: ignore[F841] 132 | bar = 0 | ^^^ - | help: Remove assignment to unused variable `bar` | 131 | """ # ruff: ignore[F841] @@ -487,7 +481,6 @@ RUF100 [*] Unused suppression (non-enabled: `F401`) 176 | print("goodbye") 177 | # ruff:enable[F401] | ------------------- - | help: Remove unused suppression | 174 | # https://github.com/astral-sh/ruff/issues/23235 diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_0.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_0.snap index 1d99fa87554065..9925381435866e 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_0.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_0.snap @@ -209,7 +209,6 @@ E501 Line too long (89 > 88) 92 | 93 | "shape: (6,)\nSeries: '' [duration[μs]]\n[\n\t0µs\n\t1µs\n\t2µs\n\t3µs\n\t4µs\n\t5µs\n]" # noqa: F401 | ^ - | RUF100 [*] Unused `noqa` directive (unused: `F401`) --> RUF100_0.py:93:92 @@ -218,7 +217,6 @@ RUF100 [*] Unused `noqa` directive (unused: `F401`) 92 | 93 | "shape: (6,)\nSeries: '' [duration[μs]]\n[\n\t0µs\n\t1µs\n\t2µs\n\t3µs\n\t4µs\n\t5µs\n]" # noqa: F401 | ^^^^^^^^^^^^ - | help: Remove unused `noqa` directive | 92 | @@ -234,7 +232,6 @@ F841 [*] Local variable `e` is assigned to but never used 107 | d = 1 # …noqa: F841, E50 108 | e = 1 # …noqa: E50 | ^ - | help: Remove assignment to unused variable `e` | 107 | d = 1 # …noqa: F841, E50 @@ -339,7 +336,6 @@ RUF100 [*] Unused `noqa` directive (duplicated: `PGH001`, `S307`) 130 | x = eval(command) # noqa: PGH001, S307, PGH001 131 | x = eval(command) # noqa: PGH001, S307, PGH001, S307 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove unused `noqa` directive | 130 | x = eval(command) # noqa: PGH001, S307, PGH001 diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_0_prefix.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_0_prefix.snap index 1d99fa87554065..9925381435866e 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_0_prefix.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_0_prefix.snap @@ -209,7 +209,6 @@ E501 Line too long (89 > 88) 92 | 93 | "shape: (6,)\nSeries: '' [duration[μs]]\n[\n\t0µs\n\t1µs\n\t2µs\n\t3µs\n\t4µs\n\t5µs\n]" # noqa: F401 | ^ - | RUF100 [*] Unused `noqa` directive (unused: `F401`) --> RUF100_0.py:93:92 @@ -218,7 +217,6 @@ RUF100 [*] Unused `noqa` directive (unused: `F401`) 92 | 93 | "shape: (6,)\nSeries: '' [duration[μs]]\n[\n\t0µs\n\t1µs\n\t2µs\n\t3µs\n\t4µs\n\t5µs\n]" # noqa: F401 | ^^^^^^^^^^^^ - | help: Remove unused `noqa` directive | 92 | @@ -234,7 +232,6 @@ F841 [*] Local variable `e` is assigned to but never used 107 | d = 1 # …noqa: F841, E50 108 | e = 1 # …noqa: E50 | ^ - | help: Remove assignment to unused variable `e` | 107 | d = 1 # …noqa: F841, E50 @@ -339,7 +336,6 @@ RUF100 [*] Unused `noqa` directive (duplicated: `PGH001`, `S307`) 130 | x = eval(command) # noqa: PGH001, S307, PGH001 131 | x = eval(command) # noqa: PGH001, S307, PGH001, S307 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove unused `noqa` directive | 130 | x = eval(command) # noqa: PGH001, S307, PGH001 diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_1.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_1.snap index a362758258ed37..653a8ea3021911 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_1.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_1.snap @@ -95,7 +95,6 @@ F401 [*] `typing.Awaitable` imported but unused 88 | # This should mark F501 as unused. 89 | from typing import Awaitable, AwaitableGenerator # noqa: F501 | ^^^^^^^^^ - | help: Remove unused import | 88 | # This should mark F501 as unused. @@ -110,7 +109,6 @@ F401 [*] `typing.AwaitableGenerator` imported but unused 88 | # This should mark F501 as unused. 89 | from typing import Awaitable, AwaitableGenerator # noqa: F501 | ^^^^^^^^^^^^^^^^^^ - | help: Remove unused import | 88 | # This should mark F501 as unused. @@ -125,7 +123,6 @@ RUF100 [*] Unused `noqa` directive (non-enabled: `F501`) 88 | # This should mark F501 as unused. 89 | from typing import Awaitable, AwaitableGenerator # noqa: F501 | ^^^^^^^^^^^^ - | help: Remove unused `noqa` directive | 88 | # This should mark F501 as unused. diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_2.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_2.snap index 60decc6cd4168b..3b2f4a86dc2b2c 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_2.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_2.snap @@ -6,7 +6,6 @@ RUF100 [*] Unused `noqa` directive (non-enabled: `F401`) | 1 | import itertools # noqa: F401 | ^^^^^^^^^^^^ - | help: Remove unused `noqa` directive | - import itertools # noqa: F401 diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_3.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_3.snap index ae760882c11189..aa8e5eb9583d07 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_3.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_3.snap @@ -422,7 +422,6 @@ RUF100 [*] Unused `noqa` directive (unused: `E501`) 30 | print(a) # comment with unicode µ # noqa: E501 31 | print(a) # comment with unicode µ # noqa: E501, F821 | ^^^^^^^^^^^^^^^^^^ - | help: Remove unused `noqa` directive | 30 | print(a) # comment with unicode µ # noqa: E501 diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_5.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_5.snap index 6422ffed1939fb..2edd5120911d8d 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_5.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruf100_5.snap @@ -75,7 +75,6 @@ RUF100 [*] Unused `noqa` directive (non-enabled: `RET504`) 20 | # line below should autofix to `return data` 21 | return data # noqa: RET504 - intentional incorrect noqa, will be removed | ^^^^^^^^^^^^^^ - | help: Remove unused `noqa` directive | 20 | # line below should autofix to `return data` diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_codes.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_codes.snap index 42f0dfd342428b..6faada6c7ba0a9 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_codes.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_codes.snap @@ -7,7 +7,6 @@ F841 [*] Local variable `x` is assigned to but never used 7 | def f(): 8 | x = 1 | ^ - | help: Remove assignment to unused variable `x` | 7 | def f(): diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_filedirective_unused.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_filedirective_unused.snap index e22cbd8e0ad134..f1c33a1592c6eb 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_filedirective_unused.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_filedirective_unused.snap @@ -6,7 +6,6 @@ RUF100 [*] Unused `noqa` directive (non-enabled: `F841`) | 1 | # ruff: noqa: F841 -- intentional unused file directive; will be removed | ^^^^^^^^^^^^^^^^^^ - | help: Remove unused `noqa` directive | - # ruff: noqa: F841 -- intentional unused file directive; will be removed diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_filedirective_unused_last_of_many.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_filedirective_unused_last_of_many.snap index 4a0b525f25d147..3c138f9c1d1b68 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_filedirective_unused_last_of_many.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_filedirective_unused_last_of_many.snap @@ -21,7 +21,6 @@ RUF100 [*] Unused `noqa` directive (non-enabled: `E701`) 1 | # flake8: noqa: F841, E501 -- used followed by unused code 2 | # ruff: noqa: E701, F541 -- unused followed by used code | ^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove unused `noqa` directive | 1 | # flake8: noqa: F841, E501 -- used followed by unused code diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_invalid.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_invalid.snap index c127d4c20f1b91..04b50369b36864 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_invalid.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__ruff_noqa_invalid.snap @@ -6,7 +6,6 @@ F401 [*] `os` imported but unused | 1 | import os # ruff: noqa: F401 | ^^ - | help: Remove unused import: `os` | - import os # ruff: noqa: F401 @@ -19,7 +18,6 @@ F841 [*] Local variable `x` is assigned to but never used 4 | def f(): 5 | x = 1 | ^ - | help: Remove assignment to unused variable `x` | 4 | def f(): diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__strictly_empty_init_modules_ruf067.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__strictly_empty_init_modules_ruf067.snap index 682497466e3b87..d5e32a443f4617 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__strictly_empty_init_modules_ruf067.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__strictly_empty_init_modules_ruf067.snap @@ -28,7 +28,6 @@ RUF067 `__init__` module should only contain docstrings and re-exports 14 | 15 | os.environ["FOO"] = 1 | ^^^^^^^^^^^^^^^^^^^^^ - | RUF067 `__init__` module should only contain docstrings and re-exports @@ -186,7 +185,6 @@ RUF067 `__init__` module should not contain any code 14 | 15 | os.environ["FOO"] = 1 | ^^^^^^^^^^^^^^^^^^^^^ - | RUF067 `__init__` module should not contain any code @@ -421,4 +419,3 @@ RUF067 `__init__` module should not contain any code 57 | # also allow `__author__` 58 | __author__ = "The Author" # ok | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__unnecessary_if_and_needless_else.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__unnecessary_if_and_needless_else.snap index 6f3f9fc00506f8..e8ed80b8735c84 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__unnecessary_if_and_needless_else.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__unnecessary_if_and_needless_else.snap @@ -47,7 +47,6 @@ RUF047 [*] Empty `else` clause 21 | / else: 22 | | pass | |________^ - | help: Remove the `else` clause | 20 | pass diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__useless_finally_and_needless_else.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__useless_finally_and_needless_else.snap index c3a43a1770e933..b8824b9cea3788 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__useless_finally_and_needless_else.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__useless_finally_and_needless_else.snap @@ -85,7 +85,6 @@ RUF072 [*] Empty `finally` clause 29 | / finally: 30 | | pass | |________^ - | help: Remove the `finally` clause | 28 | baz() diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__useless_finally_and_needless_else_and_suppressible_exception.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__useless_finally_and_needless_else_and_suppressible_exception.snap index f619ab2c8aae7f..d6b94487535a16 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__useless_finally_and_needless_else_and_suppressible_exception.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__useless_finally_and_needless_else_and_suppressible_exception.snap @@ -28,7 +28,6 @@ RUF072 [*] Empty `finally` clause 9 | / finally: 10 | | pass | |________^ - | help: Remove the `finally` clause | 8 | pass diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__useless_finally_and_suppressible_exception.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__useless_finally_and_suppressible_exception.snap index c0ff748c42b354..845be65e12b1fc 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__useless_finally_and_suppressible_exception.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__useless_finally_and_suppressible_exception.snap @@ -9,7 +9,6 @@ RUF072 [*] Empty `finally` clause 8 | / finally: 9 | | pass | |________^ - | help: Remove the `finally` clause | 7 | pass diff --git a/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__error-instead-of-exception_TRY400.py.snap b/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__error-instead-of-exception_TRY400.py.snap index 67c8f11db92e74..51a8680efaca1f 100644 --- a/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__error-instead-of-exception_TRY400.py.snap +++ b/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__error-instead-of-exception_TRY400.py.snap @@ -25,7 +25,6 @@ TRY400 [*] Use `logging.exception` instead of `logging.error` 15 | if True: 16 | logging.error("Context message here") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `exception` | 15 | if True: @@ -59,7 +58,6 @@ TRY400 [*] Use `logging.exception` instead of `logging.error` 29 | if True: 30 | logger.error("Context message here") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `exception` | 29 | if True: @@ -94,7 +92,6 @@ TRY400 [*] Use `logging.exception` instead of `logging.error` 39 | if True: 40 | log.error("Context message here") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `exception` | 39 | if True: @@ -129,7 +126,6 @@ TRY400 [*] Use `logging.exception` instead of `logging.error` 49 | if True: 50 | self.logger.error("Context message here") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `exception` | 49 | if True: @@ -163,7 +159,6 @@ TRY400 [*] Use `logging.exception` instead of `logging.error` 102 | if True: 103 | error("Context message here") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `exception` | 102 | if True: @@ -179,7 +174,6 @@ TRY400 [*] Use `logging.exception` instead of `logging.error` 142 | except Exception: 143 | error("Context message here") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Replace with `exception` | 142 | except Exception: diff --git a/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__raise-vanilla-args_TRY003.py.snap b/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__raise-vanilla-args_TRY003.py.snap index c9cbe9dd20bc66..b312410cec3555 100644 --- a/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__raise-vanilla-args_TRY003.py.snap +++ b/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__raise-vanilla-args_TRY003.py.snap @@ -19,7 +19,6 @@ TRY003 Avoid specifying long messages outside the exception class 33 | if a % 2 == 0: 34 | raise BadArgCantBeEven(f"The argument '{a}' should be even") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | TRY003 Avoid specifying long messages outside the exception class --> TRY003.py:39:15 @@ -28,7 +27,6 @@ TRY003 Avoid specifying long messages outside the exception class 38 | if a % 2 == 0: 39 | raise BadArgCantBeEven(f"The argument {a} should not be odd.") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | TRY003 Avoid specifying long messages outside the exception class --> TRY003.py:44:15 @@ -37,4 +35,3 @@ TRY003 Avoid specifying long messages outside the exception class 43 | if a % 2 == 0: 44 | raise BadArgCantBeEven("The argument `a` should not be odd.") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__raise-vanilla-class_TRY002.py.snap b/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__raise-vanilla-class_TRY002.py.snap index a781966a173c91..87e6ca16ae3981 100644 --- a/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__raise-vanilla-class_TRY002.py.snap +++ b/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__raise-vanilla-class_TRY002.py.snap @@ -19,7 +19,6 @@ TRY002 Create your own exception 16 | if b == 1: 17 | raise Exception | ^^^^^^^^^ - | TRY002 Create your own exception --> TRY002.py:37:15 @@ -39,4 +38,3 @@ TRY002 Create your own exception 40 | if b == 1: 41 | raise BaseException | ^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__type-check-without-type-error_TRY004.py.snap b/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__type-check-without-type-error_TRY004.py.snap index 893ee904d68f5a..c44177b5421ee8 100644 --- a/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__type-check-without-type-error_TRY004.py.snap +++ b/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__type-check-without-type-error_TRY004.py.snap @@ -8,7 +8,6 @@ TRY004 Prefer `TypeError` exception for invalid type 11 | else: 12 | raise Exception("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:19:9 @@ -17,7 +16,6 @@ TRY004 Prefer `TypeError` exception for invalid type 18 | else: 19 | raise Exception("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:30:9 @@ -26,7 +24,6 @@ TRY004 Prefer `TypeError` exception for invalid type 29 | else: 30 | raise Exception("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:37:9 @@ -35,7 +32,6 @@ TRY004 Prefer `TypeError` exception for invalid type 36 | else: 37 | raise Exception("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:44:9 @@ -44,7 +40,6 @@ TRY004 Prefer `TypeError` exception for invalid type 43 | else: 44 | raise ArithmeticError("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:51:9 @@ -53,7 +48,6 @@ TRY004 Prefer `TypeError` exception for invalid type 50 | else: 51 | raise AssertionError("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:58:9 @@ -62,7 +56,6 @@ TRY004 Prefer `TypeError` exception for invalid type 57 | else: 58 | raise AttributeError("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:65:9 @@ -71,7 +64,6 @@ TRY004 Prefer `TypeError` exception for invalid type 64 | else: 65 | raise BufferError # should be typeerror | ^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:72:9 @@ -80,7 +72,6 @@ TRY004 Prefer `TypeError` exception for invalid type 71 | else: 72 | raise EOFError("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:79:9 @@ -89,7 +80,6 @@ TRY004 Prefer `TypeError` exception for invalid type 78 | else: 79 | raise ImportError("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:86:9 @@ -98,7 +88,6 @@ TRY004 Prefer `TypeError` exception for invalid type 85 | else: 86 | raise LookupError("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:95:9 @@ -109,7 +98,6 @@ TRY004 Prefer `TypeError` exception for invalid type 96 | | "..." 97 | | ) | |_________^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:104:9 @@ -118,7 +106,6 @@ TRY004 Prefer `TypeError` exception for invalid type 103 | else: 104 | raise NameError("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:111:9 @@ -127,7 +114,6 @@ TRY004 Prefer `TypeError` exception for invalid type 110 | else: 111 | raise ReferenceError("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:118:9 @@ -136,7 +122,6 @@ TRY004 Prefer `TypeError` exception for invalid type 117 | else: 118 | raise RuntimeError("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:125:9 @@ -145,7 +130,6 @@ TRY004 Prefer `TypeError` exception for invalid type 124 | else: 125 | raise SyntaxError("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:132:9 @@ -154,7 +138,6 @@ TRY004 Prefer `TypeError` exception for invalid type 131 | else: 132 | raise SystemError("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:139:9 @@ -163,7 +146,6 @@ TRY004 Prefer `TypeError` exception for invalid type 138 | else: 139 | raise ValueError("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:146:9 @@ -172,7 +154,6 @@ TRY004 Prefer `TypeError` exception for invalid type 145 | else: 146 | raise Exception("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:153:9 @@ -181,7 +162,6 @@ TRY004 Prefer `TypeError` exception for invalid type 152 | else: 153 | raise Exception("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:160:9 @@ -190,7 +170,6 @@ TRY004 Prefer `TypeError` exception for invalid type 159 | else: 160 | raise Exception("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:167:9 @@ -199,7 +178,6 @@ TRY004 Prefer `TypeError` exception for invalid type 166 | else: 167 | raise Exception("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:174:9 @@ -208,7 +186,6 @@ TRY004 Prefer `TypeError` exception for invalid type 173 | else: 174 | raise Exception("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:181:9 @@ -217,7 +194,6 @@ TRY004 Prefer `TypeError` exception for invalid type 180 | else: 181 | raise Exception("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:188:9 @@ -226,7 +202,6 @@ TRY004 Prefer `TypeError` exception for invalid type 187 | else: 188 | raise Exception("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:195:9 @@ -235,7 +210,6 @@ TRY004 Prefer `TypeError` exception for invalid type 194 | else: 195 | raise Exception("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:202:9 @@ -244,7 +218,6 @@ TRY004 Prefer `TypeError` exception for invalid type 201 | else: 202 | raise Exception("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:209:9 @@ -253,7 +226,6 @@ TRY004 Prefer `TypeError` exception for invalid type 208 | else: 209 | raise Exception("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:216:9 @@ -262,7 +234,6 @@ TRY004 Prefer `TypeError` exception for invalid type 215 | else: 216 | raise Exception("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:223:9 @@ -271,7 +242,6 @@ TRY004 Prefer `TypeError` exception for invalid type 222 | else: 223 | raise Exception("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:230:9 @@ -280,7 +250,6 @@ TRY004 Prefer `TypeError` exception for invalid type 229 | elif isinstance(arg2, int): 230 | raise Exception("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:239:9 @@ -289,7 +258,6 @@ TRY004 Prefer `TypeError` exception for invalid type 238 | else: 239 | raise Exception("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:276:9 @@ -298,7 +266,6 @@ TRY004 Prefer `TypeError` exception for invalid type 275 | if isinstance(some_args, int): 276 | raise ValueError("...") # should be typeerror | ^^^^^^^^^^^^^^^^^^^^^^^ - | TRY004 Prefer `TypeError` exception for invalid type --> TRY004.py:286:9 @@ -329,4 +296,3 @@ TRY004 Prefer `TypeError` exception for invalid type 315 | else: 316 | raise Exception(f"Unknown object type: {obj.__class__.__name__}") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__verbose-log-message_TRY401.py.snap b/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__verbose-log-message_TRY401.py.snap index 87a8944016df64..6958981373c931 100644 --- a/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__verbose-log-message_TRY401.py.snap +++ b/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__verbose-log-message_TRY401.py.snap @@ -8,7 +8,6 @@ TRY401 Redundant exception object included in `logging.exception` call 7 | except Exception as ex: 8 | logger.exception(f"Found an error: {ex}") # TRY401 | ^^ - | TRY401 Redundant exception object included in `logging.exception` call --> TRY401.py:19:53 @@ -70,7 +69,6 @@ TRY401 Redundant exception object included in `logging.exception` call 26 | if True: 27 | logger.exception(f"Found an error: {bad}") # TRY401 | ^^^ - | TRY401 Redundant exception object included in `logging.exception` call --> TRY401.py:39:47 @@ -79,7 +77,6 @@ TRY401 Redundant exception object included in `logging.exception` call 38 | except Exception as ex: 39 | logger.exception(f"Logging an error: {ex}") # TRY401 | ^^ - | TRY401 Redundant exception object included in `logging.exception` call --> TRY401.py:46:53 @@ -88,7 +85,6 @@ TRY401 Redundant exception object included in `logging.exception` call 45 | except Exception as ex: 46 | logger.exception("Logging an error: " + str(ex)) # TRY401 | ^^ - | TRY401 Redundant exception object included in `logging.exception` call --> TRY401.py:53:47 @@ -97,7 +93,6 @@ TRY401 Redundant exception object included in `logging.exception` call 52 | except Exception as ex: 53 | logger.exception("Logging an error:", ex) # TRY401 | ^^ - | TRY401 Redundant exception object included in `logging.exception` call --> TRY401.py:77:38 @@ -106,7 +101,6 @@ TRY401 Redundant exception object included in `logging.exception` call 76 | except Exception as ex: 77 | exception(f"Found an error: {ex}") # TRY401 | ^^ - | TRY401 Redundant exception object included in `logging.exception` call --> TRY401.py:88:46 @@ -168,7 +162,6 @@ TRY401 Redundant exception object included in `logging.exception` call 95 | if True: 96 | exception(f"Found an error: {bad}") # TRY401 | ^^^ - | TRY401 Redundant exception object included in `logging.exception` call --> TRY401.py:103:40 @@ -177,7 +170,6 @@ TRY401 Redundant exception object included in `logging.exception` call 102 | except Exception as ex: 103 | exception(f"Logging an error: {ex}") # TRY401 | ^^ - | TRY401 Redundant exception object included in `logging.exception` call --> TRY401.py:110:46 @@ -186,7 +178,6 @@ TRY401 Redundant exception object included in `logging.exception` call 109 | except Exception as ex: 110 | exception("Logging an error: " + str(ex)) # TRY401 | ^^ - | TRY401 Redundant exception object included in `logging.exception` call --> TRY401.py:117:40 @@ -195,7 +186,6 @@ TRY401 Redundant exception object included in `logging.exception` call 116 | except Exception as ex: 117 | exception("Logging an error:", ex) # TRY401 | ^^ - | TRY401 Redundant exception object included in `logging.exception` call --> TRY401.py:139:49 @@ -204,7 +194,6 @@ TRY401 Redundant exception object included in `logging.exception` call 138 | except Exception as ex: 139 | logger.exception(f"Found an error: {ex}") # TRY401 | ^^ - | TRY401 Redundant exception object included in `logging.exception` call --> TRY401.py:150:49 @@ -213,4 +202,3 @@ TRY401 Redundant exception object included in `logging.exception` call 149 | except Exception: 150 | logger.exception(f"Found an error: {ex}") # TRY401 | ^^ - | diff --git a/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__verbose-raise_TRY201.py.snap b/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__verbose-raise_TRY201.py.snap index f40a9fda632f0d..0560eb3a084734 100644 --- a/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__verbose-raise_TRY201.py.snap +++ b/crates/ruff_linter/src/rules/tryceratops/snapshots/ruff_linter__rules__tryceratops__tests__verbose-raise_TRY201.py.snap @@ -8,7 +8,6 @@ TRY201 [*] Use `raise` without specifying exception name 19 | logger.exception("process failed") 20 | raise e | ^ - | help: Remove exception name | 19 | logger.exception("process failed") @@ -25,7 +24,6 @@ TRY201 [*] Use `raise` without specifying exception name 62 | if True: 63 | raise e | ^ - | help: Remove exception name | 62 | if True: @@ -41,7 +39,6 @@ TRY201 [*] Use `raise` without specifying exception name 73 | def foo(): 74 | raise e | ^ - | help: Remove exception name | 73 | def foo(): diff --git a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__async_comprehension.py.snap b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__async_comprehension.py.snap index e39895d9c6f7af..4d6b3dfb9b4f22 100644 --- a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__async_comprehension.py.snap +++ b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__async_comprehension.py.snap @@ -31,4 +31,3 @@ PLE1142 `await` should be used within an async function 10 | / async for _ in elements(1): 11 | | pass | |____________^ - | diff --git a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__async_comprehension_in_sync_comprehension_notebook_3.10.snap b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__async_comprehension_in_sync_comprehension_notebook_3.10.snap index 14c1cea362c827..fed430c44b9c99 100644 --- a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__async_comprehension_in_sync_comprehension_notebook_3.10.snap +++ b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__async_comprehension_in_sync_comprehension_notebook_3.10.snap @@ -8,4 +8,3 @@ invalid-syntax: cannot use an asynchronous comprehension inside of a synchronous 2 | [x async for x in elements(5)] # okay, async at top level 3 | [[x async for x in elements(5)] for i in range(5)] # error on 3.10, okay after | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__await_scope_notebook.snap b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__await_scope_notebook.snap index 2038653a11c2d3..858407cf45dd3e 100644 --- a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__await_scope_notebook.snap +++ b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__await_scope_notebook.snap @@ -7,4 +7,3 @@ F704 `await` statement outside of a function 1 | class _: 2 | await 1 # SyntaxError: await outside function | ^^^^^^^ - | diff --git a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__import_sorting.snap b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__import_sorting.snap index b788f7b1fb24b3..9d888d969781b1 100644 --- a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__import_sorting.snap +++ b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__import_sorting.snap @@ -8,7 +8,6 @@ I001 [*] Import block is un-sorted or un-formatted 2 | | import random 3 | | import math | |___________^ - | help: Organize imports ::: cell 1 | @@ -65,7 +64,6 @@ I001 [*] Import block is un-sorted or un-formatted 7 | / import math 8 | | import abc | |__________^ - | help: Organize imports ::: cell 3 | diff --git a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__ipy_escape_command.snap b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__ipy_escape_command.snap index 1ddd61a96a8a6c..646b1f26c4f73c 100644 --- a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__ipy_escape_command.snap +++ b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__ipy_escape_command.snap @@ -25,7 +25,6 @@ F401 [*] `sys` imported but unused 1 | %%timeit 2 | import sys | ^^^ - | help: Remove unused import: `sys` ::: cell 2 | diff --git a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__late_future_import.py.snap b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__late_future_import.py.snap index 0274914bacb60f..8d7121eb3cb301 100644 --- a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__late_future_import.py.snap +++ b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__late_future_import.py.snap @@ -7,4 +7,3 @@ F404 `from __future__` imports must occur at the beginning of the file 1 | import random 2 | from __future__ import annotations # Error; not at top of file | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__return_in_generator.py.snap b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__return_in_generator.py.snap index 2abd1fad09c537..093c1340f12171 100644 --- a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__return_in_generator.py.snap +++ b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__return_in_generator.py.snap @@ -52,4 +52,3 @@ B901 Using `yield` and `return {value}` in a generator function can lead to conf 23 | yield 1 24 | return 10 | ^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__return_outside_function.py.snap b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__return_outside_function.py.snap index dd8114a6dc301a..cab2c636126d44 100644 --- a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__return_outside_function.py.snap +++ b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__return_outside_function.py.snap @@ -15,7 +15,6 @@ F706 `return` statement outside of a function/method 13 | return 1 # error 14 | return # error | ^^^^^^ - | F706 `return` statement outside of a function/method --> resources/test/fixtures/syntax_errors/return_outside_function.py:18:5 @@ -23,7 +22,6 @@ F706 `return` statement outside of a function/method 17 | class C: 18 | return 1 # error | ^^^^^^^^ - | F706 `return` statement outside of a function/method --> resources/test/fixtures/syntax_errors/return_outside_function.py:23:9 @@ -32,4 +30,3 @@ F706 `return` statement outside of a function/method 22 | class C: 23 | return 1 # error | ^^^^^^^^ - | diff --git a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__semantic_syntax_error_annotated_global.py_3.14.snap b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__semantic_syntax_error_annotated_global.py_3.14.snap index bc8140b3854499..731ac3ee423244 100644 --- a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__semantic_syntax_error_annotated_global.py_3.14.snap +++ b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__semantic_syntax_error_annotated_global.py_3.14.snap @@ -71,4 +71,3 @@ invalid-syntax: annotated name `x` can't be global 37 | global x # error 38 | x: str | ^ - | diff --git a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__semantic_syntax_error_duplicate_type_parameter.py_3.12.snap b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__semantic_syntax_error_duplicate_type_parameter.py_3.12.snap index 9b3d052471fd49..dc5d76e882346f 100644 --- a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__semantic_syntax_error_duplicate_type_parameter.py_3.12.snap +++ b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__semantic_syntax_error_duplicate_type_parameter.py_3.12.snap @@ -6,4 +6,3 @@ invalid-syntax: duplicate type parameter | 1 | class C[T, T]: pass | ^ - | diff --git a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__semantic_syntax_error_invalid_star_expression.py_3.10.snap b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__semantic_syntax_error_invalid_star_expression.py_3.10.snap index f26a2d73a7852b..f04472006eb09f 100644 --- a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__semantic_syntax_error_invalid_star_expression.py_3.10.snap +++ b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__semantic_syntax_error_invalid_star_expression.py_3.10.snap @@ -27,4 +27,3 @@ invalid-syntax: Starred expression cannot be used here 7 | def func(): 8 | yield *x | ^^ - | diff --git a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__semantic_syntax_error_rebound_comprehension.py_3.10.snap b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__semantic_syntax_error_rebound_comprehension.py_3.10.snap index 91fa59a6fc12ba..58b567adb05ce0 100644 --- a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__semantic_syntax_error_rebound_comprehension.py_3.10.snap +++ b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__semantic_syntax_error_rebound_comprehension.py_3.10.snap @@ -25,4 +25,3 @@ invalid-syntax: assignment expression within a comprehension cannot be used in a 4 | class C: 5 | [(x := y) for y in range(3)] | ^^^^^^ - | diff --git a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__semantic_syntax_error_single_starred_assignment.py_3.10.snap b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__semantic_syntax_error_single_starred_assignment.py_3.10.snap index 7c3cc3916bdaf3..04ce5f307b9f6b 100644 --- a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__semantic_syntax_error_single_starred_assignment.py_3.10.snap +++ b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__semantic_syntax_error_single_starred_assignment.py_3.10.snap @@ -6,4 +6,3 @@ invalid-syntax: starred assignment target must be in a list or tuple | 1 | *a = [1, 2, 3, 4] | ^^ - | diff --git a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__undefined_name.snap b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__undefined_name.snap index 478ccbfead7756..949a99ac82d5c5 100644 --- a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__undefined_name.snap +++ b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__undefined_name.snap @@ -6,4 +6,3 @@ F821 Undefined name `undefined` | 1 | print(undefined) | ^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__unused_variable.snap b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__unused_variable.snap index fc213dcdd24358..de53bff60850a9 100644 --- a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__unused_variable.snap +++ b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__unused_variable.snap @@ -26,7 +26,6 @@ F841 [*] Local variable `foo2` is assigned to but never used 2 | foo1 = %matplotlib --list 3 | foo2: list[str] = %matplotlib --list | ^^^^ - | help: Remove assignment to unused variable `foo2` ::: cell 1 | @@ -61,7 +60,6 @@ F841 [*] Local variable `bar2` is assigned to but never used 2 | bar1 = !pwd 3 | bar2: str = !pwd | ^^^^ - | help: Remove assignment to unused variable `bar2` ::: cell 2 | diff --git a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__yield_from_in_async_function.py.snap b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__yield_from_in_async_function.py.snap index ab60900419faf6..a53ef734606598 100644 --- a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__yield_from_in_async_function.py.snap +++ b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__yield_from_in_async_function.py.snap @@ -6,4 +6,3 @@ PLE1700 `yield from` statement in async function; use `async for` instead | 1 | async def f(): yield from x # error | ^^^^^^^^^^^^ - | diff --git a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__yield_scope.py.snap b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__yield_scope.py.snap index e32c627fce7eda..09a503ee676bb3 100644 --- a/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__yield_scope.py.snap +++ b/crates/ruff_linter/src/snapshots/ruff_linter__linter__tests__yield_scope.py.snap @@ -48,7 +48,6 @@ F704 `yield` statement outside of a function 4 | await 1 # error 5 | [(yield x) for x in range(3)] # error | ^^^^^^^ - | F704 `yield` statement outside of a function --> resources/test/fixtures/syntax_errors/yield_scope.py:23:9 @@ -110,7 +109,6 @@ F704 `yield` statement outside of a function 28 | {(yield 1): 0 for x in range(3)} # error 29 | {0: (yield 1) for x in range(3)} # error | ^^^^^^^ - | F704 `await` statement outside of a function --> resources/test/fixtures/syntax_errors/yield_scope.py:36:10 @@ -127,4 +125,3 @@ F704 `await` statement outside of a function | 41 | await 1 # error | ^^^^^^^ - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_invalid_annotation.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_invalid_annotation.py.snap index 21eb2b1619c5c0..32da2cab8d10f7 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_invalid_annotation.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_invalid_annotation.py.snap @@ -219,7 +219,6 @@ Module( 3 | x: yield from b = 1 4 | x: y := int = 1 | ^^ Syntax Error: Expected a statement - | ## Semantic Syntax Errors diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_invalid_target.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_invalid_target.py.snap index 1e58991d1734f7..12e797e8121680 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_invalid_target.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_invalid_target.py.snap @@ -563,4 +563,3 @@ Module( 9 | [x]: int = 1 10 | [x, y]: int = 1, 2 | ^^^^^^ Syntax Error: Only single target (not list) can be annotated - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_invalid_value.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_invalid_value.py.snap index f9ad11979a6331..2123f14a29a38c 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_invalid_value.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_invalid_value.py.snap @@ -246,4 +246,3 @@ Module( 2 | x: Any = x := 1 3 | x: list = [x, *a | b, *a or b] | ^^^^^^ Syntax Error: Boolean expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_missing_rhs.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_missing_rhs.py.snap index babd3409873a3b..db6d7e8c2d1c5a 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_missing_rhs.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_missing_rhs.py.snap @@ -43,4 +43,3 @@ Module( | 1 | x: int = | ^ Syntax Error: Expected an expression - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_type_alias_annotation.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_type_alias_annotation.py.snap index 8c2e51d0cd1fc0..0b9892d0bff585 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_type_alias_annotation.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ann_assign_stmt_type_alias_annotation.py.snap @@ -120,4 +120,3 @@ Module( 1 | a: type X = int 2 | lambda: type X = int | ^ Syntax Error: Simple statements must be separated by newlines or semicolons - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@args_unparenthesized_generator.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@args_unparenthesized_generator.py.snap index 13b2bd42923e37..49270f2b3893e3 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@args_unparenthesized_generator.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@args_unparenthesized_generator.py.snap @@ -337,4 +337,3 @@ Module( 2 | total(1, 2, x for x in range(5), 6) 3 | sum(x for x in range(10),) | ^^^^^^^^^^^^^^^^^^^^ Syntax Error: Unparenthesized generator expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_empty_msg.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_empty_msg.py.snap index fd78d8760b20f8..2b647a18873d3e 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_empty_msg.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_empty_msg.py.snap @@ -34,4 +34,3 @@ Module( | 1 | assert x, | ^ Syntax Error: Expected an expression - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_empty_test.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_empty_test.py.snap index 2c64815756f4f6..14a4dd1844f5a0 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_empty_test.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_empty_test.py.snap @@ -34,4 +34,3 @@ Module( | 1 | assert | ^ Syntax Error: Expected an expression - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_invalid_msg_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_invalid_msg_expr.py.snap index 2cc454ed48567b..b8edfb474b04f5 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_invalid_msg_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_invalid_msg_expr.py.snap @@ -175,4 +175,3 @@ Module( 3 | assert False, yield x 4 | assert False, x := 1 | ^^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_invalid_test_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_invalid_test_expr.py.snap index 87c0dcf6728918..23311b018ff27f 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_invalid_test_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assert_invalid_test_expr.py.snap @@ -160,4 +160,3 @@ Module( 3 | assert yield x 4 | assert x := 1 | ^^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_invalid_target.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_invalid_target.py.snap index 7516e2d842c92b..1b06e85b42d5b9 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_invalid_target.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_invalid_target.py.snap @@ -276,7 +276,6 @@ Module( 3 | x = 1 = y = 2 = z 4 | ["a", "b"] = ["a", "b"] | ^^^ Syntax Error: Invalid assignment target - | | @@ -284,4 +283,3 @@ Module( 3 | x = 1 = y = 2 = z 4 | ["a", "b"] = ["a", "b"] | ^^^ Syntax Error: Invalid assignment target - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_invalid_value_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_invalid_value_expr.py.snap index 6fe406354b0503..65b3b025729c7c 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_invalid_value_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_invalid_value_expr.py.snap @@ -342,4 +342,3 @@ Module( 4 | x = (*lambda x: x,) 5 | x = x := 1 | ^^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_starred_expr_value.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_starred_expr_value.py.snap index 45bda59ff0903a..186eb41f69fe43 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_starred_expr_value.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@assign_stmt_starred_expr_value.py.snap @@ -217,4 +217,3 @@ Module( 3 | _ = *list() 4 | _ = *(p + q) | ^^^^^^^^ Syntax Error: Starred expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@aug_assign_stmt_invalid_target.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@aug_assign_stmt_invalid_target.py.snap index dbe201539e5e23..4fd519628a094b 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@aug_assign_stmt_invalid_target.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@aug_assign_stmt_invalid_target.py.snap @@ -255,4 +255,3 @@ Module( 5 | x += pass 6 | (x + y) += 1 | ^^^^^ Syntax Error: Invalid augmented assignment target - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@aug_assign_stmt_invalid_value.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@aug_assign_stmt_invalid_value.py.snap index eeec973fc91724..02e8bdd44765f4 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@aug_assign_stmt_invalid_value.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@aug_assign_stmt_invalid_value.py.snap @@ -279,4 +279,3 @@ Module( 4 | x += *lambda x: x 5 | x += y := 1 | ^^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@backslash_continuation_indentation_error.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@backslash_continuation_indentation_error.py.snap index c8a556e09bee4c..d32ea7bf469d1e 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@backslash_continuation_indentation_error.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@backslash_continuation_indentation_error.py.snap @@ -68,4 +68,3 @@ Module( 3 | / \ 4 | | 2 | |____^ Syntax Error: Unexpected indentation - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@case_expect_indented_block.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@case_expect_indented_block.py.snap index 952ba305f785cd..5b757520e6503f 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@case_expect_indented_block.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@case_expect_indented_block.py.snap @@ -92,4 +92,3 @@ Module( 2 | case 1: 3 | case 2: ... | ^^^^ Syntax Error: Expected an indented block after `case` block - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_def_empty_body.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_def_empty_body.py.snap index b12cc050bf6f19..7a88362450c6c0 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_def_empty_body.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_def_empty_body.py.snap @@ -91,4 +91,3 @@ Module( 2 | class Foo(): 3 | x = 42 | ^ Syntax Error: Expected an indented block after `class` definition - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_def_missing_name.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_def_missing_name.py.snap index 218b289dc4a4b7..ffb66e8ee6a124 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_def_missing_name.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_def_missing_name.py.snap @@ -155,4 +155,3 @@ Module( 2 | class (): ... 3 | class (metaclass=ABC): ... | ^ Syntax Error: Expected an identifier - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_def_unparenthesized_generator_argument.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_def_unparenthesized_generator_argument.py.snap index 08770ff67ff6e0..6a5ebeb17cd603 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_def_unparenthesized_generator_argument.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_def_unparenthesized_generator_argument.py.snap @@ -94,4 +94,3 @@ Module( | 1 | class Foo(base for base in bases): ... | ^^^^^^^^^^^^^^^^^^^^^^ Syntax Error: Unparenthesized generator expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_type_params_py311.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_type_params_py311.py.snap index 69e2166048b198..b24904e9ac128f 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_type_params_py311.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@class_type_params_py311.py.snap @@ -176,7 +176,6 @@ Module( 2 | class Foo[S: (str, bytes), T: float, *Ts, **P]: ... 3 | class Foo[]: ... | ^ Syntax Error: Type parameter list cannot be empty - | ## Unsupported Syntax Errors @@ -194,4 +193,3 @@ Module( 2 | class Foo[S: (str, bytes), T: float, *Ts, **P]: ... 3 | class Foo[]: ... | ^^ Syntax Error: Cannot use type parameter lists on Python 3.11 (syntax was added in Python 3.12) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@clause_expect_indented_block.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@clause_expect_indented_block.py.snap index 32d4fbf051962e..e38fc337b08939 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@clause_expect_indented_block.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@clause_expect_indented_block.py.snap @@ -67,4 +67,3 @@ Module( 5 | # at the newline token after `:` 6 | if True: | ^ Syntax Error: Expected an indented block after `if` statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@clause_expect_single_statement.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@clause_expect_single_statement.py.snap index f43fda3f905451..fbcd78eef2c24b 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@clause_expect_single_statement.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@clause_expect_single_statement.py.snap @@ -56,4 +56,3 @@ Module( | 1 | if True: if True: pass | ^^ Syntax Error: Expected a simple statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@comma_separated_missing_comma.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@comma_separated_missing_comma.py.snap index 84c88e8d1f18e8..d5cb24b9ffb29e 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@comma_separated_missing_comma.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@comma_separated_missing_comma.py.snap @@ -69,10 +69,8 @@ Module( | 1 | call(**x := 1) | ^^ Syntax Error: Expected `,`, found `:=` - | | 1 | call(**x := 1) | ^ Syntax Error: Positional argument cannot follow keyword argument unpacking - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@comma_separated_missing_comma_between_elements.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@comma_separated_missing_comma_between_elements.py.snap index 4da8a91dea5153..69e493cafcbc27 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@comma_separated_missing_comma_between_elements.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@comma_separated_missing_comma_between_elements.py.snap @@ -62,4 +62,3 @@ Module( 1 | # The comma between the first two elements is expected in `parse_list_expression`. 2 | [0, 1 2] | ^ Syntax Error: Expected `,`, found int - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@comma_separated_missing_element_between_commas.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@comma_separated_missing_element_between_commas.py.snap index 07e9b5e2725b30..2c50e8d7c59f06 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@comma_separated_missing_element_between_commas.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@comma_separated_missing_element_between_commas.py.snap @@ -61,4 +61,3 @@ Module( | 1 | [0, 1, , 2] | ^ Syntax Error: Expected an expression or a ']' - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@comma_separated_missing_first_element.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@comma_separated_missing_first_element.py.snap index 5f233426139c27..48bd834ed4e684 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@comma_separated_missing_first_element.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@comma_separated_missing_first_element.py.snap @@ -55,4 +55,3 @@ Module( | 1 | call(= 1) | ^ Syntax Error: Expected an expression or a ')' - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@comprehension_missing_for_after_async.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@comprehension_missing_for_after_async.py.snap index a31a0559196b6c..dc0abcd271e83d 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@comprehension_missing_for_after_async.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@comprehension_missing_for_after_async.py.snap @@ -86,4 +86,3 @@ Module( 1 | (async) 2 | (x async x in iter) | ^ Syntax Error: Expected `for`, found name - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_class.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_class.py.snap index d3f8cd86fd51bf..b12ab21adc57df 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_class.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_class.py.snap @@ -103,4 +103,3 @@ Module( 1 | class __debug__: ... # class name 2 | class C[__debug__]: ... # type parameter name | ^^^^^^^^^ Syntax Error: cannot assign to `__debug__` - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_function.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_function.py.snap index 18d9869410f954..0b94a57f9d2200 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_function.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_function.py.snap @@ -245,4 +245,3 @@ Module( 3 | def f(__debug__): ... # parameter name 4 | lambda __debug__: 0 # lambda parameter name | ^^^^^^^^^ Syntax Error: cannot assign to `__debug__` - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_import.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_import.py.snap index c40da1652ab96d..870b0b879363aa 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_import.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_import.py.snap @@ -151,4 +151,3 @@ Module( 3 | from x import __debug__ 4 | from x import debug as __debug__ | ^^^^^^^^^ Syntax Error: cannot assign to `__debug__` - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_match.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_match.py.snap index 0fe9d38d820489..6d47e009d455e9 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_match.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_match.py.snap @@ -69,4 +69,3 @@ Module( 1 | match x: 2 | case __debug__: ... | ^^^^^^^^^ Syntax Error: cannot assign to `__debug__` - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_try.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_try.py.snap index 1514d68600a063..827e2c62acb927 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_try.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_try.py.snap @@ -82,4 +82,3 @@ Module( 1 | try: ... 2 | except Exception as __debug__: ... | ^^^^^^^^^ Syntax Error: cannot assign to `__debug__` - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_type_alias.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_type_alias.py.snap index 89647fd3a3d378..e0d4739946ad58 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_type_alias.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_type_alias.py.snap @@ -108,4 +108,3 @@ Module( 1 | type __debug__ = list[int] # visited as an Expr but still flagged 2 | type Debug[__debug__] = str | ^^^^^^^^^ Syntax Error: cannot assign to `__debug__` - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_with.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_with.py.snap index 12c000349972ea..c0e68ac262e1df 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_with.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@debug_shadow_with.py.snap @@ -98,4 +98,3 @@ Module( | 1 | with open("foo.txt") as __debug__: ... | ^^^^^^^^^ Syntax Error: cannot assign to `__debug__` - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_missing_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_missing_expression.py.snap index 43ca84eb0610f2..dca904baa9149c 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_missing_expression.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_missing_expression.py.snap @@ -277,4 +277,3 @@ Module( 7 | @ 8 | class Test | ^ Syntax Error: Expected `:`, found newline - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_missing_newline.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_missing_newline.py.snap index ea573c4cde9082..30cf842b3c50fb 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_missing_newline.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_missing_newline.py.snap @@ -180,4 +180,3 @@ Module( 2 | @x async def foo(): ... 3 | @x class Foo: ... | ^^^^^ Syntax Error: Expected newline, found `class` - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_unexpected_token.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_unexpected_token.py.snap index df57c3024ac0ad..be98f7c3ada669 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_unexpected_token.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@decorator_unexpected_token.py.snap @@ -167,4 +167,3 @@ Module( 3 | @foo 4 | x = 1 | ^ Syntax Error: Expected class, function definition or async function definition after decorator - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@del_debug_py39.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@del_debug_py39.py.snap index 83f2d822875458..dbb86fe82298f1 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@del_debug_py39.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@del_debug_py39.py.snap @@ -36,4 +36,3 @@ Module( 1 | # parse_options: {"target-version": "3.9"} 2 | del __debug__ | ^^^^^^^^^ Syntax Error: cannot delete `__debug__` on Python 3.9 (syntax was removed in 3.9) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@del_incomplete_target.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@del_incomplete_target.py.snap index 1ea6b54337ef93..e8a391037c30bd 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@del_incomplete_target.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@del_incomplete_target.py.snap @@ -137,4 +137,3 @@ Module( 3 | del x, y[ 4 | z | ^ Syntax Error: unexpected EOF while parsing - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@del_stmt_empty.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@del_stmt_empty.py.snap index a769520c8a3949..28619bfea25884 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@del_stmt_empty.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@del_stmt_empty.py.snap @@ -26,4 +26,3 @@ Module( | 1 | del | ^ Syntax Error: Delete statement must have at least one target - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@different_match_pattern_bindings.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@different_match_pattern_bindings.py.snap index 588dbe3cd8c555..9f689a303d11ff 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@different_match_pattern_bindings.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@different_match_pattern_bindings.py.snap @@ -1230,4 +1230,3 @@ Module( 12 | case [C(D(a))] | [C(D(b))]: ... 13 | case [(a, b)] | [(c, d)]: ... | ^^^^^^^^^^^^^^^^^^^ Syntax Error: alternative patterns bind different names - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@dotted_name_multiple_dots.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@dotted_name_multiple_dots.py.snap index dd982db9073a65..ebad60ec0ace0e 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@dotted_name_multiple_dots.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@dotted_name_multiple_dots.py.snap @@ -91,11 +91,9 @@ Module( 1 | import a..b 2 | import a...b | ^^^ Syntax Error: Simple statements must be separated by newlines or semicolons - | | 1 | import a..b 2 | import a...b | ^ Syntax Error: Simple statements must be separated by newlines or semicolons - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@duplicate_match_class_attr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@duplicate_match_class_attr.py.snap index 83e2d732da886e..94f9ad317cc205 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@duplicate_match_class_attr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@duplicate_match_class_attr.py.snap @@ -820,7 +820,6 @@ Module( 5 | case [{}, {"x": x, "y": Foo(x=1, x=2)}]: ... 6 | case Class(x=1, d={"x": 1, "x": 2}, other=Class(x=1, x=2)): ... | ^^^ Syntax Error: mapping pattern checks duplicate key `"x"` - | | @@ -828,4 +827,3 @@ Module( 5 | case [{}, {"x": x, "y": Foo(x=1, x=2)}]: ... 6 | case Class(x=1, d={"x": 1, "x": 2}, other=Class(x=1, x=2)): ... | ^ Syntax Error: attribute name `x` repeated in class pattern - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@duplicate_type_parameter_names.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@duplicate_type_parameter_names.py.snap index 6630565e33e177..ffbe7baa874fc4 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@duplicate_type_parameter_names.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@duplicate_type_parameter_names.py.snap @@ -671,4 +671,3 @@ Module( 6 | def f[T, *T](): ... # star is still duplicate 7 | def f[T, **T](): ... # as is double star | ^^^ Syntax Error: duplicate type parameter - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@except_star_py310.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@except_star_py310.py.snap index 668f37596bfac5..56a1931678e7db 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@except_star_py310.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@except_star_py310.py.snap @@ -158,4 +158,3 @@ Module( 4 | except* KeyError: ... 5 | except * Error: ... | ^ Syntax Error: Cannot use `except*` on Python 3.10 (syntax was added in Python 3.11) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__double_starred.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__double_starred.py.snap index 8656ee03e8e167..58d3cd2c1c9d42 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__double_starred.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__double_starred.py.snap @@ -239,7 +239,6 @@ Module( 4 | 5 | call(**x := 1) | ^^ Syntax Error: Expected `,`, found `:=` - | | @@ -247,4 +246,3 @@ Module( 4 | 5 | call(**x := 1) | ^ Syntax Error: Positional argument cannot follow keyword argument unpacking - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__duplicate_keyword_arguments.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__duplicate_keyword_arguments.py.snap index 9f5a0cfa416758..61195ea44ce061 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__duplicate_keyword_arguments.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__duplicate_keyword_arguments.py.snap @@ -146,10 +146,8 @@ Module( | 1 | foo(a=1, b=2, c=3, b=4, a=5) | ^^^ Syntax Error: Duplicate keyword argument "b" - | | 1 | foo(a=1, b=2, c=3, b=4, a=5) | ^^^ Syntax Error: Duplicate keyword argument "a" - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__invalid_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__invalid_expression.py.snap index 1e7f4b61921f8e..b444c4d79d7918 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__invalid_expression.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__invalid_expression.py.snap @@ -223,4 +223,3 @@ Module( 4 | call(yield x) 5 | call(yield from x) | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__invalid_keyword_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__invalid_keyword_expression.py.snap index 00502dd67916e3..551521976d0d85 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__invalid_keyword_expression.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__invalid_keyword_expression.py.snap @@ -259,4 +259,3 @@ Module( 3 | call(x = *y) 4 | call(x = (*y)) | ^^ Syntax Error: Starred expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__invalid_order.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__invalid_order.py.snap index 90c44de37ccd42..9ccc48a63065ec 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__invalid_order.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__invalid_order.py.snap @@ -343,4 +343,3 @@ Module( 4 | call(**kwargs, *args) 5 | call(**kwargs, (*args)) | ^^^^^ Syntax Error: Starred expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__missing_argument.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__missing_argument.py.snap index 42fd265361af0e..9525b67f768d18 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__missing_argument.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__missing_argument.py.snap @@ -62,4 +62,3 @@ Module( | 1 | call(x,,y) | ^ Syntax Error: Expected an expression or a ')' - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__missing_comma.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__missing_comma.py.snap index 0f781f1e531c00..33b40228411b7f 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__missing_comma.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__missing_comma.py.snap @@ -62,4 +62,3 @@ Module( | 1 | call(x y) | ^ Syntax Error: Expected `,`, found name - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__starred.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__starred.py.snap index 7703db14a26ffa..f74d95974caf90 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__starred.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__arguments__starred.py.snap @@ -200,7 +200,6 @@ Module( 2 | call(*yield x) 3 | call(*yield from x) | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here - | ## Unsupported Syntax Errors diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__attribute__invalid_member.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__attribute__invalid_member.py.snap index 67ca493c7d65f3..40b4cb4fe17761 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__attribute__invalid_member.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__attribute__invalid_member.py.snap @@ -160,4 +160,3 @@ Module( 2 | x.1.0 3 | x.[0] | ^ Syntax Error: Expected an identifier - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__attribute__multiple_dots.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__attribute__multiple_dots.py.snap index cbbf28892ac5f9..ee5946cf597b18 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__attribute__multiple_dots.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__attribute__multiple_dots.py.snap @@ -163,7 +163,6 @@ Module( 2 | multiple....dots 3 | multiple.....dots | ^^^ Syntax Error: Simple statements must be separated by newlines or semicolons - | | @@ -171,4 +170,3 @@ Module( 2 | multiple....dots 3 | multiple.....dots | ^ Syntax Error: Expected an identifier - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__attribute__no_member.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__attribute__no_member.py.snap index 04634b6766d0ca..f23c09e43450bb 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__attribute__no_member.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__attribute__no_member.py.snap @@ -96,4 +96,3 @@ Module( 5 | # No member access after the dot. 6 | last. | ^ Syntax Error: Expected an identifier - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__await__recover.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__await__recover.py.snap index 3eb34793946a5e..e3f5cb4807966b 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__await__recover.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__await__recover.py.snap @@ -365,4 +365,3 @@ Module( 16 | await ~x 17 | await not x | ^^^^^ Syntax Error: Boolean 'not' expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__invalid_rhs_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__invalid_rhs_expression.py.snap index 41d99048051189..2d828a4ea59176 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__invalid_rhs_expression.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__invalid_rhs_expression.py.snap @@ -128,4 +128,3 @@ Module( 2 | 3 | x - yield y | ^^^^^^^ Syntax Error: Yield expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__named_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__named_expression.py.snap index 8293f4b759d267..47e26dcc60e23c 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__named_expression.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__named_expression.py.snap @@ -134,4 +134,3 @@ Module( 1 | x - y := (1, 2) 2 | x / y := 2 | ^^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__starred_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__starred_expression.py.snap index 5080466f7f07e8..2e97b80a96d49c 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__starred_expression.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bin_op__starred_expression.py.snap @@ -99,4 +99,3 @@ Module( 1 | x + *y 2 | x ** *y | ^^ Syntax Error: Starred expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__invalid_rhs_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__invalid_rhs_expression.py.snap index 8f10231161e6e1..151ded376121c2 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__invalid_rhs_expression.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__invalid_rhs_expression.py.snap @@ -132,4 +132,3 @@ Module( 2 | 3 | x or yield y | ^^^^^^^ Syntax Error: Yield expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__missing_lhs.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__missing_lhs.py.snap index 7becb2d219913b..1a9fd282135fc4 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__missing_lhs.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__missing_lhs.py.snap @@ -33,4 +33,3 @@ Module( | 1 | and y | ^^^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__named_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__named_expression.py.snap index c599119ee6c2fe..4b0e330e7f1eb3 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__named_expression.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__named_expression.py.snap @@ -117,4 +117,3 @@ Module( 1 | x and a := b 2 | x or a := b | ^^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__starred_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__starred_expression.py.snap index a63aa3e1776d1b..c9ef42bbbdcf1e 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__starred_expression.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__bool_op__starred_expression.py.snap @@ -103,4 +103,3 @@ Module( 1 | x and *y 2 | x or *y | ^^ Syntax Error: Starred expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__invalid_order.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__invalid_order.py.snap index ccc649ea7c5751..ff77fb79c97aa9 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__invalid_order.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__invalid_order.py.snap @@ -169,18 +169,15 @@ Module( 6 | # Same here as well, `not` without `in` is considered to be a unary operator 7 | x not is y | ^^^ Syntax Error: Simple statements must be separated by newlines or semicolons - | | 6 | # Same here as well, `not` without `in` is considered to be a unary operator 7 | x not is y | ^^ Syntax Error: Expected an identifier, but found a keyword `is` that cannot be used here - | | 6 | # Same here as well, `not` without `in` is considered to be a unary operator 7 | x not is y | ^ Syntax Error: Simple statements must be separated by newlines or semicolons - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__invalid_rhs_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__invalid_rhs_expression.py.snap index 22a228bba8f382..49de0166982da1 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__invalid_rhs_expression.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__invalid_rhs_expression.py.snap @@ -136,4 +136,3 @@ Module( 2 | 3 | x == yield y | ^^^^^^^ Syntax Error: Yield expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__multiple_equals.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__multiple_equals.py.snap index 38297d62dac51a..170fba27dcc85d 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__multiple_equals.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__multiple_equals.py.snap @@ -123,7 +123,6 @@ Module( 2 | x === y 3 | x !== y | ^ Syntax Error: Expected an expression - | | @@ -131,4 +130,3 @@ Module( 2 | x === y 3 | x !== y | ^^^^ Syntax Error: Invalid assignment target - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__named_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__named_expression.py.snap index 3bdec1455cbb12..bbdd1585540214 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__named_expression.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__named_expression.py.snap @@ -142,4 +142,3 @@ Module( 1 | x not in y := (1, 2) 2 | x > y := 2 | ^^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__starred_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__starred_expression.py.snap index 0de6ae37e09042..4b546bf98cbfcc 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__starred_expression.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__compare__starred_expression.py.snap @@ -205,4 +205,3 @@ Module( 4 | *x < y 5 | *x is not y | ^^^^^^^^^^ Syntax Error: Comparison expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__comprehension.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__comprehension.py.snap index a0f372cea4987c..2bec92c3f3bf16 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__comprehension.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__comprehension.py.snap @@ -959,4 +959,3 @@ Module( 16 | {x: y for x in data if yield from y} 17 | {x: y for x in data if lambda y: y} | ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__double_star.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__double_star.py.snap index 64fb0233e45b79..0be18e9338e618 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__double_star.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__double_star.py.snap @@ -633,4 +633,3 @@ Module( 11 | {**x not in y} 12 | {**x < y} | ^^^^^ Syntax Error: Comparison expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__missing_closing_brace_0.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__missing_closing_brace_0.py.snap index 31bd7feb9f80b4..a72d48175c0ec1 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__missing_closing_brace_0.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__missing_closing_brace_0.py.snap @@ -104,11 +104,9 @@ Module( 3 | def foo(): 4 | pass | ^^^^ Syntax Error: Expected an identifier, but found a keyword `pass` that cannot be used here - | | 3 | def foo(): 4 | pass | ^ Syntax Error: unexpected EOF while parsing - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__missing_closing_brace_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__missing_closing_brace_1.py.snap index c53bcf8e92c698..3fda1e1433bc8e 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__missing_closing_brace_1.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__missing_closing_brace_1.py.snap @@ -72,4 +72,3 @@ Module( 2 | 3 | 1 + 2 | ^ Syntax Error: unexpected EOF while parsing - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__recover.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__recover.py.snap index b1ad5d82550291..c26c1b247d592a 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__recover.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__dict__recover.py.snap @@ -558,7 +558,6 @@ Module( 23 | {*x: y, z: a, *b: c} 24 | {x: *y, z: *a} | ^^ Syntax Error: Starred expression cannot be used here - | | @@ -566,4 +565,3 @@ Module( 23 | {*x: y, z: a, *b: c} 24 | {x: *y, z: *a} | ^^ Syntax Error: Starred expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__emoji_identifiers.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__emoji_identifiers.py.snap index ba444eb9597ab7..52729b5c7a0bf6 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__emoji_identifiers.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__emoji_identifiers.py.snap @@ -129,7 +129,6 @@ Module( 6 | # comment 7 | 🐶) | ^^ Syntax Error: Got unexpected token 🐶 - | | @@ -137,7 +136,6 @@ Module( 6 | # comment 7 | 🐶) | ^ Syntax Error: Expected a statement - | | @@ -145,4 +143,3 @@ Module( 6 | # comment 7 | 🐶) | ^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__emoji_statement.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__emoji_statement.py.snap index 20d9f0812e8b44..6b0e5ccbb99c51 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__emoji_statement.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__emoji_statement.py.snap @@ -18,4 +18,3 @@ Module( | 1 | 👍 | ^^ Syntax Error: Got unexpected token 👍 - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__if__recover.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__if__recover.py.snap index 38a8d3c530737a..8e25a9ff448b4a 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__if__recover.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__if__recover.py.snap @@ -404,4 +404,3 @@ Module( 9 | x if expr else yield y 10 | x if expr else yield from y | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__lambda_default_parameters.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__lambda_default_parameters.py.snap index 7d2bfdb631b072..73de71b4d091ee 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__lambda_default_parameters.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__lambda_default_parameters.py.snap @@ -107,4 +107,3 @@ Module( | 1 | lambda a, b=20, c: 1 | ^ Syntax Error: Parameter without a default cannot follow a parameter with a default - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__lambda_duplicate_parameters.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__lambda_duplicate_parameters.py.snap index 39ddc3c4c5cbf8..b81032db425c6b 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__lambda_duplicate_parameters.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__lambda_duplicate_parameters.py.snap @@ -339,7 +339,6 @@ Module( 8 | 9 | lambda a, *, **a: 1 | ^^^ Syntax Error: Expected one or more keyword parameter after `*` separator - | ## Semantic Syntax Errors @@ -387,4 +386,3 @@ Module( 8 | 9 | lambda a, *, **a: 1 | ^ Syntax Error: Duplicate parameter "a" - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__comprehension.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__comprehension.py.snap index 10e74383621b76..63a9049b312fda 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__comprehension.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__comprehension.py.snap @@ -1291,7 +1291,6 @@ Module( 21 | [*x if x else y for x in z] 22 | [x if x else *y for x in z] | ^^ Syntax Error: Starred expression cannot be used here - | ## Unsupported Syntax Errors diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_0.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_0.py.snap index 27415fde735360..1129c6f661cbff 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_0.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_0.py.snap @@ -44,4 +44,3 @@ Module( 2 | 3 | [ | ^ Syntax Error: unexpected EOF while parsing - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_1.py.snap index d53b5a82915e34..8ac3aa77ce3e34 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_1.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_1.py.snap @@ -59,4 +59,3 @@ Module( 5 | 6 | x + y | ^ Syntax Error: unexpected EOF while parsing - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_2.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_2.py.snap index 3bfaaa689ef92c..347768333c58ef 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_2.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__missing_closing_bracket_2.py.snap @@ -68,4 +68,3 @@ Module( 5 | 6 | x + y | ^ Syntax Error: unexpected EOF while parsing - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__recover.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__recover.py.snap index 3fa2a32578be65..818809026883f5 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__recover.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__recover.py.snap @@ -344,4 +344,3 @@ Module( 19 | 20 | [*] | ^ Syntax Error: Expected an expression - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__star_expression_precedence.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__star_expression_precedence.py.snap index 064ab37b927619..13ec68acb821f2 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__star_expression_precedence.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__list__star_expression_precedence.py.snap @@ -522,4 +522,3 @@ Module( 9 | [*lambda x: x, z] 10 | [*x := 2, z] | ^^ Syntax Error: Assignment expression target must be an identifier - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__invalid_target.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__invalid_target.py.snap index 80c4345b88149c..a7ba61211f8afb 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__invalid_target.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__invalid_target.py.snap @@ -234,4 +234,3 @@ Module( 5 | (*x := 1) 6 | ([x, y] := [1, 2]) | ^^^^^^ Syntax Error: Assignment expression target must be an identifier - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_0.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_0.py.snap index d434114a508d90..80360bc64321d2 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_0.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_0.py.snap @@ -35,7 +35,6 @@ Module( 2 | 3 | x := | ^^ Syntax Error: Expected a statement - | | @@ -43,4 +42,3 @@ Module( 2 | 3 | x := | ^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_1.py.snap index d37bcfe97a45ea..6adc7cf73868bb 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_1.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_1.py.snap @@ -49,4 +49,3 @@ Module( 2 | 3 | (x := | ^ Syntax Error: unexpected EOF while parsing - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_2.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_2.py.snap index 057477b76152b1..c5d280ce7a0d67 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_2.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_2.py.snap @@ -102,11 +102,9 @@ Module( 5 | def foo(): 6 | pass | ^^^^ Syntax Error: Expected an identifier, but found a keyword `pass` that cannot be used here - | | 5 | def foo(): 6 | pass | ^ Syntax Error: unexpected EOF while parsing - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_3.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_3.py.snap index 181c17c668dfde..56494fe2b3913c 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_3.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__named__missing_expression_3.py.snap @@ -64,4 +64,3 @@ Module( 5 | 6 | x + y | ^ Syntax Error: unexpected EOF while parsing - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__generator.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__generator.py.snap index 2c06c02bf47582..10b1f719faeb9a 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__generator.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__generator.py.snap @@ -83,16 +83,13 @@ Module( | 1 | (x := 1, for x in y) | ^^^ Syntax Error: Expected `)`, found `for` - | | 1 | (x := 1, for x in y) | ^ Syntax Error: Expected `:`, found `)` - | | 1 | (x := 1, for x in y) | ^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_0.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_0.py.snap index ed9f13abc614da..be74ea3c8ab90e 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_0.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_0.py.snap @@ -35,4 +35,3 @@ Module( 2 | 3 | ( | ^ Syntax Error: unexpected EOF while parsing - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_1.py.snap index 80fe213fc24f61..53ae176db37118 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_1.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_1.py.snap @@ -50,4 +50,3 @@ Module( 5 | 6 | x + y | ^ Syntax Error: unexpected EOF while parsing - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_2.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_2.py.snap index fa0cdaade8253a..05c0bb17752e73 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_2.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__missing_closing_paren_2.py.snap @@ -69,4 +69,3 @@ Module( 5 | 6 | x + y | ^ Syntax Error: unexpected EOF while parsing - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__parenthesized.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__parenthesized.py.snap index 2dc3440241eb7f..9f0372217cb2ac 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__parenthesized.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__parenthesized.py.snap @@ -79,4 +79,3 @@ Module( 4 | # Unparenthesized named expression is allowed. 5 | x := 1 | ^^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__tuple.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__tuple.py.snap index 7670ed0edd3eae..9aa45988b6c183 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__tuple.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__tuple.py.snap @@ -421,4 +421,3 @@ Module( 20 | # Unparenthesized named expression is not allowed 21 | x, y := 2, z | ^^ Syntax Error: Expected `,`, found `:=` - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__tuple_starred_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__tuple_starred_expr.py.snap index 05cd9dbaca3410..fc2ce04a1ca3be 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__tuple_starred_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__parenthesized__tuple_starred_expr.py.snap @@ -1403,7 +1403,6 @@ Module( 9 | (*lambda x: x, z, *lambda x: x) 10 | (*x := 2, z, *x := 2) | ^^ Syntax Error: Assignment expression target must be an identifier - | | @@ -1411,7 +1410,6 @@ Module( 9 | (*lambda x: x, z, *lambda x: x) 10 | (*x := 2, z, *x := 2) | ^^ Syntax Error: Assignment expression target must be an identifier - | | @@ -1535,7 +1533,6 @@ Module( 19 | *lambda x: x, z, *lambda x: x 20 | *x := 2, z, *x := 2 | ^^ Syntax Error: Expected a statement - | | @@ -1543,4 +1540,3 @@ Module( 19 | *lambda x: x, z, *lambda x: x 20 | *x := 2, z, *x := 2 | ^^ Syntax Error: Expected `,`, found `:=` - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__comprehension.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__comprehension.py.snap index 22132cd30124a1..fe53312824c591 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__comprehension.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__comprehension.py.snap @@ -839,4 +839,3 @@ Module( 16 | {x for x in data if yield from y} 17 | {x for x in data if lambda y: y} | ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_0.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_0.py.snap index 759f2c99c0dcfd..b520e3eea91dd9 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_0.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_0.py.snap @@ -43,4 +43,3 @@ Module( 2 | 3 | { | ^ Syntax Error: unexpected EOF while parsing - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_1.py.snap index 01bfdf46921129..b746257d0b8017 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_1.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_1.py.snap @@ -58,4 +58,3 @@ Module( 5 | 6 | x + y | ^ Syntax Error: unexpected EOF while parsing - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_2.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_2.py.snap index ead70d568e9978..ef03e861b0ad6d 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_2.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__missing_closing_curly_brace_2.py.snap @@ -67,4 +67,3 @@ Module( 5 | 6 | x + y | ^ Syntax Error: unexpected EOF while parsing - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__recover.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__recover.py.snap index 74e95fe8c79a72..8954c554faa965 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__recover.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__recover.py.snap @@ -332,4 +332,3 @@ Module( 21 | 22 | [*] | ^ Syntax Error: Expected an expression - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__star_expression_precedence.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__star_expression_precedence.py.snap index d3c23a0ec39094..20d61b1a4c6b22 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__star_expression_precedence.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__set__star_expression_precedence.py.snap @@ -514,4 +514,3 @@ Module( 9 | {*lambda x: x, z} 10 | {*x := 2, z} | ^^ Syntax Error: Assignment expression target must be an identifier - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__subscript__invalid_slice_element.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__subscript__invalid_slice_element.py.snap index 2e4321abd9be7f..91295b506fd1b2 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__subscript__invalid_slice_element.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__subscript__invalid_slice_element.py.snap @@ -337,4 +337,3 @@ Module( 11 | # Mixed starred expression and named expression 12 | x[*x := 1] | ^^ Syntax Error: Assignment expression target must be an identifier - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__subscript__unclosed_slice_0.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__subscript__unclosed_slice_0.py.snap index b8b02d2973f326..bb210f7665b36a 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__subscript__unclosed_slice_0.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__subscript__unclosed_slice_0.py.snap @@ -75,4 +75,3 @@ Module( 2 | 3 | x + y | ^ Syntax Error: unexpected EOF while parsing - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__subscript__unclosed_slice_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__subscript__unclosed_slice_1.py.snap index 05de28c27535df..13d17537ca1db7 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__subscript__unclosed_slice_1.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__subscript__unclosed_slice_1.py.snap @@ -113,11 +113,9 @@ Module( 3 | def foo(): 4 | pass | ^^^^ Syntax Error: Expected an identifier, but found a keyword `pass` that cannot be used here - | | 3 | def foo(): 4 | pass | ^ Syntax Error: unexpected EOF while parsing - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__unary.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__unary.py.snap index b8f917a7ddba4d..3510eb8a3cabca 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__unary.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__unary.py.snap @@ -55,4 +55,3 @@ Module( | 1 | not x := 1 | ^^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__unary__named_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__unary__named_expression.py.snap index 45a740ba23683c..a410a5cb73abdd 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__unary__named_expression.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__unary__named_expression.py.snap @@ -99,4 +99,3 @@ Module( 1 | -x := 1 2 | not x := 1 | ^^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield__named_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield__named_expression.py.snap index 49a4e5362b2015..c637ec5f6bdb62 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield__named_expression.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield__named_expression.py.snap @@ -126,4 +126,3 @@ Module( 3 | 4 | yield 1, x := 2, 3 | ^^ Syntax Error: Expected `,`, found `:=` - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield__star_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield__star_expression.py.snap index 4238df7e8c799e..88317ef0ada798 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield__star_expression.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield__star_expression.py.snap @@ -123,7 +123,6 @@ Module( 3 | 4 | yield *x and y, z | ^^^^^^^ Syntax Error: Boolean expression cannot be used here - | ## Semantic Syntax Errors diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield_from__starred_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield_from__starred_expression.py.snap index 719d563ed29afb..b8f1723b79245d 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield_from__starred_expression.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield_from__starred_expression.py.snap @@ -101,4 +101,3 @@ Module( 3 | yield from *x 4 | yield from *x, y | ^^ Syntax Error: Starred expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield_from__unparenthesized.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield_from__unparenthesized.py.snap index d521191aa7c85c..4ce09310632541 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield_from__unparenthesized.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@expressions__yield_from__unparenthesized.py.snap @@ -174,4 +174,3 @@ Module( 8 | # vvvvvvvvvvvvv 9 | yield from (x, *x and y) | ^^^^^^^ Syntax Error: Boolean expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_conversion_follows_exclamation.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_conversion_follows_exclamation.py.snap index 63c3670334a41e..aef6b79cbf26ac 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_conversion_follows_exclamation.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_conversion_follows_exclamation.py.snap @@ -176,7 +176,6 @@ Module( 2 | t"{x! s}" 3 | f"{x! z}" | ^ Syntax Error: f-string: conversion type must come right after the exclamation mark - | | @@ -184,4 +183,3 @@ Module( 2 | t"{x! s}" 3 | f"{x! z}" | ^ Syntax Error: f-string: invalid conversion character - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_empty_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_empty_expression.py.snap index f18251146bb830..68b565cf3beb5a 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_empty_expression.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_empty_expression.py.snap @@ -121,4 +121,3 @@ Module( 1 | f"{}" 2 | f"{ }" | ^ Syntax Error: Expected an expression - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_invalid_conversion_flag_name_tok.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_invalid_conversion_flag_name_tok.py.snap index a5603a2dd3544b..2086898197bbb2 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_invalid_conversion_flag_name_tok.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_invalid_conversion_flag_name_tok.py.snap @@ -66,4 +66,3 @@ Module( | 1 | f"{x!z}" | ^ Syntax Error: f-string: invalid conversion character - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_invalid_conversion_flag_other_tok.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_invalid_conversion_flag_other_tok.py.snap index f69dee9e5c3c7f..a2ad5f30d0902f 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_invalid_conversion_flag_other_tok.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_invalid_conversion_flag_other_tok.py.snap @@ -121,4 +121,3 @@ Module( 1 | f"{x!123}" 2 | f"{x!'a'}" | ^^^ Syntax Error: f-string: invalid conversion character - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_invalid_starred_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_invalid_starred_expr.py.snap index 20091bbe0206b4..56eacd2d9098d7 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_invalid_starred_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_invalid_starred_expr.py.snap @@ -226,4 +226,3 @@ Module( 3 | f"{*x and y}" 4 | f"{*yield x}" | ^^^^^^^ Syntax Error: Yield expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_lambda_without_parentheses.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_lambda_without_parentheses.py.snap index 2f5d76744821a7..97f372aa569389 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_lambda_without_parentheses.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_lambda_without_parentheses.py.snap @@ -106,22 +106,18 @@ Module( | 1 | f"{lambda x: x}" | ^^ Syntax Error: Expected an expression - | | 1 | f"{lambda x: x}" | ^^^^^^^^^ Syntax Error: f-string: lambda expressions are not allowed without parentheses - | | 1 | f"{lambda x: x}" | ^^ Syntax Error: f-string: expecting `}` - | | 1 | f"{lambda x: x}" | ^ Syntax Error: Expected an element of or the end of the f-string - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_unclosed_lbrace.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_unclosed_lbrace.py.snap index 3fa3b4613073d4..acff57934788eb 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_unclosed_lbrace.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_unclosed_lbrace.py.snap @@ -297,4 +297,3 @@ Module( 4 | f"{" 5 | f"""{""" | ^^^ Syntax Error: Expected an expression - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_unclosed_lbrace_in_format_spec.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_unclosed_lbrace_in_format_spec.py.snap index ac1d7c98f41ce0..1ac023ab765116 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_unclosed_lbrace_in_format_spec.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@f_string_unclosed_lbrace_in_format_spec.py.snap @@ -155,4 +155,3 @@ Module( 1 | f"hello {x:" 2 | f"hello {x:.3f" | ^ Syntax Error: f-string: expecting `}` - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_iter_unpack_py38.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_iter_unpack_py38.py.snap index 36e244899b1d4c..01aa0c3e56e3fa 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_iter_unpack_py38.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_iter_unpack_py38.py.snap @@ -235,7 +235,6 @@ Module( 3 | for x in a, *b: ... 4 | for x in *a, *b: ... | ^^ Syntax Error: Cannot use iterable unpacking in `for` statements on Python 3.8 (syntax was added in Python 3.9) - | | @@ -243,4 +242,3 @@ Module( 3 | for x in a, *b: ... 4 | for x in *a, *b: ... | ^^ Syntax Error: Cannot use iterable unpacking in `for` statements on Python 3.8 (syntax was added in Python 3.9) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_invalid_iter_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_invalid_iter_expr.py.snap index ab00df4afe98bf..3479a2f1cdfa87 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_invalid_iter_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_invalid_iter_expr.py.snap @@ -193,7 +193,6 @@ Module( 2 | for x in yield a: ... 3 | for target in x := 1: ... | ^^ Syntax Error: Expected `:`, found `:=` - | | @@ -201,7 +200,6 @@ Module( 2 | for x in yield a: ... 3 | for target in x := 1: ... | ^ Syntax Error: Invalid annotated assignment target - | ## Semantic Syntax Errors diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_invalid_target.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_invalid_target.py.snap index 88050de12eb565..c8f400ccc869fc 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_invalid_target.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_invalid_target.py.snap @@ -508,7 +508,6 @@ Module( 6 | for yield x in y: ... 7 | for [x, 1, y, *["a"]] in z: ... | ^ Syntax Error: Invalid assignment target - | | @@ -516,7 +515,6 @@ Module( 6 | for yield x in y: ... 7 | for [x, 1, y, *["a"]] in z: ... | ^^^ Syntax Error: Invalid assignment target - | ## Semantic Syntax Errors diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_invalid_target_binary_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_invalid_target_binary_expr.py.snap index 72cac3d1564099..dee71c15aa6338 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_invalid_target_binary_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_invalid_target_binary_expr.py.snap @@ -379,4 +379,3 @@ Module( 5 | for not x in y: ... 6 | for x | y in z: ... | ^^^^^ Syntax Error: Invalid assignment target - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_invalid_target_in_keyword.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_invalid_target_in_keyword.py.snap index d219ca921c9e64..76ecd5aca005be 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_invalid_target_in_keyword.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_invalid_target_in_keyword.py.snap @@ -493,4 +493,3 @@ Module( 5 | for [x in y, z] in iter: ... 6 | for {x in y, z} in iter: ... | ^^^^^^^^^^^ Syntax Error: Invalid assignment target - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_missing_in_keyword.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_missing_in_keyword.py.snap index a2bf0f699daa08..256fc1f8bd2d43 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_missing_in_keyword.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_missing_in_keyword.py.snap @@ -103,4 +103,3 @@ Module( 1 | for a b: ... 2 | for a: ... | ^ Syntax Error: Expected `in`, found `:` - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_missing_target.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_missing_target.py.snap index 6484c523fd7582..184d01f31ca381 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_missing_target.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@for_stmt_missing_target.py.snap @@ -57,4 +57,3 @@ Module( | 1 | for in x: ... | ^^ Syntax Error: Expected an identifier - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_dotted_names.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_dotted_names.py.snap index cae496aa760b2c..e64b251ac4127d 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_dotted_names.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_dotted_names.py.snap @@ -188,7 +188,6 @@ Module( 2 | from x import a.b 3 | from x import a, b.c, d, e.f, g | ^ Syntax Error: Expected `,`, found `.` - | | @@ -196,4 +195,3 @@ Module( 2 | from x import a.b 3 | from x import a, b.c, d, e.f, g | ^ Syntax Error: Expected `,`, found `.` - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_empty_names.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_empty_names.py.snap index c4479ebffddec0..39401788860ca5 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_empty_names.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_empty_names.py.snap @@ -85,7 +85,6 @@ Module( 2 | from x import () 3 | from x import ,, | ^ Syntax Error: Expected an import name - | | @@ -93,7 +92,6 @@ Module( 2 | from x import () 3 | from x import ,, | ^ Syntax Error: Expected an import name - | | @@ -101,4 +99,3 @@ Module( 2 | from x import () 3 | from x import ,, | ^ Syntax Error: Expected one or more symbol names after import - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_missing_module.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_missing_module.py.snap index c5a59ee6c7a77d..6dcd1dcea06644 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_missing_module.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_missing_module.py.snap @@ -58,4 +58,3 @@ Module( 1 | from 2 | from import x | ^^^^^^ Syntax Error: Expected a module name - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_parenthesized_star.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_parenthesized_star.py.snap index c58ee28937c30c..4b7d807a7f9371 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_parenthesized_star.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_parenthesized_star.py.snap @@ -46,4 +46,3 @@ Module( | 1 | from x import (*) | ^^ Syntax Error: Star import cannot be parenthesized - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_star_with_other_names.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_star_with_other_names.py.snap index fc9bb538a66c74..57dc8ea3c4fc0d 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_star_with_other_names.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_star_with_other_names.py.snap @@ -221,4 +221,3 @@ Module( 3 | from x import *, a as b 4 | from x import *, *, a | ^^^^^^^ Syntax Error: Star import must be the only import - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_unparenthesized_trailing_comma.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_unparenthesized_trailing_comma.py.snap index 01701ed4517432..996f94b7d1fb23 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_unparenthesized_trailing_comma.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@from_import_unparenthesized_trailing_comma.py.snap @@ -134,4 +134,3 @@ Module( 2 | from a import b as c, 3 | from a import b, c, | ^ Syntax Error: Trailing comma not allowed - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_empty_body.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_empty_body.py.snap index 8774db9904042b..151d9f4b392022 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_empty_body.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_empty_body.py.snap @@ -113,4 +113,3 @@ Module( 2 | def foo() -> int: 3 | x = 42 | ^ Syntax Error: Expected an indented block after function definition - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_invalid_return_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_invalid_return_expr.py.snap index a3bef4f4b931a2..a807f4cf4fec4a 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_invalid_return_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_invalid_return_expr.py.snap @@ -200,7 +200,6 @@ Module( 2 | def foo() -> (*int): ... 3 | def foo() -> yield x: ... | ^^^^^^^ Syntax Error: Yield expression cannot be used here - | ## Semantic Syntax Errors @@ -210,4 +209,3 @@ Module( 2 | def foo() -> (*int): ... 3 | def foo() -> yield x: ... | ^^^^^^^ Syntax Error: yield expression cannot be used within a type annotation - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_missing_identifier.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_missing_identifier.py.snap index 1ee0f8c743ce48..51228a1638111a 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_missing_identifier.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_missing_identifier.py.snap @@ -112,4 +112,3 @@ Module( 1 | def (): ... 2 | def () -> int: ... | ^ Syntax Error: Expected an identifier - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_missing_return_type.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_missing_return_type.py.snap index 36593a9900dcfc..acfd61b9242fd8 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_missing_return_type.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_missing_return_type.py.snap @@ -57,4 +57,3 @@ Module( | 1 | def foo() -> : ... | ^ Syntax Error: Expected an expression - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_unclosed_parameter_list.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_unclosed_parameter_list.py.snap index 9efb6d3facb45c..9d71866cf6d595 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_unclosed_parameter_list.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_unclosed_parameter_list.py.snap @@ -255,11 +255,9 @@ Module( 4 | def foo(a: int, b: str 5 | x = 10 | ^ Syntax Error: Expected `,`, found name - | | 4 | def foo(a: int, b: str 5 | x = 10 | ^ Syntax Error: unexpected EOF while parsing - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_unparenthesized_return_types.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_unparenthesized_return_types.py.snap index fc72f4209f88e2..e943085fc1dda5 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_unparenthesized_return_types.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_def_unparenthesized_return_types.py.snap @@ -149,4 +149,3 @@ Module( 1 | def foo() -> int,: ... 2 | def foo() -> int, str: ... | ^^^^^^^^ Syntax Error: Multiple return types must be parenthesized - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_type_params_py311.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_type_params_py311.py.snap index 5ab2a0d3644611..020e464de8cc24 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_type_params_py311.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@function_type_params_py311.py.snap @@ -123,7 +123,6 @@ Module( 2 | def foo[T](): ... 3 | def foo[](): ... | ^ Syntax Error: Type parameter list cannot be empty - | ## Unsupported Syntax Errors @@ -141,4 +140,3 @@ Module( 2 | def foo[T](): ... 3 | def foo[](): ... | ^^ Syntax Error: Cannot use type parameter lists on Python 3.11 (syntax was added in Python 3.12) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@global_stmt_empty.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@global_stmt_empty.py.snap index 5971aa62c7163b..92375a3dfba725 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@global_stmt_empty.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@global_stmt_empty.py.snap @@ -26,4 +26,3 @@ Module( | 1 | global | ^ Syntax Error: Global statement must have at least one name - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@global_stmt_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@global_stmt_expression.py.snap index c80bc045056b83..018d9049ee9b8d 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@global_stmt_expression.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@global_stmt_expression.py.snap @@ -54,4 +54,3 @@ Module( | 1 | global x + 1 | ^ Syntax Error: Simple statements must be separated by newlines or semicolons - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@global_stmt_trailing_comma.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@global_stmt_trailing_comma.py.snap index 689169704255ec..22cbfb00161e6e 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@global_stmt_trailing_comma.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@global_stmt_trailing_comma.py.snap @@ -83,4 +83,3 @@ Module( 2 | global x, 3 | global x, y, | ^ Syntax Error: Trailing comma not allowed - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_empty_body.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_empty_body.py.snap index 1d74c36f4867cf..ad3fe7c4ca1236 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_empty_body.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_empty_body.py.snap @@ -66,4 +66,3 @@ Module( 1 | if True: 2 | 1 + 1 | ^ Syntax Error: Expected an indented block after `if` statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_invalid_test_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_invalid_test_expr.py.snap index c06836fcdb8ff2..1840201849a752 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_invalid_test_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_invalid_test_expr.py.snap @@ -145,4 +145,3 @@ Module( 2 | if yield x: ... 3 | if yield from x: ... | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_missing_test.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_missing_test.py.snap index 421ce18c821534..f0f87f8a4fa3e4 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_missing_test.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_missing_test.py.snap @@ -48,4 +48,3 @@ Module( | 1 | if : ... | ^ Syntax Error: Expected an expression - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_misspelled_elif.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_misspelled_elif.py.snap index 4a0f4d0afaefdc..3a360a80665dd5 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_misspelled_elif.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@if_stmt_misspelled_elif.py.snap @@ -127,4 +127,3 @@ Module( 5 | else: 6 | pass | ^^^^ Syntax Error: Unexpected indentation - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_alias_missing_asname.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_alias_missing_asname.py.snap index 873a39cf58d3a7..47f3fd931108c3 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_alias_missing_asname.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_alias_missing_asname.py.snap @@ -38,4 +38,3 @@ Module( | 1 | import x as | ^ Syntax Error: Expected symbol after `as` - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_from_star.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_from_star.py.snap index cc5f028404015b..c2e12781c9a3dc 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_from_star.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_from_star.py.snap @@ -233,7 +233,6 @@ Module( 7 | def f3(): 8 | from module import *, * | ^^^^ Syntax Error: Star import must be the only import - | ## Semantic Syntax Errors @@ -272,4 +271,3 @@ Module( 7 | def f3(): 8 | from module import *, * | ^^^^^^^^^^^^^^^^^^^^^^^ Syntax Error: `from module import *` only allowed at module level - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_empty.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_empty.py.snap index 37436698288593..6f254cafc4e38f 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_empty.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_empty.py.snap @@ -27,4 +27,3 @@ Module( | 1 | import | ^ Syntax Error: Expected one or more symbol names after import - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_parenthesized_names.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_parenthesized_names.py.snap index d410339d7d5190..e4acf74b900261 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_parenthesized_names.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_parenthesized_names.py.snap @@ -89,4 +89,3 @@ Module( 1 | import (a) 2 | import (a, b) | ^ Syntax Error: Expected one or more symbol names after import - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_star_import.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_star_import.py.snap index 8abd54a19e0aa2..78b584adc6b7b9 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_star_import.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_star_import.py.snap @@ -121,18 +121,15 @@ Module( 1 | import * 2 | import x, *, y | ^ Syntax Error: Trailing comma not allowed - | | 1 | import * 2 | import x, *, y | ^ Syntax Error: Simple statements must be separated by newlines or semicolons - | | 1 | import * 2 | import x, *, y | ^ Syntax Error: Expected an expression - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_trailing_comma.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_trailing_comma.py.snap index 7114dbf8d2f47a..37a98420278ade 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_trailing_comma.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@import_stmt_trailing_comma.py.snap @@ -71,4 +71,3 @@ Module( 1 | import , 2 | import x, y, | ^ Syntax Error: Trailing comma not allowed - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@incomplete_attribute_before_for_in_delimiter.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@incomplete_attribute_before_for_in_delimiter.py.snap index c8b5eb4ab3b88e..b59353d9aec69a 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@incomplete_attribute_before_for_in_delimiter.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@incomplete_attribute_before_for_in_delimiter.py.snap @@ -398,4 +398,3 @@ Module( 5 | [item for item. in xs] 6 | for item. in xs: ... | ^^ Syntax Error: Expected an identifier - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_annotation_class.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_annotation_class.py.snap index 3c8495804d398b..9876d8216bd7ab 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_annotation_class.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_annotation_class.py.snap @@ -572,4 +572,3 @@ Module( 6 | class M[T]((await 1)): ... 7 | class N[T: (await 1)]: ... | ^^^^^^^ Syntax Error: await expression cannot be used within a TypeVar bound - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_annotation_function.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_annotation_function.py.snap index 682cbac08f18da..9ca7f7bbefb41f 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_annotation_function.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_annotation_function.py.snap @@ -1805,4 +1805,3 @@ Module( 19 | def v[*Ts = (await 1)](): ... # await in TypeVarTuple default 20 | def w[**Ts = (await 1)](): ... # await in ParamSpec default | ^^^^^^^ Syntax Error: await expression cannot be used within a ParamSpec default - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_annotation_function_py314.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_annotation_function_py314.py.snap index 132507c7c768a0..ddf812502d5e3e 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_annotation_function_py314.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_annotation_function_py314.py.snap @@ -657,4 +657,3 @@ Module( 10 | def f() -> (await 1): ... 11 | def g(arg: (await 1)): ... | ^^^^^^^ Syntax Error: await expression cannot be used within a type annotation - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_annotation_py314.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_annotation_py314.py.snap index f3fdd11ffe8681..80f657c1339471 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_annotation_py314.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_annotation_py314.py.snap @@ -236,4 +236,3 @@ Module( 6 | async def outer(): 7 | d: (await 1) | ^^^^^^^ Syntax Error: await expression cannot be used within a type annotation - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_annotation_type_alias.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_annotation_type_alias.py.snap index 5a05ef64f6aa69..a0174091277bdc 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_annotation_type_alias.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_annotation_type_alias.py.snap @@ -488,4 +488,3 @@ Module( 7 | type Y[T: (await 1)] = int # await in bound 8 | type Y = (await 1) # await in value | ^^^^^^^ Syntax Error: await expression cannot be used within a type alias - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_byte_literal.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_byte_literal.py.snap index a330b1ce963345..0de2a88389a014 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_byte_literal.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_byte_literal.py.snap @@ -120,4 +120,3 @@ Module( 2 | rb"a𝐁c123" 3 | b"""123a𝐁c""" | ^ Syntax Error: bytes can only contain ASCII literal characters - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_del_target.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_del_target.py.snap index 5834d7311a2c25..cc7fbd303af659 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_del_target.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_del_target.py.snap @@ -254,7 +254,6 @@ Module( 3 | del {'x', 'y'} 4 | del None, True, False, 1, 1.0, "abc" | ^^^^ Syntax Error: Invalid delete target - | | @@ -262,7 +261,6 @@ Module( 3 | del {'x', 'y'} 4 | del None, True, False, 1, 1.0, "abc" | ^^^^ Syntax Error: Invalid delete target - | | @@ -270,7 +268,6 @@ Module( 3 | del {'x', 'y'} 4 | del None, True, False, 1, 1.0, "abc" | ^^^^^ Syntax Error: Invalid delete target - | | @@ -278,7 +275,6 @@ Module( 3 | del {'x', 'y'} 4 | del None, True, False, 1, 1.0, "abc" | ^ Syntax Error: Invalid delete target - | | @@ -286,7 +282,6 @@ Module( 3 | del {'x', 'y'} 4 | del None, True, False, 1, 1.0, "abc" | ^^^ Syntax Error: Invalid delete target - | | @@ -294,4 +289,3 @@ Module( 3 | del {'x', 'y'} 4 | del None, True, False, 1, 1.0, "abc" | ^^^^^ Syntax Error: Invalid delete target - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_fstring_literal_element.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_fstring_literal_element.py.snap index 0d2f651c21adcd..fc74da89bfdd57 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_fstring_literal_element.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_fstring_literal_element.py.snap @@ -101,4 +101,3 @@ Module( 1 | f'hello \N{INVALID} world' 2 | f"""hello \N{INVALID} world""" | ^^^^^^^ Syntax Error: Got unexpected unicode - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_future_feature.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_future_feature.py.snap index ec4c8f6c56b530..121735f806bc5e 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_future_feature.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_future_feature.py.snap @@ -138,7 +138,6 @@ Module( 2 | from __future__ import annotations, invalid_feature 3 | from __future__ import invalid_feature_1, invalid_feature_2 | ^^^^^^^^^^^^^^^^^ Syntax Error: Future feature `invalid_feature_1` is not defined - | | @@ -146,4 +145,3 @@ Module( 2 | from __future__ import annotations, invalid_feature 3 | from __future__ import invalid_feature_1, invalid_feature_2 | ^^^^^^^^^^^^^^^^^ Syntax Error: Future feature `invalid_feature_2` is not defined - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_string_literal.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_string_literal.py.snap index 72cdf3cf6ac390..4d20a344387111 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_string_literal.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@invalid_string_literal.py.snap @@ -81,4 +81,3 @@ Module( 1 | 'hello \N{INVALID} world' 2 | """hello \N{INVALID} world""" | ^^^^^^^ Syntax Error: Got unexpected unicode - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ipython_help_escape_command_error_recovery_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ipython_help_escape_command_error_recovery_1.py.snap index aa33df6cbcd5ab..6f812719739d07 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ipython_help_escape_command_error_recovery_1.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ipython_help_escape_command_error_recovery_1.py.snap @@ -81,4 +81,3 @@ Module( 2 | with (a, ?b) 3 | ? | ^ Syntax Error: Expected an indented block after `with` statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ipython_help_escape_command_error_recovery_2.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ipython_help_escape_command_error_recovery_2.py.snap index 424b43d107c9e2..4f1baa69a7c8d8 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ipython_help_escape_command_error_recovery_2.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@ipython_help_escape_command_error_recovery_2.py.snap @@ -70,11 +70,9 @@ Module( 2 | with (a, ?b 3 | ? | ^ Syntax Error: Expected `,`, found `?` - | | 2 | with (a, ?b 3 | ? | ^ Syntax Error: unexpected EOF while parsing - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@iter_unpack_return_py37.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@iter_unpack_return_py37.py.snap index cc4ffef0402823..34d46e2a2bb657 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@iter_unpack_return_py37.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@iter_unpack_return_py37.py.snap @@ -160,4 +160,3 @@ Module( 2 | rest = (4, 5, 6) 3 | def f(): return 1, 2, 3, *rest | ^^^^^ Syntax Error: Cannot use iterable unpacking in return statements on Python 3.7 (syntax was added in Python 3.8) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@iter_unpack_yield_py37.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@iter_unpack_yield_py37.py.snap index 09bb35556958b1..4110c28f156e94 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@iter_unpack_yield_py37.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@iter_unpack_yield_py37.py.snap @@ -285,4 +285,3 @@ Module( 3 | def g(): yield 1, 2, 3, *rest 4 | def h(): yield 1, (yield 2, *rest), 3 | ^^^^^ Syntax Error: Cannot use iterable unpacking in yield expressions on Python 3.7 (syntax was added in Python 3.8) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lambda_body_with_starred_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lambda_body_with_starred_expr.py.snap index a438ef9c4614b1..c06d9a8abc2b76 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lambda_body_with_starred_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lambda_body_with_starred_expr.py.snap @@ -308,4 +308,3 @@ Module( 3 | lambda x: *y, z 4 | lambda x: *y and z | ^^^^^^^^ Syntax Error: Starred expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lambda_body_with_yield_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lambda_body_with_yield_expr.py.snap index 50eb38666e6b79..d21b80f6d6c890 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lambda_body_with_yield_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lambda_body_with_yield_expr.py.snap @@ -135,4 +135,3 @@ Module( 1 | lambda x: yield y 2 | lambda x: yield from y | ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lazy_import_invalid_context_py315.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lazy_import_invalid_context_py315.py.snap index 9d2f1d49f444a8..67abc8a22c3629 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lazy_import_invalid_context_py315.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lazy_import_invalid_context_py315.py.snap @@ -375,4 +375,3 @@ Module( 22 | class Inner: 23 | lazy import json | ^^^^^^^^^^^^^^^^ Syntax Error: lazy import not allowed inside classes - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lazy_import_invalid_from_py315.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lazy_import_invalid_from_py315.py.snap index 146d091c51f322..3e7266d9186338 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lazy_import_invalid_from_py315.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lazy_import_invalid_from_py315.py.snap @@ -145,11 +145,9 @@ Module( 5 | def func(): 6 | lazy from sys import * | ^^^^^^^^^^^^^^^^^^^^^^ Syntax Error: lazy from ... import not allowed inside functions - | | 5 | def func(): 6 | lazy from sys import * | ^^^^^^^^^^^^^^^^^^^^^^ Syntax Error: `from sys import *` only allowed at module level - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lazy_import_stmt_py314.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lazy_import_stmt_py314.py.snap index c3e6a3fedf0040..14f80ce4ad9a01 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lazy_import_stmt_py314.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@lazy_import_stmt_py314.py.snap @@ -75,4 +75,3 @@ Module( 2 | lazy import foo 3 | lazy from bar import baz | ^^^^ Syntax Error: Cannot use `lazy` import statement on Python 3.14 (syntax was added in Python 3.15) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expect_indented_block.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expect_indented_block.py.snap index 60781de936a192..f8ff37f51a06f7 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expect_indented_block.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expect_indented_block.py.snap @@ -63,11 +63,9 @@ Module( 1 | match foo: 2 | case _: ... | ^^^^ Syntax Error: Expected an indented block after `match` statement - | | 1 | match foo: 2 | case _: ... | ^ Syntax Error: Expected dedent, found end of file - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expected_case_block.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expected_case_block.py.snap index 8aaaa11d01ea14..5c0854d664cceb 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expected_case_block.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expected_case_block.py.snap @@ -146,4 +146,3 @@ Module( 4 | match y: 5 | case _: ... | ^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_invalid_guard_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_invalid_guard_expr.py.snap index 967dfc2d2e89d1..5ae960f29c5bed 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_invalid_guard_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_invalid_guard_expr.py.snap @@ -236,4 +236,3 @@ Module( 5 | match x: 6 | case y if yield x: ... | ^^^^^^^ Syntax Error: Yield expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_missing_guard_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_missing_guard_expr.py.snap index bf66acae17c6f7..880d99610c296e 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_missing_guard_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_missing_guard_expr.py.snap @@ -69,4 +69,3 @@ Module( 1 | match x: 2 | case y if: ... | ^ Syntax Error: Expected an expression - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_missing_pattern.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_missing_pattern.py.snap index 84fad76972405d..17247bca62985f 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_missing_pattern.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_missing_pattern.py.snap @@ -69,4 +69,3 @@ Module( 1 | match x: 2 | case : ... | ^ Syntax Error: Expected a pattern - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_no_newline_before_case.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_no_newline_before_case.py.snap index 7888bcd48e10a3..7d49a7f558ec69 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_no_newline_before_case.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_no_newline_before_case.py.snap @@ -62,10 +62,8 @@ Module( | 1 | match foo: case _: ... | ^^^^ Syntax Error: Expected newline, found `case` - | | 1 | match foo: case _: ... | ^ Syntax Error: Expected dedent, found end of file - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@mixed_bytes_and_non_bytes_literals.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@mixed_bytes_and_non_bytes_literals.py.snap index 6ac75db9d502cd..829f518bed2971 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@mixed_bytes_and_non_bytes_literals.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@mixed_bytes_and_non_bytes_literals.py.snap @@ -197,4 +197,3 @@ Module( 2 | f'first' b'second' 3 | 'first' f'second' b'third' | ^^^^^^^^^^^^^^^^^^^^^^^^^^ Syntax Error: Bytes literal cannot be mixed with non-bytes literals - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@multiple_assignment_in_case_pattern.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@multiple_assignment_in_case_pattern.py.snap index 3aed1135574516..234f5001e0f5f4 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@multiple_assignment_in_case_pattern.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@multiple_assignment_in_case_pattern.py.snap @@ -819,4 +819,3 @@ Module( 9 | case [x] | {1: x} | Class(y=x, z=x): ... # MatchOr 10 | case x as x: ... # MatchAs | ^ Syntax Error: multiple assignments to name `x` in pattern - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@multiple_clauses_on_same_line.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@multiple_clauses_on_same_line.py.snap index be571b2cd21dbc..cd8e98be1cee8c 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@multiple_clauses_on_same_line.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@multiple_clauses_on_same_line.py.snap @@ -410,7 +410,6 @@ Module( 5 | try: pass except exc: pass else: pass finally: pass 6 | try: pass; except exc: pass; else: pass; finally: pass | ^^^^^^ Syntax Error: Expected newline, found `except` - | | @@ -418,7 +417,6 @@ Module( 5 | try: pass except exc: pass else: pass finally: pass 6 | try: pass; except exc: pass; else: pass; finally: pass | ^^^^ Syntax Error: Expected newline, found `else` - | | @@ -426,4 +424,3 @@ Module( 5 | try: pass except exc: pass else: pass finally: pass 6 | try: pass; except exc: pass; else: pass; finally: pass | ^^^^^^^ Syntax Error: Expected newline, found `finally` - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@multiple_starred_assignment_target.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@multiple_starred_assignment_target.py.snap index 01b96d2fc46b55..fe2d8393ce51ab 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@multiple_starred_assignment_target.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@multiple_starred_assignment_target.py.snap @@ -509,7 +509,6 @@ Module( 4 | [*a, *b, c] = (1, 2, 3) 5 | (*a, *b, (*c, *d)) = (1, 2) | ^^^^^^^^^^^^^^^^^^ Syntax Error: Two starred expressions in assignment - | | @@ -517,4 +516,3 @@ Module( 4 | [*a, *b, c] = (1, 2, 3) 5 | (*a, *b, (*c, *d)) = (1, 2) | ^^^^^^^^ Syntax Error: Two starred expressions in assignment - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@multiple_starred_names_in_sequence_pattern.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@multiple_starred_names_in_sequence_pattern.py.snap index 62a1d0db0020e4..c289a7895a5713 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@multiple_starred_names_in_sequence_pattern.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@multiple_starred_names_in_sequence_pattern.py.snap @@ -102,11 +102,9 @@ Module( 1 | match subject: 2 | case *first, *second, *third: ... | ^^^^^^^ Syntax Error: multiple starred names in sequence pattern - | | 1 | match subject: 2 | case *first, *second, *third: ... | ^^^^^^ Syntax Error: multiple starred names in sequence pattern - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@named_expr_slice.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@named_expr_slice.py.snap index ab0bcdf9caee95..961dcf36e150ce 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@named_expr_slice.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@named_expr_slice.py.snap @@ -266,7 +266,6 @@ Module( 3 | lst[1:x:=1] 4 | lst[1:3:x:=1] | ^^ Syntax Error: Expected `]`, found `:=` - | | @@ -274,7 +273,6 @@ Module( 3 | lst[1:x:=1] 4 | lst[1:3:x:=1] | ^ Syntax Error: Expected a statement - | | @@ -282,4 +280,3 @@ Module( 3 | lst[1:x:=1] 4 | lst[1:3:x:=1] | ^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@named_expr_slice_parse_error.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@named_expr_slice_parse_error.py.snap index e282dc0cab1aac..34c884074894ad 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@named_expr_slice_parse_error.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@named_expr_slice_parse_error.py.snap @@ -92,4 +92,3 @@ Module( 2 | # before 3.9, only emit the parse error, not the unsupported syntax error 3 | lst[x:=1:-1] | ^^^^ Syntax Error: Unparenthesized named expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nested_async_comprehension_py310.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nested_async_comprehension_py310.py.snap index 94435420da820e..ff285092c21185 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nested_async_comprehension_py310.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nested_async_comprehension_py310.py.snap @@ -937,4 +937,3 @@ Module( 5 | async def i(): return [([y async for y in range(1)], [z for z in range(2)]) for x in range(5)] 6 | async def j(): return [([y for y in range(1)], [z async for z in range(2)]) for x in range(5)] | ^^^^^^^^^^^^^^^^^^^^^^^ Syntax Error: cannot use an asynchronous comprehension inside of a synchronous comprehension on Python 3.10 (syntax was added in 3.11) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nested_quote_in_format_spec_py312.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nested_quote_in_format_spec_py312.py.snap index 7eec20f80b9c27..187240a204f323 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nested_quote_in_format_spec_py312.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nested_quote_in_format_spec_py312.py.snap @@ -89,4 +89,3 @@ Module( 1 | # parse_options: {"target-version": "3.12"} 2 | f"{1:""}" # this is a ParseError on all versions | ^ Syntax Error: f-string: expecting `}` - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@node_range_with_gaps.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@node_range_with_gaps.py.snap index 361fe1288bb44e..a71728ff9d61cf 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@node_range_with_gaps.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@node_range_with_gaps.py.snap @@ -125,11 +125,9 @@ Module( 2 | def bar(): ... 3 | def baz | ^ Syntax Error: Expected `(`, found newline - | | 2 | def bar(): ... 3 | def baz | ^ Syntax Error: Expected `)`, found end of file - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_declaration_at_module_level.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_declaration_at_module_level.py.snap index ecfbbe06d22aae..5f81d3505db579 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_declaration_at_module_level.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_declaration_at_module_level.py.snap @@ -58,4 +58,3 @@ Module( 1 | nonlocal x 2 | nonlocal x, y | ^^^^^^^^^^^^^ Syntax Error: nonlocal declaration not allowed at module level - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_stmt_empty.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_stmt_empty.py.snap index e7c4c552bd7b26..cba504e096f0e1 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_stmt_empty.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_stmt_empty.py.snap @@ -53,4 +53,3 @@ Module( 1 | def _(): 2 | nonlocal | ^ Syntax Error: Nonlocal statement must have at least one name - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_stmt_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_stmt_expression.py.snap index f82316bd467099..ae92fb5c2b1f60 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_stmt_expression.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_stmt_expression.py.snap @@ -81,4 +81,3 @@ Module( 1 | def _(): 2 | nonlocal x + 1 | ^ Syntax Error: Simple statements must be separated by newlines or semicolons - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_stmt_trailing_comma.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_stmt_trailing_comma.py.snap index d749245b986aca..5060d24003b38c 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_stmt_trailing_comma.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@nonlocal_stmt_trailing_comma.py.snap @@ -112,4 +112,3 @@ Module( 3 | nonlocal x, 4 | nonlocal x, y, | ^ Syntax Error: Trailing comma not allowed - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_missing_annotation.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_missing_annotation.py.snap index 16efd0233ed095..97f376531396e5 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_missing_annotation.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_missing_annotation.py.snap @@ -135,4 +135,3 @@ Module( 1 | def foo(x:): ... 2 | def foo(x:,): ... | ^ Syntax Error: Expected an expression - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_missing_default.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_missing_default.py.snap index fcb763f0a12dc8..677e725f3ad368 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_missing_default.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_missing_default.py.snap @@ -144,4 +144,3 @@ Module( 1 | def foo(x=): ... 2 | def foo(x: int = ): ... | ^ Syntax Error: Expected an expression - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_with_invalid_annotation.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_with_invalid_annotation.py.snap index d6b1a5944eacdd..b81e6a9903bed5 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_with_invalid_annotation.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_with_invalid_annotation.py.snap @@ -256,7 +256,6 @@ Module( 2 | def foo(arg: yield int): ... 3 | def foo(arg: x := int): ... | ^^ Syntax Error: Expected `,`, found `:=` - | ## Semantic Syntax Errors diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_with_invalid_default.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_with_invalid_default.py.snap index fcc9686845a00a..461ef54faab205 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_with_invalid_default.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_with_invalid_default.py.snap @@ -248,4 +248,3 @@ Module( 2 | def foo(x=(*int)): ... 3 | def foo(x=yield y): ... | ^^^^^^^ Syntax Error: Yield expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_with_star_annotation_py310.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_with_star_annotation_py310.py.snap index 0add20fe0e03b2..20e6c382e4c928 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_with_star_annotation_py310.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@param_with_star_annotation_py310.py.snap @@ -85,4 +85,3 @@ Module( 1 | # parse_options: {"target-version": "3.10"} 2 | def foo(*args: *Ts): ... | ^^^ Syntax Error: Cannot use star annotation on Python 3.10 (syntax was added in Python 3.11) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_duplicate_names.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_duplicate_names.py.snap index 54ade04fb29417..cf8ca302d41f0c 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_duplicate_names.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_duplicate_names.py.snap @@ -160,28 +160,23 @@ Module( | 1 | def foo(a, a=10, *a, a, a: str, **a): ... | ^ Syntax Error: Duplicate parameter "a" - | | 1 | def foo(a, a=10, *a, a, a: str, **a): ... | ^ Syntax Error: Duplicate parameter "a" - | | 1 | def foo(a, a=10, *a, a, a: str, **a): ... | ^ Syntax Error: Duplicate parameter "a" - | | 1 | def foo(a, a=10, *a, a, a: str, **a): ... | ^ Syntax Error: Duplicate parameter "a" - | | 1 | def foo(a, a=10, *a, a, a: str, **a): ... | ^ Syntax Error: Duplicate parameter "a" - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_expected_after_star_separator.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_expected_after_star_separator.py.snap index f343b562c6e2ee..3a61d03ad026e4 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_expected_after_star_separator.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_expected_after_star_separator.py.snap @@ -290,4 +290,3 @@ Module( 4 | def foo(a, *,): ... 5 | def foo(*, **kwargs): ... | ^^^^^^^^ Syntax Error: Expected one or more keyword parameter after `*` separator - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_follows_var_keyword_param.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_follows_var_keyword_param.py.snap index 930431d5258a2c..f643b398d07345 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_follows_var_keyword_param.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_follows_var_keyword_param.py.snap @@ -121,28 +121,23 @@ Module( | 1 | def foo(**kwargs, a, /, b=10, *, *args): ... | ^ Syntax Error: Parameter cannot follow var-keyword parameter - | | 1 | def foo(**kwargs, a, /, b=10, *, *args): ... | ^ Syntax Error: Parameter cannot follow var-keyword parameter - | | 1 | def foo(**kwargs, a, /, b=10, *, *args): ... | ^ Syntax Error: Parameter cannot follow var-keyword parameter - | | 1 | def foo(**kwargs, a, /, b=10, *, *args): ... | ^ Syntax Error: Parameter cannot follow var-keyword parameter - | | 1 | def foo(**kwargs, a, /, b=10, *, *args): ... | ^ Syntax Error: Parameter cannot follow var-keyword parameter - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_kwarg_after_star_separator.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_kwarg_after_star_separator.py.snap index 589d8905af1e1e..3c76f98da42b55 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_kwarg_after_star_separator.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_kwarg_after_star_separator.py.snap @@ -68,4 +68,3 @@ Module( | 1 | def foo(*, **kwargs): ... | ^^^^^^^^ Syntax Error: Expected one or more keyword parameter after `*` separator - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_kwargs.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_kwargs.py.snap index 156a9627466331..b5c0c9d0aacad2 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_kwargs.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_kwargs.py.snap @@ -84,4 +84,3 @@ Module( | 1 | def foo(a, **kwargs1, **kwargs2): ... | ^^ Syntax Error: Parameter cannot follow var-keyword parameter - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_slash_separator.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_slash_separator.py.snap index 21a9f2882093c8..8fe7404b2345a2 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_slash_separator.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_slash_separator.py.snap @@ -182,4 +182,3 @@ Module( 1 | def foo(a, /, /, b): ... 2 | def foo(a, /, b, c, /): ... | ^ Syntax Error: Only one '/' separator allowed - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_star_separator.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_star_separator.py.snap index 4daa7f27f272ec..642996446c7b59 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_star_separator.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_star_separator.py.snap @@ -182,4 +182,3 @@ Module( 1 | def foo(a, *, *, b): ... 2 | def foo(a, *, b, c, *): ... | ^ Syntax Error: Only one '*' separator allowed - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_varargs.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_varargs.py.snap index 8fb783b1c13e25..a60de5d69e42ed 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_varargs.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_multiple_varargs.py.snap @@ -296,4 +296,3 @@ Module( 3 | def foo(a, *args1, *args2, b): ... 4 | def foo(a, *args1, b, c, *args2): ... | ^^^^^^ Syntax Error: Only one '*' parameter allowed - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_no_arg_before_slash.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_no_arg_before_slash.py.snap index 7444c8148adc72..f3fc1117e0011d 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_no_arg_before_slash.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_no_arg_before_slash.py.snap @@ -119,4 +119,3 @@ Module( 1 | def foo(/): ... 2 | def foo(/, a): ... | ^ Syntax Error: Position-only parameter separator not allowed as first parameter - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_non_default_after_default.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_non_default_after_default.py.snap index 4d23c7dde97cdf..6dfcec4878927c 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_non_default_after_default.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_non_default_after_default.py.snap @@ -122,10 +122,8 @@ Module( | 1 | def foo(a=10, b, c: int): ... | ^ Syntax Error: Parameter without a default cannot follow a parameter with a default - | | 1 | def foo(a=10, b, c: int): ... | ^^^^^^ Syntax Error: Parameter without a default cannot follow a parameter with a default - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_star_after_slash.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_star_after_slash.py.snap index 2015f10090653c..485d7d49babb5b 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_star_after_slash.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_star_after_slash.py.snap @@ -347,4 +347,3 @@ Module( 3 | def foo(a, *, /, b): ... 4 | def foo(a, *, b, c, /, d): ... | ^ Syntax Error: '/' parameter must appear before '*' parameter - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_star_separator_after_star_param.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_star_separator_after_star_param.py.snap index fb13bd6095a1d6..6a75f864f722b3 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_star_separator_after_star_param.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_star_separator_after_star_param.py.snap @@ -204,4 +204,3 @@ Module( 1 | def foo(a, *args, *, b): ... 2 | def foo(a, *args, b, c, *): ... | ^ Syntax Error: Keyword-only parameter separator not allowed after '*' parameter - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_var_keyword_with_default.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_var_keyword_with_default.py.snap index 87adc006a3378c..6a172bd47cb8c6 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_var_keyword_with_default.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_var_keyword_with_default.py.snap @@ -166,22 +166,18 @@ Module( | 1 | def foo(a, **kwargs={'b': 1, 'c': 2}): ... | ^ Syntax Error: Parameter with `*` or `**` cannot have default value - | | 1 | def foo(a, **kwargs={'b': 1, 'c': 2}): ... | ^ Syntax Error: Expected `)`, found `{` - | | 1 | def foo(a, **kwargs={'b': 1, 'c': 2}): ... | ^ Syntax Error: Expected newline, found `)` - | | 1 | def foo(a, **kwargs={'b': 1, 'c': 2}): ... | ^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_var_positional_with_default.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_var_positional_with_default.py.snap index e965d4a0b45601..076fbfe23bf1e6 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_var_positional_with_default.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@params_var_positional_with_default.py.snap @@ -118,22 +118,18 @@ Module( | 1 | def foo(a, *args=(1, 2)): ... | ^ Syntax Error: Parameter with `*` or `**` cannot have default value - | | 1 | def foo(a, *args=(1, 2)): ... | ^ Syntax Error: Expected `)`, found `(` - | | 1 | def foo(a, *args=(1, 2)): ... | ^ Syntax Error: Expected newline, found `)` - | | 1 | def foo(a, *args=(1, 2)): ... | ^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@parenthesized_context_manager_py38.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@parenthesized_context_manager_py38.py.snap index c9fce5f0817d41..3185cb6e3246f3 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@parenthesized_context_manager_py38.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@parenthesized_context_manager_py38.py.snap @@ -222,4 +222,3 @@ Module( 3 | with (foo, bar as y): ... 4 | with (foo as x, bar): ... | ^ Syntax Error: Cannot use parentheses within a `with` statement on Python 3.8 (syntax was added in Python 3.9) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@parenthesized_kwarg_py38.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@parenthesized_kwarg_py38.py.snap index 149fba6e356a93..6a2b1560fd23e5 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@parenthesized_kwarg_py38.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@parenthesized_kwarg_py38.py.snap @@ -180,4 +180,3 @@ Module( 3 | f((a) = 1) 4 | f( ( a ) = 1) | ^^^^^ Syntax Error: Cannot use parenthesized keyword argument name on Python 3.8 (syntax was removed in Python 3.8) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@pep701_f_string_py311.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@pep701_f_string_py311.py.snap index 85b7abc8b40544..b1f3dfc4fc77c1 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@pep701_f_string_py311.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@pep701_f_string_py311.py.snap @@ -1078,7 +1078,6 @@ Module( 14 | f"""{f"""{x}"""}""" # mark the whole triple quote 15 | f"{'\n'.join(['\t', '\v', '\r'])}" # multiple escape sequences, multiple errors | ^ Syntax Error: Cannot use an escape sequence (backslash) in f-strings on Python 3.11 (syntax was added in Python 3.12) - | | @@ -1086,7 +1085,6 @@ Module( 14 | f"""{f"""{x}"""}""" # mark the whole triple quote 15 | f"{'\n'.join(['\t', '\v', '\r'])}" # multiple escape sequences, multiple errors | ^ Syntax Error: Cannot use an escape sequence (backslash) in f-strings on Python 3.11 (syntax was added in Python 3.12) - | | @@ -1094,7 +1092,6 @@ Module( 14 | f"""{f"""{x}"""}""" # mark the whole triple quote 15 | f"{'\n'.join(['\t', '\v', '\r'])}" # multiple escape sequences, multiple errors | ^ Syntax Error: Cannot use an escape sequence (backslash) in f-strings on Python 3.11 (syntax was added in Python 3.12) - | | @@ -1102,4 +1099,3 @@ Module( 14 | f"""{f"""{x}"""}""" # mark the whole triple quote 15 | f"{'\n'.join(['\t', '\v', '\r'])}" # multiple escape sequences, multiple errors | ^ Syntax Error: Cannot use an escape sequence (backslash) in f-strings on Python 3.11 (syntax was added in Python 3.12) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@pep701_nested_interpolation_py311.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@pep701_nested_interpolation_py311.py.snap index 5699059e9178be..51ca8d4ddaf317 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@pep701_nested_interpolation_py311.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@pep701_nested_interpolation_py311.py.snap @@ -228,4 +228,3 @@ Module( 3 | f'{1: abcd "{'aa'}" }' 4 | f'{1: abcd "{"\n"}" }' | ^ Syntax Error: Cannot use an escape sequence (backslash) in f-strings on Python 3.11 (syntax was added in Python 3.12) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@pep_798_invalid_dict_unpacking_comprehensions_py315.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@pep_798_invalid_dict_unpacking_comprehensions_py315.py.snap index f4b8413ff6a2d8..cf6a44043bf19b 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@pep_798_invalid_dict_unpacking_comprehensions_py315.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@pep_798_invalid_dict_unpacking_comprehensions_py315.py.snap @@ -351,4 +351,3 @@ Module( 4 | {**k: v for k, v in items} 5 | {k: **v for k, v in items} | ^^^ Syntax Error: Starred expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@pep_798_unpacking_comprehensions_py314.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@pep_798_unpacking_comprehensions_py314.py.snap index f388ce286994d7..86297c504ceae2 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@pep_798_unpacking_comprehensions_py314.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@pep_798_unpacking_comprehensions_py314.py.snap @@ -331,4 +331,3 @@ Module( 5 | (*x for x in y) 6 | f(*x for x in y) | ^^ Syntax Error: Cannot use iterable unpacking in a generator expression on Python 3.14 (syntax was added in Python 3.15) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@pos_only_py37.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@pos_only_py37.py.snap index 5328fcf7ddaa76..5a0accedf73167 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@pos_only_py37.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@pos_only_py37.py.snap @@ -299,7 +299,6 @@ Module( 4 | def foo(a, *args, /, b): ... 5 | def foo(a, //): ... | ^^ Syntax Error: Expected `,`, found `//` - | ## Unsupported Syntax Errors diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_from_without_exc.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_from_without_exc.py.snap index 4e9bad06a48ffa..a26ddcf6ec9286 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_from_without_exc.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_from_without_exc.py.snap @@ -59,4 +59,3 @@ Module( 1 | raise from exc 2 | raise from None | ^^^^ Syntax Error: Exception missing in `raise` statement with cause - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_invalid_cause.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_invalid_cause.py.snap index c9559c557f6004..5554450d32949d 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_invalid_cause.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_invalid_cause.py.snap @@ -145,4 +145,3 @@ Module( 2 | raise x from yield y 3 | raise x from y := 1 | ^^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_invalid_exc.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_invalid_exc.py.snap index 6886f22badb49d..02dab5618e6f20 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_invalid_exc.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_invalid_exc.py.snap @@ -118,4 +118,3 @@ Module( 2 | raise yield x 3 | raise x := 1 | ^^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_unparenthesized_tuple_cause.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_unparenthesized_tuple_cause.py.snap index 40dc442afdf028..8920563325fa72 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_unparenthesized_tuple_cause.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_unparenthesized_tuple_cause.py.snap @@ -107,4 +107,3 @@ Module( 1 | raise x from y, 2 | raise x from y, z | ^^^^ Syntax Error: Unparenthesized tuple expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_unparenthesized_tuple_exc.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_unparenthesized_tuple_exc.py.snap index 34510782dc3724..249774dde9e13c 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_unparenthesized_tuple_exc.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@raise_stmt_unparenthesized_tuple_exc.py.snap @@ -143,4 +143,3 @@ Module( 2 | raise x, y 3 | raise x, y from z | ^^^^ Syntax Error: Unparenthesized tuple expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lex_logical_token.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lex_logical_token.py.snap index 93b1439a588077..9410e6f20a83fb 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lex_logical_token.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lex_logical_token.py.snap @@ -949,4 +949,3 @@ Module( 56 | def bar(): 57 | pass | ^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lexing__fstring_format_spec_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lexing__fstring_format_spec_1.py.snap index f0d3b3104c6320..c9aa9e7ce459a6 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lexing__fstring_format_spec_1.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lexing__fstring_format_spec_1.py.snap @@ -484,25 +484,21 @@ Module( 11 | f'middle {'string':\\\ 12 | 'format spec'} | ^ Syntax Error: f-string: expecting `}` - | | 11 | f'middle {'string':\\\ 12 | 'format spec'} | ^^^^^^ Syntax Error: Simple statements must be separated by newlines or semicolons - | | 11 | f'middle {'string':\\\ 12 | 'format spec'} | ^^^^ Syntax Error: Simple statements must be separated by newlines or semicolons - | | 11 | f'middle {'string':\\\ 12 | 'format spec'} | ^^ Syntax Error: missing closing quote in string literal - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lexing__triple_quoted_fstring_1.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lexing__triple_quoted_fstring_1.py.snap index f58010350b4f12..8fcddba72a0b20 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lexing__triple_quoted_fstring_1.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lexing__triple_quoted_fstring_1.py.snap @@ -77,14 +77,12 @@ Module( | ___________________________^ 6 | | y = 1 | |_____^ Syntax Error: f-string: unterminated triple-quoted string - | | 5 | f"""hello {x # comment 6 | y = 1 | ^ Syntax Error: f-string: expecting `}` - | | @@ -94,11 +92,9 @@ Module( | ___________________________^ 6 | | y = 1 | |_____^ Syntax Error: Expected FStringEnd, found FStringMiddle - | | 5 | f"""hello {x # comment 6 | y = 1 | ^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lexing__triple_quoted_fstring_2.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lexing__triple_quoted_fstring_2.py.snap index 7a5f85ab4a6f16..290b20e86aee5e 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lexing__triple_quoted_fstring_2.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lexing__triple_quoted_fstring_2.py.snap @@ -81,4 +81,3 @@ Module( 5 | f'''{foo:.3f 6 | ''' | ^^^ Syntax Error: f-string: expecting `}` - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lexing__ty_1828.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lexing__ty_1828.py.snap index f46548da509458..d0ee282cd7f40b 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lexing__ty_1828.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@re_lexing__ty_1828.py.snap @@ -197,7 +197,6 @@ Module( 4 | | class A: 5 | | pass | |_________^ Syntax Error: f-string: unterminated triple-quoted string - | | @@ -217,11 +216,9 @@ Module( 4 | | class A: 5 | | pass | |_________^ Syntax Error: Expected a statement - | | 4 | class A: 5 | pass | ^ Syntax Error: unexpected EOF while parsing - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@rebound_comprehension_variable.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@rebound_comprehension_variable.py.snap index 51966592d8a630..932b4f7ac26bfe 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@rebound_comprehension_variable.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@rebound_comprehension_variable.py.snap @@ -1021,7 +1021,6 @@ Module( 8 | [(a := 0) for a in range (0) for b in range(0)] 9 | [((a := 0), (b := 1)) for a in range (0) for b in range(0)] | ^ Syntax Error: assignment expression cannot rebind comprehension variable - | | @@ -1029,4 +1028,3 @@ Module( 8 | [(a := 0) for a in range (0) for b in range(0)] 9 | [((a := 0), (b := 1)) for a in range (0) for b in range(0)] | ^ Syntax Error: assignment expression cannot rebind comprehension variable - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@return_stmt_invalid_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@return_stmt_invalid_expr.py.snap index c6e921af8335f3..d00b8aadbf4c99 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@return_stmt_invalid_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@return_stmt_invalid_expr.py.snap @@ -198,7 +198,6 @@ Module( 4 | return x := 1 5 | return *x and y | ^^^^^^^ Syntax Error: Boolean expression cannot be used here - | ## Semantic Syntax Errors @@ -216,4 +215,3 @@ Module( 4 | return x := 1 5 | return *x and y | ^^^^^^^^ Syntax Error: Starred expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_and_compound_stmt_on_same_line.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_and_compound_stmt_on_same_line.py.snap index fe0e953b6837d3..c7203ece654ae4 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_and_compound_stmt_on_same_line.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_and_compound_stmt_on_same_line.py.snap @@ -70,4 +70,3 @@ Module( | 1 | a; if b: pass; b | ^^ Syntax Error: Compound statements are not allowed on the same line as simple statements - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_and_compound_stmt_on_same_line_in_block.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_and_compound_stmt_on_same_line_in_block.py.snap index 9364793f007b99..8ca5568f51cfc7 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_and_compound_stmt_on_same_line_in_block.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_and_compound_stmt_on_same_line_in_block.py.snap @@ -115,4 +115,3 @@ Module( 1 | if True: pass if False: pass 2 | if True: pass; if False: pass | ^^ Syntax Error: Compound statements are not allowed on the same line as simple statements - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_stmts_on_same_line.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_stmts_on_same_line.py.snap index 2fdd57a51a6fe2..4a6746ba538bac 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_stmts_on_same_line.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_stmts_on_same_line.py.snap @@ -153,7 +153,6 @@ Module( 2 | a + b c + d 3 | break; continue pass; continue break | ^^^^ Syntax Error: Simple statements must be separated by newlines or semicolons - | | @@ -161,4 +160,3 @@ Module( 2 | a + b c + d 3 | break; continue pass; continue break | ^^^^^ Syntax Error: Simple statements must be separated by newlines or semicolons - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_stmts_on_same_line_in_block.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_stmts_on_same_line_in_block.py.snap index 99af157a8ee650..9f757bf464c5b2 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_stmts_on_same_line_in_block.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@simple_stmts_on_same_line_in_block.py.snap @@ -65,10 +65,8 @@ Module( | 1 | if True: break; continue pass; continue break | ^^^^ Syntax Error: Simple statements must be separated by newlines or semicolons - | | 1 | if True: break; continue pass; continue break | ^^^^^ Syntax Error: Simple statements must be separated by newlines or semicolons - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@single_star_for.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@single_star_for.py.snap index ad76a4b9a2a710..f1a7ec5d751985 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@single_star_for.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@single_star_for.py.snap @@ -117,4 +117,3 @@ Module( 1 | for _ in *x: ... 2 | for *x in xs: ... | ^^ Syntax Error: Starred expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@single_star_return.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@single_star_return.py.snap index c9515b946ec96b..46af64432464cd 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@single_star_return.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@single_star_return.py.snap @@ -68,4 +68,3 @@ Module( | 1 | def f(): return *x | ^^ Syntax Error: Starred expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@single_star_yield.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@single_star_yield.py.snap index e4eaafb75c0345..e95f6482b7998a 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@single_star_yield.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@single_star_yield.py.snap @@ -74,4 +74,3 @@ Module( | 1 | def f(): yield *x | ^^ Syntax Error: Starred expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@single_starred_assignment_target.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@single_starred_assignment_target.py.snap index c619b3d4151d72..93661f3f07564c 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@single_starred_assignment_target.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@single_starred_assignment_target.py.snap @@ -61,4 +61,3 @@ Module( | 1 | *a = (1,) | ^^ Syntax Error: starred assignment target must be in a list or tuple - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@star_index_py310.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@star_index_py310.py.snap index 23e829c3841ef6..c10eb737d2e3c1 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@star_index_py310.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@star_index_py310.py.snap @@ -468,4 +468,3 @@ Module( 6 | lst[*a, *b] # multiple unpacks 7 | array[3:5, *idxs] # mixed with slices | ^^^^^ Syntax Error: Cannot use star expression in index on Python 3.10 (syntax was added in Python 3.11) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@star_slices.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@star_slices.py.snap index d4d9df070fccdc..48d71c4c722c98 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@star_slices.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@star_slices.py.snap @@ -81,10 +81,8 @@ Module( | 1 | array[*start:*end] | ^^^^^^ Syntax Error: Starred expression cannot be used here - | | 1 | array[*start:*end] | ^^^^ Syntax Error: Starred expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@starred_comprehension_target.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@starred_comprehension_target.py.snap index 02d17ed47a2c49..bf5f2b33ebe434 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@starred_comprehension_target.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@starred_comprehension_target.py.snap @@ -70,4 +70,3 @@ Module( | 1 | [item for *items in source] | ^^^^^^ Syntax Error: Starred expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@starred_list_comp_py314.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@starred_list_comp_py314.py.snap index 75daac8756e310..e567871623993b 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@starred_list_comp_py314.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@starred_list_comp_py314.py.snap @@ -71,4 +71,3 @@ Module( 1 | # parse_options: {"target-version": "3.14"} 2 | [*x for x in y] | ^^ Syntax Error: Cannot use iterable unpacking in a list comprehension on Python 3.14 (syntax was added in Python 3.15) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@starred_starred_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@starred_starred_expression.py.snap index 71cf34bfa139f3..5e7b922cfabd74 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@starred_starred_expression.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@starred_starred_expression.py.snap @@ -127,4 +127,3 @@ Module( 2 | *[]) 3 | print(* *[]) | ^^^ Syntax Error: Starred expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__function_type_parameters.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__function_type_parameters.py.snap index 18b90424fa117a..0b2e6cb57b5377 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__function_type_parameters.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__function_type_parameters.py.snap @@ -426,7 +426,6 @@ Module( 18 | 19 | def multiple_commas_and_recovery[A,,100](): ... | ^ Syntax Error: Expected a type parameter or the end of the type parameter list - | | @@ -434,7 +433,6 @@ Module( 18 | 19 | def multiple_commas_and_recovery[A,,100](): ... | ^^^ Syntax Error: Expected `]`, found int - | | @@ -442,7 +440,6 @@ Module( 18 | 19 | def multiple_commas_and_recovery[A,,100](): ... | ^ Syntax Error: Expected newline, found `]` - | | @@ -450,4 +447,3 @@ Module( 18 | 19 | def multiple_commas_and_recovery[A,,100](): ... | ^^ Syntax Error: Only single target (not tuple) can be annotated - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__if_extra_closing_parentheses.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__if_extra_closing_parentheses.py.snap index 126138f28ade20..a7555f2ebf6625 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__if_extra_closing_parentheses.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__if_extra_closing_parentheses.py.snap @@ -74,4 +74,3 @@ Module( 2 | if True)): 3 | pass | ^^^^ Syntax Error: Unexpected indentation - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__if_extra_indent.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__if_extra_indent.py.snap index e3796a8d1f3e12..b469e7418a1c73 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__if_extra_indent.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__if_extra_indent.py.snap @@ -596,4 +596,3 @@ Module( 49 | before_eof 50 | final_eof | ^^^^^^^^ Syntax Error: Unexpected indentation - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__invalid_assignment_targets.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__invalid_assignment_targets.py.snap index 7744b48010a38c..510a3c189c766b 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__invalid_assignment_targets.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__invalid_assignment_targets.py.snap @@ -1884,7 +1884,6 @@ Module( 41 | [[a, b], [[42]], d] = [[1, 2], [[3]], 4] 42 | (x, foo(), y) = (42, 42, 42) | ^^^^^ Syntax Error: Invalid assignment target - | ## Semantic Syntax Errors diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__invalid_augmented_assignment_target.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__invalid_augmented_assignment_target.py.snap index 4c67e9427830c4..1e0455a3d24b4a 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__invalid_augmented_assignment_target.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__invalid_augmented_assignment_target.py.snap @@ -1739,4 +1739,3 @@ Module( 33 | [[a, b], [[42]], d] += [[1, 2], [[3]], 4] 34 | (x, foo(), y) += (42, 42, 42) | ^^^^^^^^^^^^^ Syntax Error: Invalid augmented assignment target - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_2.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_2.py.snap index 4bd787208c6eda..f02af5a34e1ae6 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_2.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_2.py.snap @@ -130,11 +130,9 @@ Module( 4 | case x as y + 1j: 5 | pass | ^^^^^^^^ Syntax Error: Expected dedent, found indent - | | 4 | case x as y + 1j: 5 | pass | ^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_3.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_3.py.snap index ad4dbb0ec8d8fa..eb00a56bdde69f 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_3.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__as_pattern_3.py.snap @@ -159,11 +159,9 @@ Module( 4 | case {(x as y): 1}: 5 | pass | ^^^^^^^^ Syntax Error: Unexpected indentation - | | 4 | case {(x as y): 1}: 5 | pass | ^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_mapping_pattern.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_mapping_pattern.py.snap index 1fbaa9df86ce27..45178034fd49f8 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_mapping_pattern.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__match__invalid_mapping_pattern.py.snap @@ -646,4 +646,3 @@ Module( 22 | match subject: 23 | case {Foo(a as b): 1}: ... | ^^^^^^^^^^^ Syntax Error: Invalid mapping pattern key - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__ambiguous_lpar_with_items.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__ambiguous_lpar_with_items.py.snap index b0cefbde739d3d..441cae77b76f05 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__ambiguous_lpar_with_items.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__ambiguous_lpar_with_items.py.snap @@ -1869,7 +1869,6 @@ Module( 31 | with (item as f1) as f2: ... 32 | with (item1 as f, item2 := 0): ... | ^^^^^^^^^^ Syntax Error: Unparenthesized named expression cannot be used here - | ## Unsupported Syntax Errors diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__unclosed_ambiguous_lpar.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__unclosed_ambiguous_lpar.py.snap index 9c651474b89b5d..b1fee5d797b331 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__unclosed_ambiguous_lpar.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__unclosed_ambiguous_lpar.py.snap @@ -82,4 +82,3 @@ Module( 2 | 3 | x + y | ^ Syntax Error: unexpected EOF while parsing - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__unclosed_ambiguous_lpar_eof.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__unclosed_ambiguous_lpar_eof.py.snap index 317469f9005a54..6724cfec7005de 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__unclosed_ambiguous_lpar_eof.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__unclosed_ambiguous_lpar_eof.py.snap @@ -42,4 +42,3 @@ Module( | 1 | with ( | ^ Syntax Error: unexpected EOF while parsing - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__unparenthesized_with_items.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__unparenthesized_with_items.py.snap index daebbd0a9680b7..9f31d95dd880f6 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__unparenthesized_with_items.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__with__unparenthesized_with_items.py.snap @@ -402,4 +402,3 @@ Module( 8 | with item1 as f, *item2: pass 9 | with item := 0 as f: pass | ^^ Syntax Error: Expected `,`, found `:=` - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_empty_expression.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_empty_expression.py.snap index de21eac870cb0a..7133e8b63fcabc 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_empty_expression.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_empty_expression.py.snap @@ -119,4 +119,3 @@ Module( 2 | t"{}" 3 | t"{ }" | ^ Syntax Error: Expected an expression - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_invalid_conversion_flag_name_tok.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_invalid_conversion_flag_name_tok.py.snap index b1b3890a11c2a9..55f34a110b1da3 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_invalid_conversion_flag_name_tok.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_invalid_conversion_flag_name_tok.py.snap @@ -65,4 +65,3 @@ Module( 1 | # parse_options: {"target-version": "3.14"} 2 | t"{x!z}" | ^ Syntax Error: t-string: invalid conversion character - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_invalid_conversion_flag_other_tok.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_invalid_conversion_flag_other_tok.py.snap index ef9242f4f87306..0c729b6c50f0d3 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_invalid_conversion_flag_other_tok.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_invalid_conversion_flag_other_tok.py.snap @@ -119,4 +119,3 @@ Module( 2 | t"{x!123}" 3 | t"{x!'a'}" | ^^^ Syntax Error: t-string: invalid conversion character - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_invalid_starred_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_invalid_starred_expr.py.snap index d906c8c8370333..29393932932ac2 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_invalid_starred_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_invalid_starred_expr.py.snap @@ -221,4 +221,3 @@ Module( 4 | t"{*x and y}" 5 | t"{*yield x}" | ^^^^^^^ Syntax Error: Yield expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_lambda_without_parentheses.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_lambda_without_parentheses.py.snap index 0de7376e010ee0..b26d9cf4db8a2f 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_lambda_without_parentheses.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_lambda_without_parentheses.py.snap @@ -105,25 +105,21 @@ Module( 1 | # parse_options: {"target-version": "3.14"} 2 | t"{lambda x: x}" | ^^ Syntax Error: Expected an expression - | | 1 | # parse_options: {"target-version": "3.14"} 2 | t"{lambda x: x}" | ^^^^^^^^^ Syntax Error: t-string: lambda expressions are not allowed without parentheses - | | 1 | # parse_options: {"target-version": "3.14"} 2 | t"{lambda x: x}" | ^^ Syntax Error: t-string: expecting `}` - | | 1 | # parse_options: {"target-version": "3.14"} 2 | t"{lambda x: x}" | ^ Syntax Error: Expected an element of or the end of the t-string - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_unclosed_lbrace.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_unclosed_lbrace.py.snap index f6537ec7ee8bf4..e755d104ba5fa6 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_unclosed_lbrace.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_unclosed_lbrace.py.snap @@ -289,4 +289,3 @@ Module( 5 | t"{" 6 | t"""{""" | ^^^ Syntax Error: Expected an expression - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_unclosed_lbrace_in_format_spec.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_unclosed_lbrace_in_format_spec.py.snap index 9789ed892261c4..5efaaaebe15423 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_unclosed_lbrace_in_format_spec.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@t_string_unclosed_lbrace_in_format_spec.py.snap @@ -153,4 +153,3 @@ Module( 2 | t"hello {x:" 3 | t"hello {x:.3f" | ^ Syntax Error: t-string: expecting `}` - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@template_strings_py313.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@template_strings_py313.py.snap index 1eed6688273807..aaa2aed20ff70d 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@template_strings_py313.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@template_strings_py313.py.snap @@ -166,4 +166,3 @@ Module( 4 | / t"""what's 5 | | happening?""" | |_____________^ Syntax Error: Cannot use t-strings on Python 3.13 (syntax was added in Python 3.14) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@try_stmt_invalid_order.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@try_stmt_invalid_order.py.snap index 9f55c082517cb9..193c1c82696670 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@try_stmt_invalid_order.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@try_stmt_invalid_order.py.snap @@ -79,4 +79,3 @@ Module( 5 | else: 6 | pass | ^^^^ Syntax Error: Unexpected indentation - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@try_stmt_missing_except_finally.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@try_stmt_missing_except_finally.py.snap index cdba0803143486..6368dc0cd18226 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@try_stmt_missing_except_finally.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@try_stmt_missing_except_finally.py.snap @@ -73,4 +73,3 @@ Module( 5 | else: 6 | pass | ^ Syntax Error: Expected `except` or `finally` after `try` block - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@try_stmt_mixed_except_kind.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@try_stmt_mixed_except_kind.py.snap index 98f032e8c9c15c..62db5271c7b964 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@try_stmt_mixed_except_kind.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@try_stmt_mixed_except_kind.py.snap @@ -276,4 +276,3 @@ Module( 21 | / except* ExceptionGroup: 22 | | pass | |________^ Syntax Error: Cannot have both 'except' and 'except*' on the same 'try' - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@tuple_context_manager_py38.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@tuple_context_manager_py38.py.snap index be7cb746f5dc3d..059a866b5dd31f 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@tuple_context_manager_py38.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@tuple_context_manager_py38.py.snap @@ -188,4 +188,3 @@ Module( 10 | ): ... 11 | with (foo,): ... | ^ Syntax Error: Cannot use parentheses within a `with` statement on Python 3.8 (syntax was added in Python 3.9) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_alias_incomplete_stmt.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_alias_incomplete_stmt.py.snap index b035de8a7fa626..eb26aa58f7f835 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_alias_incomplete_stmt.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_alias_incomplete_stmt.py.snap @@ -94,4 +94,3 @@ Module( 2 | type x 3 | type x = | ^ Syntax Error: Expected an expression - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_alias_invalid_value_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_alias_invalid_value_expr.py.snap index 57d354e2fdef9a..9e9d4f715353e2 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_alias_invalid_value_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_alias_invalid_value_expr.py.snap @@ -175,7 +175,6 @@ Module( 3 | type x = yield from y 4 | type x = x := 1 | ^^ Syntax Error: Expected a statement - | ## Semantic Syntax Errors diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_default_py312.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_default_py312.py.snap index 996be97aa4fba7..d20f30583a1437 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_default_py312.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_default_py312.py.snap @@ -331,7 +331,6 @@ Module( 4 | class C[T = int](): ... 5 | class D[S, T = int, U = uint](): ... | ^^^^^ Syntax Error: Cannot set default type for a type parameter on Python 3.12 (syntax was added in Python 3.13) - | | @@ -339,4 +338,3 @@ Module( 4 | class C[T = int](): ... 5 | class D[S, T = int, U = uint](): ... | ^^^^^^ Syntax Error: Cannot set default type for a type parameter on Python 3.12 (syntax was added in Python 3.13) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_invalid_bound_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_invalid_bound_expr.py.snap index 7876c6b6ecd65f..56404f81d85a74 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_invalid_bound_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_invalid_bound_expr.py.snap @@ -289,7 +289,6 @@ Module( 3 | type X[T: yield from x] = int 4 | type X[T: x := int] = int | ^^ Syntax Error: Expected `,`, found `:=` - | ## Semantic Syntax Errors diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_missing_bound.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_missing_bound.py.snap index d029828b20c53e..4a12a66c5d60e7 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_missing_bound.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_missing_bound.py.snap @@ -126,4 +126,3 @@ Module( 1 | type X[T: ] = int 2 | type X[T1: , T2] = int | ^ Syntax Error: Expected an expression - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_param_spec_bound.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_param_spec_bound.py.snap index 351a141b60d9ca..0a0d030f520342 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_param_spec_bound.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_param_spec_bound.py.snap @@ -89,16 +89,13 @@ Module( | 1 | type X[**T: int] = int | ^ Syntax Error: Expected `]`, found `:` - | | 1 | type X[**T: int] = int | ^ Syntax Error: Expected a statement - | | 1 | type X[**T: int] = int | ^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_param_spec_invalid_default_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_param_spec_invalid_default_expr.py.snap index fd2b2f4714831e..6e215c846a687b 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_param_spec_invalid_default_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_param_spec_invalid_default_expr.py.snap @@ -353,7 +353,6 @@ Module( 4 | type X[**P = x := int] = int 5 | type X[**P = *int] = int | ^^^^ Syntax Error: Starred expression cannot be used here - | ## Semantic Syntax Errors diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_param_spec_missing_default.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_param_spec_missing_default.py.snap index 1036d8c59a90ae..180df8a3edbf4c 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_param_spec_missing_default.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_param_spec_missing_default.py.snap @@ -124,4 +124,3 @@ Module( 1 | type X[**P =] = int 2 | type X[**P =, T2] = int | ^ Syntax Error: Expected an expression - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_type_var_invalid_default_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_type_var_invalid_default_expr.py.snap index 0b4041088c037e..cc7032b9c67a6c 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_type_var_invalid_default_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_type_var_invalid_default_expr.py.snap @@ -427,7 +427,6 @@ Module( 5 | type X[T = x := int] = int 6 | type X[T: int = *int] = int | ^^^^ Syntax Error: Starred expression cannot be used here - | ## Semantic Syntax Errors diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_type_var_missing_default.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_type_var_missing_default.py.snap index 55290b5e188b28..0b4f3f21836c5e 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_type_var_missing_default.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_type_var_missing_default.py.snap @@ -188,4 +188,3 @@ Module( 2 | type X[T: int =] = int 3 | type X[T1 =, T2] = int | ^ Syntax Error: Expected an expression - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_type_var_tuple_bound.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_type_var_tuple_bound.py.snap index ae228c0e307e03..edeed69d21dec6 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_type_var_tuple_bound.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_type_var_tuple_bound.py.snap @@ -89,16 +89,13 @@ Module( | 1 | type X[*T: int] = int | ^ Syntax Error: Expected `]`, found `:` - | | 1 | type X[*T: int] = int | ^ Syntax Error: Expected a statement - | | 1 | type X[*T: int] = int | ^ Syntax Error: Expected a statement - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_type_var_tuple_invalid_default_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_type_var_tuple_invalid_default_expr.py.snap index 8cd49704ce151b..f5fd209fbec592 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_type_var_tuple_invalid_default_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_type_var_tuple_invalid_default_expr.py.snap @@ -362,7 +362,6 @@ Module( 4 | type X[*Ts = yield from x] = int 5 | type X[*Ts = x := int] = int | ^^ Syntax Error: Expected `,`, found `:=` - | ## Semantic Syntax Errors @@ -391,4 +390,3 @@ Module( 4 | type X[*Ts = yield from x] = int 5 | type X[*Ts = x := int] = int | ^^^ Syntax Error: non default type parameter `int` follows default type parameter - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_type_var_tuple_missing_default.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_type_var_tuple_missing_default.py.snap index 313733b6e5446f..f31c1fae6416de 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_type_var_tuple_missing_default.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_param_type_var_tuple_missing_default.py.snap @@ -124,4 +124,3 @@ Module( 1 | type X[*Ts =] = int 2 | type X[*Ts =, T2] = int | ^ Syntax Error: Expected an expression - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_parameter_default_order.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_parameter_default_order.py.snap index 9ce4c11a842cf3..6d6b2fe73e9984 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_parameter_default_order.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_parameter_default_order.py.snap @@ -365,4 +365,3 @@ Module( 3 | def f[T = int, U](): ... 4 | type Alias[T = int, U] = ... | ^ Syntax Error: non default type parameter `U` follows default type parameter - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_params_empty.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_params_empty.py.snap index 967dce60f483f4..d28237e35fd8a7 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_params_empty.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_params_empty.py.snap @@ -111,4 +111,3 @@ Module( 2 | pass 3 | type ListOrSet[] = list | set | ^ Syntax Error: Type parameter list cannot be empty - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_stmt_py311.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_stmt_py311.py.snap index 05bad9f457ac26..227ca0f7fe4115 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_stmt_py311.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@type_stmt_py311.py.snap @@ -43,4 +43,3 @@ Module( 1 | # parse_options: {"target-version": "3.11"} 2 | type x = int | ^^^^ Syntax Error: Cannot use `type` alias statement on Python 3.11 (syntax was added in Python 3.12) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@unparenthesized_named_expr_index_py38.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@unparenthesized_named_expr_index_py38.py.snap index 15c59e5cca4802..c144ff3d3a4412 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@unparenthesized_named_expr_index_py38.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@unparenthesized_named_expr_index_py38.py.snap @@ -64,4 +64,3 @@ Module( 1 | # parse_options: {"target-version": "3.8"} 2 | lst[x:=1] | ^^^^ Syntax Error: Cannot use unparenthesized assignment expression in a sequence index on Python 3.8 (syntax was added in Python 3.9) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@unparenthesized_named_expr_set_comp_py38.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@unparenthesized_named_expr_set_comp_py38.py.snap index f907721b0f9398..ecc5a6040e5978 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@unparenthesized_named_expr_set_comp_py38.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@unparenthesized_named_expr_set_comp_py38.py.snap @@ -100,4 +100,3 @@ Module( 1 | # parse_options: {"target-version": "3.8"} 2 | {last := x for x in range(3)} | ^^^^^^^^^ Syntax Error: Cannot use unparenthesized assignment expression as an element in a set comprehension on Python 3.8 (syntax was added in Python 3.9) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@unparenthesized_named_expr_set_literal_py38.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@unparenthesized_named_expr_set_literal_py38.py.snap index bf277fe095619f..3d999f8721c7ab 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@unparenthesized_named_expr_set_literal_py38.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@unparenthesized_named_expr_set_literal_py38.py.snap @@ -204,4 +204,3 @@ Module( 3 | {1, x := 2, 3} 4 | {1, 2, x := 3} | ^^^^^^ Syntax Error: Cannot use unparenthesized assignment expression as an element in a set literal on Python 3.8 (syntax was added in Python 3.9) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@walrus_py37.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@walrus_py37.py.snap index dc64a3105d37af..e712c5694089d4 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@walrus_py37.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@walrus_py37.py.snap @@ -49,4 +49,3 @@ Module( 1 | # parse_options: { "target-version": "3.7" } 2 | (x := 1) | ^^^^^^ Syntax Error: Cannot use named assignment expression (`:=`) on Python 3.7 (syntax was added in Python 3.8) - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@while_stmt_invalid_test_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@while_stmt_invalid_test_expr.py.snap index acdd7532add042..e6637b1f496d55 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@while_stmt_invalid_test_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@while_stmt_invalid_test_expr.py.snap @@ -211,4 +211,3 @@ Module( 3 | while a, b: ... 4 | while a := 1, b: ... | ^ Syntax Error: Expected `:`, found `,` - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@with_items_parenthesized_missing_comma.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@with_items_parenthesized_missing_comma.py.snap index 0c4b117dcf47d1..c756775e3b8fda 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@with_items_parenthesized_missing_comma.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@with_items_parenthesized_missing_comma.py.snap @@ -377,4 +377,3 @@ Module( 4 | with (item1, item2 as f1 item3, item4): ... 5 | with (item1, item2: ... | ^ Syntax Error: Expected `)`, found `:` - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@write_to_debug_expr.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@write_to_debug_expr.py.snap index cb9bd384b5885f..b23970c545bc8d 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@write_to_debug_expr.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@write_to_debug_expr.py.snap @@ -224,4 +224,3 @@ Module( 3 | __debug__ = 1 4 | x, y, __debug__, z = 1, 2, 3, 4 | ^^^^^^^^^ Syntax Error: cannot assign to `__debug__` - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@yield_after_comma.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@yield_after_comma.py.snap index 327a30a0d3733f..78d8a6437b3ee1 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@yield_after_comma.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@yield_after_comma.py.snap @@ -87,4 +87,3 @@ Module( | 1 | def f(): 1, yield 1 | ^^^^^^^ Syntax Error: Yield expression cannot be used here - | diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@yield_from_in_async_function.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@yield_from_in_async_function.py.snap index 86372e56d9e05e..f040e673c2a8d7 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@yield_from_in_async_function.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@yield_from_in_async_function.py.snap @@ -65,4 +65,3 @@ Module( | 1 | async def f(): yield from x | ^^^^^^^^^^^^ Syntax Error: `yield from` statement in async function; use `async for` instead - | diff --git a/crates/ty/tests/cli/analysis_options.rs b/crates/ty/tests/cli/analysis_options.rs index 496b9f2b6d115b..fcc20d7ab69407 100644 --- a/crates/ty/tests/cli/analysis_options.rs +++ b/crates/ty/tests/cli/analysis_options.rs @@ -31,7 +31,6 @@ fn respect_type_ignore_comments_is_turned_off() -> anyhow::Result<()> { | 2 | y = a + 5 # type: ignore | ^ - | Found 1 diagnostic @@ -81,7 +80,6 @@ fn overrides_basic() -> anyhow::Result<()> { | 2 | print(x) # type: ignore # ignore not-respected (override) | ^ - | Found 1 diagnostic @@ -137,7 +135,6 @@ fn overrides_precedence() -> anyhow::Result<()> { | 2 | print(y) # type: ignore (should be an error, because type ignores are disabled) | ^ - | Found 1 diagnostic @@ -189,14 +186,12 @@ fn overrides_inherit_global() -> anyhow::Result<()> { | 2 | print(y) # type: ignore ignore not-respected (global) | ^ - | error[unresolved-reference]: Name `y` used when not defined --> tests/test_main.py:2:7 | 2 | print(y) # type: ignore ignore respected (inherited from global) | ^ - | Found 2 diagnostics diff --git a/crates/ty/tests/cli/config_option.rs b/crates/ty/tests/cli/config_option.rs index 89e4c7266d7557..d89f5f34df84ec 100644 --- a/crates/ty/tests/cli/config_option.rs +++ b/crates/ty/tests/cli/config_option.rs @@ -16,7 +16,6 @@ fn cli_config_args_toml_string_basic() -> anyhow::Result<()> { | 1 | print(x) # [unresolved-reference] | ^ - | Found 1 diagnostic @@ -33,7 +32,6 @@ fn cli_config_args_toml_string_basic() -> anyhow::Result<()> { | 1 | print(x) # [unresolved-reference] | ^ - | Found 1 diagnostic @@ -66,7 +64,6 @@ fn cli_config_args_overrides_ty_toml() -> anyhow::Result<()> { | 1 | print(x) # [unresolved-reference] | ^ - | Found 1 diagnostic @@ -83,7 +80,6 @@ fn cli_config_args_overrides_ty_toml() -> anyhow::Result<()> { | 1 | print(x) # [unresolved-reference] | ^ - | Found 1 diagnostic @@ -105,7 +101,6 @@ fn cli_config_args_later_overrides_earlier() -> anyhow::Result<()> { | 1 | print(x) # [unresolved-reference] | ^ - | Found 1 diagnostic @@ -164,7 +159,6 @@ fn config_file_override() -> anyhow::Result<()> { | 1 | print(x) # [unresolved-reference] | ^ - | Found 1 diagnostic @@ -181,7 +175,6 @@ fn config_file_override() -> anyhow::Result<()> { | 1 | print(x) # [unresolved-reference] | ^ - | Found 1 diagnostic diff --git a/crates/ty/tests/cli/exit_code.rs b/crates/ty/tests/cli/exit_code.rs index 784d7bbe848c4f..85eceea528ffa1 100644 --- a/crates/ty/tests/cli/exit_code.rs +++ b/crates/ty/tests/cli/exit_code.rs @@ -15,7 +15,6 @@ fn only_warnings() -> anyhow::Result<()> { | 1 | print(x) # [unresolved-reference] | ^ - | Found 1 diagnostic @@ -85,7 +84,6 @@ fn only_info() -> anyhow::Result<()> { | 3 | reveal_type(1) | ^ `Literal[1]` - | Found 1 diagnostic @@ -114,7 +112,6 @@ fn only_info_and_error_on_warning_is_true() -> anyhow::Result<()> { | 3 | reveal_type(1) | ^ `Literal[1]` - | Found 1 diagnostic @@ -146,7 +143,6 @@ fn only_warnings_and_error_on_warning_overrides_configuration() -> anyhow::Resul | 1 | print(x) # [unresolved-reference] | ^ - | Found 1 diagnostic @@ -178,7 +174,6 @@ fn only_warnings_and_error_on_warning_is_disabled_in_configuration() -> anyhow:: | 1 | print(x) # [unresolved-reference] | ^ - | Found 1 diagnostic @@ -207,14 +202,12 @@ fn both_warnings_and_errors() -> anyhow::Result<()> { | 2 | print(x) # [unresolved-reference] | ^ - | error[not-subscriptable]: Cannot subscript object of type `Literal[4]` with no `__getitem__` method --> test.py:3:7 | 3 | print(4[1]) # [not-subscriptable] | ^^^^ - | Found 2 diagnostics @@ -243,14 +236,12 @@ fn both_warnings_and_errors_and_exit_zero_on_warning() -> anyhow::Result<()> { | 2 | print(x) # [unresolved-reference] | ^ - | error[not-subscriptable]: Cannot subscript object of type `Literal[4]` with no `__getitem__` method --> test.py:3:7 | 3 | print(4[1]) # [not-subscriptable] | ^^^^ - | Found 2 diagnostics @@ -279,14 +270,12 @@ fn exit_zero_is_true() -> anyhow::Result<()> { | 2 | print(x) # [unresolved-reference] | ^ - | error[not-subscriptable]: Cannot subscript object of type `Literal[4]` with no `__getitem__` method --> test.py:3:7 | 3 | print(4[1]) # [not-subscriptable] | ^^^^ - | Found 2 diagnostics diff --git a/crates/ty/tests/cli/file_selection.rs b/crates/ty/tests/cli/file_selection.rs index 7046d1deb19752..5d2a082659d624 100644 --- a/crates/ty/tests/cli/file_selection.rs +++ b/crates/ty/tests/cli/file_selection.rs @@ -124,14 +124,12 @@ fn exclude_argument() -> anyhow::Result<()> { | 2 | print(undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^ - | error[unresolved-reference]: Name `temp_undefined_var` used when not defined --> temp_file.py:2:7 | 2 | print(temp_undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^^^^^^ - | Found 2 diagnostics @@ -148,7 +146,6 @@ fn exclude_argument() -> anyhow::Result<()> { | 2 | print(undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^ - | Found 1 diagnostic @@ -200,7 +197,6 @@ fn configuration_include() -> anyhow::Result<()> { | 2 | print(undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^ - | Found 1 diagnostic @@ -225,14 +221,12 @@ fn configuration_include() -> anyhow::Result<()> { | 2 | print(other_undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^^^^^^^ - | error[unresolved-reference]: Name `undefined_var` used when not defined --> src/main.py:2:7 | 2 | print(undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^ - | Found 2 diagnostics @@ -290,7 +284,6 @@ fn configuration_include_no_extension() -> anyhow::Result<()> { | 2 | print(undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^ - | Found 1 diagnostic @@ -342,14 +335,12 @@ fn configuration_exclude() -> anyhow::Result<()> { | 2 | print(undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^ - | error[unresolved-reference]: Name `temp_undefined_var` used when not defined --> temp_file.py:2:7 | 2 | print(temp_undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^^^^^^ - | Found 2 diagnostics @@ -374,7 +365,6 @@ fn configuration_exclude() -> anyhow::Result<()> { | 2 | print(undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^ - | Found 1 diagnostic @@ -427,7 +417,6 @@ fn exclude_precedence_over_include() -> anyhow::Result<()> { | 2 | print(undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^ - | Found 1 diagnostic @@ -479,7 +468,6 @@ fn exclude_argument_precedence_include_argument() -> anyhow::Result<()> { | 2 | print(undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^ - | Found 1 diagnostic @@ -517,7 +505,6 @@ fn remove_default_exclude() -> anyhow::Result<()> { | 2 | print(undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^ - | Found 1 diagnostic @@ -542,14 +529,12 @@ fn remove_default_exclude() -> anyhow::Result<()> { | 2 | print(another_undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^^^^^^^^^ - | error[unresolved-reference]: Name `undefined_var` used when not defined --> src/main.py:2:7 | 2 | print(undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^ - | Found 2 diagnostics @@ -596,7 +581,6 @@ fn cli_removes_config_exclude() -> anyhow::Result<()> { | 2 | print(undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^ - | Found 1 diagnostic @@ -613,14 +597,12 @@ fn cli_removes_config_exclude() -> anyhow::Result<()> { | 2 | print(build_undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^^^^^^^ - | error[unresolved-reference]: Name `undefined_var` used when not defined --> src/main.py:2:7 | 2 | print(undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^ - | Found 2 diagnostics @@ -671,7 +653,6 @@ fn explicit_path_overrides_exclude() -> anyhow::Result<()> { | 2 | print(undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^ - | Found 1 diagnostic @@ -688,7 +669,6 @@ fn explicit_path_overrides_exclude() -> anyhow::Result<()> { | 2 | print(dist_undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^^^^^^ - | Found 1 diagnostic @@ -705,7 +685,6 @@ fn explicit_path_overrides_exclude() -> anyhow::Result<()> { | 2 | print(other_undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^^^^^^^ - | Found 1 diagnostic @@ -756,14 +735,12 @@ fn explicit_path_overrides_exclude_force_exclude() -> anyhow::Result<()> { | 2 | print(undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^ - | error[unresolved-reference]: Name `dist_undefined_var` used when not defined --> tests/generated.py:2:7 | 2 | print(dist_undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^^^^^^ - | Found 2 diagnostics @@ -780,7 +757,6 @@ fn explicit_path_overrides_exclude_force_exclude() -> anyhow::Result<()> { | 2 | print(undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^ - | Found 1 diagnostic @@ -797,14 +773,12 @@ fn explicit_path_overrides_exclude_force_exclude() -> anyhow::Result<()> { | 2 | print(other_undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^^^^^^^ - | error[unresolved-reference]: Name `undefined_var` used when not defined --> src/main.py:2:7 | 2 | print(undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^ - | Found 2 diagnostics @@ -821,7 +795,6 @@ fn explicit_path_overrides_exclude_force_exclude() -> anyhow::Result<()> { | 2 | print(undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^ - | Found 1 diagnostic @@ -868,14 +841,12 @@ fn force_exclude_directory_exclusion() -> anyhow::Result<()> { | 3 | if base_path not in CMAKE_PREFIX_PATH: | ^^^^^^^^^^^^^^^^^ - | error[unresolved-reference]: Name `CMAKE_PREFIX_PATH` used when not defined --> out/amd64/install/_setup_util.py:4:5 | 4 | CMAKE_PREFIX_PATH.insert(0, base_path) | ^^^^^^^^^^^^^^^^^ - | Found 2 diagnostics @@ -935,14 +906,12 @@ fn cli_and_configuration_exclude() -> anyhow::Result<()> { | 2 | print(other_undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^^^^^^^ - | error[unresolved-reference]: Name `undefined_var` used when not defined --> src/main.py:2:7 | 2 | print(undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^ - | Found 2 diagnostics @@ -958,7 +927,6 @@ fn cli_and_configuration_exclude() -> anyhow::Result<()> { | 2 | print(undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^ - | Found 1 diagnostic @@ -1142,14 +1110,12 @@ print(other_undefined) # error: unresolved-reference | 3 | return missing_value # error: unresolved-reference | ^^^^^^^^^^^^^ - | error[unresolved-reference]: Name `undefined_var` used when not defined --> main.py:5:7 | 5 | print(undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^ - | Found 2 diagnostics @@ -1166,7 +1132,6 @@ print(other_undefined) # error: unresolved-reference | 5 | print(undefined_var) # error: unresolved-reference | ^^^^^^^^^^^^^ - | Found 1 diagnostic @@ -1219,21 +1184,18 @@ print(regular_undefined) # error: unresolved-reference | 2 | print(regular_undefined) # error: unresolved-reference | ^^^^^^^^^^^^^^^^^ - | error[unresolved-reference]: Name `undefined_var` used when not defined --> src/module.py:3:12 | 3 | return undefined_var # error: unresolved-reference | ^^^^^^^^^^^^^ - | error[unresolved-reference]: Name `missing_value` used when not defined --> src/utils.py:3:12 | 3 | return missing_value # error: unresolved-reference | ^^^^^^^^^^^^^ - | Found 3 diagnostics @@ -1250,21 +1212,18 @@ print(regular_undefined) # error: unresolved-reference | 3 | return undefined_var # error: unresolved-reference | ^^^^^^^^^^^^^ - | error[unresolved-reference]: Name `missing_value` used when not defined --> generated_utils.py:3:12 | 3 | return missing_value # error: unresolved-reference | ^^^^^^^^^^^^^ - | error[unresolved-reference]: Name `regular_undefined` used when not defined --> regular.py:2:7 | 2 | print(regular_undefined) # error: unresolved-reference | ^^^^^^^^^^^^^^^^^ - | Found 3 diagnostics @@ -1281,7 +1240,6 @@ print(regular_undefined) # error: unresolved-reference | 3 | return undefined_var # error: unresolved-reference | ^^^^^^^^^^^^^ - | Found 1 diagnostic diff --git a/crates/ty/tests/cli/fixes.rs b/crates/ty/tests/cli/fixes.rs index 03cdb6abe0e229..b751e0d11073da 100644 --- a/crates/ty/tests/cli/fixes.rs +++ b/crates/ty/tests/cli/fixes.rs @@ -140,21 +140,18 @@ fn add_ignore_unfixable() -> anyhow::Result<()> { | 6 | reveal_type(x) # ty: ignore[undefined-reveal] | ^ `Unknown` - | error[unresolved-reference]: Name `x` used when not defined --> has_syntax_error.py:1:7 | 1 | print(x # [unresolved-reference] | ^ - | error[invalid-syntax]: unexpected EOF while parsing --> has_syntax_error.py:1:34 | 1 | print(x # [unresolved-reference] | ^ - | Found 3 diagnostics Added 5 ignore comments @@ -225,8 +222,6 @@ fn fix_unfixable() -> anyhow::Result<()> { ----- stdout ----- error[invalid-syntax]: unexpected EOF while parsing --> has_syntax_error.py:1:1 - | - | Found 2 diagnostics (1 fixed, 1 remaining). diff --git a/crates/ty/tests/cli/main.rs b/crates/ty/tests/cli/main.rs index 67d5672c380d3d..fa536f10f8a621 100644 --- a/crates/ty/tests/cli/main.rs +++ b/crates/ty/tests/cli/main.rs @@ -57,7 +57,6 @@ fn test_quiet_output() -> anyhow::Result<()> { | --- ^^^^^ Incompatible value of type `Literal["foo"]` | | | Declared type - | Found 1 diagnostic @@ -132,7 +131,6 @@ fn test_run_in_sub_directory() -> anyhow::Result<()> { | 1 | ~ | ^ - | Found 1 diagnostic @@ -153,7 +151,6 @@ fn test_include_hidden_files_by_default() -> anyhow::Result<()> { | 1 | ~ | ^ - | Found 1 diagnostic @@ -186,7 +183,6 @@ fn test_respect_ignore_files() -> anyhow::Result<()> { | 1 | ~ | ^ - | Found 1 diagnostic @@ -204,7 +200,6 @@ fn test_respect_ignore_files() -> anyhow::Result<()> { | 1 | ~ | ^ - | Found 1 diagnostic @@ -222,7 +217,6 @@ fn test_respect_ignore_files() -> anyhow::Result<()> { | 1 | ~ | ^ - | Found 1 diagnostic @@ -283,7 +277,6 @@ fn cli_arguments_are_relative_to_the_current_directory() -> anyhow::Result<()> { | 2 | from utils import add | ^^^^^ - | info: Searched in the following paths during module resolution: info: 1. / (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -396,7 +389,6 @@ fn user_configuration() -> anyhow::Result<()> { | 2 | y = 4 / 0 | ^^^^^ - | info: rule `division-by-zero` was selected in the configuration file error[unresolved-reference]: Name `prin` used when not defined @@ -404,7 +396,6 @@ fn user_configuration() -> anyhow::Result<()> { | 7 | prin(x) | ^^^^ - | info: rule `unresolved-reference` is enabled by default Found 2 diagnostics @@ -437,7 +428,6 @@ fn user_configuration() -> anyhow::Result<()> { | 2 | y = 4 / 0 | ^^^^^ - | info: rule `division-by-zero` was selected in the configuration file warning[unresolved-reference]: Name `prin` used when not defined @@ -445,7 +435,6 @@ fn user_configuration() -> anyhow::Result<()> { | 7 | prin(x) | ^^^^ - | info: rule `unresolved-reference` was selected in the configuration file Found 2 diagnostics @@ -494,7 +483,6 @@ fn check_specific_paths() -> anyhow::Result<()> { | 2 | from main2 import z # error: unresolved-import | ^^^^^ - | info: Searched in the following paths during module resolution: info: 1. / (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -505,7 +493,6 @@ fn check_specific_paths() -> anyhow::Result<()> { | 2 | import does_not_exist # error: unresolved-import | ^^^^^^^^^^^^^^ - | info: Searched in the following paths during module resolution: info: 1. / (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -530,7 +517,6 @@ fn check_specific_paths() -> anyhow::Result<()> { | 2 | from main2 import z # error: unresolved-import | ^^^^^ - | info: Searched in the following paths during module resolution: info: 1. / (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -541,7 +527,6 @@ fn check_specific_paths() -> anyhow::Result<()> { | 2 | import does_not_exist # error: unresolved-import | ^^^^^^^^^^^^^^ - | info: Searched in the following paths during module resolution: info: 1. / (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -602,7 +587,6 @@ fn check_file_without_extension() -> anyhow::Result<()> { | 1 | a = b | ^ - | Found 1 diagnostic @@ -841,7 +825,6 @@ fn can_handle_large_binop_expressions() -> anyhow::Result<()> { | 4 | reveal_type(total) | ^^^^^ `Literal[2000]` - | Found 1 diagnostic diff --git a/crates/ty/tests/cli/python_environment.rs b/crates/ty/tests/cli/python_environment.rs index 18c04e9025c727..2f20a098af8843 100644 --- a/crates/ty/tests/cli/python_environment.rs +++ b/crates/ty/tests/cli/python_environment.rs @@ -35,14 +35,12 @@ fn config_override_python_version() -> anyhow::Result<()> { | 5 | print(sys.last_exc) | ^^^^^^^^^^^^ - | info: The member may be available on other Python versions or platforms info: Python 3.11 was assumed when resolving the `last_exc` attribute --> pyproject.toml:3:18 | 3 | python-version = "3.11" | ^^^^^^ Python version configuration - | Found 1 diagnostic @@ -92,7 +90,6 @@ fn config_override_python_platform() -> anyhow::Result<()> { | 5 | reveal_type(sys.platform) | ^^^^^^^^^^^^ `Literal["linux"]` - | Found 1 diagnostic @@ -108,7 +105,6 @@ fn config_override_python_platform() -> anyhow::Result<()> { | 5 | reveal_type(sys.platform) | ^^^^^^^^^^^^ `LiteralString` - | Found 1 diagnostic @@ -145,14 +141,12 @@ fn config_file_annotation_showing_where_python_version_set_typing_error() -> any | 2 | PythonFinalizationError | ^^^^^^^^^^^^^^^^^^^^^^^ - | info: `PythonFinalizationError` was added as a builtin in Python 3.13 info: Python 3.12 was assumed when resolving types --> pyproject.toml:3:18 | 3 | python-version = "3.12" | ^^^^^^ Python version configuration - | Found 1 diagnostic @@ -168,7 +162,6 @@ fn config_file_annotation_showing_where_python_version_set_typing_error() -> any | 2 | PythonFinalizationError | ^^^^^^^^^^^^^^^^^^^^^^^ - | info: `PythonFinalizationError` was added as a builtin in Python 3.13 info: Python 3.12 was assumed when resolving types because it was specified on the command line @@ -202,7 +195,6 @@ fn src_subdirectory_takes_precedence_over_repo_root() -> anyhow::Result<()> { | 1 | from . import nonexistent_submodule | ^^^^^^^^^^^^^^^^^^^^^ - | Found 1 diagnostic @@ -266,7 +258,6 @@ fn python_version_inferred_from_system_installation() -> anyhow::Result<()> { | 1 | PythonFinalizationError | ^^^^^^^^^^^^^^^^^^^^^^^ - | info: `PythonFinalizationError` was added as a builtin in Python 3.13 info: Python 3.12 was assumed when resolving types because of the layout of your Python installation info: The primary `site-packages` directory of your installation was found at `lib/python3.12/site-packages/` @@ -292,7 +283,6 @@ fn python_version_inferred_from_system_installation() -> anyhow::Result<()> { | 1 | PythonFinalizationError | ^^^^^^^^^^^^^^^^^^^^^^^ - | info: `PythonFinalizationError` was added as a builtin in Python 3.13 info: Python 3.12 was assumed when resolving types because of the layout of your Python installation info: The primary `site-packages` directory of your installation was found at `lib/pypy3.12/site-packages/` @@ -321,7 +311,6 @@ fn python_version_inferred_from_system_installation() -> anyhow::Result<()> { | 1 | import string.templatelib | ^^^^^^^^^^^^^^^^^^ - | info: The stdlib module `string.templatelib` is only available on Python 3.14+ info: Python 3.13 was assumed when resolving modules because of the layout of your Python installation info: The primary `site-packages` directory of your installation was found at `lib/python3.13t/site-packages/` @@ -404,7 +393,6 @@ import colorama | 1 | import foo | ^^^ - | info: Searched in the following paths during module resolution: info: 1. /project (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -416,7 +404,6 @@ import colorama | 3 | import colorama | ^^^^^^^^ - | info: Searched in the following paths during module resolution: info: 1. /project (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -439,7 +426,6 @@ import colorama | 2 | import bar | ^^^ - | info: Searched in the following paths during module resolution: info: 1. /project (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -451,7 +437,6 @@ import colorama | 3 | import colorama | ^^^^^^^^ - | info: Searched in the following paths during module resolution: info: 1. /project (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -474,7 +459,6 @@ import colorama | 2 | import bar | ^^^ - | info: Searched in the following paths during module resolution: info: 1. /project (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -486,7 +470,6 @@ import colorama | 3 | import colorama | ^^^^^^^^ - | info: Searched in the following paths during module resolution: info: 1. /project (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -509,7 +492,6 @@ import colorama | 2 | import bar | ^^^ - | info: Searched in the following paths during module resolution: info: 1. /project (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -521,7 +503,6 @@ import colorama | 3 | import colorama | ^^^^^^^^ - | info: Searched in the following paths during module resolution: info: 1. /project (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -575,7 +556,6 @@ import bar", | 1 | import foo | ^^^ - | info: Searched in the following paths during module resolution: info: 1. / (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -622,7 +602,6 @@ fn lib64_site_packages_directory_on_unix() -> anyhow::Result<()> { | 1 | import foo, bar, baz | ^^^ - | info: Searched in the following paths during module resolution: info: 1. / (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -666,7 +645,6 @@ fn many_search_paths() -> anyhow::Result<()> { | 1 | import foo1, baz | ^^^ - | info: Searched in the following paths during module resolution: info: 1. /extra1 (extra search path specified on the CLI or in your config file) info: 2. /extra2 (extra search path specified on the CLI or in your config file) @@ -699,7 +677,6 @@ fn many_search_paths() -> anyhow::Result<()> { | 1 | import foo1, baz | ^^^ - | info: Searched in the following paths during module resolution: info: 1. /extra1 (extra search path specified on the CLI or in your config file) info: 2. /extra2 (extra search path specified on the CLI or in your config file) @@ -734,7 +711,6 @@ fn many_search_paths() -> anyhow::Result<()> { | 1 | import foo1, baz | ^^^ - | info: Searched in the following paths during module resolution: info: 1. /extra1 (extra search path specified on the CLI or in your config file) info: 2. /extra2 (extra search path specified on the CLI or in your config file) @@ -794,14 +770,12 @@ fn pyvenv_cfg_file_annotation_showing_where_python_version_set() -> anyhow::Resu | 1 | PythonFinalizationError | ^^^^^^^^^^^^^^^^^^^^^^^ - | info: `PythonFinalizationError` was added as a builtin in Python 3.13 info: Python 3.12 was assumed when resolving types because of your virtual environment --> venv/pyvenv.cfg:2:11 | 2 | version = 3.12 | ^^^^ Virtual environment metadata - | info: No Python version was specified on the command line or in a configuration file Found 1 diagnostic @@ -850,14 +824,12 @@ fn pyvenv_cfg_file_annotation_no_trailing_newline() -> anyhow::Result<()> { | 1 | PythonFinalizationError | ^^^^^^^^^^^^^^^^^^^^^^^ - | info: `PythonFinalizationError` was added as a builtin in Python 3.13 info: Python 3.12 was assumed when resolving types because of your virtual environment --> venv/pyvenv.cfg:3:23 | 3 | version = 3.12 | ^^^^ Virtual environment metadata - | info: No Python version was specified on the command line or in a configuration file Found 1 diagnostic @@ -899,13 +871,11 @@ fn config_file_annotation_showing_where_python_version_set_syntax_error() -> any | 2 | match object(): | ^^^^^ - | info: Python 3.8 was assumed when parsing syntax --> pyproject.toml:3:19 | 3 | requires-python = ">=3.8" | ^^^^^^^ Python version configuration - | Found 1 diagnostic @@ -921,7 +891,6 @@ fn config_file_annotation_showing_where_python_version_set_syntax_error() -> any | 2 | match object(): | ^^^^^ - | info: Python 3.9 was assumed when parsing syntax because it was specified on the command line Found 1 diagnostic @@ -1082,7 +1051,6 @@ fn config_file_broken_python_setting() -> anyhow::Result<()> { 10 | [tool.ty.environment] 11 | python = "not-a-directory-or-executable" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ does not point to a Python executable or a directory on disk - | Cause: No such file or directory (os error 2) "#); @@ -1172,7 +1140,6 @@ fn config_file_python_setting_directory_with_no_site_packages() -> anyhow::Resul 2 | [tool.ty.environment] 3 | python = "directory-but-no-site-packages" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Could not find a `site-packages` directory for this Python installation/executable - | "#); Ok(()) @@ -1217,7 +1184,6 @@ fn config_file_python_setting_directory_with_unsupported_python_version() -> any | 2 | version_info = 3.16.0 | ^^^^^^ - | info: Expected one of `3.7`, `3.8`, `3.9`, `3.10`, `3.11`, `3.12`, `3.13`, `3.14`, `3.15`. info: Set `environment.python-version` explicitly to override the inferred version. info: The version was inferred from your virtual environment metadata. @@ -1262,7 +1228,6 @@ fn unix_system_installation_with_no_lib_directory() -> anyhow::Result<()> { 2 | [tool.ty.environment] 3 | python = "directory-but-no-site-packages" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | "#); Ok(()) @@ -1303,28 +1268,24 @@ fn defaults_to_a_new_python_version() -> anyhow::Result<()> { | 4 | os.grantpt(1) # only available on unix, Python 3.13 or newer | ^^^^^^^^^^ - | info: The member may be available on other Python versions or platforms info: Python 3.10 was assumed when resolving the `grantpt` attribute --> ty.toml:3:18 | 3 | python-version = "3.10" | ^^^^^^ Python version configuration - | error[unresolved-import]: Module `typing` has no member `LiteralString` --> main.py:6:20 | 6 | from typing import LiteralString # added in Python 3.11 | ^^^^^^^^^^^^^ - | info: The member may be available on other Python versions or platforms info: Python 3.10 was assumed when resolving imports --> ty.toml:3:18 | 3 | python-version = "3.10" | ^^^^^^ Python version configuration - | Found 2 diagnostics @@ -1522,7 +1483,6 @@ home = ./ | 4 | from package1 import WorkingVenv | ^^^^^^^^^^^ - | Found 1 diagnostic @@ -1541,7 +1501,6 @@ home = ./ | 2 | from package1 import ActiveVenv | ^^^^^^^^^^ - | Found 1 diagnostic @@ -1560,7 +1519,6 @@ home = ./ | 3 | from package1 import ChildConda | ^^^^^^^^^^ - | Found 1 diagnostic @@ -1580,7 +1538,6 @@ home = ./ | 4 | from package1 import WorkingVenv | ^^^^^^^^^^^ - | Found 1 diagnostic @@ -1602,7 +1559,6 @@ home = ./ | 2 | from package1 import ActiveVenv | ^^^^^^^^^^ - | Found 1 diagnostic @@ -1622,7 +1578,6 @@ home = ./ | 3 | from package1 import ChildConda | ^^^^^^^^^^ - | Found 1 diagnostic @@ -1642,7 +1597,6 @@ home = ./ | 3 | from package1 import ChildConda | ^^^^^^^^^^ - | Found 1 diagnostic @@ -1662,7 +1616,6 @@ home = ./ | 5 | from package1 import BaseConda | ^^^^^^^^^ - | Found 1 diagnostic @@ -1749,7 +1702,6 @@ home = ./ | 2 | from package1 import ActiveVenv | ^^^^^^^^ - | info: Searched in the following paths during module resolution: info: 1. /project (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -1760,7 +1712,6 @@ home = ./ | 3 | from package1 import ChildConda | ^^^^^^^^ - | info: Searched in the following paths during module resolution: info: 1. /project (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -1771,7 +1722,6 @@ home = ./ | 4 | from package1 import WorkingVenv | ^^^^^^^^ - | info: Searched in the following paths during module resolution: info: 1. /project (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -1782,7 +1732,6 @@ home = ./ | 5 | from package1 import BaseConda | ^^^^^^^^ - | info: Searched in the following paths during module resolution: info: 1. /project (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -1805,7 +1754,6 @@ home = ./ | 2 | from package1 import ActiveVenv | ^^^^^^^^^^ - | Found 1 diagnostic @@ -1824,7 +1772,6 @@ home = ./ | 3 | from package1 import ChildConda | ^^^^^^^^^^ - | Found 1 diagnostic @@ -1844,7 +1791,6 @@ home = ./ | 5 | from package1 import BaseConda | ^^^^^^^^^ - | Found 1 diagnostic @@ -1866,7 +1812,6 @@ home = ./ | 2 | from package1 import ActiveVenv | ^^^^^^^^^^ - | Found 1 diagnostic @@ -1886,7 +1831,6 @@ home = ./ | 5 | from package1 import BaseConda | ^^^^^^^^^ - | Found 1 diagnostic @@ -1906,7 +1850,6 @@ home = ./ | 3 | from package1 import ChildConda | ^^^^^^^^^^ - | Found 1 diagnostic @@ -1926,7 +1869,6 @@ home = ./ | 5 | from package1 import BaseConda | ^^^^^^^^^ - | Found 1 diagnostic @@ -2058,7 +2000,6 @@ fn ty_environment_and_discovered_venv() -> anyhow::Result<()> { | 9 | from shared_package import FromLocalVenv | ^^^^^^^^^^^^^ - | Found 1 diagnostic @@ -2132,7 +2073,6 @@ fn ty_environment_and_active_environment() -> anyhow::Result<()> { | 2 | from ty_package import TyEnvClass | ^^^^^^^^^^ - | info: Searched in the following paths during module resolution: info: 1. / (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -2251,7 +2191,6 @@ fn ty_system_environment_and_local_venv() -> anyhow::Result<()> { | 3 | from system_package import SystemEnvClass | ^^^^^^^^^^^^^^ - | info: Searched in the following paths during module resolution: info: 1. / (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -2288,7 +2227,6 @@ fn src_root_deprecation_warning() -> anyhow::Result<()> { | 3 | root = "./src" | ^^^^^^^ - | Found 1 diagnostic @@ -2323,7 +2261,6 @@ fn src_root_deprecation_warning_with_environment_root() -> anyhow::Result<()> { | 3 | root = "./src" | ^^^^^^^ - | info: The `src.root` setting was ignored in favor of the `environment.root` setting Found 1 diagnostic @@ -2365,7 +2302,6 @@ fn environment_root_takes_precedence_over_src_root() -> anyhow::Result<()> { | 3 | root = "./src" | ^^^^^^^ - | info: The `src.root` setting was ignored in favor of the `environment.root` setting Found 1 diagnostic @@ -2554,7 +2490,6 @@ fn default_root_tests_package() -> anyhow::Result<()> { | 3 | from bar import bar # expected unresolved import | ^^^ - | info: Searched in the following paths during module resolution: info: 1. /src (first-party code) info: 2. / (first-party code) @@ -2624,7 +2559,6 @@ fn default_root_python_package() -> anyhow::Result<()> { | 3 | from bar import bar # expected unresolved import | ^^^ - | info: Searched in the following paths during module resolution: info: 1. /src (first-party code) info: 2. / (first-party code) @@ -2666,7 +2600,6 @@ fn default_root_python_package_pyi() -> anyhow::Result<()> { | 3 | from bar import bar # expected unresolved import | ^^^ - | info: Searched in the following paths during module resolution: info: 1. /src (first-party code) info: 2. / (first-party code) @@ -2704,7 +2637,6 @@ fn pythonpath_is_respected() -> anyhow::Result<()> { | 2 | import baz | ^^^ - | info: Searched in the following paths during module resolution: info: 1. /src (first-party code) info: 2. / (first-party code) @@ -2757,7 +2689,6 @@ fn pythonpath_multiple_dirs_is_respected() -> anyhow::Result<()> { | 2 | import baz | ^^^ - | info: Searched in the following paths during module resolution: info: 1. /src (first-party code) info: 2. / (first-party code) @@ -2769,7 +2700,6 @@ fn pythonpath_multiple_dirs_is_respected() -> anyhow::Result<()> { | 3 | import foo | ^^^ - | info: Searched in the following paths during module resolution: info: 1. /src (first-party code) info: 2. / (first-party code) diff --git a/crates/ty/tests/cli/rule_selection.rs b/crates/ty/tests/cli/rule_selection.rs index 78f6743f472143..b04e6a542ced78 100644 --- a/crates/ty/tests/cli/rule_selection.rs +++ b/crates/ty/tests/cli/rule_selection.rs @@ -27,7 +27,6 @@ fn configuration_rule_severity() -> anyhow::Result<()> { | 7 | prin(x) # unresolved-reference | ^^^^ - | info: rule `unresolved-reference` is enabled by default Found 1 diagnostic @@ -54,7 +53,6 @@ fn configuration_rule_severity() -> anyhow::Result<()> { | 2 | y = 4 / 0 | ^^^^^ - | info: rule `division-by-zero` was selected in the configuration file Found 1 diagnostic @@ -94,7 +92,6 @@ fn cli_rule_severity() -> anyhow::Result<()> { | 2 | import does_not_exit | ^^^^^^^^^^^^^ - | info: Searched in the following paths during module resolution: info: 1. / (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -106,7 +103,6 @@ fn cli_rule_severity() -> anyhow::Result<()> { | 9 | prin(x) # unresolved-reference | ^^^^ - | info: rule `unresolved-reference` is enabled by default Found 2 diagnostics @@ -134,7 +130,6 @@ fn cli_rule_severity() -> anyhow::Result<()> { | 2 | import does_not_exit | ^^^^^^^^^^^^^ - | info: Searched in the following paths during module resolution: info: 1. / (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -146,7 +141,6 @@ fn cli_rule_severity() -> anyhow::Result<()> { | 4 | y = 4 / 0 | ^^^^^ - | info: rule `division-by-zero` was selected on the command line Found 2 diagnostics @@ -185,7 +179,6 @@ fn cli_rule_severity_precedence() -> anyhow::Result<()> { | 7 | prin(x) # unresolved-reference | ^^^^ - | info: rule `unresolved-reference` is enabled by default Found 1 diagnostic @@ -213,7 +206,6 @@ fn cli_rule_severity_precedence() -> anyhow::Result<()> { | 2 | y = 4 / 0 | ^^^^^ - | info: rule `division-by-zero` was selected on the command line Found 1 diagnostic @@ -249,7 +241,6 @@ fn configuration_unknown_rules() -> anyhow::Result<()> { | 3 | division-by-zer = "warn" # incorrect rule name | ^^^^^^^^^^^^^^^ - | Found 1 diagnostic @@ -324,7 +315,6 @@ fn overrides_basic() -> anyhow::Result<()> { | 2 | y = 4 / 0 # division-by-zero: error (global) | ^^^^^ - | info: rule `division-by-zero` was selected in the configuration file error[unresolved-reference]: Name `prin` used when not defined @@ -332,7 +322,6 @@ fn overrides_basic() -> anyhow::Result<()> { | 4 | prin(x) # unresolved-reference: error (global) | ^^^^ - | info: rule `unresolved-reference` was selected in the configuration file warning[division-by-zero]: Cannot divide object of type `Literal[4]` by zero @@ -340,7 +329,6 @@ fn overrides_basic() -> anyhow::Result<()> { | 2 | y = 4 / 0 # division-by-zero: warn (override) | ^^^^^ - | info: rule `division-by-zero` was selected in the configuration file Found 3 diagnostics @@ -398,7 +386,6 @@ fn overrides_precedence() -> anyhow::Result<()> { | 2 | y = 4 / 0 # division-by-zero: warn (first override) | ^^^^^ - | info: rule `division-by-zero` was selected in the configuration file Found 1 diagnostic @@ -448,7 +435,6 @@ fn multiple_overrides_inherit_cli_rules() -> anyhow::Result<()> { | 2 | y = 4 / 0 | ^^^^^ - | Found 1 diagnostic @@ -499,7 +485,6 @@ fn overrides_exclude() -> anyhow::Result<()> { | 2 | y = 4 / 0 # division-by-zero: error (override excluded) | ^^^^^ - | info: rule `division-by-zero` was selected in the configuration file warning[division-by-zero]: Cannot divide object of type `Literal[4]` by zero @@ -507,7 +492,6 @@ fn overrides_exclude() -> anyhow::Result<()> { | 2 | y = 4 / 0 # division-by-zero: warn (override applies) | ^^^^^ - | info: rule `division-by-zero` was selected in the configuration file Found 2 diagnostics @@ -563,7 +547,6 @@ fn overrides_inherit_global() -> anyhow::Result<()> { | 2 | y = 4 / 0 # division-by-zero: warn (global) | ^^^^^ - | info: rule `division-by-zero` was selected in the configuration file error[unresolved-reference]: Name `prin` used when not defined @@ -571,7 +554,6 @@ fn overrides_inherit_global() -> anyhow::Result<()> { | 3 | prin(y) # unresolved-reference: error (global) | ^^^^ - | info: rule `unresolved-reference` was selected in the configuration file error[unresolved-reference]: Name `prin` used when not defined @@ -579,7 +561,6 @@ fn overrides_inherit_global() -> anyhow::Result<()> { | 3 | prin(y) # unresolved-reference: error (inherited from global) | ^^^^ - | info: rule `unresolved-reference` was selected in the configuration file Found 3 diagnostics @@ -716,7 +697,6 @@ fn overrides_missing_include_exclude() -> anyhow::Result<()> { | 5 | [[tool.ty.overrides]] | ^^^^^^^^^^^^^^^^^^^^^ This overrides section applies to all files - | info: It has no `include` or `exclude` option restricting the files info: Restrict the files by adding a pattern to `include` or `exclude`... info: or remove the `[[overrides]]` section and merge the configuration into the root `[rules]` table if the configuration should apply to all files @@ -726,7 +706,6 @@ fn overrides_missing_include_exclude() -> anyhow::Result<()> { | 2 | y = 4 / 0 | ^^^^^ - | info: rule `division-by-zero` was selected in the configuration file Found 2 diagnostics @@ -771,7 +750,6 @@ fn overrides_empty_include() -> anyhow::Result<()> { | 6 | include = [] # Empty include - won't match any files | ^^ This `include` list is empty - | info: Remove the `include` option to match all files or add a pattern to match specific files error[division-by-zero]: Cannot divide object of type `Literal[4]` by zero @@ -779,7 +757,6 @@ fn overrides_empty_include() -> anyhow::Result<()> { | 2 | y = 4 / 0 | ^^^^^ - | info: rule `division-by-zero` was selected in the configuration file Found 2 diagnostics @@ -823,7 +800,6 @@ fn overrides_no_actual_overrides() -> anyhow::Result<()> { | 5 | [[tool.ty.overrides]] | ^^^^^^^^^^^^^^^^^^^^^ This overrides section overrides no settings - | info: It has no `rules` or `analysis` table info: Add a `[overrides.rules]` or `[overrides.analysis]` table... info: or remove the `[[overrides]]` section if there's nothing to override @@ -833,7 +809,6 @@ fn overrides_no_actual_overrides() -> anyhow::Result<()> { | 2 | y = 4 / 0 | ^^^^^ - | info: rule `division-by-zero` was selected in the configuration file Found 2 diagnostics @@ -886,7 +861,6 @@ fn overrides_unknown_rules() -> anyhow::Result<()> { | 2 | y = 4 / 0 | ^^^^^ - | info: rule `division-by-zero` was selected in the configuration file warning[unknown-rule]: Unknown rule `division-by-zer`. Did you mean `division-by-zero`? @@ -894,14 +868,12 @@ fn overrides_unknown_rules() -> anyhow::Result<()> { | 10 | division-by-zer = "error" # incorrect rule name | ^^^^^^^^^^^^^^^ - | warning[division-by-zero]: Cannot divide object of type `Literal[4]` by zero --> tests/test_main.py:2:5 | 2 | y = 4 / 0 | ^^^^^ - | info: rule `division-by-zero` was selected in the configuration file Found 3 diagnostics @@ -972,7 +944,6 @@ fn cli_all_rules_warn() -> anyhow::Result<()> { | 2 | prin(x) # unresolved-reference | ^^^^ - | info: rule `unresolved-reference` was selected on the command line warning[unresolved-reference]: Name `x` used when not defined @@ -980,7 +951,6 @@ fn cli_all_rules_warn() -> anyhow::Result<()> { | 2 | prin(x) # unresolved-reference | ^ - | info: rule `unresolved-reference` was selected on the command line Found 2 diagnostics @@ -1026,7 +996,6 @@ fn cli_all_rules_precedence() -> anyhow::Result<()> { | 6 | prin(y) # unresolved-reference | ^^^^ - | info: rule `unresolved-reference` was selected on the command line Found 1 diagnostic @@ -1106,7 +1075,6 @@ fn configuration_all_rules() -> anyhow::Result<()> { | 6 | prin(y) # unresolved-reference | ^^^^ - | info: rule `unresolved-reference` was selected in the configuration file Found 1 diagnostic @@ -1165,7 +1133,6 @@ fn configuration_all_rules_with_rule_sorting_before_all() -> anyhow::Result<()> | ------ 11 | class Derived(Base): | ^^^^^^^ `foo` is unimplemented - | info: rule `abstract-method-in-final-class` was selected in the configuration file Found 1 diagnostic @@ -1228,7 +1195,6 @@ fn overrides_all_rules_with_rule_sorting_before_all() -> anyhow::Result<()> { | ------ 11 | class Derived(Base): | ^^^^^^^ `foo` is unimplemented - | info: rule `abstract-method-in-final-class` was selected in the configuration file Found 1 diagnostic @@ -1284,7 +1250,6 @@ fn all_overrides() -> anyhow::Result<()> { | 2 | y = 4 / 0 # division-by-zero: error (global) | ^^^^^ - | info: rule `division-by-zero` was selected in the configuration file error[unresolved-reference]: Name `prin` used when not defined @@ -1292,7 +1257,6 @@ fn all_overrides() -> anyhow::Result<()> { | 4 | prin(x) # unresolved-reference: error (global) | ^^^^ - | info: rule `unresolved-reference` was selected in the configuration file error[division-by-zero]: Cannot divide object of type `Literal[4]` by zero @@ -1300,7 +1264,6 @@ fn all_overrides() -> anyhow::Result<()> { | 2 | y = 4 / 0 # division-by-zero: error (global) | ^^^^^ - | info: rule `division-by-zero` was selected in the configuration file warning[unresolved-reference]: Name `prin` used when not defined @@ -1308,7 +1271,6 @@ fn all_overrides() -> anyhow::Result<()> { | 4 | prin(x) # unresolved-reference: warn (override) | ^^^^ - | info: rule `unresolved-reference` was selected in the configuration file Found 4 diagnostics diff --git a/crates/ty/tests/cli/scripts.rs b/crates/ty/tests/cli/scripts.rs index 885340644e22d0..e52dfa59a5774b 100644 --- a/crates/ty/tests/cli/scripts.rs +++ b/crates/ty/tests/cli/scripts.rs @@ -40,7 +40,6 @@ fn project_settings_and_overrides_do_not_apply() -> anyhow::Result<()> { | 7 | print(missing) | ^^^^^^^ - | Found 1 diagnostic @@ -87,7 +86,6 @@ fn metadata_without_tool_ty_uses_default_settings() -> anyhow::Result<()> { | --- ^^^^^^^^^^^^ Incompatible value of type `Literal["not an int"]` | | | Declared type - | Found 1 diagnostic @@ -135,7 +133,6 @@ fn environment_options() -> anyhow::Result<()> { | 12 | reveal_type(sys.version_info[:2] == (3, 12)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Literal[True]` - | Found 1 diagnostic @@ -175,7 +172,6 @@ fn inline_overrides_are_ignored() -> anyhow::Result<()> { | 13 | print(missing) | ^^^^^^^ - | Found 1 diagnostic @@ -212,7 +208,6 @@ fn inline_terminal_settings_do_not_apply() -> anyhow::Result<()> { | 10 | print(missing) | ^^^^^^^ - | Found 1 diagnostic @@ -258,7 +253,6 @@ fn inline_settings_override_user_configuration() -> anyhow::Result<()> { | 10 | print(missing) # type: ignore | ^^^^^^^ - | Found 1 diagnostic @@ -301,14 +295,12 @@ fn user_configuration_applies() -> anyhow::Result<()> { | 6 | print(missing) | ^^^^^^^ - | warning[unresolved-reference]: Name `suppressed` used when not defined --> script.py:7:7 | 7 | print(suppressed) # type: ignore | ^^^^^^^^^^ - | Found 2 diagnostics @@ -351,7 +343,6 @@ fn cli_arguments_override_script_options() -> anyhow::Result<()> { | 10 | print(missing) | ^^^^^^^ - | Found 1 diagnostic @@ -403,7 +394,6 @@ fn explicit_config_replaces_inline_metadata() -> anyhow::Result<()> { | 10 | print(missing) | ^^^^^^^ - | Found 1 diagnostic diff --git a/crates/ty_ide/src/all_symbols.rs b/crates/ty_ide/src/all_symbols.rs index 3b62813e0a2447..ab25c746fa0172 100644 --- a/crates/ty_ide/src/all_symbols.rs +++ b/crates/ty_ide/src/all_symbols.rs @@ -615,7 +615,6 @@ def zqzqzq(): | 2 | from pandas.io.api import zqzqzq | ^^^^^^ - | info: Function zqzqzq "); } @@ -660,7 +659,6 @@ def zqzqzq(): | 2 | from pandas.io.api import zqzqzq as zqzqzq | ^^^^^^ - | info: Function zqzqzq "); } @@ -705,7 +703,6 @@ def zqzqzq(): | 2 | from pandas.io.api import * | ^ - | info: Function zqzqzq "); @@ -763,7 +760,6 @@ def zqzqzq(): | 2 | from pandas.io.parsers import zqzqzq | ^^^^^^ - | info: Function zqzqzq info[all-symbols]: AllSymbolInfo @@ -771,7 +767,6 @@ def zqzqzq(): | 2 | from pandas.io.parsers.readers import zqzqzq | ^^^^^^ - | info: Function zqzqzq "); } @@ -824,7 +819,6 @@ __all__ = ['zqzqzq'] | 2 | def zqzqzq(): | ^^^^^^ - | info: Function zqzqzq "); } @@ -855,7 +849,6 @@ def zqzqzq(): | 2 | def zqzqzq(): | ^^^^^^ - | info: Function zqzqzq info[all-symbols]: AllSymbolInfo @@ -863,7 +856,6 @@ def zqzqzq(): | 1 | from pandas import zqzqzq as zqzqzq | ^^^^^^ - | info: Function zqzqzq "); } @@ -897,7 +889,6 @@ def zqzqzq(): | 2 | def zqzqzq(): | ^^^^^^ - | info: Function zqzqzq info[all-symbols]: AllSymbolInfo @@ -905,7 +896,6 @@ def zqzqzq(): | 1 | from pandas import zqzqzq as zqzqzq | ^^^^^^ - | info: Function zqzqzq info[all-symbols]: AllSymbolInfo @@ -913,7 +903,6 @@ def zqzqzq(): | 1 | from pandas import zqzqzq as zqzqzq | ^^^^^^ - | info: Function zqzqzq "); } @@ -955,7 +944,6 @@ ABCDEFGHIJKLMNOP = 'https://api.example.com' | 2 | ABCDEFGHIJKLMNOP = 'https://api.example.com' | ^^^^^^^^^^^^^^^^ - | info: Constant ABCDEFGHIJKLMNOP info[all-symbols]: AllSymbolInfo @@ -963,7 +951,6 @@ ABCDEFGHIJKLMNOP = 'https://api.example.com' | 2 | class Abcdefghijklmnop: | ^^^^^^^^^^^^^^^^ - | info: Class Abcdefghijklmnop info[all-symbols]: AllSymbolInfo @@ -971,7 +958,6 @@ ABCDEFGHIJKLMNOP = 'https://api.example.com' | 2 | def abcdefghijklmnop(): | ^^^^^^^^^^^^^^^^ - | info: Function abcdefghijklmnop "); } @@ -1002,7 +988,6 @@ def test_helper_xyzxyzxyz(): | 2 | def test_helper_xyzxyzxyz(): | ^^^^^^^^^^^^^^^^^^^^^ - | info: Function test_helper_xyzxyzxyz "); } @@ -1038,7 +1023,6 @@ def test_helper_xyzxyzxyz(): | 1 | def helper_xyzxyzxyz(): pass | ^^^^^^^^^^^^^^^^ - | info: Function helper_xyzxyzxyz info[all-symbols]: AllSymbolInfo @@ -1046,7 +1030,6 @@ def test_helper_xyzxyzxyz(): | 1 | def useful_xyzxyzxyz(): pass | ^^^^^^^^^^^^^^^^ - | info: Function useful_xyzxyzxyz "); } @@ -1071,7 +1054,6 @@ def test_helper_xyzxyzxyz(): | 1 | ZQZQZQ = 1 | ^^^^^^ - | info: Constant ZQZQZQ info[all-symbols]: AllSymbolInfo @@ -1079,7 +1061,6 @@ def test_helper_xyzxyzxyz(): | 1 | ZQZQZQ = 1 | ^^^^^^ - | info: Constant ZQZQZQ info[all-symbols]: AllSymbolInfo @@ -1087,7 +1068,6 @@ def test_helper_xyzxyzxyz(): | 1 | ZQZQZQ = 1 | ^^^^^^ - | info: Constant ZQZQZQ info[all-symbols]: AllSymbolInfo @@ -1095,7 +1075,6 @@ def test_helper_xyzxyzxyz(): | 1 | ZQZQZQ = 1 | ^^^^^^ - | info: Constant ZQZQZQ "); } @@ -1119,7 +1098,6 @@ def test_helper_xyzxyzxyz(): | 1 | ZQZQZQ = 1 | ^^^^^^ - | info: Constant ZQZQZQ "); } diff --git a/crates/ty_ide/src/call_hierarchy.rs b/crates/ty_ide/src/call_hierarchy.rs index 7fd38b180cb359..6b1f0ec596a0db 100644 --- a/crates/ty_ide/src/call_hierarchy.rs +++ b/crates/ty_ide/src/call_hierarchy.rs @@ -246,7 +246,6 @@ mod tests { | 2 | def foo(): | ^^^ - | "); } @@ -264,7 +263,6 @@ mod tests { | 2 | class MyClass: | ^^^^^^^ - | "); } @@ -283,7 +281,6 @@ mod tests { | 3 | def method(self): | ^^^^^^ - | "); } @@ -303,7 +300,6 @@ mod tests { | 2 | def foo(): | ^^^ - | "); } @@ -340,21 +336,18 @@ mod tests { | 5 | def foo(x: int) -> int: ... | ^^^ - | info[prepare-call-hierarchy]: Function: `foo` (`main`) --> main.py:7:5 | 7 | def foo(x: str) -> str: ... | ^^^ - | info[prepare-call-hierarchy]: Function: `foo` (`main`) --> main.py:8:5 | 8 | def foo(x): | ^^^ - | "); } @@ -374,7 +367,6 @@ mod tests { | 2 | async def foo(): | ^^^ - | "); } @@ -394,7 +386,6 @@ mod tests { | 4 | def method(): | ^^^^^^ - | "); } @@ -414,7 +405,6 @@ mod tests { | 4 | def method(cls): | ^^^^^^ - | "); } } diff --git a/crates/ty_ide/src/call_hierarchy/incoming_calls.rs b/crates/ty_ide/src/call_hierarchy/incoming_calls.rs index 69e0d9fae00264..68516e8d34f992 100644 --- a/crates/ty_ide/src/call_hierarchy/incoming_calls.rs +++ b/crates/ty_ide/src/call_hierarchy/incoming_calls.rs @@ -579,13 +579,11 @@ mod tests { | 6 | foo() | ^^^ Call site - | info: Function: `caller` (`main`) --> main.py:5:5 | 5 | def caller(): | ^^^^^^ - | "); } @@ -607,13 +605,11 @@ mod tests { | 7 | foo() # this is a call — should appear once | ^^^ Call site - | info: Function: `caller` (`main`) --> main.py:5:5 | 5 | def caller(): | ^^^^^^ - | "); } @@ -643,13 +639,11 @@ def use(): | 5 | foo() | ^^^ Call site - | info: Function: `use` (`caller`) --> caller.py:4:5 | 4 | def use(): | ^^^ - | "); } @@ -679,13 +673,11 @@ def use(): | 5 | bar() | ^^^ Call site - | info: Function: `use` (`caller`) --> caller.py:4:5 | 4 | def use(): | ^^^ - | "); } @@ -716,13 +708,11 @@ def invoke(value: Callable) -> int: | 5 | return value() | ^^^^^ Call site - | info: Function: `invoke` (`caller`) --> caller.py:4:5 | 4 | def invoke(value: Callable) -> int: | ^^^^^^ - | "); } @@ -743,13 +733,11 @@ def invoke(value: Callable) -> int: | 6 | foo(x=1) | ^^^ Call site - | info: Function: `caller` (`main`) --> main.py:5:5 | 5 | def caller(): | ^^^^^^ - | "); } @@ -769,7 +757,6 @@ def invoke(value: Callable) -> int: | 5 | foo() | ^^^ Call site - | info: Module: `main` --> main.py:1:1 "); @@ -794,7 +781,6 @@ def invoke(value: Callable) -> int: | 5 | @foo | ^^^ Call site - | info: Module: `main` --> main.py:1:1 "); @@ -825,13 +811,11 @@ class C: | 9 | def method(self, value=default()): | ^^^^^^^ Call site - | info: Class: `C` (`main`) --> main.py:7:7 | 7 | class C: | ^ - | "); } @@ -859,13 +843,11 @@ class C: | 11 | a.foo() | ^^^ Call site - | info: Function: `use` (`main`) --> main.py:10:5 | 10 | def use(a: A, b: B): | ^^^ - | "); } @@ -890,13 +872,11 @@ class C: | 8 | super().m() | ^ Call site - | info: Method: `m` (`main`) --> main.py:7:9 | 7 | def m(self): | ^ - | "); } @@ -927,13 +907,11 @@ def make() -> C: | 5 | return C() | ^ Call site - | info: Function: `make` (`caller`) --> caller.py:4:5 | 4 | def make() -> C: | ^^^^ - | "); } @@ -962,13 +940,11 @@ def make() -> C: | 8 | return c.prop | ^^^^ Call site - | info: Function: `read` (`main`) --> main.py:7:5 | 7 | def read(c: C) -> int: | ^^^^ - | "); } @@ -1000,13 +976,11 @@ def make() -> C: | 12 | c.prop = 5 | ^^^^ Call site - | info: Function: `write` (`main`) --> main.py:11:5 | 11 | def write(c: C) -> None: | ^^^^^ - | "); } @@ -1036,13 +1010,11 @@ def make() -> C: | 12 | del c.prop | ^^^^ Call site - | info: Function: `remove` (`main`) --> main.py:11:5 | 11 | def remove(c: C) -> None: | ^^^^^^ - | "); } @@ -1099,13 +1071,11 @@ def make() -> C: | 7 | return c.method() | ^^^^^^ Call site - | info: Function: `use` (`main`) --> main.py:6:5 | 6 | def use(c: C) -> int: | ^^^ - | "); } @@ -1148,13 +1118,11 @@ def make() -> C: | 5 | f = lambda x: target(x) | ^^^^^^ Call site - | info: Function: `(lambda)` (`main`) --> main.py:5:5 | 5 | f = lambda x: target(x) | ^^^^^^^^ - | "); let Some(target) = test .prepare_calls() @@ -1191,26 +1159,22 @@ def make() -> C: | 5 | a = lambda x: target(x) | ^^^^^^ Call site - | info: Function: `(lambda)` (`main`) --> main.py:5:5 | 5 | a = lambda x: target(x) | ^^^^^^^^ - | info[incoming-calls]: Incoming calls to `target` --> main.py:6:13 | 6 | b = lambda: target(0) | ^^^^^^ Call site - | info: Function: `(lambda)` (`main`) --> main.py:6:5 | 6 | b = lambda: target(0) | ^^^^^^ - | "); } @@ -1235,13 +1199,11 @@ def make() -> C: | 6 | f = lambda x: target(x) | ^^^^^^ Call site - | info: Function: `(lambda)` (`main`) --> main.py:6:9 | 6 | f = lambda x: target(x) | ^^^^^^^^ - | "); } @@ -1265,13 +1227,11 @@ def make() -> C: | 6 | return [target(x) for x in xs] | ^^^^^^ Call site - | info: Function: `caller` (`main`) --> main.py:5:5 | 5 | def caller(xs): | ^^^^^^ - | "); } diff --git a/crates/ty_ide/src/call_hierarchy/outgoing_calls.rs b/crates/ty_ide/src/call_hierarchy/outgoing_calls.rs index 647dfd76d7e9b9..47d8b8e4e7659d 100644 --- a/crates/ty_ide/src/call_hierarchy/outgoing_calls.rs +++ b/crates/ty_ide/src/call_hierarchy/outgoing_calls.rs @@ -368,13 +368,11 @@ mod tests { | 6 | helper() | ^^^^^^ Call site - | info: Function: `helper` (`main`) --> main.py:2:5 | 2 | def helper(): | ^^^^^^ - | "); } @@ -396,13 +394,11 @@ mod tests { | 7 | c.m() | ^ Call site - | info: Method: `m` (`main`) --> main.py:3:9 | 3 | def m(self): | ^ - | "); } @@ -423,13 +419,11 @@ mod tests { | 6 | C() | ^ Call site - | info: Class: `C` (`main`) --> main.py:2:7 | 2 | class C: | ^ - | "); } @@ -453,13 +447,11 @@ mod tests { | ^^^^^^ Call site 7 | helper() | ^^^^^^ Call site - | info: Function: `helper` (`main`) --> main.py:2:5 | 2 | def helper(): | ^^^^^^ - | "); } @@ -521,65 +513,55 @@ mod tests { | 17 | @cls_deco | ^^^^^^^^ Call site - | info: Function: `cls_deco` (`main`) --> main.py:2:5 | 2 | def cls_deco(cls): | ^^^^^^^^ - | info[outgoing-calls]: Outgoing calls from `Cls` --> main.py:18:11 | 18 | class Cls(base_factory()): | ^^^^^^^^^^^^ Call site - | info: Function: `base_factory` (`main`) --> main.py:5:5 | 5 | def base_factory(): | ^^^^^^^^^^^^ - | info[outgoing-calls]: Outgoing calls from `Cls` --> main.py:19:12 | 19 | attr = class_body_helper() | ^^^^^^^^^^^^^^^^^ Call site - | info: Function: `class_body_helper` (`main`) --> main.py:8:5 | 8 | def class_body_helper(): | ^^^^^^^^^^^^^^^^^ - | info[outgoing-calls]: Outgoing calls from `Cls` --> main.py:21:6 | 21 | @method_deco | ^^^^^^^^^^^ Call site - | info: Function: `method_deco` (`main`) --> main.py:11:5 | 11 | def method_deco(fn): | ^^^^^^^^^^^ - | info[outgoing-calls]: Outgoing calls from `Cls` --> main.py:22:19 | 22 | def m(self, x=default_factory()): | ^^^^^^^^^^^^^^^ Call site - | info: Function: `default_factory` (`main`) --> main.py:14:5 | 14 | def default_factory(): | ^^^^^^^^^^^^^^^ - | "); } @@ -605,13 +587,11 @@ mod tests { | 8 | nested() | ^^^^^^ Call site - | info: Function: `nested` (`main`) --> main.py:6:9 | 6 | def nested(): | ^^^^^^ - | "); } @@ -634,13 +614,11 @@ mod tests { | 5 | def foo(x=default_factory()): | ^^^^^^^^^^^^^^^ Call site - | info: Function: `default_factory` (`main`) --> main.py:2:5 | 2 | def default_factory(): | ^^^^^^^^^^^^^^^ - | "); } @@ -663,13 +641,11 @@ mod tests { | 5 | class Derived(base_factory()): | ^^^^^^^^^^^^ Call site - | info: Function: `base_factory` (`main`) --> main.py:2:5 | 2 | def base_factory(): | ^^^^^^^^^^^^ - | "); } @@ -698,13 +674,11 @@ mod tests { | 9 | f = lambda x=default_factory(): lambda_body_helper() | ^^^^^^^^^^^^^^^ Call site - | info: Function: `default_factory` (`main`) --> main.py:2:5 | 2 | def default_factory(): | ^^^^^^^^^^^^^^^ - | "); } @@ -723,26 +697,22 @@ mod tests { | LL | print("hi") # builtins resolve via stubs, so this *does* appear | ^^^^^ Call site - | info: Function: `print` (`builtins`) --> stdlib/builtins.pyi:LL:5 | LL | def print( | ^^^^^ - | info[outgoing-calls]: Outgoing calls from `foo` --> main.py:LL:5 | LL | print("hi") # builtins resolve via stubs, so this *does* appear | ^^^^^ Call site - | info: Function: `print` (`builtins`) --> stdlib/builtins.pyi:LL:5 | LL | def print( | ^^^^^ - | "#); } @@ -767,26 +737,22 @@ mod tests { | 8 | super().m() | ^ Call site - | info: Method: `m` (`main`) --> main.py:3:9 | 3 | def m(self): | ^ - | info[outgoing-calls]: Outgoing calls from `m` --> main.py:LL:9 | LL | super().m() | ^^^^^ Call site - | info: Class: `super` (`builtins`) --> stdlib/builtins.pyi:LL:7 | LL | class super: | ^^^^^ - | "); } @@ -817,13 +783,11 @@ def foo(): | 5 | helper() | ^^^^^^ Call site - | info: Function: `helper` (`lib`) --> lib.py:2:5 | 2 | def helper(): | ^^^^^^ - | "); } } diff --git a/crates/ty_ide/src/code_action.rs b/crates/ty_ide/src/code_action.rs index 2f28043eeca2ab..0246b424697d72 100644 --- a/crates/ty_ide/src/code_action.rs +++ b/crates/ty_ide/src/code_action.rs @@ -104,7 +104,6 @@ mod tests { 1 | b = a / 10 | ^ | - | - b = a / 10 1 + b = a / 10 # ty: ignore[unresolved-reference] | @@ -122,7 +121,6 @@ mod tests { 1 | b = a / 10 # fmt: off | ^ | - | - b = a / 10 # fmt: off 1 + b = a / 10 # fmt: off # ty: ignore[unresolved-reference] | @@ -152,7 +150,6 @@ mod tests { 2 | b = a / 0 # ty:ignore[division-by-zero] | ^ | - | 1 | - b = a / 0 # ty:ignore[division-by-zero] 2 + b = a / 0 # ty:ignore[division-by-zero, unresolved-reference] @@ -175,7 +172,6 @@ mod tests { 2 | b = a / 10 # ty:ignore[] | ^ | - | 1 | - b = a / 10 # ty:ignore[] 2 + b = a / 10 # ty:ignore[unresolved-reference] @@ -200,7 +196,6 @@ mod tests { 4 | b = a / 10 | ^ | - | 2 | seen_code = True - # ty:ignore[] 3 + # ty:ignore[unresolved-reference] @@ -231,7 +226,6 @@ mod tests { 3 | # ty:ignore[] # ty:ignore[not-a-rule] # ty:ignore[division-by-zero] | ^^^^^^^^^^ | - | 2 | seen_code = True - # ty:ignore[] # ty:ignore[not-a-rule] # ty:ignore[division-by-zero] 3 + # ty:ignore[ignore-comment-unknown-rule] # ty:ignore[not-a-rule] # ty:ignore[division-by-zero] @@ -261,7 +255,6 @@ mod tests { 7 | absent, | ^^^^^^ | - | 2 | seen_code = True - # ty:ignore[] 3 + # ty:ignore[unresolved-reference] @@ -293,7 +286,6 @@ mod tests { 9 | absent, | ^^^^^^ | - | 4 | seen_code = True - # ty:ignore[invalid-assignment] 5 + # ty:ignore[invalid-assignment, unresolved-reference] @@ -317,7 +309,6 @@ mod tests { 2 | b = a / 0 # type:ignore[ty:division-by-zero] | ^ | - | 1 | - b = a / 0 # type:ignore[ty:division-by-zero] 2 + b = a / 0 # type:ignore[ty:division-by-zero, ty:unresolved-reference] @@ -340,7 +331,6 @@ mod tests { 2 | b = a / 0 # type:ignore[mypy-code] | ^ | - | 1 | - b = a / 0 # type:ignore[mypy-code] 2 + b = a / 0 # type:ignore[mypy-code] # ty: ignore[unresolved-reference] @@ -365,7 +355,6 @@ mod tests { 4 | b = a / 0 | ^ | - | 3 | - b = a / 0 4 + b = a / 0 # ty: ignore[unresolved-reference] @@ -388,7 +377,6 @@ mod tests { 2 | b = a / 0 # ty:ignore[division-by-zero,] | ^ | - | 1 | - b = a / 0 # ty:ignore[division-by-zero,] 2 + b = a / 0 # ty:ignore[division-by-zero, unresolved-reference] @@ -411,7 +399,6 @@ mod tests { 2 | b = a / 0 # ty:ignore[division-by-zero ] | ^ | - | 1 | - b = a / 0 # ty:ignore[division-by-zero ] 2 + b = a / 0 # ty:ignore[division-by-zero, unresolved-reference ] @@ -434,7 +421,6 @@ mod tests { 2 | b = a / 0 # ty:ignore[division-by-zero] some explanation | ^ | - | 1 | - b = a / 0 # ty:ignore[division-by-zero] some explanation 2 + b = a / 0 # ty:ignore[division-by-zero] some explanation # ty: ignore[unresolved-reference] @@ -463,7 +449,6 @@ mod tests { 5 | | 0 | |_________^ | - | 2 | b = ( - a # ty:ignore[division-by-zero] 3 + a # ty:ignore[division-by-zero, unresolved-reference] @@ -493,7 +478,6 @@ mod tests { 5 | | 0 # ty:ignore[division-by-zero] | |_________^ | - | 4 | / - 0 # ty:ignore[division-by-zero] 5 + 0 # ty:ignore[division-by-zero, unresolved-reference] @@ -523,7 +507,6 @@ mod tests { 5 | | 0 # ty:ignore[division-by-zero] | |_________^ | - | 2 | b = ( - a # ty:ignore[division-by-zero] 3 + a # ty:ignore[division-by-zero, unresolved-reference] @@ -550,7 +533,6 @@ mod tests { 3 | {a} | ^ | - | 4 | more text - """ 5 + """ # ty: ignore[unresolved-reference] @@ -578,7 +560,6 @@ mod tests { 4 | a | ^ | - | 3 | { - a 4 + a # ty: ignore[unresolved-reference] @@ -604,7 +585,6 @@ mod tests { 2 | b = a + """ | ^ | - | 3 | more text - """ 4 + """ # ty: ignore[unresolved-reference] @@ -628,7 +608,6 @@ mod tests { 2 | b = a \ | ^ | - | 2 | b = a \ - + "test" 3 + + "test" # ty: ignore[unresolved-reference] @@ -655,7 +634,6 @@ mod tests { 4 | + ddd \ | ^^^ | - | 4 | + ddd \ - 5 + # ty: ignore[unresolved-reference] @@ -678,7 +656,6 @@ mod tests { | 2 | reveal_type(1) | ^^^^^^^^^^^ - | help: This is a preferred code action | 1 + from typing import reveal_type @@ -691,7 +668,6 @@ mod tests { 2 | reveal_type(1) | ^^^^^^^^^^^ | - | 1 | - reveal_type(1) 2 + reveal_type(1) # ty: ignore[undefined-reveal] @@ -714,7 +690,6 @@ mod tests { | 2 | @deprecated("do not use") | ^^^^^^^^^^ - | help: This is a preferred code action | 1 + from warnings import deprecated @@ -727,7 +702,6 @@ mod tests { 2 | @deprecated("do not use") | ^^^^^^^^^^ | - | 1 | - @deprecated("do not use") 2 + @deprecated("do not use") # ty: ignore[unresolved-reference] @@ -753,7 +727,6 @@ mod tests { | 4 | @deprecated("do not use") | ^^^^^^^^^^ - | help: This is a preferred code action | 1 + from warnings import deprecated @@ -765,7 +738,6 @@ mod tests { | 4 | @deprecated("do not use") | ^^^^^^^^^^ - | help: This is a preferred code action | 3 | @@ -780,7 +752,6 @@ mod tests { 4 | @deprecated("do not use") | ^^^^^^^^^^ | - | 3 | - @deprecated("do not use") 4 + @deprecated("do not use") # ty: ignore[unresolved-reference] @@ -804,7 +775,6 @@ mod tests { | 2 | ExecutionLoader | ^^^^^^^^^^^^^^^ - | help: This is a preferred code action | 1 + from importlib.abc import ExecutionLoader @@ -817,7 +787,6 @@ mod tests { 2 | ExecutionLoader | ^^^^^^^^^^^^^^^ | - | 1 | - ExecutionLoader 2 + ExecutionLoader # ty: ignore[unresolved-reference] @@ -844,7 +813,6 @@ mod tests { | 3 | ExecutionLoader | ^^^^^^^^^^^^^^^ - | help: This is a preferred code action | 1 + from importlib.abc import ExecutionLoader @@ -857,7 +825,6 @@ mod tests { 3 | ExecutionLoader | ^^^^^^^^^^^^^^^ | - | 2 | import importlib - ExecutionLoader 3 + ExecutionLoader # ty: ignore[unresolved-reference] @@ -881,7 +848,6 @@ mod tests { | 3 | ExecutionLoader | ^^^^^^^^^^^^^^^ - | help: This is a preferred code action | 1 + from importlib.abc import ExecutionLoader @@ -893,7 +859,6 @@ mod tests { | 3 | ExecutionLoader | ^^^^^^^^^^^^^^^ - | help: This is a preferred code action | 2 | import importlib.abc @@ -907,7 +872,6 @@ mod tests { 3 | ExecutionLoader | ^^^^^^^^^^^^^^^ | - | 2 | import importlib.abc - ExecutionLoader 3 + ExecutionLoader # ty: ignore[unresolved-reference] diff --git a/crates/ty_ide/src/doc_highlights.rs b/crates/ty_ide/src/doc_highlights.rs index 66375681e0841f..31ca4400ce0502 100644 --- a/crates/ty_ide/src/doc_highlights.rs +++ b/crates/ty_ide/src/doc_highlights.rs @@ -72,14 +72,12 @@ mod tests { | 1 | from . import module_a | ^^^^^^^^ - | info[document_highlights]: Highlight 2 (Read) --> mypackage/__init__.py:2:5 | 2 | x = module_a | ^^^^^^^^ - | "); } @@ -127,28 +125,24 @@ def calculate_sum(): | 3 | value = 10 | ^^^^^ - | info[document_highlights]: Highlight 2 (Read) --> main.py:4:15 | 4 | doubled = value * 2 | ^^^^^ - | info[document_highlights]: Highlight 3 (Read) --> main.py:5:14 | 5 | result = value + doubled | ^^^^^ - | info[document_highlights]: Highlight 4 (Read) --> main.py:6:12 | 6 | return value | ^^^^^ - | "); } @@ -170,28 +164,24 @@ def process_data(data): | 2 | def process_data(data): | ^^^^ - | info[document_highlights]: Highlight 2 (Read) --> main.py:3:8 | 3 | if data: | ^^^^ - | info[document_highlights]: Highlight 3 (Read) --> main.py:4:21 | 4 | processed = data.upper() | ^^^^ - | info[document_highlights]: Highlight 4 (Read) --> main.py:6:12 | 6 | return data | ^^^^ - | "); } @@ -213,14 +203,12 @@ calc = Calculator() | 2 | class Calculator: | ^^^^^^^^^^ - | info[document_highlights]: Highlight 2 (Read) --> main.py:6:8 | 6 | calc = Calculator() | ^^^^^^^^^^ - | "); } @@ -259,21 +247,18 @@ def test(): | 2 | a: str = "test" | ^ - | info[document_highlights]: Highlight 2 (Write) --> main.py:4:1 | 4 | a: int = 10 | ^ - | info[document_highlights]: Highlight 3 (Read) --> main.py:6:7 | 6 | print(a) | ^ - | "#); } } diff --git a/crates/ty_ide/src/document_symbols.rs b/crates/ty_ide/src/document_symbols.rs index b6bf4eee3a5bc4..23b79503458394 100644 --- a/crates/ty_ide/src/document_symbols.rs +++ b/crates/ty_ide/src/document_symbols.rs @@ -37,7 +37,6 @@ class World: | 2 | def hello(): | ^^^^^ - | info: Function hello info[document-symbols]: SymbolInfo @@ -45,7 +44,6 @@ class World: | 5 | class World: | ^^^^^ - | info: Class World info[document-symbols]: SymbolInfo @@ -53,7 +51,6 @@ class World: | 6 | def method(self): | ^^^^^^ - | info: Method method "); } @@ -96,7 +93,6 @@ def standalone_function(): | 5 | CONSTANT = 42 | ^^^^^^^^ - | info: Constant CONSTANT info[document-symbols]: SymbolInfo @@ -104,7 +100,6 @@ def standalone_function(): | 6 | variable = 'hello' | ^^^^^^^^ - | info: Variable variable info[document-symbols]: SymbolInfo @@ -112,7 +107,6 @@ def standalone_function(): | 7 | typed_global: str = 'typed' | ^^^^^^^^^^^^ - | info: Variable typed_global info[document-symbols]: SymbolInfo @@ -120,7 +114,6 @@ def standalone_function(): | 8 | annotated_only: int | ^^^^^^^^^^^^^^ - | info: Variable annotated_only info[document-symbols]: SymbolInfo @@ -128,7 +121,6 @@ def standalone_function(): | 10 | class MyClass: | ^^^^^^^ - | info: Class MyClass info[document-symbols]: SymbolInfo @@ -136,7 +128,6 @@ def standalone_function(): | 11 | class_var = 100 | ^^^^^^^^^ - | info: Field class_var info[document-symbols]: SymbolInfo @@ -144,7 +135,6 @@ def standalone_function(): | 12 | typed_class_var: str = 'class_typed' | ^^^^^^^^^^^^^^^ - | info: Field typed_class_var info[document-symbols]: SymbolInfo @@ -152,7 +142,6 @@ def standalone_function(): | 13 | annotated_class_var: float | ^^^^^^^^^^^^^^^^^^^ - | info: Field annotated_class_var info[document-symbols]: SymbolInfo @@ -160,7 +149,6 @@ def standalone_function(): | 15 | def __init__(self): | ^^^^^^^^ - | info: Constructor __init__ info[document-symbols]: SymbolInfo @@ -168,7 +156,6 @@ def standalone_function(): | 18 | def public_method(self): | ^^^^^^^^^^^^^ - | info: Method public_method info[document-symbols]: SymbolInfo @@ -176,7 +163,6 @@ def standalone_function(): | 21 | def _private_method(self): | ^^^^^^^^^^^^^^^ - | info: Method _private_method info[document-symbols]: SymbolInfo @@ -184,7 +170,6 @@ def standalone_function(): | 24 | def standalone_function(): | ^^^^^^^^^^^^^^^^^^^ - | info: Function standalone_function "); } @@ -211,7 +196,6 @@ class OuterClass: | 2 | class OuterClass: | ^^^^^^^^^^ - | info: Class OuterClass info[document-symbols]: SymbolInfo @@ -219,7 +203,6 @@ class OuterClass: | 3 | OUTER_CONSTANT = 100 | ^^^^^^^^^^^^^^ - | info: Constant OUTER_CONSTANT info[document-symbols]: SymbolInfo @@ -227,7 +210,6 @@ class OuterClass: | 5 | def outer_method(self): | ^^^^^^^^^^^^ - | info: Method outer_method info[document-symbols]: SymbolInfo @@ -235,7 +217,6 @@ class OuterClass: | 8 | class InnerClass: | ^^^^^^^^^^ - | info: Class InnerClass info[document-symbols]: SymbolInfo @@ -243,7 +224,6 @@ class OuterClass: | 9 | def inner_method(self): | ^^^^^^^^^^^^ - | info: Method inner_method "); } @@ -265,7 +245,6 @@ class Aliases: | 2 | type IntList = list[int] | ^^^^^^^ - | info: Variable IntList info[document-symbols]: SymbolInfo @@ -273,7 +252,6 @@ class Aliases: | 4 | class Aliases: | ^^^^^^^ - | info: Class Aliases info[document-symbols]: SymbolInfo @@ -281,7 +259,6 @@ class Aliases: | 5 | type Item = int | ^^^^ - | info: Variable Item "); } diff --git a/crates/ty_ide/src/find_references.rs b/crates/ty_ide/src/find_references.rs index bac9fb84b368cd..0b331e17cbd590 100644 --- a/crates/ty_ide/src/find_references.rs +++ b/crates/ty_ide/src/find_references.rs @@ -130,7 +130,6 @@ def outer(): 16 | write_nonlocal() 17 | return last | ---- - | "); } @@ -152,7 +151,6 @@ def f(items): | ---- 4 | return last | ---- - | "); } @@ -174,7 +172,6 @@ def f(items): | ---- 4 | return last | ---- - | "); } @@ -198,7 +195,6 @@ def f(items): | ---- 2 | print(last) | ---- - | "); } @@ -232,7 +228,6 @@ result = calculate_sum(value=42) 7 | # Call with keyword argument 8 | result = calculate_sum(value=42) | ----- - | "); } @@ -293,7 +288,6 @@ def outer_function(): 18 | decrement() 19 | final = counter | ------- - | "); } @@ -351,7 +345,6 @@ final_value = global_counter 17 | decrement_global() 18 | final_value = global_counter | -------------- - | "); } @@ -389,7 +382,6 @@ except ValueError as err: | --- 11 | print(f'Different error: {err}') | --- - | "); } @@ -416,7 +408,6 @@ match x: | ------- 5 | return pattern | ------- - | "); } @@ -444,7 +435,6 @@ match data: | ---- 6 | return rest | ---- - | "); } @@ -491,7 +481,6 @@ value = my_function | ----------- 14 | value = my_function | ----------- - | "); } @@ -547,7 +536,6 @@ test("test") 3 | 4 | test("test") | ---- - | "#); } @@ -594,7 +582,6 @@ cls = MyClass | 15 | cls = MyClass | ------- - | "); } @@ -618,7 +605,6 @@ cls = MyClass 3 | 4 | class MyClass: | ------- - | "#); } @@ -639,7 +625,6 @@ cls = MyClass | 2 | a: "MyClass" = 1 | ------- - | "#); } @@ -663,7 +648,6 @@ cls = MyClass 3 | 4 | class MyClass: | ------- - | "#); } @@ -701,7 +685,6 @@ cls = MyClass 3 | 4 | class MyClass: | ------- - | "#); } @@ -753,7 +736,6 @@ cls = MyClass 3 | 4 | class MyClass: | ------- - | "#); } @@ -785,7 +767,6 @@ cls = MyClass | 2 | ab: "ab" | -- -- - | "#); } @@ -819,7 +800,6 @@ cls = MyClass | -- 5 | x = ab | -- - | "#); } @@ -842,7 +822,6 @@ cls = MyClass | -- 5 | x = ab | -- - | "#); } @@ -865,7 +844,6 @@ cls = MyClass | -- 5 | x = ab | -- - | "#); } @@ -888,7 +866,6 @@ cls = MyClass | -- 5 | x = ab | -- - | "#); } @@ -911,7 +888,6 @@ cls = MyClass | -- 5 | x = ab | -- - | "#); } @@ -934,7 +910,6 @@ cls = MyClass | -- 5 | x = ab | -- - | "#); } @@ -963,7 +938,6 @@ cls = MyClass | -- 11 | x = ab | -- - | "); } @@ -992,7 +966,6 @@ cls = MyClass | -- 11 | x = ab | -- - | "); } @@ -1027,7 +1000,6 @@ cls = MyClass 9 | match event: 10 | case Click(x, button=ab): | ----- - | "); } @@ -1065,7 +1037,6 @@ cls = MyClass | 2 | type Alias1[AB: int = bool] = tuple[AB, list[AB]] | -- -- -- - | "); } @@ -1083,7 +1054,6 @@ cls = MyClass | 2 | type Alias1[AB: int = bool] = tuple[AB, list[AB]] | -- -- -- - | "); } @@ -1102,7 +1072,6 @@ cls = MyClass | 3 | type Alias2[**AB = [int, str]] = Callable[AB, tuple[AB]] | -- -- -- - | "); } @@ -1121,7 +1090,6 @@ cls = MyClass | 3 | type Alias2[**AB = [int, str]] = Callable[AB, tuple[AB]] | -- -- -- - | "); } @@ -1139,7 +1107,6 @@ cls = MyClass | 2 | type Alias3[*AB = ()] = tuple[tuple[*AB], tuple[*AB]] | -- -- -- - | "); } @@ -1157,7 +1124,6 @@ cls = MyClass | 2 | type Alias3[*AB = ()] = tuple[tuple[*AB], tuple[*AB]] | -- -- -- - | "); } @@ -1224,7 +1190,6 @@ class DataProcessor: | 2 | def func(x): | ---- - | "); } @@ -1274,7 +1239,6 @@ def process_model(): 5 | def get_attribute(self): 6 | return MyModel.attr | ---- - | "); } @@ -1312,7 +1276,6 @@ instance = ExampleClass(old_name="test") | -------- 4 | self.old_name = old_name | -------- - | "#); } @@ -1340,7 +1303,6 @@ TD(f=1) 7 | 8 | TD(f=1) | - - | "); } @@ -1368,7 +1330,6 @@ TD(f=1) 7 | 8 | TD(f=1) | - - | "); } @@ -1396,7 +1357,6 @@ NT(f=1) 7 | 8 | NT(f=1) | - - | "); } @@ -1425,7 +1385,6 @@ DC(f=1) 8 | 9 | DC(f=1) | - - | "); } @@ -1462,7 +1421,6 @@ result = func(value=42) | ----- 3 | return value * 2 | ----- - | "); } @@ -1504,7 +1462,6 @@ result = func(value=1) 4 | 5 | result = func(value=42) | ----- - | "); } @@ -1542,7 +1499,6 @@ async def main(): | ----- 3 | return value * 2 | ----- - | "); } @@ -1573,7 +1529,6 @@ instance = ExampleClass(old_name="test") | 4 | self.old_name = old_name | -------- - | "); } @@ -1611,7 +1566,6 @@ result = func(value=10) | ----- 4 | return value * 2 | ----- - | "); } @@ -1653,7 +1607,6 @@ result = instance.method(old_name="world") | -------- 4 | self.old_name = old_name | -------- - | "#); } @@ -1690,7 +1643,6 @@ func_alias() 3 | 4 | func_alias() | ---------- - | "); } @@ -1736,7 +1688,6 @@ func_alias() | 2 | class Path: | ---- - | "#); } @@ -1764,7 +1715,6 @@ func_alias() 4 | 5 | x = abc | --- - | "); } @@ -1792,7 +1742,6 @@ func_alias() 4 | 5 | x = abc | --- - | "); } @@ -1821,7 +1770,6 @@ func_alias() 4 | 5 | y = xyz | --- - | "); } @@ -1850,7 +1798,6 @@ func_alias() 4 | 5 | y = xyz | --- - | "); } @@ -1881,7 +1828,6 @@ func_alias() | 4 | x = subpkg | ------ - | "); } @@ -2014,7 +1960,6 @@ func_alias() | 2 | subpkg: int = 10 | ------ - | "); } @@ -2051,7 +1996,6 @@ func_alias() | 2 | subpkg: int = 10 | ------ - | "); } @@ -2083,7 +2027,6 @@ func_alias() 5 | 6 | print(a) | - - | "#); } @@ -2102,7 +2045,6 @@ print(x) | 3 | print(x) | - - | "); } @@ -2124,7 +2066,6 @@ print(x) | - 4 | print(x) | - - | "); } @@ -2146,7 +2087,6 @@ print(x) | - 4 | print(x) | - - | "); } @@ -2166,7 +2106,6 @@ print(x) | 4 | print(x) | - - | "); } @@ -2185,7 +2124,6 @@ value: Box | 3 | value: Box | --- - | "); } @@ -2209,7 +2147,6 @@ def test(flag: bool): | 8 | print(x) | - - | "); } @@ -2233,7 +2170,6 @@ def f(flag: bool): | - 6 | print(x) | - - | "); } @@ -2255,7 +2191,6 @@ print(x) | 6 | print(x) | - - | "); } @@ -2278,7 +2213,6 @@ class C: | 7 | print(self.x) | - - | "); } @@ -2303,7 +2237,6 @@ class C: | 9 | print(self.x) | - - | "); } } diff --git a/crates/ty_ide/src/folding_range.rs b/crates/ty_ide/src/folding_range.rs index cdcb38efc7ba67..6a6cefa8b74457 100644 --- a/crates/ty_ide/src/folding_range.rs +++ b/crates/ty_ide/src/folding_range.rs @@ -792,7 +792,6 @@ class MyClass: 6 | | def method(self): 7 | | return self.value | |_________________________^ - | info[folding-range]: Folding Range --> main.py:3:24 @@ -801,7 +800,6 @@ class MyClass: | ________________________^ 4 | | self.value = 1 | |______________________^ - | info[folding-range]: Folding Range --> main.py:6:22 @@ -810,7 +808,6 @@ class MyClass: | ______________________^ 7 | | return self.value | |_________________________^ - | "); } @@ -845,7 +842,6 @@ class MyClass: 7 | | attribute comment. 8 | | """ | |___________^ - | info[folding-range]: Folding Range --> main.py:3:24 @@ -858,7 +854,6 @@ class MyClass: 7 | | attribute comment. 8 | | """ | |___________^ - | info[folding-range]: Folding Range --> main.py:5:9 @@ -868,7 +863,6 @@ class MyClass: 7 | | attribute comment. 8 | | """ | |___________^ - | "#); } @@ -896,7 +890,6 @@ def main(): 3 | | import sys 4 | | from typing import List, Dict | |_____________________________^ - | info[folding-range]: Folding Range --> main.py:6:12 @@ -905,7 +898,6 @@ def main(): | ____________^ 7 | | pass | |________^ - | "); } @@ -934,7 +926,6 @@ import requests 2 | / import os 3 | | import sys | |__________^ - | info[folding-range]: Folding Range (imports) --> main.py:5:1 @@ -943,7 +934,6 @@ import requests 6 | | import pandas 7 | | import requests | |_______________^ - | "); } @@ -978,7 +968,6 @@ from fastapi import FastAPI 2 | / import os 3 | | from math import prod | |_____________________^ - | info[folding-range]: Folding Range (imports) --> main.py:12:1 @@ -986,7 +975,6 @@ from fastapi import FastAPI 12 | / import requests 13 | | from fastapi import FastAPI | |___________________________^ - | info[folding-range]: Folding Range --> main.py:5:5 @@ -996,7 +984,6 @@ from fastapi import FastAPI 6 | | import foo 7 | | import bar | |______________^ - | info[folding-range]: Folding Range (imports) --> main.py:6:5 @@ -1004,7 +991,6 @@ from fastapi import FastAPI 6 | / import foo 7 | | import bar | |______________^ - | info[folding-range]: Folding Range --> main.py:8:20 @@ -1014,7 +1000,6 @@ from fastapi import FastAPI 9 | | first = None 10 | | bar = None | |______________^ - | "); } @@ -1056,7 +1041,6 @@ class MyClass: 8 | | 9 | | do_something() | |__________________^ - | info[folding-range]: Folding Range (imports) --> main.py:3:5 @@ -1064,7 +1048,6 @@ class MyClass: 3 | / import os 4 | | import sys | |______________^ - | info[folding-range]: Folding Range (imports) --> main.py:6:5 @@ -1072,7 +1055,6 @@ class MyClass: 6 | / import numpy 7 | | import pandas | |_________________^ - | info[folding-range]: Folding Range --> main.py:12:15 @@ -1082,7 +1064,6 @@ class MyClass: 13 | | import typing 14 | | import collections | |______________________^ - | info[folding-range]: Folding Range (imports) --> main.py:13:5 @@ -1090,7 +1071,6 @@ class MyClass: 13 | / import typing 14 | | import collections | |______________________^ - | "); } @@ -1130,7 +1110,6 @@ else: | ______________^ 3 | | do_something() | |__________________^ - | info[folding-range]: Folding Range --> main.py:4:12 @@ -1139,7 +1118,6 @@ else: | ____________^ 5 | | do_other() | |______________^ - | info[folding-range]: Folding Range --> main.py:6:6 @@ -1148,7 +1126,6 @@ else: | ______^ 7 | | default() | |_____________^ - | info[folding-range]: Folding Range --> main.py:9:19 @@ -1157,7 +1134,6 @@ else: | ___________________^ 10 | | process(item) | |_________________^ - | info[folding-range]: Folding Range --> main.py:11:6 @@ -1166,7 +1142,6 @@ else: | ______^ 12 | | okay() | |__________^ - | info[folding-range]: Folding Range --> main.py:14:15 @@ -1175,7 +1150,6 @@ else: | _______________^ 15 | | continue_work() | |___________________^ - | info[folding-range]: Folding Range --> main.py:16:6 @@ -1184,7 +1158,6 @@ else: | ______^ 17 | | doit() | |__________^ - | "); } @@ -1257,7 +1230,6 @@ match value: 14 | | ): 15 | | return fallback | |_______________________^ - | info[folding-range]: Folding Range --> main.py:5:3 @@ -1275,7 +1247,6 @@ match value: 14 | | ): 15 | | return fallback | |_______________________^ - | info[folding-range]: Folding Range --> main.py:6:12 @@ -1288,7 +1259,6 @@ match value: 10 | | ): 11 | | return value | |____________________^ - | info[folding-range]: Folding Range --> main.py:10:7 @@ -1297,7 +1267,6 @@ match value: | _______^ 11 | | return value | |____________________^ - | info[folding-range]: Folding Range --> main.py:7:10 @@ -1307,7 +1276,6 @@ match value: 8 | | value, 9 | | ] | |________^ - | info[folding-range]: Folding Range --> main.py:12:11 @@ -1318,7 +1286,6 @@ match value: 14 | | ): 15 | | return fallback | |_______________________^ - | info[folding-range]: Folding Range --> main.py:14:7 @@ -1327,7 +1294,6 @@ match value: | _______^ 15 | | return fallback | |_______________________^ - | info[folding-range]: Folding Range --> main.py:17:18 @@ -1342,7 +1308,6 @@ match value: 23 | | ): 24 | | pass | |________^ - | info[folding-range]: Folding Range --> main.py:23:3 @@ -1351,7 +1316,6 @@ match value: | ___^ 24 | | pass | |________^ - | info[folding-range]: Folding Range --> main.py:26:5 @@ -1360,7 +1324,6 @@ match value: | _____^ 27 | | pass | |________^ - | info[folding-range]: Folding Range --> main.py:28:9 @@ -1372,7 +1335,6 @@ match value: 31 | | ) as error: 32 | | raise error | |_______________^ - | info[folding-range]: Folding Range --> main.py:31:12 @@ -1381,7 +1343,6 @@ match value: | ____________^ 32 | | raise error | |_______________^ - | info[folding-range]: Folding Range --> main.py:34:13 @@ -1394,7 +1355,6 @@ match value: 38 | | }: 39 | | handle_mapping() | |________________________^ - | info[folding-range]: Folding Range --> main.py:35:11 @@ -1406,7 +1366,6 @@ match value: 38 | | }: 39 | | handle_mapping() | |________________________^ - | info[folding-range]: Folding Range --> main.py:38:7 @@ -1415,7 +1374,6 @@ match value: | _______^ 39 | | handle_mapping() | |________________________^ - | "#); } @@ -1448,7 +1406,6 @@ def foo(x=[ 6 | | qux = x[0] + 1 7 | | return qux | |______________^ - | info[folding-range]: Folding Range --> main.py:5:4 @@ -1458,7 +1415,6 @@ def foo(x=[ 6 | | qux = x[0] + 1 7 | | return qux | |______________^ - | "); } @@ -1483,7 +1439,6 @@ if condition: # why | _____________________^ 3 | | do_work() | |_____________^ - | "); } @@ -1523,7 +1478,6 @@ if condition: 9 | | and_maybe_this() 10 | | and_maybe_this() | |____________________________^ - | info[folding-range]: Folding Range --> main.py:3:19 @@ -1538,7 +1492,6 @@ if condition: 9 | | and_maybe_this() 10 | | and_maybe_this() | |____________________________^ - | info[folding-range]: Folding Range --> main.py:6:18 @@ -1550,7 +1503,6 @@ if condition: 9 | | and_maybe_this() 10 | | and_maybe_this() | |____________________________^ - | "); } @@ -1587,7 +1539,6 @@ else: 3 | | process(item) 4 | | validate(item) | |__________________^ - | info[folding-range]: Folding Range --> main.py:5:6 @@ -1597,7 +1548,6 @@ else: 6 | | log_success() 7 | | notify_complete() | |_____________________^ - | info[folding-range]: Folding Range --> main.py:9:17 @@ -1607,7 +1557,6 @@ else: 10 | | do_work() 11 | | check_status() | |__________________^ - | info[folding-range]: Folding Range --> main.py:12:6 @@ -1617,7 +1566,6 @@ else: 13 | | handle_done() 14 | | cleanup_resources() | |_______________________^ - | "); } @@ -1650,7 +1598,6 @@ finally: | _____^ 3 | | risky_operation() | |_____________________^ - | info[folding-range]: Folding Range --> main.py:8:6 @@ -1659,7 +1606,6 @@ finally: | ______^ 9 | | success_action() | |____________________^ - | info[folding-range]: Folding Range --> main.py:10:9 @@ -1668,7 +1614,6 @@ finally: | _________^ 11 | | cleanup() | |_____________^ - | info[folding-range]: Folding Range --> main.py:4:19 @@ -1677,7 +1622,6 @@ finally: | ___________________^ 5 | | handle_value_error() | |________________________^ - | info[folding-range]: Folding Range --> main.py:6:18 @@ -1686,7 +1630,6 @@ finally: | __________________^ 7 | | handle_type_error() | |_______________________^ - | "); } @@ -1734,7 +1677,6 @@ my_list_with_trailing_own_line_comment = [ 4 | | 2, 5 | | 3, | |_______^ - | info[folding-range]: Folding Range --> main.py:8:12 @@ -1744,7 +1686,6 @@ my_list_with_trailing_own_line_comment = [ 9 | | "a": 1, 10 | | "b": 2, | |____________^ - | info[folding-range]: Folding Range --> main.py:13:42 @@ -1755,7 +1696,6 @@ my_list_with_trailing_own_line_comment = [ 15 | | 2, 16 | | 3, # reason | |_________________^ - | info[folding-range]: Folding Range --> main.py:19:43 @@ -1767,7 +1707,6 @@ my_list_with_trailing_own_line_comment = [ 22 | | 3, 23 | | # comment | |______________^ - | "#); } @@ -1830,7 +1769,6 @@ type Alias[ 3 | | first, 4 | | second, | |____________^ - | info[folding-range]: Folding Range --> main.py:7:11 @@ -1840,7 +1778,6 @@ type Alias[ 8 | | "a", 9 | | "b", | |_________^ - | info[folding-range]: Folding Range --> main.py:12:13 @@ -1850,7 +1787,6 @@ type Alias[ 13 | | first, 14 | | second, | |____________^ - | info[folding-range]: Folding Range --> main.py:17:17 @@ -1860,7 +1796,6 @@ type Alias[ 18 | | item 19 | | for item in items | |______________________^ - | info[folding-range]: Folding Range --> main.py:22:17 @@ -1870,7 +1805,6 @@ type Alias[ 23 | | item 24 | | for item in items | |______________________^ - | info[folding-range]: Folding Range --> main.py:27:16 @@ -1880,7 +1814,6 @@ type Alias[ 28 | | item 29 | | for item in items | |______________________^ - | info[folding-range]: Folding Range --> main.py:32:17 @@ -1890,7 +1823,6 @@ type Alias[ 33 | | key: value 34 | | for key, value in items | |____________________________^ - | info[folding-range]: Folding Range --> main.py:37:12 @@ -1900,7 +1832,6 @@ type Alias[ 38 | | T, 39 | | U, | |_______^ - | "#); } @@ -1940,7 +1871,6 @@ chained_call = ( | ___________________________^ 3 | | factory | |____________^ - | info[folding-range]: Folding Range --> main.py:4:3 @@ -1949,7 +1879,6 @@ chained_call = ( | ___^ 5 | | arg, | |_________^ - | info[folding-range]: Folding Range --> main.py:8:34 @@ -1958,7 +1887,6 @@ chained_call = ( | __________________________________^ 9 | | factory | |____________^ - | info[folding-range]: Folding Range --> main.py:16:3 @@ -1967,7 +1895,6 @@ chained_call = ( | ___^ 17 | | second, | |____________^ - | info[folding-range]: Folding Range --> main.py:12:17 @@ -1976,7 +1903,6 @@ chained_call = ( | _________________^ 13 | | factory | |____________^ - | info[folding-range]: Folding Range --> main.py:14:3 @@ -1985,7 +1911,6 @@ chained_call = ( | ___^ 15 | | first, | |___________^ - | "); } @@ -2015,7 +1940,6 @@ parenthesized_subscript_value = ( | ____________________________^ 3 | | key | |________^ - | info[folding-range]: Folding Range --> main.py:6:34 @@ -2024,7 +1948,6 @@ parenthesized_subscript_value = ( | __________________________________^ 7 | | data | |_________^ - | "); } @@ -2069,7 +1992,6 @@ multiline t-string 4 | | multiline string 5 | | """ | |___^ - | info[folding-range]: Folding Range --> main.py:7:19 @@ -2080,7 +2002,6 @@ multiline t-string 9 | | multiline bytes 10 | | """ | |___^ - | info[folding-range]: Folding Range --> main.py:12:21 @@ -2091,7 +2012,6 @@ multiline t-string 14 | | multiline f-string 15 | | """ | |___^ - | info[folding-range]: Folding Range --> main.py:17:21 @@ -2102,7 +2022,6 @@ multiline t-string 19 | | multiline t-string 20 | | """ | |___^ - | "#); } @@ -2137,7 +2056,6 @@ match value: 7 | | case _: 8 | | default() | |_________________^ - | info[folding-range]: Folding Range --> main.py:3:12 @@ -2146,7 +2064,6 @@ match value: | ____________^ 4 | | one() | |_____________^ - | info[folding-range]: Folding Range --> main.py:5:12 @@ -2155,7 +2072,6 @@ match value: | ____________^ 6 | | two() | |_____________^ - | info[folding-range]: Folding Range --> main.py:7:12 @@ -2164,7 +2080,6 @@ match value: | ____________^ 8 | | default() | |_________________^ - | "); } @@ -2195,7 +2110,6 @@ def main(): 3 | / import os 4 | | import sys | |__________^ - | info[folding-range]: Folding Range --> main.py:8:12 @@ -2204,7 +2118,6 @@ def main(): | ____________^ 9 | | pass | |________^ - | info[folding-range]: Folding Range (region) --> main.py:2:1 @@ -2214,7 +2127,6 @@ def main(): 4 | | import sys 5 | | # endregion | |___________^ - | info[folding-range]: Folding Range (region) --> main.py:7:1 @@ -2224,7 +2136,6 @@ def main(): 9 | | pass 10 | | # endregion | |___________^ - | "); } @@ -2255,7 +2166,6 @@ message = f""" 5 | | # endregion 6 | | """ | |___^ - | "#); } @@ -2288,7 +2198,6 @@ def my_function(): 6 | | """ 7 | | pass | |________^ - | info[folding-range]: Folding Range (comment) --> main.py:3:5 @@ -2298,7 +2207,6 @@ def my_function(): 5 | | docstring. 6 | | """ | |_______^ - | info[folding-range]: Folding Range --> main.py:3:5 @@ -2308,7 +2216,6 @@ def my_function(): 5 | | docstring. 6 | | """ | |_______^ - | "#); } @@ -2358,7 +2265,6 @@ def with_rawstring_doc(): 6 | | """ 7 | | pass | |________^ - | info[folding-range]: Folding Range (comment) --> main.py:3:5 @@ -2368,7 +2274,6 @@ def with_rawstring_doc(): 5 | | used as a docstring. 6 | | """ | |_______^ - | info[folding-range]: Folding Range --> main.py:3:5 @@ -2378,7 +2283,6 @@ def with_rawstring_doc(): 5 | | used as a docstring. 6 | | """ | |_______^ - | info[folding-range]: Folding Range --> main.py:10:24 @@ -2391,7 +2295,6 @@ def with_rawstring_doc(): 14 | | """ 15 | | pass | |________^ - | info[folding-range]: Folding Range (comment) --> main.py:11:5 @@ -2401,7 +2304,6 @@ def with_rawstring_doc(): 13 | | used as a docstring. 14 | | """ | |_______^ - | info[folding-range]: Folding Range --> main.py:11:5 @@ -2411,7 +2313,6 @@ def with_rawstring_doc(): 13 | | used as a docstring. 14 | | """ | |_______^ - | info[folding-range]: Folding Range --> main.py:18:26 @@ -2424,7 +2325,6 @@ def with_rawstring_doc(): 22 | | """ 23 | | pass | |________^ - | info[folding-range]: Folding Range (comment) --> main.py:19:5 @@ -2434,7 +2334,6 @@ def with_rawstring_doc(): 21 | | used as a docstring. 22 | | """ | |_______^ - | info[folding-range]: Folding Range --> main.py:19:5 @@ -2444,7 +2343,6 @@ def with_rawstring_doc(): 21 | | used as a docstring. 22 | | """ | |_______^ - | "#); } @@ -2478,7 +2376,6 @@ def foo(): | ___________^ 7 | | pass | |________^ - | info[folding-range]: Folding Range (comment) --> main.py:2:1 @@ -2487,7 +2384,6 @@ def foo(): 3 | | # that spans multiple lines 4 | | # explaining something important | |________________________________^ - | info[folding-range]: Folding Range (comment) --> main.py:9:1 @@ -2495,7 +2391,6 @@ def foo(): 9 | / # Another comment block 10 | | # with more details | |___________________^ - | ", ); } @@ -2523,7 +2418,6 @@ with open("file.txt") as f: 3 | | content = f.read() 4 | | process(content) | |____________________^ - | "#); } @@ -2577,7 +2471,6 @@ with open("file.txt") as f: 16 | | # Don't exceed the overall end date or max_days limit 17 | | c = 30 | |______________________________^ - | info[folding-range]: Folding Range (comment) --> main.py:3:21 @@ -2588,7 +2481,6 @@ with open("file.txt") as f: 6 | | into smaller chunks that can be requested individually. 7 | | """ | |_______________________^ - | info[folding-range]: Folding Range --> main.py:3:21 @@ -2599,7 +2491,6 @@ with open("file.txt") as f: 6 | | into smaller chunks that can be requested individually. 7 | | """ | |_______________________^ - | info[folding-range]: Folding Range --> main.py:11:42 @@ -2613,7 +2504,6 @@ with open("file.txt") as f: 16 | | # Don't exceed the overall end date or max_days limit 17 | | c = 30 | |______________________________^ - | info[folding-range]: Folding Range (comment) --> main.py:12:1 @@ -2621,7 +2511,6 @@ with open("file.txt") as f: 12 | / # Calculate the end of the current chunk 13 | | # Go to the last day of the current month | |_________________________________________________________________^ - | "#); } @@ -2655,7 +2544,6 @@ with open("file.txt") as f: | _______________^ 2 | | pass | |________^ - | "); // So does a single CRLF new-line. @@ -2670,7 +2558,6 @@ with open("file.txt") as f: | _______________^ 2 | | pass | |________^ - | "); // And so to does a single CR new-line. @@ -2685,7 +2572,6 @@ with open("file.txt") as f: | _______________^ 2 | | pass | |________^ - | "); } @@ -2728,7 +2614,6 @@ def my_function(): | ___________________^ 4 | | pass | |________^ - | "); } @@ -2756,7 +2641,6 @@ def my_function(): | ___________________^ 6 | | pass | |________^ - | "); } @@ -2785,7 +2669,6 @@ class MyClass: 4 | | value: int 5 | | name: str | |_____________^ - | "); } @@ -2812,7 +2695,6 @@ class MyClass: | _______________^ 5 | | value: int | |______________^ - | "); } @@ -2838,7 +2720,6 @@ async def my_async_function(): | _______________________________^ 4 | | pass | |________^ - | "); } @@ -2867,7 +2748,6 @@ def outer_function(): 4 | | def inner_function(): 5 | | pass | |____________^ - | info[folding-range]: Folding Range --> main.py:4:26 @@ -2876,7 +2756,6 @@ def outer_function(): | __________________________^ 5 | | pass | |____________^ - | "); } @@ -2905,7 +2784,6 @@ class MyClass: 4 | | async def my_async_method(self): 5 | | pass | |____________^ - | info[folding-range]: Folding Range --> main.py:4:37 @@ -2914,7 +2792,6 @@ class MyClass: | _____________________________________^ 5 | | pass | |____________^ - | "); } diff --git a/crates/ty_ide/src/goto_declaration.rs b/crates/ty_ide/src/goto_declaration.rs index 86e7bb5351c707..48924e71e7c8fd 100644 --- a/crates/ty_ide/src/goto_declaration.rs +++ b/crates/ty_ide/src/goto_declaration.rs @@ -53,13 +53,11 @@ mod tests { | 5 | result = my_function(1, 2) | ^^^^^^^^^^^ Clicking here - | info: Found 1 declaration --> main.py:2:5 | 2 | def my_function(x, y): | ----------- - | "); } @@ -78,13 +76,11 @@ mod tests { | 3 | y = x | ^ Clicking here - | info: Found 1 declaration --> main.py:2:1 | 2 | x = 42 | - - | "); } @@ -109,13 +105,11 @@ mod tests { | 9 | person["name"] | ^^^^^^ Clicking here - | info: Found 1 declaration --> main.py:5:5 | 5 | name: str | ---- - | "#); } @@ -137,13 +131,11 @@ mod tests { | 6 | instance = MyClass() | ^^^^^^^ Clicking here - | info: Found 1 declaration --> main.py:2:7 | 2 | class MyClass: | ------- - | "); } @@ -162,13 +154,11 @@ mod tests { | 3 | return param * 2 | ^^^^^ Clicking here - | info: Found 1 declaration --> main.py:2:9 | 2 | def foo(param): | ----- - | "); } @@ -188,13 +178,11 @@ mod tests { | 3 | v: T = value | ^ Clicking here - | info: Found 1 declaration --> main.py:2:18 | 2 | def generic_func[T](value: T) -> T: | - - | "); } @@ -214,13 +202,11 @@ mod tests { | 3 | def __init__(self, value: T): | ^ Clicking here - | info: Found 1 declaration --> main.py:2:20 | 2 | class GenericClass[T]: | - - | "); } @@ -242,13 +228,11 @@ mod tests { | 5 | return x # Should find outer x | ^ Clicking here - | info: Found 1 declaration --> main.py:2:1 | 2 | x = "outer" | - - | "#); } @@ -297,13 +281,11 @@ variable = 42 | 3 | print(mymodule.function()) | ^^^^^^^^ Clicking here - | info: Found 1 declaration --> mymodule.py:1:1 | 1 | | - - | "); } @@ -335,13 +317,11 @@ def other_function(): | 3 | print(my_function()) | ^^^^^^^^^^^ Clicking here - | info: Found 1 declaration --> mymodule.py:2:5 | 2 | def my_function(): | ----------- - | "); } @@ -376,13 +356,11 @@ FOO = 0 | 3 | print(sub.helper()) | ^^^ Clicking here - | info: Found 1 declaration --> mymodule/submodule.py:1:1 | 1 | | - - | "); } @@ -401,11 +379,8 @@ FOO = 0 | 1 | from lib import module | ^^^^^^ Clicking here - | info: Found 1 declaration --> lib/module.py:1:1 - | - | "); } @@ -435,13 +410,11 @@ def func(arg): | 3 | print(h("test")) | ^ Clicking here - | info: Found 1 declaration --> utils.py:2:5 | 2 | def func(arg): | ---- - | "#); } @@ -477,13 +450,11 @@ def shared_function(): | 3 | print(shared_function()) | ^^^^^^^^^^^^^^^ Clicking here - | info: Found 1 declaration --> original.py:2:5 | 2 | def shared_function(): | --------------- - | "); } @@ -517,13 +488,11 @@ def multiply_numbers(a, b): | 3 | result = add_numbers(5, 3) | ^^^^^^^^^^^ Clicking here - | info: Found 1 declaration --> math_utils.py:2:5 | 2 | def add_numbers(a, b): | ----------- - | "); } @@ -564,13 +533,11 @@ def another_helper(): | 3 | result = helper_function("test") | ^^^^^^^^^^^^^^^ Clicking here - | info: Found 1 declaration --> package/utils.py:2:5 | 2 | def helper_function(arg): | --------------- - | "#); } @@ -610,13 +577,11 @@ def another_helper(): | 3 | result = helper_function("test") | ^^^^^^^^^^^^^^^ Clicking here - | info: Found 1 declaration --> package/utils.py:2:5 | 2 | def helper_function(arg): | --------------- - | "#); } @@ -650,13 +615,11 @@ FOO = 0 | 2 | import mymodule.submodule as sub | ^^^ Clicking here - | info: Found 1 declaration --> mymodule/submodule.py:1:1 | 1 | | - - | "); } @@ -690,13 +653,11 @@ FOO = 0 | 2 | import mymodule.submodule as sub | ^^^^^^^^^ Clicking here - | info: Found 1 declaration --> mymodule/submodule.py:1:1 | 1 | | - - | "); } @@ -734,13 +695,11 @@ def another_helper(path): | 2 | from mypackage.utils import helper as h | ^^^^^^ Clicking here - | info: Found 1 declaration --> mypackage/utils.py:2:5 | 2 | def helper(a, b): | ------ - | "); } @@ -778,13 +737,11 @@ def another_helper(path): | 2 | from mypackage.utils import helper as h | ^ Clicking here - | info: Found 1 declaration --> mypackage/utils.py:2:5 | 2 | def helper(a, b): | ------ - | "); } @@ -822,13 +779,11 @@ def another_helper(path): | 2 | from mypackage.utils import helper as h | ^^^^^ Clicking here - | info: Found 1 declaration --> mypackage/utils.py:1:1 | 1 | | - - | "); } @@ -851,13 +806,11 @@ def another_helper(path): | 7 | y = c.x | ^ Clicking here - | info: Found 1 declaration --> main.py:4:9 | 4 | self.x: int = 1 | ------ - | "); } @@ -878,13 +831,11 @@ def another_helper(path): | 2 | a: "MyClass" = 1 | ^^^^^^^ Clicking here - | info: Found 1 declaration --> main.py:4:7 | 4 | class MyClass: | ------- - | "#); } @@ -905,13 +856,11 @@ def another_helper(path): | 2 | a: "None | MyClass" = 1 | ^^^^^^^ Clicking here - | info: Found 1 declaration --> main.py:4:7 | 4 | class MyClass: | ------- - | "#); } @@ -946,13 +895,11 @@ def another_helper(path): | 2 | a: "None | MyClass" = 1 | ^^^^^^^ Clicking here - | info: Found 1 declaration --> main.py:4:7 | 4 | class MyClass: | ------- - | "#); } @@ -1001,13 +948,11 @@ def another_helper(path): | 2 | a: "MyClass | No" = 1 | ^^^^^^^ Clicking here - | info: Found 1 declaration --> main.py:4:7 | 4 | class MyClass: | ------- - | "#); } @@ -1039,13 +984,11 @@ def another_helper(path): | 2 | ab: "ab" | ^^ Clicking here - | info: Found 1 declaration --> main.py:2:1 | 2 | ab: "ab" | -- - | "#); } @@ -1077,13 +1020,11 @@ def another_helper(path): | 2 | x: "list['MyClass | int'] | None" | ^^^^^^^ Clicking here - | info: Found 1 declaration --> main.py:4:7 | 4 | class MyClass: | ------- - | "#); } @@ -1104,13 +1045,11 @@ def another_helper(path): | 2 | x: "list['int | MyClass'] | None" | ^^^^^^^ Clicking here - | info: Found 1 declaration --> main.py:4:7 | 4 | class MyClass: | ------- - | "#); } @@ -1131,13 +1070,11 @@ def another_helper(path): | 2 | x: "list['int | None'] | MyClass" | ^^^^^^^ Clicking here - | info: Found 1 declaration --> main.py:4:7 | 4 | class MyClass: | ------- - | "#); } @@ -1158,13 +1095,11 @@ def another_helper(path): | 2 | x: "list['int' | 'MyClass'] | None" | ^^^^^^^ Clicking here - | info: Found 1 declaration --> main.py:4:7 | 4 | class MyClass: | ------- - | "#); } @@ -1185,13 +1120,11 @@ def another_helper(path): | 2 | x: "list['MyClass' | 'str'] | None" | ^^^^^^^ Clicking here - | info: Found 1 declaration --> main.py:4:7 | 4 | class MyClass: | ------- - | "#); } @@ -1226,13 +1159,11 @@ def another_helper(path): | 2 | x: """'list["int" | "str"]' | MyClass""" | ^^^^^^^ Clicking here - | info: Found 1 declaration --> main.py:4:7 | 4 | class MyClass: | ------- - | "#); } @@ -1259,13 +1190,11 @@ def another_helper(path): | 11 | y = d.y.x | ^ Clicking here - | info: Found 1 declaration --> main.py:4:9 | 4 | self.x: int = 1 | ------ - | "); } @@ -1288,13 +1217,11 @@ def another_helper(path): | 7 | y = c.x | ^ Clicking here - | info: Found 1 declaration --> main.py:4:9 | 4 | self.x = 1 | ------ - | "); } @@ -1317,13 +1244,11 @@ def another_helper(path): | 7 | res = c.foo() | ^^^ Clicking here - | info: Found 1 declaration --> main.py:3:9 | 3 | def foo(self): | --- - | "); } @@ -1387,13 +1312,11 @@ def outer(): | 8 | return x # Should find the nonlocal x declaration in outer scope | ^ Clicking here - | info: Found 1 declaration --> main.py:3:5 | 3 | x = "outer_value" | - - | "#); } @@ -1420,13 +1343,11 @@ def outer(): | 6 | nonlocal xy | ^^ Clicking here - | info: Found 1 declaration --> main.py:3:5 | 3 | xy = "outer_value" | -- - | "#); } @@ -1450,13 +1371,11 @@ def function(): | 7 | return global_var # Should find the global variable declaration | ^^^^^^^^^^ Clicking here - | info: Found 1 declaration --> main.py:2:1 | 2 | global_var = "global_value" | ---------- - | "#); } @@ -1480,13 +1399,11 @@ def function(): | 5 | global global_var | ^^^^^^^^^^ Clicking here - | info: Found 1 declaration --> main.py:2:1 | 2 | global_var = "global_value" | ---------- - | "#); } @@ -1511,13 +1428,11 @@ def function(): | 9 | y = b.x | ^ Clicking here - | info: Found 1 declaration --> main.py:3:5 | 3 | x = 10 | - - | "); } @@ -1538,13 +1453,11 @@ def function(): | 4 | case ["get", ab]: | ^^ Clicking here - | info: Found 1 declaration --> main.py:4:22 | 4 | case ["get", ab]: | -- - | "#); } @@ -1565,13 +1478,11 @@ def function(): | 5 | x = ab | ^^ Clicking here - | info: Found 1 declaration --> main.py:4:22 | 4 | case ["get", ab]: | -- - | "#); } @@ -1592,13 +1503,11 @@ def function(): | 4 | case ["get", *ab]: | ^^ Clicking here - | info: Found 1 declaration --> main.py:4:23 | 4 | case ["get", *ab]: | -- - | "#); } @@ -1619,13 +1528,11 @@ def function(): | 5 | x = ab | ^^ Clicking here - | info: Found 1 declaration --> main.py:4:23 | 4 | case ["get", *ab]: | -- - | "#); } @@ -1646,13 +1553,11 @@ def function(): | 4 | case ["get", ("a" | "b") as ab]: | ^^ Clicking here - | info: Found 1 declaration --> main.py:4:37 | 4 | case ["get", ("a" | "b") as ab]: | -- - | "#); } @@ -1673,13 +1578,11 @@ def function(): | 5 | x = ab | ^^ Clicking here - | info: Found 1 declaration --> main.py:4:37 | 4 | case ["get", ("a" | "b") as ab]: | -- - | "#); } @@ -1706,13 +1609,11 @@ def function(): | 10 | case Click(x, button=ab): | ^^ Clicking here - | info: Found 1 declaration --> main.py:10:30 | 10 | case Click(x, button=ab): | -- - | "); } @@ -1739,13 +1640,11 @@ def function(): | 11 | x = ab | ^^ Clicking here - | info: Found 1 declaration --> main.py:10:30 | 10 | case Click(x, button=ab): | -- - | "); } @@ -1772,13 +1671,11 @@ def function(): | 10 | case Click(x, button=ab): | ^^^^^ Clicking here - | info: Found 1 declaration --> main.py:2:7 | 2 | class Click: | ----- - | "); } @@ -1816,13 +1713,11 @@ def function(): | 2 | type Alias1[AB: int = bool] = tuple[AB, list[AB]] | ^^ Clicking here - | info: Found 1 declaration --> main.py:2:13 | 2 | type Alias1[AB: int = bool] = tuple[AB, list[AB]] | -- - | "); } @@ -1840,13 +1735,11 @@ def function(): | 2 | type Alias1[AB: int = bool] = tuple[AB, list[AB]] | ^^ Clicking here - | info: Found 1 declaration --> main.py:2:13 | 2 | type Alias1[AB: int = bool] = tuple[AB, list[AB]] | -- - | "); } @@ -1865,13 +1758,11 @@ def function(): | 3 | type Alias2[**AB = [int, str]] = Callable[AB, tuple[AB]] | ^^ Clicking here - | info: Found 1 declaration --> main.py:3:15 | 3 | type Alias2[**AB = [int, str]] = Callable[AB, tuple[AB]] | -- - | "); } @@ -1890,13 +1781,11 @@ def function(): | 3 | type Alias2[**AB = [int, str]] = Callable[AB, tuple[AB]] | ^^ Clicking here - | info: Found 1 declaration --> main.py:3:15 | 3 | type Alias2[**AB = [int, str]] = Callable[AB, tuple[AB]] | -- - | "); } @@ -1914,13 +1803,11 @@ def function(): | 2 | type Alias3[*AB = ()] = tuple[tuple[*AB], tuple[*AB]] | ^^ Clicking here - | info: Found 1 declaration --> main.py:2:14 | 2 | type Alias3[*AB = ()] = tuple[tuple[*AB], tuple[*AB]] | -- - | "); } @@ -1938,13 +1825,11 @@ def function(): | 2 | type Alias3[*AB = ()] = tuple[tuple[*AB], tuple[*AB]] | ^^ Clicking here - | info: Found 1 declaration --> main.py:2:14 | 2 | type Alias3[*AB = ()] = tuple[tuple[*AB], tuple[*AB]] | -- - | "); } @@ -1971,13 +1856,11 @@ def function(): | 11 | c.value = 42 | ^^^^^ Clicking here - | info: Found 1 declaration --> main.py:7:9 | 7 | def value(self): | ----- - | "); } @@ -2041,13 +1924,11 @@ def function(): | 9 | obj.name | ^^^^ Clicking here - | info: Found 1 declaration --> main.py:6:5 | 6 | name: str | ---- - | "); } @@ -2070,13 +1951,11 @@ class MyClass: | 5 | def generic_method[T](self, value: ClassType) -> T: | ^^^^^^^^^ Clicking here - | info: Found 1 declaration --> main.py:3:5 | 3 | ClassType = int | --------- - | "); } @@ -2097,13 +1976,11 @@ class MyClass: | 5 | result = my_function(1, y=2, z=3) | ^ Clicking here - | info: Found 1 declaration --> main.py:2:20 | 2 | def my_function(x, y, z=10): | - - | "); } @@ -2134,7 +2011,6 @@ class MyClass: | 14 | result = process("hello", format="json") | ^^^^^^ Clicking here - | info: Found 2 declarations --> main.py:5:24 | @@ -2144,7 +2020,6 @@ class MyClass: 7 | @overload 8 | def process(data: int, format: int) -> int: ... | ------ - | "#); } @@ -2168,13 +2043,11 @@ class MyClass: | 8 | TD(f=1) | ^ Clicking here - | info: Found 1 declaration --> main.py:5:5 | 5 | f: int | - - | "); } @@ -2198,13 +2071,11 @@ class MyClass: | 8 | NT(f=1) | ^ Clicking here - | info: Found 1 declaration --> main.py:5:5 | 5 | f: int | - - | "); } @@ -2229,13 +2100,11 @@ class MyClass: | 9 | DC(f=1) | ^ Clicking here - | info: Found 1 declaration --> main.py:6:5 | 6 | f: int | - - | "); } @@ -2262,13 +2131,11 @@ class MyClass: | 11 | DC(f=1) | ^ Clicking here - | info: Found 1 declaration --> main.py:9:24 | 9 | def __init__(self, f: int) -> None: ... | - - | "); } @@ -2296,13 +2163,11 @@ class MyClass: | 12 | DC(g=1) | ^ Clicking here - | info: Found 1 declaration --> main.py:10:5 | 10 | f: int = Field(alias='g') | - - | "); } @@ -2344,7 +2209,6 @@ def ab(a: str): ... | 4 | ab(1) | ^^ Clicking here - | info: Found 2 declarations --> mymodule.pyi:5:5 | @@ -2354,7 +2218,6 @@ def ab(a: str): ... 7 | @overload 8 | def ab(a: str): ... | -- - | "); } @@ -2396,7 +2259,6 @@ def ab(a: str): ... | 4 | ab("hello") | ^^ Clicking here - | info: Found 2 declarations --> mymodule.pyi:5:5 | @@ -2406,7 +2268,6 @@ def ab(a: str): ... 7 | @overload 8 | def ab(a: str): ... | -- - | "#); } @@ -2448,7 +2309,6 @@ def ab(a: int): ... | 4 | ab(1, 2) | ^^ Clicking here - | info: Found 2 declarations --> mymodule.pyi:5:5 | @@ -2458,7 +2318,6 @@ def ab(a: int): ... 7 | @overload 8 | def ab(a: int): ... | -- - | "); } @@ -2500,7 +2359,6 @@ def ab(a: int): ... | 4 | ab(1) | ^^ Clicking here - | info: Found 2 declarations --> mymodule.pyi:5:5 | @@ -2510,7 +2368,6 @@ def ab(a: int): ... 7 | @overload 8 | def ab(a: int): ... | -- - | "); } @@ -2555,7 +2412,6 @@ def ab(a: int, *, c: int): ... | 4 | ab(1, b=2) | ^^ Clicking here - | info: Found 3 declarations --> mymodule.pyi:5:5 | @@ -2569,7 +2425,6 @@ def ab(a: int, *, c: int): ... 10 | @overload 11 | def ab(a: int, *, c: int): ... | -- - | "); } @@ -2614,7 +2469,6 @@ def ab(a: int, *, c: int): ... | 4 | ab(1, c=2) | ^^ Clicking here - | info: Found 3 declarations --> mymodule.pyi:5:5 | @@ -2628,7 +2482,6 @@ def ab(a: int, *, c: int): ... 10 | @overload 11 | def ab(a: int, *, c: int): ... | -- - | "); } @@ -2658,13 +2511,11 @@ def ab(a: int, *, c: int): ... | 4 | x = subpkg | ^^^^^^ Clicking here - | info: Found 1 declaration --> mypackage/__init__.py:2:7 | 2 | from .subpkg.submod import val | ------ - | "); } @@ -2698,11 +2549,8 @@ def ab(a: int, *, c: int): ... | 2 | from .subpkg.submod import val | ^^^^^^ Clicking here - | info: Found 1 declaration --> mypackage/subpkg/__init__.py:1:1 - | - | "); } @@ -2757,13 +2605,11 @@ def ab(a: int, *, c: int): ... | 2 | from .subpkg.submod import val | ^^^^^^ Clicking here - | info: Found 1 declaration --> mypackage/subpkg/submod.py:1:1 | 1 | | - - | "); } @@ -2793,13 +2639,11 @@ def ab(a: int, *, c: int): ... | 2 | from .subpkg import subpkg | ^^^^^^ Clicking here - | info: Found 1 declaration --> mypackage/subpkg/__init__.py:1:1 | 1 | | - - | "); } @@ -2829,13 +2673,11 @@ def ab(a: int, *, c: int): ... | 2 | from .subpkg import subpkg | ^^^^^^ Clicking here - | info: Found 1 declaration --> mypackage/subpkg/__init__.py:2:1 | 2 | subpkg: int = 10 | ------ - | "); } @@ -2866,13 +2708,11 @@ def ab(a: int, *, c: int): ... | 4 | x = subpkg | ^^^^^^ Clicking here - | info: Found 1 declaration --> mypackage/subpkg/__init__.py:2:1 | 2 | subpkg: int = 10 | ------ - | "); } @@ -2900,7 +2740,6 @@ def ab(a: int, *, c: int): ... | 6 | print(a) | ^ Clicking here - | info: Found 3 declarations --> main.py:2:1 | @@ -2914,7 +2753,6 @@ def ab(a: int, *, c: int): ... 7 | 8 | a: bool = True | - - | "#); } diff --git a/crates/ty_ide/src/goto_definition.rs b/crates/ty_ide/src/goto_definition.rs index 9f6295b0ef652a..c4fdbf790a4ee5 100644 --- a/crates/ty_ide/src/goto_definition.rs +++ b/crates/ty_ide/src/goto_definition.rs @@ -71,7 +71,6 @@ def outer(): | 17 | return last | ^^^^ Clicking here - | info: Found 2 definitions --> main.py:5:5 | @@ -82,7 +81,6 @@ def outer(): | 13 | [(last := nonlocal_item) for nonlocal_item in [3]] | ---- - | "); } @@ -102,13 +100,11 @@ def f(items): | 4 | return last | ^^^^ Clicking here - | info: Found 1 definition --> main.py:3:7 | 3 | [(last := item) for item in items] | ---- - | "); } @@ -128,13 +124,11 @@ def f(items): | 4 | return last | ^^^^ Clicking here - | info: Found 1 definition --> main.py:3:8 | 3 | [[(last := item) for item in items] for _ in [1]] | ---- - | "); } @@ -151,13 +145,11 @@ def f(items): | 2 | print(last) | ^^^^ Clicking here - | info: Found 1 definition --> lib.py:1:3 | 1 | [(last := item) for item in [1]] | ---- - | "); } @@ -183,7 +175,6 @@ def outer(items): | 8 | return last | ^^^^ Clicking here - | info: Found 2 definitions --> main.py:3:5 | @@ -194,7 +185,6 @@ def outer(items): 6 | nonlocal last 7 | [(last := item) for item in items] | ---- - | "); } @@ -211,13 +201,11 @@ def outer(items): | 1 | from . import module_a | ^^^^^^^^ Clicking here - | info: Found 1 definition --> mypackage/module_a.py:1:1 | 1 | class Test: ... | - - | "); } @@ -237,13 +225,11 @@ def outer(items): | 2 | x = module_a | ^^^^^^^^ Clicking here - | info: Found 1 definition --> mypackage/module_a.py:1:1 | 1 | class Test: ... | - - | "); } @@ -264,13 +250,11 @@ def outer(items): | 2 | x = module_a | ^^^^^^^^ Clicking here - | info: Found 1 definition --> mypackage/module_a.py:1:1 | 1 | class Test: ... | - - | "); } @@ -308,13 +292,11 @@ def my_function(): ... | 2 | from mymodule import my_function | ^^^^^^^^ Clicking here - | info: Found 1 definition --> mymodule.py:1:1 | 1 | | - - | "); } @@ -350,13 +332,11 @@ def my_function(): ... | 3 | x = mymodule | ^^^^^^^^ Clicking here - | info: Found 1 definition --> mymodule.py:1:1 | 1 | | - - | "); } @@ -397,13 +377,11 @@ def other_function(): ... | 3 | print(my_function()) | ^^^^^^^^^^^ Clicking here - | info: Found 1 definition --> mymodule.py:2:5 | 2 | def my_function(): | ----------- - | "); } @@ -434,13 +412,11 @@ def bar() -> None: | 3 | bar() | ^^^ Clicking here - | info: Found 1 definition --> a/impl.py:2:5 | 2 | def bar() -> None: | --- - | "); } @@ -474,13 +450,11 @@ def other_function(): ... | 2 | def my_function(): ... | ^^^^^^^^^^^ Clicking here - | info: Found 1 definition --> mymodule.py:2:5 | 2 | def my_function(): | ----------- - | "); } @@ -531,7 +505,6 @@ def other_function(): ... | 3 | print(my_function()) | ^^^^^^^^^^^ Clicking here - | info: Found 3 definitions --> mymodule.py:2:5 | @@ -545,7 +518,6 @@ def other_function(): ... 7 | 8 | def my_function(): | ----------- - | "#); } @@ -590,13 +562,11 @@ class MyOtherClass: | 3 | x = MyClass | ^^^^^^^ Clicking here - | info: Found 1 definition --> mymodule.py:2:7 | 2 | class MyClass: | ------- - | "); } @@ -634,13 +604,11 @@ class MyOtherClass: | 2 | class MyClass: | ^^^^^^^ Clicking here - | info: Found 1 definition --> mymodule.py:2:7 | 2 | class MyClass: | ------- - | "); } @@ -685,13 +653,11 @@ class MyOtherClass: | 3 | x = MyClass(0) | ^^^^^^^ Clicking here - | info: Found 1 definition --> mymodule.py:2:7 | 2 | class MyClass: | ------- - | "); } @@ -740,13 +706,11 @@ class MyOtherClass: | 4 | x.action() | ^^^^^^ Clicking here - | info: Found 1 definition --> mymodule.py:5:9 | 5 | def action(self): | ------ - | "); } @@ -784,13 +748,11 @@ class MyClass: | 4 | x.sound | ^^^^^ Clicking here - | info: Found 1 definition --> mymodule.py:3:5 | 3 | sound: str = "generic" | ----- - | "#); } @@ -825,13 +787,11 @@ COUNT: int | 3 | mymodule.COUNT | ^^^^^ Clicking here - | info: Found 1 definition --> mymodule.py:2:1 | 2 | COUNT = 0 | ----- - | "); } @@ -879,13 +839,11 @@ class MyOtherClass: | 3 | x = MyClass.action() | ^^^^^^ Clicking here - | info: Found 1 definition --> mymodule.py:5:9 | 5 | def action(): | ------ - | "); } @@ -919,13 +877,11 @@ class MyClass: ... | 2 | from mymodule import MyClass | ^^^^^^^ Clicking here - | info: Found 1 definition --> mymodule.py:2:7 | 2 | class MyClass: ... | ------- - | "); } @@ -953,13 +909,11 @@ my_func(my_other_func(ab=5, y=2), 0) | 5 | my_other_func(my_func(ab=5, y=2), 0) | ^^ Clicking here - | info: Found 1 definition --> main.py:2:13 | 2 | def my_func(ab, y, z = None): ... | -- - | "); } @@ -987,13 +941,11 @@ my_func(my_other_func(ab=5, y=2), 0) | 6 | my_func(my_other_func(ab=5, y=2), 0) | ^^ Clicking here - | info: Found 1 definition --> main.py:3:19 | 3 | def my_other_func(ab, y): ... | -- - | "); } @@ -1021,13 +973,11 @@ my_func(my_other_func(ab=5, y=2), 0) | 5 | my_other_func(my_func(ab=5, y=2), 0) | ^^ Clicking here - | info: Found 1 definition --> main.py:2:13 | 2 | def my_func(ab, y): ... | -- - | "); } @@ -1055,13 +1005,11 @@ my_func(my_other_func(ab=5, y=2), 0) | 6 | my_func(my_other_func(ab=5, y=2), 0) | ^^ Clicking here - | info: Found 1 definition --> main.py:3:19 | 3 | def my_other_func(ab, y): ... | -- - | "); } @@ -1103,13 +1051,11 @@ def ab(a: str): ... | 4 | ab(1) | ^^ Clicking here - | info: Found 1 definition --> mymodule.py:2:5 | 2 | def ab(a): | -- - | "); } @@ -1151,13 +1097,11 @@ def ab(a: str): ... | 4 | ab("hello") | ^^ Clicking here - | info: Found 1 definition --> mymodule.py:2:5 | 2 | def ab(a): | -- - | "#); } @@ -1199,13 +1143,11 @@ def ab(a: int): ... | 4 | ab(1, 2) | ^^ Clicking here - | info: Found 1 definition --> mymodule.py:2:5 | 2 | def ab(a, b = None): | -- - | "); } @@ -1247,13 +1189,11 @@ def ab(a: int): ... | 4 | ab(1) | ^^ Clicking here - | info: Found 1 definition --> mymodule.py:2:5 | 2 | def ab(a, b = None): | -- - | "); } @@ -1298,13 +1238,11 @@ def ab(a: int, *, c: int): ... | 4 | ab(1, b=2) | ^^ Clicking here - | info: Found 1 definition --> mymodule.py:2:5 | 2 | def ab(a, *, b = None, c = None): | -- - | "); } @@ -1349,13 +1287,11 @@ def ab(a: int, *, c: int): ... | 4 | ab(1, c=2) | ^^ Clicking here - | info: Found 1 definition --> mymodule.py:2:5 | 2 | def ab(a, *, b = None, c = None): | -- - | "); } @@ -1384,13 +1320,11 @@ a + b | 10 | a + b | ^ Clicking here - | info: Found 1 definition --> main.py:3:9 | 3 | def __add__(self, other): | ------- - | "); } @@ -1417,13 +1351,11 @@ B() + A() | 8 | B() + A() | ^ Clicking here - | info: Found 1 definition --> main.py:3:9 | 3 | def __radd__(self, other) -> A: | -------- - | "); } @@ -1452,13 +1384,11 @@ a+b | 10 | a+b | ^ Clicking here - | info: Found 1 definition --> main.py:3:9 | 3 | def __add__(self, other): | ------- - | "); } @@ -1487,13 +1417,11 @@ a+b | 10 | a+b | ^ Clicking here - | info: Found 1 definition --> main.py:8:1 | 8 | b = Test() | - - | "); } @@ -1541,13 +1469,11 @@ a = Test() | 7 | ~a | ^ Clicking here - | info: Found 1 definition --> main.py:3:9 | 3 | def __invert__(self) -> 'Test': ... | ---------- - | "); } @@ -1574,13 +1500,11 @@ a = Test() | 7 | ~a | ^ Clicking here - | info: Found 1 definition --> main.py:3:9 | 3 | def __invert__(self, extra_arg) -> 'Test': ... | ---------- - | "); } @@ -1606,13 +1530,11 @@ a = Test() | 7 | ~ a | ^ Clicking here - | info: Found 1 definition --> main.py:3:9 | 3 | def __invert__(self) -> 'Test': ... | ---------- - | "); } @@ -1638,13 +1560,11 @@ a = Test() | 7 | -a | ^ Clicking here - | info: Found 1 definition --> main.py:5:1 | 5 | a = Test() | - - | "); } @@ -1670,13 +1590,11 @@ a = Test() | 7 | not a | ^^^ Clicking here - | info: Found 1 definition --> main.py:3:9 | 3 | def __bool__(self) -> bool: ... | -------- - | "); } @@ -1702,13 +1620,11 @@ a = Test() | 7 | not a | ^^^ Clicking here - | info: Found 1 definition --> main.py:3:9 | 3 | def __len__(self) -> 42: ... | ------- - | "); } @@ -1738,13 +1654,11 @@ a = Test() | 8 | not a | ^^^ Clicking here - | info: Found 1 definition --> main.py:3:9 | 3 | def __bool__(self, extra_arg) -> bool: ... | -------- - | "); } @@ -1774,13 +1688,11 @@ a = Test() | 7 | not a | ^^^ Clicking here - | info: Found 1 definition --> main.py:3:9 | 3 | def __len__(self, extra_arg) -> 42: ... | ------- - | "); } @@ -1801,7 +1713,6 @@ a: float = 3.14 | LL | a: float = 3.14 | ^^^^^ Clicking here - | info: Found 2 definitions --> stdlib/builtins.pyi:LL:7 | @@ -1812,7 +1723,6 @@ a: float = 3.14 | LL | class float: | ----- - | "); } @@ -1833,7 +1743,6 @@ a: complex = 3.14 | LL | a: complex = 3.14 | ^^^^^^^ Clicking here - | info: Found 3 definitions --> stdlib/builtins.pyi:LL:7 | @@ -1849,7 +1758,6 @@ a: complex = 3.14 | LL | class complex: | ------- - | "); } @@ -1891,13 +1799,11 @@ x = MyClass() | 5 | x = MyClass() | ^^^^^^^ Clicking here - | info: Found 1 definition --> main.py:3:9 | 3 | def __init__(self, val): | -------- - | "); } @@ -1922,13 +1828,11 @@ x = MyClass() | 5 | x = MyClass() | ^^^^^^^ Clicking here - | info: Found 1 definition --> main.py:3:9 | 3 | def __init__(self, val): | -------- - | "); } @@ -1979,13 +1883,11 @@ x = MyClass(foo) | 7 | x = MyClass(foo) | ^^^ Clicking here - | info: Found 1 definition --> main.py:2:1 | 2 | foo = 1 | --- - | ", ); } @@ -2013,7 +1915,6 @@ x = MyClass() | 7 | x = MyClass() | ^^^^^^^ Clicking here - | info: Found 2 definitions --> main.py:3:9 | @@ -2022,7 +1923,6 @@ x = MyClass() 4 | self.val = val 5 | def __new__(self, val): | ------- - | "); } @@ -2046,13 +1946,11 @@ x = DynClass() | 4 | x = DynClass() | ^^^^^^^^ Clicking here - | info: Found 1 definition --> main.py:2:1 | 2 | DynClass = type("DynClass", (), {}) | -------- - | "#); } @@ -2080,13 +1978,11 @@ x = DynClass() | LL | x = DynClass() | ^^^^^^^^ Clicking here - | info: Found 1 definition --> stdlib/builtins.pyi:LL:9 | LL | def __new__(cls) -> Self: ... | ------- - | "); } @@ -2128,13 +2024,11 @@ p = Point(1, 2) | 6 | p = Point(1, 2) | ^^^^^ Clicking here - | info: Found 1 definition --> main.py:4:1 | 4 | Point = namedtuple("Point", ["x", "y"]) | ----- - | "#); } @@ -2166,13 +2060,11 @@ p = Point(1, 2) | 6 | p = Point(1, 2) | ^^^^^ Clicking here - | info: Found 1 definition --> main.py:4:1 | 4 | Point = namedtuple("Point", ["x", "y"]) | ----- - | "#); } @@ -2200,7 +2092,6 @@ p = Point(1, 2) | 6 | print(a) | ^ Clicking here - | info: Found 3 definitions --> main.py:2:1 | @@ -2214,7 +2105,6 @@ p = Point(1, 2) 7 | 8 | a: bool = True | - - | "#); } @@ -2241,7 +2131,6 @@ p = Point(1, 2) | 8 | test.a | ^ Clicking here - | info: Found 2 definitions --> main.py:3:5 | @@ -2249,7 +2138,6 @@ p = Point(1, 2) | - 4 | a: str | - - | "); } @@ -2281,7 +2169,6 @@ p = Point(1, 2) | 13 | test.a | ^ Clicking here - | info: Found 2 definitions --> main.py:4:9 | @@ -2292,7 +2179,6 @@ p = Point(1, 2) | 8 | def a(self, value: str) -> None: | - - | "); } @@ -2316,13 +2202,11 @@ p = Point(1, 2) | LL | Foo.__dictoffset__ | ^^^^^^^^^^^^^^ Clicking here - | info: Found 1 definition --> stdlib/builtins.pyi:LL:9 | LL | def __dictoffset__(self) -> int: ... | -------------- - | "); } @@ -2348,13 +2232,11 @@ p = Point(1, 2) | 6 | Bar.a | ^ Clicking here - | info: Found 1 definition --> main.py:3:5 | 3 | a: int | - - | "); } @@ -2404,13 +2286,11 @@ p = Point(1, 2) | LL | type.__dictoffset__ | ^^^^^^^^^^^^^^ Clicking here - | info: Found 1 definition --> stdlib/builtins.pyi:LL:9 | LL | def __dictoffset__(self) -> int: ... | -------------- - | "); } @@ -2435,13 +2315,11 @@ while True: | 5 | variable | ^^^^^^^^ Clicking here - | info: Found 1 definition --> main.py:3:5 | 3 | variable = 1 | -------- - | "); } @@ -2468,13 +2346,11 @@ TD(f=1) | 8 | TD(f=1) | ^ Clicking here - | info: Found 1 definition --> main.py:5:5 | 5 | f: int | - - | "); } @@ -2502,13 +2378,11 @@ td.update(f=2) | 9 | td.update(f=2) | ^ Clicking here - | info: Found 1 definition --> main.py:5:5 | 5 | f: int | - - | "); } @@ -2537,13 +2411,11 @@ func(f=1) | 10 | func(f=1) | ^ Clicking here - | info: Found 1 definition --> main.py:5:5 | 5 | f: int | - - | "); } @@ -2570,13 +2442,11 @@ NT(f=1) | 8 | NT(f=1) | ^ Clicking here - | info: Found 1 definition --> main.py:5:5 | 5 | f: int | - - | "); } @@ -2604,13 +2474,11 @@ DC(f=1) | 9 | DC(f=1) | ^ Clicking here - | info: Found 1 definition --> main.py:6:5 | 6 | f: int | - - | "); } @@ -2640,13 +2508,11 @@ DC(f=1) | 11 | DC(f=1) | ^ Clicking here - | info: Found 1 definition --> main.py:9:24 | 9 | def __init__(self, f: int) -> None: ... | - - | "); } @@ -2677,13 +2543,11 @@ DC(g=1) | 12 | DC(g=1) | ^ Clicking here - | info: Found 1 definition --> main.py:10:5 | 10 | f: int = Field(alias='g') | - - | "); } @@ -2708,13 +2572,11 @@ for x in range(10): | 5 | variable | ^^^^^^^^ Clicking here - | info: Found 1 definition --> main.py:3:5 | 3 | variable = 1 | -------- - | "); } @@ -2742,13 +2604,11 @@ class Bar(Foo): | 8 | super().__init__(x) | ^^^^^^^^ Clicking here - | info: Found 1 definition --> main.py:3:9 | 3 | def __init__(self, x: int) -> None: | -------- - | "); } @@ -2777,13 +2637,11 @@ class GenericFoo[T](Base): | 8 | super().__init__(x) | ^^^^^^^^ Clicking here - | info: Found 1 definition --> main.py:3:9 | 3 | def __init__(self, x: int) -> None: | -------- - | "); } diff --git a/crates/ty_ide/src/goto_implementation.rs b/crates/ty_ide/src/goto_implementation.rs index 5038ac6c6e7f95..175286ae005bd3 100644 --- a/crates/ty_ide/src/goto_implementation.rs +++ b/crates/ty_ide/src/goto_implementation.rs @@ -204,7 +204,6 @@ mod tests { | 12 | animal.speak() | ^^^^^ Clicking here - | info: Found 3 implementations --> main.py:3:9 | @@ -218,7 +217,6 @@ mod tests { 8 | class Cat(Animal): 9 | def speak(self): ... | ----- - | "); } @@ -251,7 +249,6 @@ mod tests { | 17 | animal.speak() | ^^^^^ Clicking here - | info: Found 3 implementations --> main.py:6:9 | @@ -266,7 +263,6 @@ mod tests { | 13 | def speak(self) -> str: | ----- - | "); } @@ -294,7 +290,6 @@ mod tests { | 12 | animal.speak() | ^^^^^ Clicking here - | info: Found 2 implementations --> main.py:3:9 | @@ -305,7 +300,6 @@ mod tests { | 9 | def speak(self): ... | ----- - | "); } @@ -330,13 +324,11 @@ mod tests { | 9 | dog.speak() | ^^^^^ Clicking here - | info: Found 1 implementation --> main.py:3:9 | 3 | def speak(self): ... | ----- - | "); } @@ -364,13 +356,11 @@ mod tests { | 12 | dog.speak() | ^^^^^ Clicking here - | info: Found 1 implementation --> main.py:6:9 | 6 | def speak(self): ... | ----- - | "); } @@ -395,13 +385,11 @@ mod tests { | 9 | dog.speak() | ^^^^^ Clicking here - | info: Found 1 implementation --> main.py:6:5 | 6 | speak = 1 | ----- - | "); } @@ -445,13 +433,11 @@ mod tests { | 13 | animal.speak(1) | ^^^^^ Clicking here - | info: Found 1 implementation --> main.py:9:9 | 9 | def speak(self, volume: int | str) -> int | str: | ----- - | "); } @@ -482,13 +468,11 @@ mod tests { | 15 | animal.speak(1) | ^^^^^ Clicking here - | info: Found 1 implementation --> main.py:11:9 | 11 | def speak(self, volume: int | str) -> int | str: | ----- - | "); } @@ -524,7 +508,6 @@ mod tests { | 7 | def value(self, value: int) -> None: ... | ^^^^^ Clicking here - | info: Found 2 implementations --> main.py:7:9 | @@ -535,7 +518,6 @@ mod tests { | 17 | def value(self, value: int) -> None: ... | ----- - | "); } @@ -574,7 +556,6 @@ mod tests { | 23 | return base.value | ^^^^^ Clicking here - | info: Found 2 implementations --> main.py:4:9 | @@ -585,7 +566,6 @@ mod tests { | 14 | def value(self) -> int: ... | ----- - | "); } @@ -624,7 +604,6 @@ mod tests { | 23 | base.value = value | ^^^^^ Clicking here - | info: Found 2 implementations --> main.py:7:9 | @@ -635,7 +614,6 @@ mod tests { | 17 | def value(self, value: int) -> None: ... | ----- - | "); } @@ -663,13 +641,11 @@ mod tests { | 12 | pet.speak() | ^^^^^ Clicking here - | info: Found 1 implementation --> main.py:3:9 | 3 | def speak(self): ... | ----- - | "); } @@ -694,7 +670,6 @@ mod tests { | 9 | animal.speak() | ^^^^^ Clicking here - | info: Found 2 implementations --> main.py:3:9 | @@ -704,7 +679,6 @@ mod tests { 5 | class Dog(Animal): 6 | def speak(self): ... | ----- - | "); } @@ -732,7 +706,6 @@ mod tests { | 8 | cls.speak() | ^^^^^ Clicking here - | info: Found 2 implementations --> main.py:4:9 | @@ -743,7 +716,6 @@ mod tests { | 12 | def speak(cls): ... | ----- - | "); } @@ -770,7 +742,6 @@ mod tests { | 11 | cls.speak() | ^^^^^ Clicking here - | info: Found 2 implementations --> main.py:4:9 | @@ -781,7 +752,6 @@ mod tests { 7 | @classmethod 8 | def speak(cls): ... | ----- - | "); } @@ -818,7 +788,6 @@ mod tests { | 3 | def method(self): ... | ^^^^^^ Clicking here - | info: Found 2 implementations --> base.py:3:9 | @@ -829,7 +798,6 @@ mod tests { | 5 | def method(self): ... | ------ - | "); } @@ -912,13 +880,11 @@ class MyClass: | 4 | x.action() | ^^^^^^ Clicking here - | info: Found 1 implementation --> mymodule.py:5:9 | 5 | def action(self): | ------ - | "); } @@ -964,13 +930,11 @@ class MyClass: | 4 | x.action(1) | ^^^^^^ Clicking here - | info: Found 1 implementation --> mymodule.py:5:9 | 5 | def action(self, value): | ------ - | "); } @@ -1021,7 +985,6 @@ class MyClass: | 3 | def speak(self): ... | ^^^^^ Clicking here - | info: Found 2 implementations --> main.py:3:9 | @@ -1031,7 +994,6 @@ class MyClass: 5 | class Dog(Animal): 6 | def speak(self): ... | ----- - | "); } @@ -1071,7 +1033,6 @@ class MyClass: | 4 | class Animal(ABC): | ^^^^^^ Clicking here - | info: Found 3 implementations --> main.py:4:7 | @@ -1085,7 +1046,6 @@ class MyClass: 9 | 10 | class Cat(Animal): | --- - | "); } @@ -1115,7 +1075,6 @@ class MyClass: | 2 | class Animal: | ^^^^^^ Clicking here - | info: Found 2 implementations --> main.py:2:7 | @@ -1125,7 +1084,6 @@ class MyClass: 4 | 5 | class Dog(Animal): | --- - | "); } @@ -1144,13 +1102,11 @@ class MyClass: | 2 | class Widget: | ^^^^^^ Clicking here - | info: Found 1 implementation --> main.py:2:7 | 2 | class Widget: | ------ - | "); } @@ -1175,7 +1131,6 @@ class MyClass: | 5 | class Mammal(Animal): | ^^^^^^ Clicking here - | info: Found 2 implementations --> main.py:5:7 | @@ -1185,7 +1140,6 @@ class MyClass: 7 | 8 | class Dog(Mammal): | --- - | "); } @@ -1213,7 +1167,6 @@ class MyClass: | 2 | class Base: | ^^^^ Clicking here - | info: Found 4 implementations --> main.py:2:7 | @@ -1231,7 +1184,6 @@ class MyClass: 10 | 11 | class Diamond(Left, Right): | ------- - | "); } @@ -1253,7 +1205,6 @@ class MyClass: | 2 | class Container[T]: | ^^^^^^^^^ Clicking here - | info: Found 2 implementations --> main.py:2:7 | @@ -1263,7 +1214,6 @@ class MyClass: 4 | 5 | class IntContainer(Container[int]): | ------------ - | "); } @@ -1288,7 +1238,6 @@ class MyClass: | 8 | def f(x: Animal): | ^^^^^^ Clicking here - | info: Found 2 implementations --> main.py:2:7 | @@ -1298,7 +1247,6 @@ class MyClass: 4 | 5 | class Dog(Animal): | --- - | "); } @@ -1323,7 +1271,6 @@ class MyClass: | 8 | def f(x: "Animal"): | ^^^^^^ Clicking here - | info: Found 2 implementations --> main.py:2:7 | @@ -1333,7 +1280,6 @@ class MyClass: 4 | 5 | class Dog(Animal): | --- - | "#); } @@ -1364,7 +1310,6 @@ class MyClass: | 4 | class Dog(animals.Animal): | ^^^^^^ Clicking here - | info: Found 2 implementations --> animals.py:2:7 | @@ -1375,7 +1320,6 @@ class MyClass: | 4 | class Dog(animals.Animal): | --- - | "); } @@ -1408,7 +1352,6 @@ class MyClass: | 7 | animals.Animal() | ^^^^^^ Clicking here - | info: Found 2 implementations --> animals.py:2:7 | @@ -1419,7 +1362,6 @@ class MyClass: | 4 | class Dog(animals.Animal): | --- - | "); } @@ -1446,7 +1388,6 @@ class MyClass: | 11 | Base() | ^^^^ Clicking here - | info: Found 2 implementations --> main.py:5:7 | @@ -1456,7 +1397,6 @@ class MyClass: 7 | 8 | class Child(Base): | ----- - | "); } @@ -1482,7 +1422,6 @@ class MyClass: | 9 | def f(x: Outer.Inner): | ^^^^^ Clicking here - | info: Found 2 implementations --> main.py:3:11 | @@ -1492,7 +1431,6 @@ class MyClass: 5 | 6 | class SubInner(Outer.Inner): | -------- - | "); } @@ -1519,13 +1457,11 @@ class MyClass: | 9 | factory.dog_cls | ^^^^^^^ Clicking here - | info: Found 1 implementation --> main.py:2:7 | 2 | class Dog: | --- - | "); } @@ -1559,7 +1495,6 @@ class MyClass: | 18 | factory.item | ^^^^ Clicking here - | info: Found 3 implementations --> main.py:11:5 | @@ -1571,7 +1506,6 @@ class MyClass: 14 | else: 15 | item = 0 | ---- - | "); } @@ -1659,7 +1593,6 @@ class MyClass: | 2 | class Base: | ^^^^ Clicking here - | info: Found 2 implementations --> main.py:2:7 | @@ -1670,7 +1603,6 @@ class MyClass: | 4 | class Derived(Base): | ------- - | "); } @@ -1698,7 +1630,6 @@ class MyClass: | 12 | animal.sound | ^^^^^ Clicking here - | info: Found 3 implementations --> main.py:3:5 | @@ -1712,7 +1643,6 @@ class MyClass: 8 | class Cat(Animal): 9 | sound: str = "meow" | ----- - | "#); } @@ -1737,7 +1667,6 @@ class MyClass: | 9 | animal.sound | ^^^^^ Clicking here - | info: Found 2 implementations --> main.py:3:5 | @@ -1747,7 +1676,6 @@ class MyClass: 5 | class Dog(Animal): 6 | sound = "woof" | ----- - | "#); } @@ -1772,7 +1700,6 @@ class MyClass: | 9 | animal.sound | ^^^^^ Clicking here - | info: Found 2 implementations --> main.py:3:5 | @@ -1782,7 +1709,6 @@ class MyClass: 5 | class Dog(Animal): 6 | sound: str = "woof" | ----- - | "#); } @@ -1807,7 +1733,6 @@ class MyClass: | 9 | animal.speak | ^^^^^ Clicking here - | info: Found 2 implementations --> main.py:3:9 | @@ -1817,7 +1742,6 @@ class MyClass: 5 | class Dog(Animal): 6 | speak = 1 | ----- - | "); } @@ -1844,7 +1768,6 @@ class MyClass: | 11 | animal.sound | ^^^^^ Clicking here - | info: Found 2 implementations --> main.py:4:9 | @@ -1855,7 +1778,6 @@ class MyClass: 7 | def __init__(self): 8 | self.sound = "woof" | ---------- - | "#); } @@ -1885,13 +1807,11 @@ class MyClass: | 14 | dog.sound | ^^^^^ Clicking here - | info: Found 1 implementation --> main.py:4:9 | 4 | self.sound = "generic" | ---------- - | "#); } @@ -1917,7 +1837,6 @@ class MyClass: | 10 | animal.sound | ^^^^^ Clicking here - | info: Found 2 implementations --> main.py:3:5 | @@ -1928,7 +1847,6 @@ class MyClass: 6 | def __init__(self): 7 | self.sound = "woof" | ---------- - | "#); } @@ -1954,13 +1872,11 @@ class MyClass: | 8 | animal.sound | ^^^^^ Clicking here - | info: Found 1 implementation --> main.py:3:5 | 3 | sound: str = "generic" | ----- - | "#); } @@ -1997,13 +1913,11 @@ class MyClass: | 4 | x.sound | ^^^^^ Clicking here - | info: Found 1 implementation --> mymodule.py:3:5 | 3 | sound: str = "generic" | ----- - | "#); } @@ -2037,7 +1951,6 @@ class MyClass: | 14 | speaker.speak() | ^^^^^ Clicking here - | info: Found 2 implementations --> main.py:5:9 | @@ -2048,7 +1961,6 @@ class MyClass: | 11 | def speak(self) -> None: ... | ----- - | "); } @@ -2082,7 +1994,6 @@ class MyClass: | 16 | animal.speak() | ^^^^^ Clicking here - | info: Found 2 implementations --> main.py:5:9 | @@ -2093,7 +2004,6 @@ class MyClass: 8 | class Dog(Animal): 9 | def speak(self): ... | ----- - | "); } @@ -2121,13 +2031,11 @@ class MyClass: | 12 | animal.speak() | ^^^^^ Clicking here - | info: Found 1 implementation --> main.py:5:9 | 5 | def speak(self): ... | ----- - | "); } @@ -2156,13 +2064,11 @@ class MyClass: | 13 | animal.sound | ^^^^^ Clicking here - | info: Found 1 implementation --> main.py:5:5 | 5 | sound: str = "generic" | ----- - | "#); } diff --git a/crates/ty_ide/src/goto_type_definition.rs b/crates/ty_ide/src/goto_type_definition.rs index 9e4512b1b0f065..c5969957bd6026 100644 --- a/crates/ty_ide/src/goto_type_definition.rs +++ b/crates/ty_ide/src/goto_type_definition.rs @@ -48,13 +48,11 @@ mod tests { | 4 | ab = Test() | ^^ Clicking here - | info: Found 1 type definition --> main.py:2:7 | 2 | class Test: ... | ---- - | "); } @@ -74,13 +72,11 @@ mod tests { | LL | ab = Literal | ^^ Clicking here - | info: Found 1 type definition --> stdlib/typing.pyi:LL:1 | LL | Literal: _SpecialForm | ------- - | "); } @@ -102,13 +98,11 @@ mod tests { | LL | ab = Any | ^^ Clicking here - | info: Found 1 type definition --> stdlib/typing.pyi:LL:7 | LL | class Any: | --- - | "); } @@ -129,13 +123,11 @@ mod tests { | LL | ab = Generic | ^^ Clicking here - | info: Found 1 type definition --> stdlib/typing.pyi:LL:1 | LL | Generic: type[_Generic] | ------- - | "); } @@ -155,13 +147,11 @@ mod tests { | LL | ab = AlwaysTruthy | ^^ Clicking here - | info: Found 1 type definition --> stdlib/ty_extensions/__init__.pyi:LL:1 | LL | AlwaysTruthy: _SpecialForm | ------------ - | "); } @@ -183,13 +173,11 @@ mod tests { | LL | D().x | ^ Clicking here - | info: Found 1 type definition --> stdlib/ty_extensions/_internal.pyi:LL:1 | LL | Divergent: _SpecialForm | --------- - | "); } @@ -211,13 +199,11 @@ mod tests { | 6 | ab | ^^ Clicking here - | info: Found 1 type definition --> main.py:2:5 | 2 | def foo(a, b): ... | --- - | "); } @@ -245,7 +231,6 @@ mod tests { | 12 | a | ^ Clicking here - | info: Found 2 type definitions --> main.py:3:5 | @@ -254,7 +239,6 @@ mod tests { 4 | 5 | def bar(a, b): ... | --- - | "); } @@ -282,13 +266,11 @@ mod tests { | 12 | color | ^^^^^ Clicking here - | info: Found 1 type definition --> main.py:6:5 | 6 | BLUE = 2 | ---- - | "#); } @@ -317,7 +299,6 @@ mod tests { | 13 | color | ^^^^^ Clicking here - | info: Found 2 type definitions --> main.py:6:5 | @@ -325,7 +306,6 @@ mod tests { | ----- 7 | BLUE = 3 | ---- - | "#); } @@ -345,13 +325,11 @@ mod tests { | 2 | import lib | ^^^ Clicking here - | info: Found 1 type definition --> lib.py:1:1 | 1 | a = 10 | ------ - | "); } @@ -372,13 +350,11 @@ mod tests { | 2 | import lib.submod | ^^^ Clicking here - | info: Found 1 type definition --> lib/__init__.py:1:1 | 1 | b = 7 | ----- - | "); } @@ -399,13 +375,11 @@ mod tests { | 2 | import lib.submod | ^^^^^^ Clicking here - | info: Found 1 type definition --> lib/submod.py:1:1 | 1 | a = 10 | ------ - | "); } @@ -425,13 +399,11 @@ mod tests { | 2 | from lib import a | ^^^ Clicking here - | info: Found 1 type definition --> lib.py:1:1 | 1 | a = 10 | ------ - | "); } @@ -452,13 +424,11 @@ mod tests { | 2 | from lib.submod import a | ^^^ Clicking here - | info: Found 1 type definition --> lib/__init__.py:1:1 | 1 | b = 7 | ----- - | "); } @@ -479,13 +449,11 @@ mod tests { | 2 | from lib.submod import a | ^^^^^^ Clicking here - | info: Found 1 type definition --> lib/submod.py:1:1 | 1 | a = 10 | ------ - | "); } @@ -515,13 +483,11 @@ mod tests { | 2 | from .bot.botmod import * | ^^^^^^ Clicking here - | info: Found 1 type definition --> lib/sub/bot/botmod.py:1:1 | 1 | botmod = 31 | ----------- - | "); } @@ -551,13 +517,11 @@ mod tests { | 2 | from .bot.botmod import * | ^^^ Clicking here - | info: Found 1 type definition --> lib/sub/bot/__init__.py:1:1 | 1 | bot = 3 | ------- - | "); } @@ -587,13 +551,11 @@ mod tests { | 2 | from .bot.botmod import * | ^^^ Clicking here - | info: Found 1 type definition --> lib/sub/bot/__init__.py:1:1 | 1 | bot = 3 | ------- - | "); } @@ -638,13 +600,11 @@ mod tests { | 4 | lib | ^^^ Clicking here - | info: Found 1 type definition --> lib.py:1:1 | 1 | a = 10 | ------ - | "); } @@ -664,13 +624,11 @@ mod tests { | LL | a | ^ Clicking here - | info: Found 1 type definition --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | --- - | "); } #[test] @@ -687,13 +645,11 @@ mod tests { | LL | a: str = "test" | ^^^^^^ Clicking here - | info: Found 1 type definition --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | --- - | "#); } @@ -711,13 +667,11 @@ mod tests { | 2 | type Alias[T: int = bool] = list[T] | ^ Clicking here - | info: Found 1 type definition --> main.py:2:12 | 2 | type Alias[T: int = bool] = list[T] | - - | "); } @@ -735,13 +689,11 @@ mod tests { | 2 | type Alias[**P = [int, str]] = Callable[P, int] | ^ Clicking here - | info: Found 1 type definition --> main.py:2:14 | 2 | type Alias[**P = [int, str]] = Callable[P, int] | - - | "); } @@ -759,13 +711,11 @@ mod tests { | 2 | type Alias[*Ts = ()] = tuple[*Ts] | ^^ Clicking here - | info: Found 1 type definition --> main.py:2:13 | 2 | type Alias[*Ts = ()] = tuple[*Ts] | -- - | "); } @@ -787,13 +737,11 @@ mod tests { | 6 | Alias | ^^^^^ Clicking here - | info: Found 1 type definition --> main.py:4:1 | 4 | Alias = TypeAliasType("Alias", tuple[int, int]) | ----- - | "#); } @@ -814,13 +762,11 @@ mod tests { | 2 | a: "MyClass" = 1 | ^^^^^^^ Clicking here - | info: Found 1 type definition --> main.py:4:7 | 4 | class MyClass: | ------- - | "#); } @@ -841,13 +787,11 @@ mod tests { | 2 | a: "None | MyClass" = 1 | ^^^^^^^ Clicking here - | info: Found 1 type definition --> main.py:4:7 | 4 | class MyClass: | ------- - | "#); } @@ -868,7 +812,6 @@ mod tests { | LL | a: "None | MyClass" = 1 | ^^^^^^^^^^^^^^^^ Clicking here - | info: Found 2 type definitions --> main.py:LL:7 | @@ -879,7 +822,6 @@ mod tests { | LL | class NoneType: | -------- - | "#); } @@ -900,13 +842,11 @@ mod tests { | 2 | a: "None | MyClass" = 1 | ^^^^^^^ Clicking here - | info: Found 1 type definition --> main.py:4:7 | 4 | class MyClass: | ------- - | "#); } @@ -927,7 +867,6 @@ mod tests { | LL | a: "None | MyClass" = 1 | ^^^^^^^^^^^^^^^^ Clicking here - | info: Found 2 type definitions --> main.py:LL:7 | @@ -938,7 +877,6 @@ mod tests { | LL | class NoneType: | -------- - | "#); } @@ -959,13 +897,11 @@ mod tests { | LL | a: "MyClass |" = 1 | ^^^^^^^^^^^ Clicking here - | info: Found 1 type definition --> stdlib/ty_extensions/__init__.pyi:LL:1 | LL | Unknown: _SpecialForm | ------- - | "#); } @@ -986,13 +922,11 @@ mod tests { | 2 | a: "MyClass | No" = 1 | ^^^^^^^ Clicking here - | info: Found 1 type definition --> main.py:4:7 | 4 | class MyClass: | ------- - | "#); } @@ -1013,13 +947,11 @@ mod tests { | LL | a: "MyClass | No" = 1 | ^^ Clicking here - | info: Found 1 type definition --> stdlib/ty_extensions/__init__.pyi:LL:1 | LL | Unknown: _SpecialForm | ------- - | "#); } @@ -1037,13 +969,11 @@ mod tests { | LL | ab: "ab" | ^^ Clicking here - | info: Found 1 type definition --> stdlib/ty_extensions/__init__.pyi:LL:1 | LL | Unknown: _SpecialForm | ------- - | "#); } @@ -1061,13 +991,11 @@ mod tests { | LL | x: "foobar" | ^^^^^^ Clicking here - | info: Found 1 type definition --> stdlib/ty_extensions/__init__.pyi:LL:1 | LL | Unknown: _SpecialForm | ------- - | "#); } @@ -1088,13 +1016,11 @@ mod tests { | 2 | x: "list['MyClass | int'] | None" | ^^^^^^^ Clicking here - | info: Found 1 type definition --> main.py:4:7 | 4 | class MyClass: | ------- - | "#); } @@ -1115,13 +1041,11 @@ mod tests { | 2 | x: "list['int | MyClass'] | None" | ^^^^^^^ Clicking here - | info: Found 1 type definition --> main.py:4:7 | 4 | class MyClass: | ------- - | "#); } @@ -1142,13 +1066,11 @@ mod tests { | 2 | x: "list['int | None'] | MyClass" | ^^^^^^^ Clicking here - | info: Found 1 type definition --> main.py:4:7 | 4 | class MyClass: | ------- - | "#); } @@ -1169,13 +1091,11 @@ mod tests { | 2 | x: "list['int' | 'MyClass'] | None" | ^^^^^^^ Clicking here - | info: Found 1 type definition --> main.py:4:7 | 4 | class MyClass: | ------- - | "#); } @@ -1196,13 +1116,11 @@ mod tests { | 2 | x: "list['MyClass' | 'str'] | None" | ^^^^^^^ Clicking here - | info: Found 1 type definition --> main.py:4:7 | 4 | class MyClass: | ------- - | "#); } @@ -1223,13 +1141,11 @@ mod tests { | LL | x: """'list["MyClass" | "str"]' | None""" | ^^^^^^^^^ Clicking here - | info: Found 1 type definition --> stdlib/ty_extensions/__init__.pyi:LL:1 | LL | Unknown: _SpecialForm | ------- - | "#); } @@ -1250,13 +1166,11 @@ mod tests { | 2 | x: """'list["int" | "str"]' | MyClass""" | ^^^^^^^ Clicking here - | info: Found 1 type definition --> main.py:4:7 | 4 | class MyClass: | ------- - | "#); } @@ -1291,13 +1205,11 @@ mod tests { | LL | x = ab | ^^ Clicking here - | info: Found 1 type definition --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | --- - | "#); } @@ -1332,13 +1244,11 @@ mod tests { | LL | x = ab | ^^ Clicking here - | info: Found 1 type definition --> stdlib/builtins.pyi:LL:7 | LL | class list(MutableSequence[_T]): | ---- - | "#); } @@ -1373,13 +1283,11 @@ mod tests { | LL | x = ab | ^^ Clicking here - | info: Found 1 type definition --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | --- - | "#); } @@ -1426,13 +1334,11 @@ mod tests { | LL | x = ab | ^^ Clicking here - | info: Found 1 type definition --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | --- - | "); } @@ -1459,13 +1365,11 @@ mod tests { | 10 | case Click(x, button=ab): | ^^^^^ Clicking here - | info: Found 1 type definition --> main.py:2:7 | 2 | class Click: | ----- - | "); } @@ -1503,13 +1407,11 @@ mod tests { | 2 | type Alias1[AB: int = bool] = tuple[AB, list[AB]] | ^^ Clicking here - | info: Found 1 type definition --> main.py:2:13 | 2 | type Alias1[AB: int = bool] = tuple[AB, list[AB]] | -- - | "); } @@ -1527,13 +1429,11 @@ mod tests { | 2 | type Alias1[AB: int = bool] = tuple[AB, list[AB]] | ^^ Clicking here - | info: Found 1 type definition --> main.py:2:13 | 2 | type Alias1[AB: int = bool] = tuple[AB, list[AB]] | -- - | "); } @@ -1552,13 +1452,11 @@ mod tests { | 3 | type Alias2[**AB = [int, str]] = Callable[AB, tuple[AB]] | ^^ Clicking here - | info: Found 1 type definition --> main.py:3:15 | 3 | type Alias2[**AB = [int, str]] = Callable[AB, tuple[AB]] | -- - | "); } @@ -1599,13 +1497,11 @@ mod tests { | 2 | type Alias3[*AB = ()] = tuple[tuple[*AB], tuple[*AB]] | ^^ Clicking here - | info: Found 1 type definition --> main.py:2:14 | 2 | type Alias3[*AB = ()] = tuple[tuple[*AB], tuple[*AB]] | -- - | "); } @@ -1625,13 +1521,11 @@ mod tests { | LL | test(a= "123") | ^ Clicking here - | info: Found 1 type definition --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | --- - | "#); } @@ -1654,13 +1548,11 @@ mod tests { | LL | test(a= 123) | ^ Clicking here - | info: Found 1 type definition --> stdlib/builtins.pyi:LL:7 | LL | class int: | --- - | "); } @@ -1682,13 +1574,11 @@ f(**kwargs) | LL | f(**kwargs) | ^^^^^^ Clicking here - | info: Found 1 type definition --> stdlib/builtins.pyi:LL:7 | LL | class dict(MutableMapping[_KT, _VT]): | ---- - | "); } @@ -1715,13 +1605,11 @@ def outer(): | LL | return x # Should find the nonlocal x declaration in outer scope | ^ Clicking here - | info: Found 1 type definition --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | --- - | "); } @@ -1765,13 +1653,11 @@ def function(): | LL | return global_var # Should find the global variable declaration | ^^^^^^^^^^ Clicking here - | info: Found 1 type definition --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | --- - | "); } @@ -1807,13 +1693,11 @@ def function(): | LL | a | ^ Clicking here - | info: Found 1 type definition --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | --- - | "); } @@ -1836,13 +1720,11 @@ def function(): | 7 | x.foo() | ^ Clicking here - | info: Found 1 type definition --> main.py:2:7 | 2 | class X: | - - | "); } @@ -1862,13 +1744,11 @@ def function(): | 4 | foo() | ^^^ Clicking here - | info: Found 1 type definition --> main.py:2:5 | 2 | def foo(a, b): ... | --- - | "); } @@ -1888,13 +1768,11 @@ def function(): | LL | print(a) | ^ Clicking here - | info: Found 1 type definition --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | --- - | "); } @@ -1913,7 +1791,6 @@ def function(): | LL | a | ^ Clicking here - | info: Found 2 type definitions --> stdlib/builtins.pyi:LL:7 | @@ -1924,7 +1801,6 @@ def function(): | LL | class NoneType: | -------- - | "); } @@ -1955,7 +1831,6 @@ def function(): | 4 | x = subpkg | ^^^^^^ Clicking here - | info: Found 1 type definition --> mypackage/subpkg/__init__.py:1:1 | @@ -1990,7 +1865,6 @@ def function(): | 2 | from .subpkg.submod import val | ^^^^^^ Clicking here - | info: Found 1 type definition --> mypackage/subpkg/__init__.py:1:1 | @@ -2025,13 +1899,11 @@ def function(): | LL | x = submod | ^^^^^^ Clicking here - | info: Found 1 type definition --> stdlib/ty_extensions/__init__.pyi:LL:1 | LL | Unknown: _SpecialForm | ------- - | "); } @@ -2062,14 +1934,12 @@ def function(): | 2 | from .subpkg.submod import val | ^^^^^^ Clicking here - | info: Found 1 type definition --> mypackage/subpkg/submod.py:1:1 | 1 | / 2 | | val: int = 0 | |_____________- - | "); } @@ -2099,14 +1969,12 @@ def function(): | 2 | from .subpkg import subpkg | ^^^^^^ Clicking here - | info: Found 1 type definition --> mypackage/subpkg/__init__.py:1:1 | 1 | / 2 | | subpkg: int = 10 | |_________________- - | "); } @@ -2136,13 +2004,11 @@ def function(): | LL | from .subpkg import subpkg | ^^^^^^ Clicking here - | info: Found 1 type definition --> stdlib/builtins.pyi:LL:7 | LL | class int: | --- - | "); } @@ -2172,13 +2038,11 @@ def function(): | LL | x = subpkg | ^^^^^^ Clicking here - | info: Found 1 type definition --> stdlib/builtins.pyi:LL:7 | LL | class int: | --- - | "); } diff --git a/crates/ty_ide/src/hover.rs b/crates/ty_ide/src/hover.rs index a0086cc2afb9e0..595e77822a2a41 100644 --- a/crates/ty_ide/src/hover.rs +++ b/crates/ty_ide/src/hover.rs @@ -453,7 +453,6 @@ mod tests { | ^- Cursor offset | | | source - | "); } @@ -511,7 +510,6 @@ mod tests { | | | | | Cursor offset | source - | "); } @@ -567,7 +565,6 @@ mod tests { | | | | | Cursor offset | source - | "); } @@ -617,7 +614,6 @@ mod tests { | | | | | Cursor offset | source - | "#); } @@ -679,7 +675,6 @@ mod tests { | | | | | Cursor offset | source - | "); } @@ -739,7 +734,6 @@ mod tests { | | | | | Cursor offset | source - | "); } @@ -793,7 +787,6 @@ mod tests { | | | | | Cursor offset | source - | "); } @@ -847,7 +840,6 @@ mod tests { | | | | | Cursor offset | source - | "); } @@ -908,7 +900,6 @@ mod tests { | | | | | Cursor offset | source - | "); } @@ -946,7 +937,6 @@ mod tests { | | | | | Cursor offset | source - | "#); } @@ -994,7 +984,6 @@ mod tests { | | | | | Cursor offset | source - | "#); } @@ -1024,7 +1013,6 @@ mod tests { | | | | | Cursor offset | source - | "); } @@ -1062,7 +1050,6 @@ mod tests { | | | | | Cursor offset | source - | "#); } @@ -1110,7 +1097,6 @@ mod tests { | | | | | Cursor offset | source - | "); } @@ -1156,7 +1142,6 @@ mod tests { | | | | | Cursor offset | source - | "#); } @@ -1206,7 +1191,6 @@ mod tests { | | | source | Cursor offset - | "); } @@ -1248,7 +1232,6 @@ mod tests { | | | source | Cursor offset - | "); } @@ -1281,7 +1264,6 @@ mod tests { | | | | | Cursor offset | source - | "); } @@ -1314,7 +1296,6 @@ mod tests { | | | | | Cursor offset | source - | "); } @@ -1355,7 +1336,6 @@ mod tests { | | | | | Cursor offset | source - | "#); } @@ -1401,7 +1381,6 @@ mod tests { | | | | | Cursor offset | source - | "); } @@ -1446,7 +1425,6 @@ mod tests { | | | | | Cursor offset | source - | "#); } @@ -1487,7 +1465,6 @@ mod tests { | | | | | Cursor offset | source - | "#); } @@ -1528,7 +1505,6 @@ mod tests { | | | | | Cursor offset | source - | "); } @@ -1600,7 +1576,6 @@ mod tests { | | | | | Cursor offset | source - | "); } @@ -1644,7 +1619,6 @@ mod tests { | || | |Cursor offset | source - | "); } @@ -1685,7 +1659,6 @@ mod tests { | | | | | Cursor offset | source - | "#); let literal_string = hover_test( @@ -1725,7 +1698,6 @@ mod tests { | | | | | Cursor offset | source - | "#); } @@ -1771,7 +1743,6 @@ mod tests { | || | |Cursor offset | source - | "); } @@ -1811,7 +1782,6 @@ mod tests { | || | |Cursor offset | source - | "); } @@ -1860,7 +1830,6 @@ mod tests { | || | |Cursor offset | source - | "); } @@ -1917,7 +1886,6 @@ mod tests { | || | |Cursor offset | source - | "); } @@ -1970,7 +1938,6 @@ mod tests { | || | |Cursor offset | source - | "); } @@ -2022,7 +1989,6 @@ mod tests { | || | |Cursor offset | source - | "); } @@ -2075,7 +2041,6 @@ mod tests { | || | |Cursor offset | source - | "); } @@ -2114,7 +2079,6 @@ mod tests { | | | source | Cursor offset - | "); } @@ -2148,7 +2112,6 @@ mod tests { | ^^^- Cursor offset | | | source - | "); } @@ -2176,7 +2139,6 @@ mod tests { | | | | | Cursor offset | source - | "); } @@ -2216,7 +2178,6 @@ mod tests { | || | |Cursor offset | source - | "); } @@ -2258,7 +2219,6 @@ mod tests { | ^^^^^- Cursor offset | | | source - | "); } @@ -2288,7 +2248,6 @@ mod tests { | || | |Cursor offset | source - | "); } @@ -2328,7 +2287,6 @@ mod tests { | || | |Cursor offset | source - | "); } @@ -2368,7 +2326,6 @@ mod tests { | | | | | Cursor offset | source - | "); } @@ -2418,7 +2375,6 @@ mod tests { | | | | | Cursor offset | source - | "); } @@ -2465,7 +2421,6 @@ mod tests { | | | | | Cursor offset | source - | "); } @@ -2502,7 +2457,6 @@ mod tests { | | | | | Cursor offset | source - | "); } @@ -2535,7 +2489,6 @@ mod tests { | || | |Cursor offset | source - | "); } @@ -2575,7 +2528,6 @@ mod tests { | ^- Cursor offset | | | source - | "); } @@ -2610,7 +2562,6 @@ mod tests { | | | | | Cursor offset | source - | "#); } @@ -2645,7 +2596,6 @@ mod tests { | | | | | Cursor offset | source - | "#); } @@ -2693,7 +2643,6 @@ mod tests { | ^^^^^^^- Cursor offset | | | source - | "#); } @@ -2756,7 +2705,6 @@ mod tests { | | | | | Cursor offset | source - | "#); } @@ -2786,7 +2734,6 @@ mod tests { | || | |Cursor offset | source - | "#); } @@ -2813,7 +2760,6 @@ mod tests { | || | |Cursor offset | source - | "#); } @@ -2840,7 +2786,6 @@ mod tests { | | | | | Cursor offset | source - | "#); } @@ -2875,7 +2820,6 @@ mod tests { | | | | | Cursor offset | source - | "#); } @@ -2910,7 +2854,6 @@ mod tests { | | | | | Cursor offset | source - | "#); } @@ -2945,7 +2888,6 @@ mod tests { | | | | | Cursor offset | source - | "#); } @@ -2980,7 +2922,6 @@ mod tests { | | | | | Cursor offset | source - | "#); } @@ -3015,7 +2956,6 @@ mod tests { | | | | | Cursor offset | source - | "#); } @@ -3045,7 +2985,6 @@ mod tests { | | | | | Cursor offset | source - | "#); } @@ -3080,7 +3019,6 @@ mod tests { | | | | | Cursor offset | source - | "#); } @@ -3138,7 +3076,6 @@ def ab(a: str): ... | || | |Cursor offset | source - | "); } @@ -3184,7 +3121,6 @@ def bar() -> None: | | | | | Cursor offset | source - | "); } @@ -3242,7 +3178,6 @@ def ab(a: str): | || | |Cursor offset | source - | "#); } @@ -3306,7 +3241,6 @@ def ab(a: int): | || | |Cursor offset | source - | "); } @@ -3364,7 +3298,6 @@ def ab(a: int): | || | |Cursor offset | source - | "); } @@ -3434,7 +3367,6 @@ def ab(a: int, *, c: int): | || | |Cursor offset | source - | "); } @@ -3504,7 +3436,6 @@ def ab(a: int, *, c: int): | || | |Cursor offset | source - | "); } @@ -3566,7 +3497,6 @@ def ab(a: int, *, c: int): | ^^^- Cursor offset | | | source - | "); } @@ -3616,7 +3546,6 @@ def ab(a: int, *, c: int): | ^^^- Cursor offset | | | source - | "); } @@ -3667,7 +3596,6 @@ def ab(a: int, *, c: int): | | | | | Cursor offset | source - | "); } @@ -3702,7 +3630,6 @@ def outer(): | ^- Cursor offset | | | source - | "#); } @@ -3755,7 +3682,6 @@ def function(): | | | | | Cursor offset | source - | "#); } @@ -3816,7 +3742,6 @@ def function(): | || | |Cursor offset | source - | "); } @@ -3860,7 +3785,6 @@ def function(): | || | |Cursor offset | source - | "); } @@ -3904,7 +3828,6 @@ def function(): | || | |Cursor offset | source - | "#); } @@ -3960,7 +3883,6 @@ def function(): | || | |Cursor offset | source - | "); } @@ -3996,7 +3918,6 @@ def function(): | | | | | Cursor offset | source - | "); } @@ -4043,7 +3964,6 @@ def function(): | || | |Cursor offset | source - | "); } @@ -4070,7 +3990,6 @@ def function(): | || | |Cursor offset | source - | "); } @@ -4098,7 +4017,6 @@ def function(): | || | |Cursor offset | source - | "); } @@ -4128,7 +4046,6 @@ def function(): | || | |Cursor offset | source - | "); } @@ -4166,7 +4083,6 @@ def function(): | || | |Cursor offset | source - | "); } @@ -4217,7 +4133,6 @@ def function(): | | | | | Cursor offset | source - | "); } @@ -4274,7 +4189,6 @@ def function(): | ^- Cursor offset | | | source - | "); } @@ -4301,7 +4215,6 @@ def function(): | ^- Cursor offset | | | source - | "); } @@ -4327,7 +4240,6 @@ def function(): | ^^- Cursor offset | | | source - | "); } @@ -4366,7 +4278,6 @@ def function(): | ^^^^^- Cursor offset | | | source - | "); } @@ -4414,7 +4325,6 @@ def function(): | ^^^^^- Cursor offset | | | source - | "); } @@ -4460,7 +4370,6 @@ def function(): | ^^^^- Cursor offset | | | source - | "); } @@ -4508,7 +4417,6 @@ def function(): | ^^^^- Cursor offset | | | source - | "); } @@ -4548,7 +4456,6 @@ def function(): | ^- Cursor offset | | | source - | "); } @@ -4588,7 +4495,6 @@ def function(): | ^- Cursor offset | | | source - | "); } @@ -4631,7 +4537,6 @@ def function(): | ^- Cursor offset | | | source - | "); } @@ -4672,7 +4577,6 @@ def function(): | ^- Cursor offset | | | source - | "); } @@ -4716,7 +4620,6 @@ def function(): | ^- Cursor offset | | | source - | "); } @@ -4746,7 +4649,6 @@ def function(): | ^- Cursor offset | | | source - | "); } @@ -4774,7 +4676,6 @@ def function(): | ^- Cursor offset | | | source - | "); } @@ -4803,7 +4704,6 @@ def function(): | ^- Cursor offset | | | source - | "); } @@ -4835,7 +4735,6 @@ def function(): | ^- Cursor offset | | | source - | "); } @@ -4867,7 +4766,6 @@ def function(): | ^- Cursor offset | | | source - | "); } @@ -4901,7 +4799,6 @@ def function(): | ^- Cursor offset | | | source - | "); } @@ -4968,7 +4865,6 @@ def function(): | | | | | Cursor offset | source - | "); } @@ -5137,7 +5033,6 @@ def function(): | | | | | Cursor offset | source - | "#); } @@ -5175,7 +5070,6 @@ def function(): | || | |Cursor offset | source - | "); } @@ -5205,7 +5099,6 @@ def function(): | || | |Cursor offset | source - | "); } @@ -5235,7 +5128,6 @@ def function(): | || | |Cursor offset | source - | "); } @@ -5281,7 +5173,6 @@ def function(): | || | |Cursor offset | source - | "); } @@ -5319,7 +5210,6 @@ def function(): | | | | | Cursor offset | source - | "#); } @@ -5348,7 +5238,6 @@ def function(): | || | |Cursor offset | source - | "); } @@ -5383,7 +5272,6 @@ def function(): | || | |Cursor offset | source - | "); } @@ -5418,7 +5306,6 @@ def function(): | || | |Cursor offset | source - | "); } @@ -5454,7 +5341,6 @@ def function(): | || | |Cursor offset | source - | "); } @@ -5491,7 +5377,6 @@ def function(): | || | |Cursor offset | source - | "); } @@ -5529,7 +5414,6 @@ def function(): | || | |Cursor offset | source - | "); } @@ -5558,7 +5442,6 @@ def function(): | || | |Cursor offset | source - | "); } @@ -5586,7 +5469,6 @@ def function(): | ^- Cursor offset | | | source - | "); let test = hover_test( @@ -5611,7 +5493,6 @@ def function(): | ^- Cursor offset | | | source - | "); let test = hover_test( @@ -5636,7 +5517,6 @@ def function(): | ^- Cursor offset | | | source - | "); let test = hover_test( @@ -5661,7 +5541,6 @@ def function(): | ^- Cursor offset | | | source - | "); } @@ -5688,7 +5567,6 @@ def function(): | ^- Cursor offset | | | source - | "); let test = hover_test( @@ -5712,7 +5590,6 @@ def function(): | ^- Cursor offset | | | source - | "); let test = hover_test( @@ -5736,7 +5613,6 @@ def function(): | ^- Cursor offset | | | source - | "); let test = hover_test( @@ -5760,7 +5636,6 @@ def function(): | ^- Cursor offset | | | source - | "); } @@ -5786,7 +5661,6 @@ def function(): | ^- Cursor offset | | | source - | "); let test = hover_test( @@ -5809,7 +5683,6 @@ def function(): | ^- Cursor offset | | | source - | "); let test = hover_test( @@ -5832,7 +5705,6 @@ def function(): | ^- Cursor offset | | | source - | "); let test = hover_test( @@ -5855,7 +5727,6 @@ def function(): | ^- Cursor offset | | | source - | "); } @@ -5881,7 +5752,6 @@ def function(): | ^^^- Cursor offset | | | source - | "); } @@ -5918,7 +5788,6 @@ def function(): | ^^^^^^^- Cursor offset | | | source - | "); let test = hover_test( @@ -5943,7 +5812,6 @@ def function(): | | | | | Cursor offset | source - | "); } @@ -5974,7 +5842,6 @@ def function(): | ^- Cursor offset | | | source - | "); let test = hover_test( @@ -6002,7 +5869,6 @@ def function(): | ^- Cursor offset | | | source - | "); let test = hover_test( @@ -6030,7 +5896,6 @@ def function(): | ^- Cursor offset | | | source - | "); let test = hover_test( @@ -6058,7 +5923,6 @@ def function(): | ^- Cursor offset | | | source - | "); } @@ -6090,7 +5954,6 @@ def function(): | | | source | Cursor offset - | "); } @@ -6134,7 +5997,6 @@ def function(): | | | source | Cursor offset - | "); } @@ -6171,7 +6033,6 @@ def function(): | ^- Cursor offset | | | source - | "); } @@ -6202,7 +6063,6 @@ def function(): | ^^^^^- Cursor offset | | | source - | "); } @@ -6266,7 +6126,6 @@ def function(): | ^^^^^- Cursor offset | | | source - | "); let test = hover_test( @@ -6291,7 +6150,6 @@ def function(): | ^- Cursor offset | | | source - | "); } @@ -6317,7 +6175,6 @@ def function(): | ^^^- Cursor offset | | | source - | "); let test = hover_test( @@ -6340,7 +6197,6 @@ def function(): | ^^^- Cursor offset | | | source - | "); } @@ -6370,7 +6226,6 @@ def function(): | ^- Cursor offset | | | source - | "); let test = hover_test( @@ -6394,7 +6249,6 @@ def function(): | ^- Cursor offset | | | source - | "); let test = hover_test( @@ -6421,7 +6275,6 @@ def function(): | ^- Cursor offset | | | source - | "); let test = hover_test( @@ -6445,7 +6298,6 @@ def function(): | ^- Cursor offset | | | source - | "); } @@ -6485,7 +6337,6 @@ def function(): | | | | | Cursor offset | source - | "); } @@ -6525,7 +6376,6 @@ def function(): | | | | | Cursor offset | source - | "); } @@ -6565,7 +6415,6 @@ def function(): | | | | | Cursor offset | source - | "); } @@ -6605,7 +6454,6 @@ def function(): | | | | | Cursor offset | source - | "); } @@ -6644,7 +6492,6 @@ def function(): | | | | | Cursor offset | source - | "); } @@ -6683,7 +6530,6 @@ def function(): | | | | | Cursor offset | source - | "); } @@ -6722,7 +6568,6 @@ def function(): | | | | | Cursor offset | source - | "); } @@ -6766,7 +6611,6 @@ def function(): | ^- Cursor offset | | | source - | "); } @@ -6794,7 +6638,6 @@ def function(): | | | | | Cursor offset | source - | "); } @@ -6848,7 +6691,6 @@ class CoolType(str): | ^- Cursor offset | | | source - | "); } @@ -6884,7 +6726,6 @@ type U = MyType | ^- Cursor offset | | | source - | "); } @@ -6934,7 +6775,6 @@ type U = MyType | | | | | Cursor offset | source - | "); } @@ -6983,7 +6823,6 @@ type U = MyType | ^^^^^- Cursor offset | | | source - | "); } @@ -7030,7 +6869,6 @@ type U = MyType | ^^^^- Cursor offset | | | source - | "); } diff --git a/crates/ty_ide/src/inlay_hints.rs b/crates/ty_ide/src/inlay_hints.rs index 4fcc167e2c471f..660bf3aa8897f2 100644 --- a/crates/ty_ide/src/inlay_hints.rs +++ b/crates/ty_ide/src/inlay_hints.rs @@ -1023,78 +1023,66 @@ Source with applied edits: | LL | Literal: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:5 | LL | y[: Literal[1]] = x | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:13 | LL | y[: Literal[1]] = x | ^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:5 | LL | z[: int] = i(1) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:5 | LL | w[: int] = z | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/typing.pyi:LL:1 | LL | Literal: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:6 | LL | bb[: Literal[b"foo"]] = aa | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class bytes(Sequence[int]): | ^^^^^ - | info: Source --> main2.py:LL:14 | LL | bb[: Literal[b"foo"]] = aa | ^^^^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -1151,104 +1139,88 @@ Source with applied edits: | LL | Literal: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:6 | LL | x2[: Literal[1]], y2[: Literal["abc"]] = (x1, y1) | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:14 | LL | x2[: Literal[1]], y2[: Literal["abc"]] = (x1, y1) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/typing.pyi:LL:1 | LL | Literal: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:24 | LL | x2[: Literal[1]], y2[: Literal["abc"]] = (x1, y1) | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:32 | LL | x2[: Literal[1]], y2[: Literal["abc"]] = (x1, y1) | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:6 | LL | x3[: int], y3[: str] = (i(1), s('abc')) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:17 | LL | x3[: int], y3[: str] = (i(1), s('abc')) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:6 | LL | x4[: int], y4[: str] = (x3, y3) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:17 | LL | x4[: int], y4[: str] = (x3, y3) | ^^^ - | "#); } @@ -1272,39 +1244,33 @@ Source with applied edits: | LL | class int: | ^^^ - | info: Source --> main2.py:LL:10 | LL | (a[: int], *b[: list[int]]) = x | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class list(MutableSequence[_T]): | ^^^^ - | info: Source --> main2.py:LL:21 | LL | (a[: int], *b[: list[int]]) = x | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:26 | LL | (a[: int], *b[: list[int]]) = x | ^^^ - | "); } @@ -1362,26 +1328,22 @@ Source with applied edits: | LL | class int: | ^^^ - | info: Source --> main2.py:LL:5 | LL | x[: int], _ignored = (i(1), s('abc')) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:16 | LL | __ignored, y[: str] = (i(1), s('abc')) | ^^^ - | "); } @@ -1409,13 +1371,11 @@ Source with applied edits: | LL | class int: | ^^^ - | info: Source --> main2.py:LL:15 | LL | __special__[: int] = i(1) | ^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -1462,104 +1422,88 @@ Source with applied edits: | LL | Literal: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:6 | LL | x2[: Literal[1]], y2[: Literal["abc"]] = x1, y1 | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:14 | LL | x2[: Literal[1]], y2[: Literal["abc"]] = x1, y1 | ^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/typing.pyi:LL:1 | LL | Literal: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:24 | LL | x2[: Literal[1]], y2[: Literal["abc"]] = x1, y1 | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:32 | LL | x2[: Literal[1]], y2[: Literal["abc"]] = x1, y1 | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:6 | LL | x3[: int], y3[: str] = i(1), s('abc') | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:17 | LL | x3[: int], y3[: str] = i(1), s('abc') | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:6 | LL | x4[: int], y4[: str] = x3, y3 | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:17 | LL | x4[: int], y4[: str] = x3, y3 | ^^^ - | "#); } @@ -1597,143 +1541,121 @@ Source with applied edits: | LL | class tuple(Sequence[_T_co]): | ^^^^^ - | info: Source --> main2.py:LL:5 | LL | y[: tuple[Literal[1], Literal["abc"]]] = x | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/typing.pyi:LL:1 | LL | Literal: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:11 | LL | y[: tuple[Literal[1], Literal["abc"]]] = x | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:19 | LL | y[: tuple[Literal[1], Literal["abc"]]] = x | ^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/typing.pyi:LL:1 | LL | Literal: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:23 | LL | y[: tuple[Literal[1], Literal["abc"]]] = x | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:31 | LL | y[: tuple[Literal[1], Literal["abc"]]] = x | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class tuple(Sequence[_T_co]): | ^^^^^ - | info: Source --> main2.py:LL:5 | LL | z[: tuple[int, str]] = (i(1), s('abc')) | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:11 | LL | z[: tuple[int, str]] = (i(1), s('abc')) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:16 | LL | z[: tuple[int, str]] = (i(1), s('abc')) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class tuple(Sequence[_T_co]): | ^^^^^ - | info: Source --> main2.py:LL:5 | LL | w[: tuple[int, str]] = z | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:11 | LL | w[: tuple[int, str]] = z | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:16 | LL | w[: tuple[int, str]] = z | ^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -1785,156 +1707,132 @@ Source with applied edits: | LL | Literal: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:6 | LL | x2[: Literal[1]], (y2[: Literal["abc"]], z2[: Literal[2]]) = (x1, (y1, z1)) | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:14 | LL | x2[: Literal[1]], (y2[: Literal["abc"]], z2[: Literal[2]]) = (x1, (y1, z1)) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/typing.pyi:LL:1 | LL | Literal: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:25 | LL | x2[: Literal[1]], (y2[: Literal["abc"]], z2[: Literal[2]]) = (x1, (y1, z1)) | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:33 | LL | x2[: Literal[1]], (y2[: Literal["abc"]], z2[: Literal[2]]) = (x1, (y1, z1)) | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/typing.pyi:LL:1 | LL | Literal: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:47 | LL | x2[: Literal[1]], (y2[: Literal["abc"]], z2[: Literal[2]]) = (x1, (y1, z1)) | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:55 | LL | x2[: Literal[1]], (y2[: Literal["abc"]], z2[: Literal[2]]) = (x1, (y1, z1)) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:6 | LL | x3[: int], (y3[: str], z3[: int]) = (i(1), (s('abc'), i(2))) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:18 | LL | x3[: int], (y3[: str], z3[: int]) = (i(1), (s('abc'), i(2))) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:29 | LL | x3[: int], (y3[: str], z3[: int]) = (i(1), (s('abc'), i(2))) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:6 | LL | x4[: int], (y4[: str], z4[: int]) = (x3, (y3, z3)) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:18 | LL | x4[: int], (y4[: str], z4[: int]) = (x3, (y3, z3)) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:29 | LL | x4[: int], (y4[: str], z4[: int]) = (x3, (y3, z3)) | ^^^ - | "#); } @@ -1966,39 +1864,33 @@ Source with applied edits: | LL | Literal: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:5 | LL | y[: Literal[1]] = x | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:13 | LL | y[: Literal[1]] = x | ^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:5 | LL | w[: int] = z | ^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -2039,13 +1931,11 @@ Source with applied edits: | LL | class int: | ^^^ - | info: Source --> main2.py:LL:5 | LL | x[: int] = i(1) | ^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -2089,26 +1979,22 @@ Source with applied edits: | LL | Unknown: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:18 | LL | self.y[: Unknown] = y | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:3:24 | 3 | def __init__(self, y): | ^ - | info: Source --> main2.py:7:8 | 7 | a = A([y=]2) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -2153,13 +2039,11 @@ Source with applied edits: | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:17 | LL | x[: str] = ab | ^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -2196,26 +2080,22 @@ Source with applied edits: | LL | class list(MutableSequence[_T]): | ^^^^ - | info: Source --> main2.py:LL:17 | LL | x[: list[str]] = ab | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:22 | LL | x[: list[str]] = ab | ^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -2252,39 +2132,33 @@ Source with applied edits: | LL | Literal: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:17 | LL | x[: Literal["a", "b"]] = ab | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:25 | LL | x[: Literal["a", "b"]] = ab | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:30 | LL | x[: Literal["a", "b"]] = ab | ^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -2337,13 +2211,11 @@ Source with applied edits: | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:17 | LL | x[: str] = ab | ^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -2574,338 +2446,286 @@ Source with applied edits: | LL | class list(MutableSequence[_T]): | ^^^^ - | info: Source --> main2.py:LL:5 | LL | a[: list[int]] = [1, 2] | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:10 | LL | a[: list[int]] = [1, 2] | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class list(MutableSequence[_T]): | ^^^^ - | info: Source --> main2.py:LL:5 | LL | b[: list[int | float]] = [1.0, 2.0] | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:10 | LL | b[: list[int | float]] = [1.0, 2.0] | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class float: | ^^^^^ - | info: Source --> main2.py:LL:16 | LL | b[: list[int | float]] = [1.0, 2.0] | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class list(MutableSequence[_T]): | ^^^^ - | info: Source --> main2.py:LL:5 | LL | c[: list[bool]] = [True, False] | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class bool(int): | ^^^^ - | info: Source --> main2.py:LL:10 | LL | c[: list[bool]] = [True, False] | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class list(MutableSequence[_T]): | ^^^^ - | info: Source --> main2.py:LL:5 | LL | d[: list[None | Unknown]] = [None, None] | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/types.pyi:LL:7 | LL | class NoneType: | ^^^^^^^^ - | info: Source --> main2.py:LL:10 | LL | d[: list[None | Unknown]] = [None, None] | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/ty_extensions/__init__.pyi:LL:1 | LL | Unknown: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:17 | LL | d[: list[None | Unknown]] = [None, None] | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class list(MutableSequence[_T]): | ^^^^ - | info: Source --> main2.py:LL:5 | LL | e[: list[str]] = ["hel", "lo"] | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:10 | LL | e[: list[str]] = ["hel", "lo"] | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class list(MutableSequence[_T]): | ^^^^ - | info: Source --> main2.py:LL:5 | LL | f[: list[str]] = ['the', 're'] | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:10 | LL | f[: list[str]] = ['the', 're'] | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class list(MutableSequence[_T]): | ^^^^ - | info: Source --> main2.py:LL:5 | LL | g[: list[str]] = [f"{ft}", f"{ft}"] | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:10 | LL | g[: list[str]] = [f"{ft}", f"{ft}"] | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class list(MutableSequence[_T]): | ^^^^ - | info: Source --> main2.py:LL:5 | LL | h[: list[Template]] = [t"wow %d", t"wow %d"] | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/string/templatelib.pyi:LL:7 | LL | class Template: # TODO: consider making `Template` generic on `TypeVarTuple` | ^^^^^^^^ - | info: Source --> main2.py:LL:10 | LL | h[: list[Template]] = [t"wow %d", t"wow %d"] | ^^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class list(MutableSequence[_T]): | ^^^^ - | info: Source --> main2.py:LL:5 | LL | i[: list[bytes]] = [b'/x01', b'/x02'] | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class bytes(Sequence[int]): | ^^^^^ - | info: Source --> main2.py:LL:10 | LL | i[: list[bytes]] = [b'/x01', b'/x02'] | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class list(MutableSequence[_T]): | ^^^^ - | info: Source --> main2.py:LL:5 | LL | j[: list[int | float]] = [+1, +2.0] | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:10 | LL | j[: list[int | float]] = [+1, +2.0] | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class float: | ^^^^^ - | info: Source --> main2.py:LL:16 | LL | j[: list[int | float]] = [+1, +2.0] | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class list(MutableSequence[_T]): | ^^^^ - | info: Source --> main2.py:LL:5 | LL | k[: list[int | float]] = [-1, -2.0] | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:10 | LL | k[: list[int | float]] = [-1, -2.0] | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class float: | ^^^^^ - | info: Source --> main2.py:LL:16 | LL | k[: list[int | float]] = [-1, -2.0] | ^^^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -2970,39 +2790,33 @@ Source with applied edits: | LL | Literal: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:5 | LL | x[: Literal[Color.RED]] = Color.RED | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:4:7 | 4 | class Color(Enum): | ^^^^^ - | info: Source --> main2.py:8:13 | 8 | x[: Literal[Color.RED]] = Color.RED | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:5:5 | 5 | RED = 1 | ^^^ - | info: Source --> main2.py:8:19 | 8 | x[: Literal[Color.RED]] = Color.RED | ^^^ - | "); } @@ -3038,91 +2852,77 @@ Source with applied edits: | LL | class tuple(Sequence[_T_co]): | ^^^^^ - | info: Source --> main2.py:LL:5 | LL | y[: tuple[MyClass, MyClass]] = (MyClass(), MyClass()) | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:7 | 2 | class MyClass: | ^^^^^^^ - | info: Source --> main2.py:7:11 | 7 | y[: tuple[MyClass, MyClass]] = (MyClass(), MyClass()) | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:7 | 2 | class MyClass: | ^^^^^^^ - | info: Source --> main2.py:7:20 | 7 | y[: tuple[MyClass, MyClass]] = (MyClass(), MyClass()) | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:7 | 2 | class MyClass: | ^^^^^^^ - | info: Source --> main2.py:8:5 | 8 | a[: MyClass], b[: MyClass] = MyClass(), MyClass() | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:7 | 2 | class MyClass: | ^^^^^^^ - | info: Source --> main2.py:8:19 | 8 | a[: MyClass], b[: MyClass] = MyClass(), MyClass() | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:7 | 2 | class MyClass: | ^^^^^^^ - | info: Source --> main2.py:9:5 | 9 | c[: MyClass], d[: MyClass] = (MyClass(), MyClass()) | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:7 | 2 | class MyClass: | ^^^^^^^ - | info: Source --> main2.py:9:19 | 9 | c[: MyClass], d[: MyClass] = (MyClass(), MyClass()) | ^^^^^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -3170,494 +2970,418 @@ Source with applied edits: | LL | class list(MutableSequence[_T]): | ^^^^ - | info: Source --> main2.py:LL:18 | LL | self.x[: list[T@MyClass]] = x | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class tuple(Sequence[_T_co]): | ^^^^^ - | info: Source --> main2.py:LL:18 | LL | self.y[: tuple[U@MyClass, U@MyClass]] = y | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:7 | 2 | class MyClass[T, U]: | ^^^^^^^ - | info: Source --> main2.py:7:5 | 7 | x[: MyClass[int, str]] = MyClass([x=][42], [y=]("a", "b")) | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:13 | LL | x[: MyClass[int, str]] = MyClass([x=][42], [y=]("a", "b")) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:18 | LL | x[: MyClass[int, str]] = MyClass([x=][42], [y=]("a", "b")) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:3:24 | 3 | def __init__(self, x: list[T], y: tuple[U, U]): | ^ - | info: Source --> main2.py:7:35 | 7 | x[: MyClass[int, str]] = MyClass([x=][42], [y=]("a", "b")) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:3:36 | 3 | def __init__(self, x: list[T], y: tuple[U, U]): | ^ - | info: Source --> main2.py:7:45 | 7 | x[: MyClass[int, str]] = MyClass([x=][42], [y=]("a", "b")) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class tuple(Sequence[_T_co]): | ^^^^^ - | info: Source --> main2.py:LL:5 | LL | y[: tuple[MyClass[int, str], MyClass[int, str]]] = (MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b"))) | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:7 | 2 | class MyClass[T, U]: | ^^^^^^^ - | info: Source --> main2.py:8:11 | 8 | y[: tuple[MyClass[int, str], MyClass[int, str]]] = (MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b"))) | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:19 | LL | y[: tuple[MyClass[int, str], MyClass[int, str]]] = (MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b"))) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:24 | LL | y[: tuple[MyClass[int, str], MyClass[int, str]]] = (MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b"))) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:7 | 2 | class MyClass[T, U]: | ^^^^^^^ - | info: Source --> main2.py:8:30 | 8 | y[: tuple[MyClass[int, str], MyClass[int, str]]] = (MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b"))) | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:38 | LL | y[: tuple[MyClass[int, str], MyClass[int, str]]] = (MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b"))) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:43 | LL | y[: tuple[MyClass[int, str], MyClass[int, str]]] = (MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b"))) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:3:24 | 3 | def __init__(self, x: list[T], y: tuple[U, U]): | ^ - | info: Source --> main2.py:8:62 | 8 | y[: tuple[MyClass[int, str], MyClass[int, str]]] = (MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b"))) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:3:36 | 3 | def __init__(self, x: list[T], y: tuple[U, U]): | ^ - | info: Source --> main2.py:8:72 | 8 | y[: tuple[MyClass[int, str], MyClass[int, str]]] = (MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b"))) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:3:24 | 3 | def __init__(self, x: list[T], y: tuple[U, U]): | ^ - | info: Source --> main2.py:8:97 | 8 | y[: tuple[MyClass[int, str], MyClass[int, str]]] = (MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b"))) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:3:36 | 3 | def __init__(self, x: list[T], y: tuple[U, U]): | ^ - | info: Source --> main2.py:8:107 | 8 | y[: tuple[MyClass[int, str], MyClass[int, str]]] = (MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b"))) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:7 | 2 | class MyClass[T, U]: | ^^^^^^^ - | info: Source --> main2.py:9:5 | 9 | a[: MyClass[int, str]], b[: MyClass[int, str]] = MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b")) | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:13 | LL | a[: MyClass[int, str]], b[: MyClass[int, str]] = MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b")) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:18 | LL | a[: MyClass[int, str]], b[: MyClass[int, str]] = MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b")) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:7 | 2 | class MyClass[T, U]: | ^^^^^^^ - | info: Source --> main2.py:9:29 | 9 | a[: MyClass[int, str]], b[: MyClass[int, str]] = MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b")) | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:37 | LL | a[: MyClass[int, str]], b[: MyClass[int, str]] = MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b")) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:42 | LL | a[: MyClass[int, str]], b[: MyClass[int, str]] = MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b")) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:3:24 | 3 | def __init__(self, x: list[T], y: tuple[U, U]): | ^ - | info: Source --> main2.py:9:59 | 9 | a[: MyClass[int, str]], b[: MyClass[int, str]] = MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b")) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:3:36 | 3 | def __init__(self, x: list[T], y: tuple[U, U]): | ^ - | info: Source --> main2.py:9:69 | 9 | a[: MyClass[int, str]], b[: MyClass[int, str]] = MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b")) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:3:24 | 3 | def __init__(self, x: list[T], y: tuple[U, U]): | ^ - | info: Source --> main2.py:9:94 | 9 | a[: MyClass[int, str]], b[: MyClass[int, str]] = MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b")) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:3:36 | 3 | def __init__(self, x: list[T], y: tuple[U, U]): | ^ - | info: Source --> main2.py:9:104 | 9 | a[: MyClass[int, str]], b[: MyClass[int, str]] = MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b")) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:7 | 2 | class MyClass[T, U]: | ^^^^^^^ - | info: Source --> main2.py:10:5 | 10 | c[: MyClass[int, str]], d[: MyClass[int, str]] = (MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b"))) | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:13 | LL | c[: MyClass[int, str]], d[: MyClass[int, str]] = (MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b"))) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:18 | LL | c[: MyClass[int, str]], d[: MyClass[int, str]] = (MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b"))) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:7 | 2 | class MyClass[T, U]: | ^^^^^^^ - | info: Source --> main2.py:10:29 | 10 | c[: MyClass[int, str]], d[: MyClass[int, str]] = (MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b"))) | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:37 | LL | c[: MyClass[int, str]], d[: MyClass[int, str]] = (MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b"))) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:42 | LL | c[: MyClass[int, str]], d[: MyClass[int, str]] = (MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b"))) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:3:24 | 3 | def __init__(self, x: list[T], y: tuple[U, U]): | ^ - | info: Source --> main2.py:10:60 | 10 | c[: MyClass[int, str]], d[: MyClass[int, str]] = (MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b"))) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:3:36 | 3 | def __init__(self, x: list[T], y: tuple[U, U]): | ^ - | info: Source --> main2.py:10:70 | 10 | c[: MyClass[int, str]], d[: MyClass[int, str]] = (MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b"))) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:3:24 | 3 | def __init__(self, x: list[T], y: tuple[U, U]): | ^ - | info: Source --> main2.py:10:95 | 10 | c[: MyClass[int, str]], d[: MyClass[int, str]] = (MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b"))) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:3:36 | 3 | def __init__(self, x: list[T], y: tuple[U, U]): | ^ - | info: Source --> main2.py:10:105 | 10 | c[: MyClass[int, str]], d[: MyClass[int, str]] = (MyClass([x=][42], [y=]("a", "b")), MyClass([x=][42], [y=]("a", "b"))) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -3720,13 +3444,11 @@ Source with applied edits: | 2 | def foo(x: int): pass | ^ - | info: Source --> main2.py:3:6 | 3 | foo([x=]1) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -3763,13 +3485,11 @@ Source with applied edits: | 2 | def foo(x: int): pass | ^ - | info: Source --> main2.py:6:6 | 6 | foo([x=]y) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -3814,13 +3534,11 @@ Source with applied edits: | 2 | def foo(x: int): pass | ^ - | info: Source --> main2.py:10:6 | 10 | foo([x=]val.y) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -3866,13 +3584,11 @@ Source with applied edits: | 2 | def foo(x: int): pass | ^ - | info: Source --> main2.py:10:6 | 10 | foo([x=]x.y) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -3921,13 +3637,11 @@ Source with applied edits: | 2 | def foo(x: int): pass | ^ - | info: Source --> main2.py:12:6 | 12 | foo([x=]val.y()) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -3980,13 +3694,11 @@ Source with applied edits: | 4 | def foo(x: int): pass | ^ - | info: Source --> main2.py:14:6 | 14 | foo([x=]val.y()[1]) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -4025,65 +3737,55 @@ Source with applied edits: | LL | class list(MutableSequence[_T]): | ^^^^ - | info: Source --> main2.py:LL:5 | LL | x[: list[int]] = [1] | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:10 | LL | x[: list[int]] = [1] | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class list(MutableSequence[_T]): | ^^^^ - | info: Source --> main2.py:LL:5 | LL | y[: list[int]] = [2] | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:10 | LL | y[: list[int]] = [2] | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:9 | 2 | def foo(x: int): pass | ^ - | info: Source --> main2.py:7:6 | 7 | foo([x=]y[0]) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -4185,13 +3887,11 @@ Source with applied edits: | 2 | def foo(a: str, b: int, c: int, d: str): ... | ^ - | info: Source --> main2.py:4:6 | 4 | foo([a=]'foo', *t, d='bar') | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -4225,39 +3925,33 @@ Source with applied edits: | 2 | def foo(a: str, b: int, c: str): ... | ^ - | info: Source --> main2.py:4:6 | 4 | foo([a=]'foo', [b=]*t, [c=]'bar') | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:17 | 2 | def foo(a: str, b: int, c: str): ... | ^ - | info: Source --> main2.py:4:17 | 4 | foo([a=]'foo', [b=]*t, [c=]'bar') | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:25 | 2 | def foo(a: str, b: int, c: str): ... | ^ - | info: Source --> main2.py:4:25 | 4 | foo([a=]'foo', [b=]*t, [c=]'bar') | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -4290,26 +3984,22 @@ Source with applied edits: | 2 | def foo(a: int, b: int): ... | ^ - | info: Source --> main2.py:4:6 | 4 | foo([a=]1, [b=]*t) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:17 | 2 | def foo(a: int, b: int): ... | ^ - | info: Source --> main2.py:4:13 | 4 | foo([a=]1, [b=]*t) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -4342,13 +4032,11 @@ Source with applied edits: | 2 | def foo(a: int): ... | ^ - | info: Source --> main2.py:4:6 | 4 | foo([a=]*t) | ^ - | "); } @@ -4370,13 +4058,11 @@ Source with applied edits: | 2 | def foo(x: int, /, y: int): pass | ^ - | info: Source --> main2.py:3:9 | 3 | foo(1, [y=]2) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -4441,26 +4127,22 @@ Source with applied edits: | 3 | def __init__(self, x: int): pass | ^ - | info: Source --> main2.py:4:6 | 4 | Foo([x=]1) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:3:24 | 3 | def __init__(self, x: int): pass | ^ - | info: Source --> main2.py:5:10 | 5 | f = Foo([x=]1) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -4503,26 +4185,22 @@ Source with applied edits: | 5 | x: int | ^ - | info: Source --> main2.py:8:6 | 8 | Foo([x=]1, [y=]'a') | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:6:5 | 6 | y: str | ^ - | info: Source --> main2.py:8:13 | 8 | Foo([x=]1, [y=]'a') | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -4557,26 +4235,22 @@ Source with applied edits: | 3 | def __new__(cls, x: int): pass | ^ - | info: Source --> main2.py:4:6 | 4 | Foo([x=]1) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:3:22 | 3 | def __new__(cls, x: int): pass | ^ - | info: Source --> main2.py:5:10 | 5 | f = Foo([x=]1) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -4615,13 +4289,11 @@ Source with applied edits: | 3 | def __call__(self, x: int): pass | ^ - | info: Source --> main2.py:6:6 | 6 | Foo([x=]1) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -4671,13 +4343,11 @@ Source with applied edits: | 3 | def bar(self, y: int): pass | ^ - | info: Source --> main2.py:4:12 | 4 | Foo().bar([y=]2) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -4732,26 +4402,22 @@ Source with applied edits: | 8 | def choose(self: "Parent", parent_value: int) -> None: ... | ^^^^^^^^^^^^ - | info: Source --> main2.py:14:20 | 14 | parent.choose([parent_value=]1) | ^^^^^^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:6:31 | 6 | def choose(self: "Child", child_value: int) -> None: ... | ^^^^^^^^^^^ - | info: Source --> main2.py:15:19 | 15 | child.choose([child_value=]2) | ^^^^^^^^^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -4788,13 +4454,11 @@ Source with applied edits: | 4 | def bar(cls, y: int): pass | ^ - | info: Source --> main2.py:5:10 | 5 | Foo.bar([y=]2) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -4829,13 +4493,11 @@ Source with applied edits: | 4 | def bar(y: int): pass | ^ - | info: Source --> main2.py:5:10 | 5 | Foo.bar([y=]2) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -4868,26 +4530,22 @@ Source with applied edits: | 2 | def foo(x: int | str): pass | ^ - | info: Source --> main2.py:3:6 | 3 | foo([x=]1) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:9 | 2 | def foo(x: int | str): pass | ^ - | info: Source --> main2.py:4:6 | 4 | foo([x=]'abc') | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -4920,39 +4578,33 @@ Source with applied edits: | 2 | def foo(x: int, y: str, z: bool): pass | ^ - | info: Source --> main2.py:3:6 | 3 | foo([x=]1, [y=]'hello', [z=]True) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:17 | 2 | def foo(x: int, y: str, z: bool): pass | ^ - | info: Source --> main2.py:3:13 | 3 | foo([x=]1, [y=]'hello', [z=]True) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:25 | 2 | def foo(x: int, y: str, z: bool): pass | ^ - | info: Source --> main2.py:3:26 | 3 | foo([x=]1, [y=]'hello', [z=]True) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -4987,39 +4639,33 @@ Source with applied edits: | LL | class int: | ^^^ - | info: Source --> main2.py:LL:9 | LL | total[: int] = add([x=]3, [b=]2, y=4) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:9 | 2 | def add(x: int, b, y: int) -> int: | ^ - | info: Source --> main2.py:5:21 | 5 | total[: int] = add([x=]3, [b=]2, y=4) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:17 | 2 | def add(x: int, b, y: int) -> int: | ^ - | info: Source --> main2.py:5:28 | 5 | total[: int] = add([x=]3, [b=]2, y=4) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -5050,13 +4696,11 @@ Source with applied edits: | 2 | def foo(x: int, y: str, z: bool): pass | ^ - | info: Source --> main2.py:3:6 | 3 | foo([x=]1, z=True, y='hello') | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -5089,13 +4733,11 @@ Source with applied edits: | 2 | def foo(x: int, y: str): pass | ^ - | info: Source --> main2.py:3:17 | 3 | foo(y='hello', [y=]1) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -5130,78 +4772,66 @@ Source with applied edits: | 2 | def foo(x: int, y: str = 'default', z: bool = False): pass | ^ - | info: Source --> main2.py:3:6 | 3 | foo([x=]1) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:9 | 2 | def foo(x: int, y: str = 'default', z: bool = False): pass | ^ - | info: Source --> main2.py:4:6 | 4 | foo([x=]1, [y=]'custom') | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:17 | 2 | def foo(x: int, y: str = 'default', z: bool = False): pass | ^ - | info: Source --> main2.py:4:13 | 4 | foo([x=]1, [y=]'custom') | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:9 | 2 | def foo(x: int, y: str = 'default', z: bool = False): pass | ^ - | info: Source --> main2.py:5:6 | 5 | foo([x=]1, [y=]'custom', [z=]True) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:17 | 2 | def foo(x: int, y: str = 'default', z: bool = False): pass | ^ - | info: Source --> main2.py:5:13 | 5 | foo([x=]1, [y=]'custom', [z=]True) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:37 | 2 | def foo(x: int, y: str = 'default', z: bool = False): pass | ^ - | info: Source --> main2.py:5:27 | 5 | foo([x=]1, [y=]'custom', [z=]True) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -5250,78 +4880,66 @@ Source with applied edits: | 8 | def baz(a: int, b: str, c: bool): pass | ^ - | info: Source --> main2.py:10:6 | 10 | baz([a=]foo([x=]5), [b=]bar([y=]bar([y=]'test')), [c=]True) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:9 | 2 | def foo(x: int) -> int: | ^ - | info: Source --> main2.py:10:14 | 10 | baz([a=]foo([x=]5), [b=]bar([y=]bar([y=]'test')), [c=]True) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:8:17 | 8 | def baz(a: int, b: str, c: bool): pass | ^ - | info: Source --> main2.py:10:22 | 10 | baz([a=]foo([x=]5), [b=]bar([y=]bar([y=]'test')), [c=]True) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:5:9 | 5 | def bar(y: str) -> str: | ^ - | info: Source --> main2.py:10:30 | 10 | baz([a=]foo([x=]5), [b=]bar([y=]bar([y=]'test')), [c=]True) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:5:9 | 5 | def bar(y: str) -> str: | ^ - | info: Source --> main2.py:10:38 | 10 | baz([a=]foo([x=]5), [b=]bar([y=]bar([y=]'test')), [c=]True) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:8:25 | 8 | def baz(a: int, b: str, c: bool): pass | ^ - | info: Source --> main2.py:10:52 | 10 | baz([a=]foo([x=]5), [b=]bar([y=]bar([y=]'test')), [c=]True) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -5362,26 +4980,22 @@ Source with applied edits: | 3 | def foo(self, value: int) -> 'A': | ^^^^^ - | info: Source --> main2.py:8:10 | 8 | A().foo([value=]42).bar([name=]'test').baz() | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:5:19 | 5 | def bar(self, name: str) -> 'A': | ^^^^ - | info: Source --> main2.py:8:26 | 8 | A().foo([value=]42).bar([name=]'test').baz() | ^^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -5418,13 +5032,11 @@ Source with applied edits: | 2 | def foo(x: str) -> str: | ^ - | info: Source --> main2.py:5:12 | 5 | bar(y=foo([x=]'test')) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -5459,26 +5071,22 @@ Source with applied edits: | LL | Unknown: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:14 | LL | foo[: (x) -> Unknown] = lambda x: x * 2 | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/ty_extensions/__init__.pyi:LL:1 | LL | Unknown: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:17 | LL | bar[: (a, b) -> Unknown] = lambda a, b: a + b | ^^^^^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -5515,13 +5123,11 @@ Source with applied edits: | LL | LiteralString as LiteralString, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | info: Source --> main2.py:LL:9 | LL | y[: LiteralString] = x | ^^^^^^^^^^^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -5573,78 +5179,66 @@ Source with applied edits: | LL | Literal: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:9 | LL | y[: Literal[1, 2, 3, "hello"] | None] = x | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:17 | LL | y[: Literal[1, 2, 3, "hello"] | None] = x | ^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:20 | LL | y[: Literal[1, 2, 3, "hello"] | None] = x | ^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:23 | LL | y[: Literal[1, 2, 3, "hello"] | None] = x | ^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:26 | LL | y[: Literal[1, 2, 3, "hello"] | None] = x | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/types.pyi:LL:7 | LL | class NoneType: | ^^^^^^^^ - | info: Source --> main2.py:LL:37 | LL | y[: Literal[1, 2, 3, "hello"] | None] = x | ^^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -5680,26 +5274,22 @@ Source with applied edits: | 2 | class Foo[T]: ... | ^^^ - | info: Source --> main2.py:4:13 | 4 | a[: ] = Foo[int] | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:17 | LL | a[: ] = Foo[int] | ^^^ - | "); } @@ -5721,39 +5311,33 @@ Source with applied edits: | LL | class type: | ^^^^ - | info: Source --> main2.py:LL:9 | LL | y[: type[list[str]]] = type(x) | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class list(MutableSequence[_T]): | ^^^^ - | info: Source --> main2.py:LL:14 | LL | y[: type[list[str]]] = type(x) | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:19 | LL | y[: type[list[str]]] = type(x) | ^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -5790,13 +5374,11 @@ Source with applied edits: | 4 | def whatever(self): ... | ^^^^^^^^ - | info: Source --> main2.py:6:6 | 6 | ab[: property] = F.whatever | ^^^^^^^^ - | "); } @@ -5820,39 +5402,33 @@ Source with applied edits: | 2 | def foo(a: int, b: str, /, c: float, d: bool = True, *, e: int, f: str = 'default'): pass | ^ - | info: Source --> main2.py:3:16 | 3 | foo(1, 'pos', [c=]3.14, [d=]False, e=42) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:38 | 2 | def foo(a: int, b: str, /, c: float, d: bool = True, *, e: int, f: str = 'default'): pass | ^ - | info: Source --> main2.py:3:26 | 3 | foo(1, 'pos', [c=]3.14, [d=]False, e=42) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:28 | 2 | def foo(a: int, b: str, /, c: float, d: bool = True, *, e: int, f: str = 'default'): pass | ^ - | info: Source --> main2.py:4:16 | 4 | foo(1, 'pos', [c=]3.14, e=42, f='custom') | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -5894,13 +5470,11 @@ Source with applied edits: | 2 | def bar(x: int | str): | ^ - | info: Source --> main2.py:4:6 | 4 | bar([x=]1) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -5949,26 +5523,22 @@ Source with applied edits: | 5 | def foo(x: int) -> str: ... | ^ - | info: Source --> main2.py:11:6 | 11 | foo([x=]42) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:7:9 | 7 | def foo(x: str) -> int: ... | ^ - | info: Source --> main2.py:12:6 | 12 | foo([x=]'hello') | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -6021,26 +5591,22 @@ Source with applied edits: | LL | class Sequence(Reversible[_T_co], Collection[_T_co]): | ^^^^^^^^ - | info: Source --> main2.py:LL:5 | LL | b[: Sequence[str]] = S('x', 'y') | ^^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:14 | LL | b[: Sequence[str]] = S('x', 'y') | ^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -6092,13 +5658,11 @@ Source with applied edits: | 5 | def f(x: int) -> str: ... | ^ - | info: Source --> main2.py:11:4 | 11 | f([x=][]) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -6230,39 +5794,33 @@ Source with applied edits: | 2 | def foo(param: int): pass | ^^^^^ - | info: Source --> main2.py:7:6 | 7 | foo([param=]param2) | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:9 | 2 | def foo(param: int): pass | ^^^^^ - | info: Source --> main2.py:8:6 | 8 | foo([param=]my_param2) | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:9 | 2 | def foo(param: int): pass | ^^^^^ - | info: Source --> main2.py:9:6 | 9 | foo([param=]parameter) | ^^^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -6317,13 +5875,11 @@ Source with applied edits: | 2 | def foo(focus_range: int): pass | ^^^^^^^^^^^ - | info: Source --> main2.py:13:6 | 13 | foo([focus_range=]focus_end_range) | ^^^^^^^^^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -6358,13 +5914,11 @@ Source with applied edits: | 2 | def foo(x: int): pass | ^ - | info: Source --> main2.py:4:6 | 4 | foo([x=]1) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -6396,13 +5950,11 @@ Source with applied edits: | 2 | def foo(_x: int, y: int): pass | ^ - | info: Source --> main2.py:3:9 | 3 | foo(1, [y=]2) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -6441,26 +5993,22 @@ Source with applied edits: | 3 | x: int, | ^ - | info: Source --> main2.py:7:6 | 7 | foo([x=]1, [y=]2) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:4:5 | 4 | y: int | ^ - | info: Source --> main2.py:7:13 | 7 | foo([x=]1, [y=]2) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -6493,91 +6041,77 @@ Source with applied edits: | LL | class int: | ^^^ - | info: Source --> main2.py:LL:16 | LL | a[: def foo(x: int, *y: bool, *, z: str | int | list[str]) -> Unknown] = foo | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class bool(int): | ^^^^ - | info: Source --> main2.py:LL:25 | LL | a[: def foo(x: int, *y: bool, *, z: str | int | list[str]) -> Unknown] = foo | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:37 | LL | a[: def foo(x: int, *y: bool, *, z: str | int | list[str]) -> Unknown] = foo | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:43 | LL | a[: def foo(x: int, *y: bool, *, z: str | int | list[str]) -> Unknown] = foo | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class list(MutableSequence[_T]): | ^^^^ - | info: Source --> main2.py:LL:49 | LL | a[: def foo(x: int, *y: bool, *, z: str | int | list[str]) -> Unknown] = foo | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:54 | LL | a[: def foo(x: int, *y: bool, *, z: str | int | list[str]) -> Unknown] = foo | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/ty_extensions/__init__.pyi:LL:1 | LL | Unknown: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:63 | LL | a[: def foo(x: int, *y: bool, *, z: str | int | list[str]) -> Unknown] = foo | ^^^^^^^ - | "); } @@ -6603,26 +6137,22 @@ Source with applied edits: | LL | class ModuleType: | ^^^^^^^^^^ - | info: Source --> main2.py:LL:6 | LL | a[: ] = foo | ^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> foo.py:1:1 | 1 | '''Foo module''' | ^^^^^^^^^^^^^^^^ - | info: Source --> main2.py:4:14 | 4 | a[: ] = foo | ^^^ - | "); } @@ -6646,52 +6176,44 @@ Source with applied edits: | LL | Literal: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:20 | LL | a[: ] = Literal['a', 'b', 'c'] | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:28 | LL | a[: ] = Literal['a', 'b', 'c'] | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:33 | LL | a[: ] = Literal['a', 'b', 'c'] | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:38 | LL | a[: ] = Literal['a', 'b', 'c'] | ^^^ - | "#); } @@ -6715,26 +6237,22 @@ Source with applied edits: | LL | class WrapperDescriptorType: | ^^^^^^^^^^^^^^^^^^^^^ - | info: Source --> main2.py:LL:6 | LL | a[: ] = FunctionType.__get__ | ^^^^^^^^^^^^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/types.pyi:LL:7 | LL | class FunctionType: | ^^^^^^^^^^^^ - | info: Source --> main2.py:LL:39 | LL | a[: ] = FunctionType.__get__ | ^^^^^^^^ - | "); } @@ -6758,52 +6276,44 @@ Source with applied edits: | LL | class MethodWrapperType: | ^^^^^^^^^^^^^^^^^ - | info: Source --> main2.py:LL:6 | LL | a[: ] = f.__call__ | ^^^^^^^^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/types.pyi:LL:9 | LL | def __call__(self, *args: Any, **kwargs: Any) -> Any: | ^^^^^^^^ - | info: Source --> main2.py:LL:22 | LL | a[: ] = f.__call__ | ^^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/types.pyi:LL:7 | LL | class FunctionType: | ^^^^^^^^^^^^ - | info: Source --> main2.py:LL:35 | LL | a[: ] = f.__call__ | ^^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:5 | 2 | def f(): ... | ^ - | info: Source --> main2.py:4:45 | 4 | a[: ] = f.__call__ | ^ - | "); } @@ -6831,78 +6341,66 @@ Source with applied edits: | LL | class NewType: | ^^^^^^^ - | info: Source --> main2.py:LL:6 | LL | N[: ] = NewType([name=]'N', [tp=]str) | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:4:1 | 4 | N = NewType('N', str) | ^ - | info: Source --> main2.py:4:28 | 4 | N[: ] = NewType([name=]'N', [tp=]str) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/typing.pyi:LL:24 | LL | def __init__(self, name: str, tp: Any) -> None: ... # AnnotationForm | ^^^^ - | info: Source --> main2.py:LL:44 | LL | N[: ] = NewType([name=]'N', [tp=]str) | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/typing.pyi:LL:35 | LL | def __init__(self, name: str, tp: Any) -> None: ... # AnnotationForm | ^^ - | info: Source --> main2.py:LL:56 | LL | N[: ] = NewType([name=]'N', [tp=]str) | ^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/typing.pyi:LL:7 | LL | class NewType: | ^^^^^^^ - | info: Source --> main2.py:LL:6 | LL | Y[: ] = N | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:4:1 | 4 | N = NewType('N', str) | ^ - | info: Source --> main2.py:6:28 | 6 | Y[: ] = N | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -6934,26 +6432,22 @@ Source with applied edits: | LL | class type: | ^^^^ - | info: Source --> main2.py:LL:9 | LL | y[: type[T@f]] = x | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:2:7 | 2 | def f[T](x: type[T]): | ^ - | info: Source --> main2.py:3:14 | 3 | y[: type[T@f]] = x | ^^^ - | "); } @@ -6977,39 +6471,33 @@ Source with applied edits: | LL | name: str, | ^^^^ - | info: Source --> main2.py:LL:14 | LL | T = TypeVar([name=]'T') | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/typing.pyi:LL:1 | LL | Protocol: _SpecialForm | ^^^^^^^^ - | info: Source --> main2.py:LL:26 | LL | Strange[: ] = Protocol[T] | ^^^^^^^^^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:3:1 | 3 | T = TypeVar('T') | ^ - | info: Source --> main2.py:4:42 | 4 | Strange[: ] = Protocol[T] | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -7041,13 +6529,11 @@ Source with applied edits: | LL | name: str, | ^^^^ - | info: Source --> main2.py:LL:16 | LL | P = ParamSpec([name=]'P') | ^^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -7078,26 +6564,22 @@ Source with applied edits: | LL | def __new__(cls, name: str, value: Any, *, type_params: tuple[_TypeParameter, ...] = ()) -> Self: ... | ^^^^ - | info: Source --> main2.py:LL:20 | LL | A = TypeAliasType([name=]'A', [value=]str) | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/typing.pyi:LL:37 | LL | def __new__(cls, name: str, value: Any, *, type_params: tuple[_TypeParameter, ...] = ()) -> Self: ... | ^^^^^ - | info: Source --> main2.py:LL:32 | LL | A = TypeAliasType([name=]'A', [value=]str) | ^^^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -7128,13 +6610,11 @@ Source with applied edits: | LL | name: str, | ^^^^ - | info: Source --> main2.py:LL:20 | LL | Ts = TypeVarTuple([name=]'Ts') | ^^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -7173,39 +6653,33 @@ Source with applied edits: | LL | Top: _SpecialForm | ^^^ - | info: Source --> main2.py:LL:9 | LL | x[: Top[list[Any]]] = xyxy | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class list(MutableSequence[_T]): | ^^^^ - | info: Source --> main2.py:LL:13 | LL | x[: Top[list[Any]]] = xyxy | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/typing.pyi:LL:7 | LL | class Any: | ^^^ - | info: Source --> main2.py:LL:18 | LL | x[: Top[list[Any]]] = xyxy | ^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -7262,117 +6736,99 @@ Source with applied edits: | 6 | class B[T]: ... | ^ - | info: Source --> main2.py:4:5 | 4 | a[: B[A[D[int, list[str | A[B[int]]]]]]] = foo.C().foo() | ^ - | info[inlay-hint-location]: Inlay Hint Target --> foo.py:4:19 | 4 | class A[T]: ... | ^ - | info: Source --> main2.py:4:7 | 4 | a[: B[A[D[int, list[str | A[B[int]]]]]]] = foo.C().foo() | ^ - | info[inlay-hint-location]: Inlay Hint Target --> bar.py:2:19 | 2 | class D[T, U]: ... | ^ - | info: Source --> main2.py:4:9 | 4 | a[: B[A[D[int, list[str | A[B[int]]]]]]] = foo.C().foo() | ^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:11 | LL | a[: B[A[D[int, list[str | A[B[int]]]]]]] = foo.C().foo() | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class list(MutableSequence[_T]): | ^^^^ - | info: Source --> main2.py:LL:16 | LL | a[: B[A[D[int, list[str | A[B[int]]]]]]] = foo.C().foo() | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:21 | LL | a[: B[A[D[int, list[str | A[B[int]]]]]]] = foo.C().foo() | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> foo.py:4:19 | 4 | class A[T]: ... | ^ - | info: Source --> main2.py:4:27 | 4 | a[: B[A[D[int, list[str | A[B[int]]]]]]] = foo.C().foo() | ^ - | info[inlay-hint-location]: Inlay Hint Target --> foo.py:6:19 | 6 | class B[T]: ... | ^ - | info: Source --> main2.py:4:29 | 4 | a[: B[A[D[int, list[str | A[B[int]]]]]]] = foo.C().foo() | ^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:31 | LL | a[: B[A[D[int, list[str | A[B[int]]]]]]] = foo.C().foo() | ^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -7432,117 +6888,99 @@ Source with applied edits: | 6 | class B[T]: ... | ^ - | info: Source --> main2.py:4:5 | 4 | a[: B[A[D[int, list[str | A[B[int]]]]]]] = C().foo() | ^ - | info[inlay-hint-location]: Inlay Hint Target --> foo.py:4:19 | 4 | class A[T]: ... | ^ - | info: Source --> main2.py:4:7 | 4 | a[: B[A[D[int, list[str | A[B[int]]]]]]] = C().foo() | ^ - | info[inlay-hint-location]: Inlay Hint Target --> bar.py:2:19 | 2 | class D[T, U]: ... | ^ - | info: Source --> main2.py:4:9 | 4 | a[: B[A[D[int, list[str | A[B[int]]]]]]] = C().foo() | ^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:11 | LL | a[: B[A[D[int, list[str | A[B[int]]]]]]] = C().foo() | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class list(MutableSequence[_T]): | ^^^^ - | info: Source --> main2.py:LL:16 | LL | a[: B[A[D[int, list[str | A[B[int]]]]]]] = C().foo() | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:21 | LL | a[: B[A[D[int, list[str | A[B[int]]]]]]] = C().foo() | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> foo.py:4:19 | 4 | class A[T]: ... | ^ - | info: Source --> main2.py:4:27 | 4 | a[: B[A[D[int, list[str | A[B[int]]]]]]] = C().foo() | ^ - | info[inlay-hint-location]: Inlay Hint Target --> foo.py:6:19 | 6 | class B[T]: ... | ^ - | info: Source --> main2.py:4:29 | 4 | a[: B[A[D[int, list[str | A[B[int]]]]]]] = C().foo() | ^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class int: | ^^^ - | info: Source --> main2.py:LL:31 | LL | a[: B[A[D[int, list[str | A[B[int]]]]]]] = C().foo() | ^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -7601,39 +7039,33 @@ Source with applied edits: | 2 | class D[T]: | ^ - | info: Source --> main2.py:6:5 | 6 | a[: D[Baz]] = D([x=]Baz) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:4:7 | 4 | class Baz: ... | ^^^ - | info: Source --> main2.py:6:7 | 6 | a[: D[Baz]] = D([x=]Baz) | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> foo/bar.py:3:36 | 3 | def __init__(self, x: type[T]): | ^ - | info: Source --> main2.py:6:18 | 6 | a[: D[Baz]] = D([x=]Baz) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -7670,39 +7102,33 @@ Source with applied edits: | LL | class Any: | ^^^ - | info: Source --> main2.py:LL:9 | LL | a[: Any | Literal["some"]] = getattr(x, 'foo', "some") | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/typing.pyi:LL:1 | LL | Literal: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:15 | LL | a[: Any | Literal["some"]] = getattr(x, 'foo', "some") | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class str(Sequence[str]): | ^^^ - | info: Source --> main2.py:LL:23 | LL | a[: Any | Literal["some"]] = getattr(x, 'foo', "some") | ^^^^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -7750,52 +7176,44 @@ Source with applied edits: | LL | class dict(MutableMapping[_KT, _VT]): | ^^^^ - | info: Source --> main2.py:LL:5 | LL | a[: dict[TypeVar, Any] | None] = foo() | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/typing.pyi:LL:7 | LL | class TypeVar: | ^^^^^^^ - | info: Source --> main2.py:LL:10 | LL | a[: dict[TypeVar, Any] | None] = foo() | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/typing.pyi:LL:7 | LL | class Any: | ^^^ - | info: Source --> main2.py:LL:19 | LL | a[: dict[TypeVar, Any] | None] = foo() | ^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/types.pyi:LL:7 | LL | class NoneType: | ^^^^^^^^ - | info: Source --> main2.py:LL:26 | LL | a[: dict[TypeVar, Any] | None] = foo() | ^^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -7862,26 +7280,22 @@ Source with applied edits: | 2 | class A: ... | ^ - | info: Source --> main2.py:4:5 | 4 | a[: bar.A | baz.A] = foo() | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> baz.py:2:19 | 2 | class A: ... | ^ - | info: Source --> main2.py:4:13 | 4 | a[: bar.A | baz.A] = foo() | ^^^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -7953,65 +7367,55 @@ Source with applied edits: | 2 | class A: ... | ^ - | info: Source --> main2.py:5:5 | 5 | a[: bar.A | baz.A | list[bar.A | baz.A]] = foo() | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> baz.py:2:22 | 2 | class A: ... | ^ - | info: Source --> main2.py:5:13 | 5 | a[: bar.A | baz.A | list[bar.A | baz.A]] = foo() | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> stdlib/builtins.pyi:LL:7 | LL | class list(MutableSequence[_T]): | ^^^^ - | info: Source --> main2.py:LL:21 | LL | a[: bar.A | baz.A | list[bar.A | baz.A]] = foo() | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> bar.py:2:22 | 2 | class A: ... | ^ - | info: Source --> main2.py:5:26 | 5 | a[: bar.A | baz.A | list[bar.A | baz.A]] = foo() | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> baz.py:2:22 | 2 | class A: ... | ^ - | info: Source --> main2.py:5:34 | 5 | a[: bar.A | baz.A | list[bar.A | baz.A]] = foo() | ^^^^^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -8075,39 +7479,33 @@ Source with applied edits: | 8 | class B[T]: | ^ - | info: Source --> main2.py:11:5 | 11 | b[: B[A]] = B([x=]foo.A()) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> foo.py:2:19 | 2 | class A: ... | ^ - | info: Source --> main2.py:11:7 | 11 | b[: B[A]] = B([x=]foo.A()) | ^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:9:5 | 9 | x: T | ^ - | info: Source --> main2.py:11:16 | 11 | b[: B[A]] = B([x=]foo.A()) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -8153,39 +7551,33 @@ Source with applied edits: | LL | Literal: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:5 | LL | x[: Literal[Color.RED]] = Color.RED | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> test.py:4:19 | 4 | class Color(Enum): | ^^^^^ - | info: Source --> main2.py:4:13 | 4 | x[: Literal[Color.RED]] = Color.RED | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> test.py:5:17 | 5 | RED = 1 | ^^^ - | info: Source --> main2.py:4:19 | 4 | x[: Literal[Color.RED]] = Color.RED | ^^^ - | "); } @@ -8230,39 +7622,33 @@ Source with applied edits: | LL | class list(MutableSequence[_T]): | ^^^^ - | info: Source --> main2.py:LL:5 | LL | y[: list[Inner]] = wrap([x=]Outer.Inner()) | ^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> module.py:3:23 | 3 | class Inner: ... | ^^^^^ - | info: Source --> main2.py:8:10 | 8 | y[: list[Inner]] = wrap([x=]Outer.Inner()) | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> main.py:5:13 | 5 | def wrap[T](x: T) -> list[T]: | ^ - | info: Source --> main2.py:8:26 | 8 | y[: list[Inner]] = wrap([x=]Outer.Inner()) | ^ - | --------------------------------------------- info[inlay-hint-edit]: Inlay hint edits @@ -8308,39 +7694,33 @@ Source with applied edits: | LL | Literal: _SpecialForm | ^^^^^^^ - | info: Source --> main2.py:LL:5 | LL | x[: Literal[Color.RED]] = test.Color.RED | ^^^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> test.py:4:19 | 4 | class Color(Enum): | ^^^^^ - | info: Source --> main2.py:4:13 | 4 | x[: Literal[Color.RED]] = test.Color.RED | ^^^^^ - | info[inlay-hint-location]: Inlay Hint Target --> test.py:5:17 | 5 | RED = 1 | ^^^ - | info: Source --> main2.py:4:19 | 4 | x[: Literal[Color.RED]] = test.Color.RED | ^^^ - | "); } @@ -8377,13 +7757,11 @@ Source with applied edits: | 3 | class Inner: ... | ^^^^^ - | info: Source --> main2.py:4:5 | 4 | x[: Inner] = Outer().make() | ^^^^^ - | "); } @@ -8417,13 +7795,11 @@ Source with applied edits: | 3 | class Inner: ... | ^^^^^ - | info: Source --> main2.py:8:5 | 8 | x[: Inner] = Outer().make() | ^^^^^ - | "#); } diff --git a/crates/ty_ide/src/rename.rs b/crates/ty_ide/src/rename.rs index 050bcd30b76173..c3b9c155f4e8e0 100644 --- a/crates/ty_ide/src/rename.rs +++ b/crates/ty_ide/src/rename.rs @@ -206,7 +206,6 @@ def outer(): 16 | write_nonlocal() 17 | return last | ---- - | "); } @@ -228,7 +227,6 @@ def f(items): | ^^^^ 4 | return last | ---- - | "); } @@ -252,7 +250,6 @@ def f(items): | ---- 2 | print(last) | ---- - | "); } @@ -296,7 +293,6 @@ func(value=42) 5 | 6 | func(value=42) | ----- - | "); } @@ -324,7 +320,6 @@ x = func | ---- 6 | x = func | ---- - | "); } @@ -354,7 +349,6 @@ cls = MyClass | ------- 7 | cls = MyClass | ------- - | "); } @@ -374,7 +368,6 @@ def func(): | 2 | def func(): | ^^^^ - | "); } @@ -427,7 +420,6 @@ class DataProcessor: 4 | def test(data): 5 | return func(data) | ---- - | "); } @@ -465,7 +457,6 @@ instance = ExampleClass(old_name="test") | 4 | instance = ExampleClass(old_name="test") | -------- - | "#); } @@ -489,7 +480,6 @@ instance = ExampleClass(old_name="test") 3 | 4 | class MyClass: | ------- - | "#); } @@ -513,7 +503,6 @@ instance = ExampleClass(old_name="test") 3 | 4 | class MyClass: | ------- - | "#); } @@ -551,7 +540,6 @@ instance = ExampleClass(old_name="test") 3 | 4 | class MyClass: | ------- - | "#); } @@ -603,7 +591,6 @@ instance = ExampleClass(old_name="test") 3 | 4 | class MyClass: | ------- - | "#); } @@ -640,7 +627,6 @@ instance = ExampleClass(old_name="test") | ^^ 5 | x = ab | -- - | "#); } @@ -663,7 +649,6 @@ instance = ExampleClass(old_name="test") | ^^ 5 | x = ab | -- - | "#); } @@ -686,7 +671,6 @@ instance = ExampleClass(old_name="test") | ^^ 5 | x = ab | -- - | "#); } @@ -709,7 +693,6 @@ instance = ExampleClass(old_name="test") | ^^ 5 | x = ab | -- - | "#); } @@ -732,7 +715,6 @@ instance = ExampleClass(old_name="test") | ^^ 5 | x = ab | -- - | "#); } @@ -755,7 +737,6 @@ instance = ExampleClass(old_name="test") | ^^ 5 | x = ab | -- - | "#); } @@ -784,7 +765,6 @@ instance = ExampleClass(old_name="test") | ^^ 11 | x = ab | -- - | "); } @@ -813,7 +793,6 @@ instance = ExampleClass(old_name="test") | ^^ 11 | x = ab | -- - | "); } @@ -848,7 +827,6 @@ instance = ExampleClass(old_name="test") 9 | match event: 10 | case Click(x, button=ab): | ----- - | "); } @@ -886,7 +864,6 @@ instance = ExampleClass(old_name="test") | 2 | type Alias1[AB: int = bool] = tuple[AB, list[AB]] | ^^ -- -- - | "); } @@ -904,7 +881,6 @@ instance = ExampleClass(old_name="test") | 2 | type Alias1[AB: int = bool] = tuple[AB, list[AB]] | ^^ -- -- - | "); } @@ -923,7 +899,6 @@ instance = ExampleClass(old_name="test") | 3 | type Alias2[**AB = [int, str]] = Callable[AB, tuple[AB]] | ^^ -- -- - | "); } @@ -942,7 +917,6 @@ instance = ExampleClass(old_name="test") | 3 | type Alias2[**AB = [int, str]] = Callable[AB, tuple[AB]] | ^^ -- -- - | "); } @@ -960,7 +934,6 @@ instance = ExampleClass(old_name="test") | 2 | type Alias3[*AB = ()] = tuple[tuple[*AB], tuple[*AB]] | ^^ -- -- - | "); } @@ -978,7 +951,6 @@ instance = ExampleClass(old_name="test") | 2 | type Alias3[*AB = ()] = tuple[tuple[*AB], tuple[*AB]] | ^^ -- -- - | "); } @@ -1048,7 +1020,6 @@ result = alias() | ^^^^^ 3 | result = alias() | ----- - | "); } @@ -1079,7 +1050,6 @@ result = alias() | ^^^^^ 3 | result = alias() | ----- - | "); } @@ -1144,7 +1114,6 @@ value1 = func_alias() 6 | 7 | result = original_function() | ----------------- - | "); } @@ -1196,7 +1165,6 @@ class App: 3 | 4 | func2() | ----- - | "); } @@ -1251,7 +1219,6 @@ result = func(10, y=20) 4 | 5 | result = func(10, y=20) | - - | "); } @@ -1278,7 +1245,6 @@ result = func(10, y=20) 4 | 5 | result = func(10, y=20) | - - | "); } @@ -1306,7 +1272,6 @@ TD(f=1) 7 | 8 | TD(f=1) | - - | "); } @@ -1334,7 +1299,6 @@ TD(f=1) 7 | 8 | TD(f=1) | - - | "); } @@ -1362,7 +1326,6 @@ NT(f=1) 7 | 8 | NT(f=1) | - - | "); } @@ -1391,7 +1354,6 @@ DC(f=1) 8 | 9 | DC(f=1) | - - | "); } @@ -1419,7 +1381,6 @@ DC(f=1) 4 | 5 | x = abc | --- - | "); } @@ -1446,7 +1407,6 @@ DC(f=1) 3 | 4 | x = lib2 | ---- - | "); } @@ -1478,7 +1438,6 @@ DC(f=1) | 1 | def deprecated(): pass | ---------- - | "); } @@ -1506,7 +1465,6 @@ DC(f=1) 4 | 5 | x = abc | --- - | "); } @@ -1537,7 +1495,6 @@ DC(f=1) | 4 | x = subpkg | ^^^^^^ - | "); } @@ -1670,7 +1627,6 @@ DC(f=1) | 2 | subpkg: int = 10 | ------ - | "); } @@ -1708,7 +1664,6 @@ DC(f=1) | 2 | subpkg: int = 10 | ------ - | "); } @@ -1764,7 +1719,6 @@ DC(f=1) 3 | 4 | test("test") | ---- - | "#); } @@ -1819,7 +1773,6 @@ DC(f=1) | 4 | Test().test("test") | ---- - | "#); } @@ -1876,7 +1829,6 @@ DC(f=1) 10 | 11 | def test(a: Any) -> Any: | ---- - | "#); } @@ -1913,7 +1865,6 @@ DC(f=1) | 4 | print(Foo().my_property) | ----------- - | "); } @@ -1963,7 +1914,6 @@ DC(f=1) | ----------- 5 | Foo().my_property = 56 | ----------- - | "); } @@ -2013,7 +1963,6 @@ DC(f=1) | ----------- 5 | del Foo().my_property | ----------- - | "); } @@ -2076,7 +2025,6 @@ DC(f=1) | ----------- 6 | del Foo().my_property | ----------- - | "); } @@ -2128,7 +2076,6 @@ DC(f=1) | ----------- 5 | Foo().my_property = 56 | ----------- - | "); } @@ -2180,7 +2127,6 @@ DC(f=1) | ----------- 5 | Foo().my_property = 56 | ----------- - | "); } @@ -2232,7 +2178,6 @@ DC(f=1) | ----------- 8 | def my_property(self, value: int) -> None: | ----------- - | "); } @@ -2276,7 +2221,6 @@ DC(f=1) | ----- 8 | def alpha(self, value: int) -> None: | ----- - | "); } @@ -2316,7 +2260,6 @@ DC(f=1) 10 | 11 | @my_func.setter | ------- - | "); } @@ -2359,7 +2302,6 @@ DC(f=1) | ------- 12 | def my_func(): | ^^^^^^^ - | "); } @@ -2394,7 +2336,6 @@ DC(f=1) 6 | 7 | @my_getter.setter | --------- - | "); } @@ -2436,7 +2377,6 @@ DC(f=1) 11 | 12 | @f.register | - - | "#); } @@ -2481,7 +2421,6 @@ DC(f=1) 12 | 13 | @f.register(str) | - - | "#); } @@ -2524,7 +2463,6 @@ DC(f=1) 12 | 13 | @f.register | - - | "#); } @@ -2571,7 +2509,6 @@ DC(f=1) 14 | 15 | @f.register | - - | "#); } @@ -2621,7 +2558,6 @@ DC(f=1) | - 16 | @f.register(float) | - - | "#); } @@ -2672,7 +2608,6 @@ DC(f=1) | --------- 16 | c.attribute = "new_value" | --------- - | "#); } @@ -2722,7 +2657,6 @@ DC(f=1) | ----------- 8 | def my_property(self, value: int) -> None: | ----------- - | "); } @@ -2761,7 +2695,6 @@ DC(f=1) | 4 | self.attribute = value | ^^^^^^^^^ - | "); } @@ -2793,7 +2726,6 @@ DC(f=1) 5 | 6 | print(a) | - - | "#); } @@ -2819,7 +2751,6 @@ class C: 5 | def __init__(self): 6 | self.value = 1 | ----- - | "#); } @@ -2845,7 +2776,6 @@ class C: 5 | def __init__(self): 6 | self.value = 1 | ----- - | "#); } @@ -2871,7 +2801,6 @@ class C: 5 | def __init__(self): 6 | self.value = 1 | ----- - | "#); } @@ -2897,7 +2826,6 @@ class C: 5 | def __init__(self): 6 | self.value = 1 | ----- - | "#); } @@ -2943,7 +2871,6 @@ class D: 5 | def __init__(self): 6 | self.value = 1 | ----- - | "#); } @@ -2969,7 +2896,6 @@ class C: 5 | def __init__(self): 6 | self.value = 1 | ----- - | "#); } @@ -2991,7 +2917,6 @@ class C: | ^^^^^ 4 | value: int | ----- - | "#); } @@ -3013,7 +2938,6 @@ class C: | 6 | self.value = 1 | ^^^^^ - | "); } @@ -3038,7 +2962,6 @@ class C: | ^^^^^ 4 | value: int = ... | ----- - | "#); } @@ -3064,7 +2987,6 @@ class C: | ^^^^^ 6 | self.value = value | ----- - | "#); } @@ -3089,7 +3011,6 @@ class Outer: | 7 | self.value = 1 | ^^^^^ - | "#); } } diff --git a/crates/ty_ide/src/selection_range.rs b/crates/ty_ide/src/selection_range.rs index d1560c14c47f56..6cac9348e339ae 100644 --- a/crates/ty_ide/src/selection_range.rs +++ b/crates/ty_ide/src/selection_range.rs @@ -85,28 +85,24 @@ x = 1 + 2 1 | / 2 | | x = 1 + 2 | |__________^ - | info[selection-range]: Selection Range 1 --> main.py:2:1 | 2 | x = 1 + 2 | ^^^^^^^^^ - | info[selection-range]: Selection Range 2 --> main.py:2:5 | 2 | x = 1 + 2 | ^^^^^ - | info[selection-range]: Selection Range 3 --> main.py:2:9 | 2 | x = 1 + 2 | ^ - | "); } @@ -129,35 +125,30 @@ print(\"hello\") 1 | / 2 | | print("hello") | |_______________^ - | info[selection-range]: Selection Range 1 --> main.py:2:1 | 2 | print("hello") | ^^^^^^^^^^^^^^ - | info[selection-range]: Selection Range 2 --> main.py:2:6 | 2 | print("hello") | ^^^^^^^^^ - | info[selection-range]: Selection Range 3 --> main.py:2:7 | 2 | print("hello") | ^^^^^^^ - | info[selection-range]: Selection Range 4 --> main.py:2:8 | 2 | print("hello") | ^^^^^ - | "#); } @@ -180,14 +171,12 @@ r"hello" 1 | / 2 | | r"hello" | |_________^ - | info[selection-range]: Selection Range 1 --> main.py:2:1 | 2 | r"hello" | ^^^^^^^^ - | "#); } @@ -204,14 +193,12 @@ r"hello" | 1 | f"foo" b"bar" | ^^^^^^^^^^^^^ - | info[selection-range]: Selection Range 1 --> main.py:1:8 | 1 | f"foo" b"bar" | ^^^^^^ - | "#); } @@ -236,7 +223,6 @@ def my_function(): 2 | | def my_function(): 3 | | return 42 | |______________^ - | info[selection-range]: Selection Range 1 --> main.py:2:1 @@ -244,14 +230,12 @@ def my_function(): 2 | / def my_function(): 3 | | return 42 | |_____________^ - | info[selection-range]: Selection Range 2 --> main.py:2:5 | 2 | def my_function(): | ^^^^^^^^^^^ - | "); } @@ -278,7 +262,6 @@ class MyClass: 3 | | def __init__(self): 4 | | self.value = 1 | |_______________________^ - | info[selection-range]: Selection Range 1 --> main.py:2:1 @@ -287,14 +270,12 @@ class MyClass: 3 | | def __init__(self): 4 | | self.value = 1 | |______________________^ - | info[selection-range]: Selection Range 2 --> main.py:2:7 | 2 | class MyClass: | ^^^^^^^ - | "); } @@ -317,56 +298,48 @@ result = [(lambda x: x[key.attr])(item) for item in data if item is not 1 | / 2 | | result = [(lambda x: x[key.attr])(item) for item in data if item is not None] | |______________________________________________________________________________^ - | info[selection-range]: Selection Range 1 --> main.py:2:1 | 2 | result = [(lambda x: x[key.attr])(item) for item in data if item is not None] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | info[selection-range]: Selection Range 2 --> main.py:2:10 | 2 | result = [(lambda x: x[key.attr])(item) for item in data if item is not None] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | info[selection-range]: Selection Range 3 --> main.py:2:11 | 2 | result = [(lambda x: x[key.attr])(item) for item in data if item is not None] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | info[selection-range]: Selection Range 4 --> main.py:2:12 | 2 | result = [(lambda x: x[key.attr])(item) for item in data if item is not None] | ^^^^^^^^^^^^^^^^^^^^^ - | info[selection-range]: Selection Range 5 --> main.py:2:22 | 2 | result = [(lambda x: x[key.attr])(item) for item in data if item is not None] | ^^^^^^^^^^^ - | info[selection-range]: Selection Range 6 --> main.py:2:24 | 2 | result = [(lambda x: x[key.attr])(item) for item in data if item is not None] | ^^^^^^^^ - | info[selection-range]: Selection Range 7 --> main.py:2:28 | 2 | result = [(lambda x: x[key.attr])(item) for item in data if item is not None] | ^^^^ - | "); } @@ -389,14 +362,12 @@ result = [(lambda x: x[key.attr])(item) for item in data if item is not 1 | / 2 | | "" | |___^ - | info[selection-range]: Selection Range 1 --> main.py:2:1 | 2 | "" | ^^ - | "#); } @@ -419,21 +390,18 @@ b"hello" 1 | / 2 | | b"hello" | |_________^ - | info[selection-range]: Selection Range 1 --> main.py:2:1 | 2 | b"hello" | ^^^^^^^^ - | info[selection-range]: Selection Range 2 --> main.py:2:3 | 2 | b"hello" | ^^^^^ - | "#); } @@ -456,14 +424,12 @@ b"123a𝐁c" 1 | / 2 | | b"123a𝐁c" | |__________^ - | info[selection-range]: Selection Range 1 --> main.py:2:1 | 2 | b"123a𝐁c" | ^^^^^^^^^ - | "#); } diff --git a/crates/ty_ide/src/snapshots/ty_ide__code_action__tests__add_ignore_trailing_whitespace.snap b/crates/ty_ide/src/snapshots/ty_ide__code_action__tests__add_ignore_trailing_whitespace.snap index e806867f13d4f5..40cf35facd50b5 100644 --- a/crates/ty_ide/src/snapshots/ty_ide__code_action__tests__add_ignore_trailing_whitespace.snap +++ b/crates/ty_ide/src/snapshots/ty_ide__code_action__tests__add_ignore_trailing_whitespace.snap @@ -8,7 +8,6 @@ info[code-action]: Ignore 'unresolved-reference' for this line 1 | b = a / 10 | ^ | - | - b = a / 10 1 + b = a / 10 # ty: ignore[unresolved-reference] | diff --git a/crates/ty_ide/src/snapshots/ty_ide__hover__tests__hover_subscript_literal_index_variants.snap b/crates/ty_ide/src/snapshots/ty_ide__hover__tests__hover_subscript_literal_index_variants.snap index 1547de6380a3e7..300ef6b9b13be0 100644 --- a/crates/ty_ide/src/snapshots/ty_ide__hover__tests__hover_subscript_literal_index_variants.snap +++ b/crates/ty_ide/src/snapshots/ty_ide__hover__tests__hover_subscript_literal_index_variants.snap @@ -17,7 +17,6 @@ info[hover]: Hovered content is | | | | | Cursor offset | source - | @@ -36,7 +35,6 @@ info[hover]: Hovered content is | | | | | Cursor offset | source - | @@ -55,7 +53,6 @@ info[hover]: Hovered content is | | | | | Cursor offset | source - | @@ -74,7 +71,6 @@ info[hover]: Hovered content is | | | | | Cursor offset | source - | @@ -93,7 +89,6 @@ info[hover]: Hovered content is | | | | | Cursor offset | source - | @@ -112,7 +107,6 @@ info[hover]: Hovered content is | | | | | Cursor offset | source - | @@ -131,7 +125,6 @@ info[hover]: Hovered content is | | | | | Cursor offset | source - | @@ -150,7 +143,6 @@ info[hover]: Hovered content is | | | | | Cursor offset | source - | @@ -169,4 +161,3 @@ info[hover]: Hovered content is | | | | | Cursor offset | source - | diff --git a/crates/ty_ide/src/snapshots/ty_ide__hover__tests__hover_subscript_non_literal_index.snap b/crates/ty_ide/src/snapshots/ty_ide__hover__tests__hover_subscript_non_literal_index.snap index 77c9274dc50bc4..983b0d938af87c 100644 --- a/crates/ty_ide/src/snapshots/ty_ide__hover__tests__hover_subscript_non_literal_index.snap +++ b/crates/ty_ide/src/snapshots/ty_ide__hover__tests__hover_subscript_non_literal_index.snap @@ -16,4 +16,3 @@ info[hover]: Hovered content is | | | source | Cursor offset - | diff --git a/crates/ty_ide/src/snapshots/ty_ide__hover__tests__hover_subscript_slice_literal_bounds_list_variants.snap b/crates/ty_ide/src/snapshots/ty_ide__hover__tests__hover_subscript_slice_literal_bounds_list_variants.snap index 4f94fb7b1b9e21..4d84c5ff9ee142 100644 --- a/crates/ty_ide/src/snapshots/ty_ide__hover__tests__hover_subscript_slice_literal_bounds_list_variants.snap +++ b/crates/ty_ide/src/snapshots/ty_ide__hover__tests__hover_subscript_slice_literal_bounds_list_variants.snap @@ -17,7 +17,6 @@ info[hover]: Hovered content is | | | | | Cursor offset | source - | @@ -36,7 +35,6 @@ info[hover]: Hovered content is | | | | | Cursor offset | source - | @@ -55,7 +53,6 @@ info[hover]: Hovered content is | | | | | Cursor offset | source - | @@ -74,7 +71,6 @@ info[hover]: Hovered content is | | | | | Cursor offset | source - | @@ -93,7 +89,6 @@ info[hover]: Hovered content is | | | | | Cursor offset | source - | @@ -112,4 +107,3 @@ info[hover]: Hovered content is | | | | | Cursor offset | source - | diff --git a/crates/ty_ide/src/snapshots/ty_ide__hover__tests__hover_subscript_slice_literal_bounds_string_variants.snap b/crates/ty_ide/src/snapshots/ty_ide__hover__tests__hover_subscript_slice_literal_bounds_string_variants.snap index 527c00fc20f6ff..0c934022d6ae82 100644 --- a/crates/ty_ide/src/snapshots/ty_ide__hover__tests__hover_subscript_slice_literal_bounds_string_variants.snap +++ b/crates/ty_ide/src/snapshots/ty_ide__hover__tests__hover_subscript_slice_literal_bounds_string_variants.snap @@ -17,7 +17,6 @@ info[hover]: Hovered content is | | | | | Cursor offset | source - | @@ -36,7 +35,6 @@ info[hover]: Hovered content is | | | | | Cursor offset | source - | @@ -55,4 +53,3 @@ info[hover]: Hovered content is | | | | | Cursor offset | source - | diff --git a/crates/ty_ide/src/workspace_symbols.rs b/crates/ty_ide/src/workspace_symbols.rs index 6a4e2799a42123..6d29743335df87 100644 --- a/crates/ty_ide/src/workspace_symbols.rs +++ b/crates/ty_ide/src/workspace_symbols.rs @@ -96,7 +96,6 @@ API_BASE_URL = 'https://api.example.com' | 2 | def utility_function(): | ^^^^^^^^^^^^^^^^ - | info: Function utility_function "); @@ -106,7 +105,6 @@ API_BASE_URL = 'https://api.example.com' | 2 | class DataModel: | ^^^^^^^^^ - | info: Class DataModel "); @@ -116,7 +114,6 @@ API_BASE_URL = 'https://api.example.com' | 2 | API_BASE_URL = 'https://api.example.com' | ^^^^^^^^^^^^ - | info: Constant API_BASE_URL "); } @@ -139,7 +136,6 @@ class Test: | 3 | def from_path(): ... | ^^^^^^^^^ - | info: Method from_path "); } @@ -163,7 +159,6 @@ class Test: | 4 | def from_path(): ... | ^^^^^^^^^ - | info: Method from_path "); } @@ -188,7 +183,6 @@ foo = 1 | 5 | foo = 1 | ^^^ - | info: Variable foo "); assert_snapshot!(test.workspace_symbols("re"), @"No symbols found"); diff --git a/crates/ty_python_semantic/resources/mdtest/annotations/any.md b/crates/ty_python_semantic/resources/mdtest/annotations/any.md index a8ca54c892bc0b..738ea4dbee3c24 100644 --- a/crates/ty_python_semantic/resources/mdtest/annotations/any.md +++ b/crates/ty_python_semantic/resources/mdtest/annotations/any.md @@ -250,7 +250,6 @@ error[invalid-assignment]: Object of type `CallableSubclassOfAny | IncompatibleC | -------------------- ^^^^^^ Incompatible value of type `CallableSubclassOfAny | IncompatibleCallable` | | | Declared type - | info: element `IncompatibleCallable` of union `CallableSubclassOfAny | IncompatibleCallable` is not assignable to `(int, /) -> int` info: └── type `IncompatibleCallable` has inferred callable type `(x: int) -> bytes` info: └── incompatible return types: `bytes` is not assignable to `int` diff --git a/crates/ty_python_semantic/resources/mdtest/annotations/literal_string.md b/crates/ty_python_semantic/resources/mdtest/annotations/literal_string.md index 5b951562e70742..4d36fdf8927f39 100644 --- a/crates/ty_python_semantic/resources/mdtest/annotations/literal_string.md +++ b/crates/ty_python_semantic/resources/mdtest/annotations/literal_string.md @@ -46,7 +46,6 @@ error[invalid-type-form]: `LiteralString` expects no type parameter | 4 | a: LiteralString[str] | ^^^^^^^^^^^^^^^^^^ - | ``` ```py @@ -62,7 +61,6 @@ error[invalid-type-form]: `LiteralString` expects no type parameter | -------------^^^^^^^ | | | Did you mean `Literal`? - | ``` ### As a base class diff --git a/crates/ty_python_semantic/resources/mdtest/annotations/new_types.md b/crates/ty_python_semantic/resources/mdtest/annotations/new_types.md index c2e1c85b9dc7d4..bdc89a0c9de9c8 100644 --- a/crates/ty_python_semantic/resources/mdtest/annotations/new_types.md +++ b/crates/ty_python_semantic/resources/mdtest/annotations/new_types.md @@ -201,7 +201,6 @@ warning[mismatched-type-name]: The name passed to `NewType` must match the varia | 5 | UserId = NewType("Id", int) | ^^^^ Expected "UserId", got "Id" - | ``` ```py @@ -217,7 +216,6 @@ warning[mismatched-type-name]: The name passed to `NewType` must match the varia | 10 | UsesExistingId = NewType("Id", "Id") | ^^^^ Expected "UsesExistingId", got "Id" - | ``` ## The base must be a class type or another newtype @@ -642,7 +640,6 @@ error[invalid-base]: Cannot subclass an instance of NewType | 6 | class Foo(X): ... | ^ - | info: Perhaps you were looking for: `Foo = NewType('Foo', X)` info: Definition of class `Foo` will raise `TypeError` at runtime ``` @@ -689,7 +686,6 @@ error[invalid-newtype]: invalid base for `typing.NewType` | 7 | UserId = NewType("UserId", Id) | ^^ type `Id` - | info: The base of a `NewType` is not allowed to be a protocol class. ``` @@ -707,7 +703,6 @@ error[invalid-newtype]: invalid base for `typing.NewType` | 12 | Bar = NewType("Bar", Foo) | ^^^ type `Foo` - | info: The base of a `NewType` is not allowed to be a `TypedDict`. ``` diff --git a/crates/ty_python_semantic/resources/mdtest/annotations/string.md b/crates/ty_python_semantic/resources/mdtest/annotations/string.md index 1d927a8eb890fa..491915d84fc144 100644 --- a/crates/ty_python_semantic/resources/mdtest/annotations/string.md +++ b/crates/ty_python_semantic/resources/mdtest/annotations/string.md @@ -307,7 +307,6 @@ error[invalid-syntax-in-forward-annotation]: Syntax error in forward annotation | 4 | c: """'"int"'""" = 1 | ^^^^^ Too many levels of nested string annotations; remove the redundant nested quotes - | error[invalid-syntax-in-forward-annotation]: Syntax error in forward annotation @@ -315,7 +314,6 @@ error[invalid-syntax-in-forward-annotation]: Syntax error in forward annotation | 9 | f: "'str | int | bool | Foo | Bar'" = 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Nested string annotation is too long; remove the redundant nested quotes - | ``` ## Parameter @@ -393,7 +391,6 @@ error[invalid-syntax-in-forward-annotation]: Syntax error in forward annotation | 43 | m: "yield 1" | ^^^^^^^ Yield expression cannot be used here - | help: Did you mean `typing.Literal["yield 1"]`? @@ -402,7 +399,6 @@ error[invalid-syntax-in-forward-annotation]: Syntax error in forward annotation | 45 | n: "yield from 1" | ^^^^^^^^^^^^ Yield expression cannot be used here - | help: Did you mean `typing.Literal["yield from 1"]`? @@ -413,7 +409,6 @@ error[invalid-syntax-in-forward-annotation]: Syntax error in forward annotation | -----^^^^^^^^^^^^- | | | Yield expression cannot be used here - | help: Did you mean `typing.Literal["list[yield from 1]"]`? @@ -424,7 +419,6 @@ error[invalid-syntax-in-forward-annotation]: Syntax error in forward annotation | ----^ | | | Unexpected token at the end of an expression - | help: Did you mean `typing.Literal["type]"]`? ``` @@ -476,7 +470,6 @@ error[invalid-syntax-in-forward-annotation]: Syntax error in forward annotation | |____^- | | | Unexpected token at the end of an expression - | error[invalid-syntax-in-forward-annotation]: Syntax error in forward annotation @@ -488,7 +481,6 @@ error[invalid-syntax-in-forward-annotation]: Syntax error in forward annotation | | ^ Unexpected token at the end of an expression 24 | | str | |____- - | error[invalid-syntax-in-forward-annotation]: Syntax error in forward annotation @@ -500,5 +492,4 @@ error[invalid-syntax-in-forward-annotation]: Syntax error in forward annotation | |____________^- | | | Unexpected token at the end of an expression - | ``` diff --git a/crates/ty_python_semantic/resources/mdtest/assignment/annotations.md b/crates/ty_python_semantic/resources/mdtest/assignment/annotations.md index 535b6844e3d510..49c28f9abb4ef0 100644 --- a/crates/ty_python_semantic/resources/mdtest/assignment/annotations.md +++ b/crates/ty_python_semantic/resources/mdtest/assignment/annotations.md @@ -33,7 +33,6 @@ error[invalid-assignment]: Object of type `Literal[1]` is not assignable to `Num | ------ ^ Incompatible value of type `Literal[1]` | | | Declared type - | info: Types from the `numbers` module aren't supported for static type checking help: Consider using a protocol instead, such as `typing.SupportsFloat` ``` diff --git a/crates/ty_python_semantic/resources/mdtest/assignment/augmented.md b/crates/ty_python_semantic/resources/mdtest/assignment/augmented.md index 1f79f3943412e7..76172dba8ebe39 100644 --- a/crates/ty_python_semantic/resources/mdtest/assignment/augmented.md +++ b/crates/ty_python_semantic/resources/mdtest/assignment/augmented.md @@ -68,7 +68,6 @@ error[unsupported-operator]: Unsupported `-=` operation | | | | | Has type `Literal[1]` | Has type `C` - | ``` ## Method union diff --git a/crates/ty_python_semantic/resources/mdtest/attributes.md b/crates/ty_python_semantic/resources/mdtest/attributes.md index 8d928138025270..ad7442e7c07890 100644 --- a/crates/ty_python_semantic/resources/mdtest/attributes.md +++ b/crates/ty_python_semantic/resources/mdtest/attributes.md @@ -1898,7 +1898,6 @@ error[unresolved-reference]: Name `x` used when not defined | 5 | y = x # snapshot | ^ - | info: An attribute `x` is available: consider using `self.x` ``` @@ -1916,7 +1915,6 @@ error[unresolved-reference]: Name `x` used when not defined | 10 | y = x # snapshot | ^ - | info: An attribute `x` is available: consider using `self.x` ``` @@ -2996,7 +2994,6 @@ error[invalid-assignment]: Cannot assign object of type `tuple[Literal[1], Liter | 5 | c.x = (1, b"") # snapshot: invalid-assignment | ^^^^^^^^ Expected `tuple[int, str]`, found `tuple[Literal[1], Literal[b""]]` - | info: Argument to bound method `C.__setattr__` is incorrect info: This assignment implicitly calls a custom `__setattr__` method info: the second tuple element is not compatible: `Literal[b""]` is not assignable to `str` @@ -3005,7 +3002,6 @@ info: Method defined here | 2 | def __setattr__(self, name: str, value: tuple[int, str]): ... | ^^^^^^^^^^^ ---------------------- Parameter declared here - | ``` ### Overloaded `__setattr__` @@ -3030,7 +3026,6 @@ error[invalid-assignment]: Cannot assign object of type `tuple[Literal[1], Liter | 11 | d.x = (1, b"") # snapshot: invalid-assignment | ^^^ No overload of bound method `D.__setattr__` matches arguments - | info: This assignment implicitly calls a custom `__setattr__` method info: First overload defined here --> src/mdtest_snippet.py:4:5 @@ -3038,7 +3033,6 @@ info: First overload defined here 4 | / @overload 5 | | def __setattr__(self, name: str, value: tuple[int, str]): ... | |_________________________________________________________________^ First overload defined here - | info: Possible overloads for bound method `__setattr__`: info: (self, name: str, value: tuple[int, str]) -> Unknown info: (self, name: str, value: int) -> Unknown @@ -3047,7 +3041,6 @@ info: Overload implementation defined here | 8 | def __setattr__(self, name: str, value: tuple[int, str] | int): ... | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | ``` ### Type of the `name` parameter @@ -3080,7 +3073,6 @@ error[invalid-assignment]: Cannot assign object of type `Literal["May"]` to attr | 13 | date.month = "May" # snapshot: invalid-assignment | ^^^^^ Expected `int`, found `Literal["May"]` - | info: Argument to bound method `Date.__setattr__` is incorrect info: This assignment implicitly calls a custom `__setattr__` method info: Method defined here @@ -3088,7 +3080,6 @@ info: Method defined here | 5 | def __setattr__(self, name: Literal["day", "month", "year"], value: int) -> None: | ^^^^^^^^^^^ ---------- Parameter declared here - | error[invalid-assignment]: Cannot assign object of type `Literal["UTC"]` to attribute `tz` on type `Date` @@ -3096,7 +3087,6 @@ error[invalid-assignment]: Cannot assign object of type `Literal["UTC"]` to attr | 16 | date.tz = "UTC" | ^^^^^^^ Expected `Literal["day", "month", "year"]`, found `Literal["tz"]` - | info: Argument to bound method `Date.__setattr__` is incorrect info: This assignment implicitly calls a custom `__setattr__` method info: Method defined here @@ -3104,7 +3094,6 @@ info: Method defined here | 5 | def __setattr__(self, name: Literal["day", "month", "year"], value: int) -> None: | ^^^^^^^^^^^ ------------------------------------- Parameter declared here - | error[invalid-assignment]: Cannot assign object of type `Literal["UTC"]` to attribute `tz` on type `Date` @@ -3112,7 +3101,6 @@ error[invalid-assignment]: Cannot assign object of type `Literal["UTC"]` to attr | 16 | date.tz = "UTC" | ^^^^^ Expected `int`, found `Literal["UTC"]` - | info: Argument to bound method `Date.__setattr__` is incorrect info: This assignment implicitly calls a custom `__setattr__` method info: Method defined here @@ -3120,7 +3108,6 @@ info: Method defined here | 5 | def __setattr__(self, name: Literal["day", "month", "year"], value: int) -> None: | ^^^^^^^^^^^ ---------- Parameter declared here - | ``` ### Return type of `__setattr__` @@ -4234,7 +4221,6 @@ error[unresolved-attribute]: Module `datetime` has no member `UTC` | 4 | reveal_type(datetime.UTC) # revealed: Unknown | ^^^^^^^^^^^^ - | info: The member may be available on other Python versions or platforms info: Python 3.10 was assumed when resolving the `UTC` attribute because it was specified on the command line ``` @@ -4256,7 +4242,6 @@ error[unresolved-attribute]: Module `datetime` has no member `fakenotreal` | 4 | reveal_type(datetime.fakenotreal) # revealed: Unknown | ^^^^^^^^^^^^^^^^^^^^ - | ``` ## Unimported submodule incorrectly accessed as attribute @@ -4293,7 +4278,6 @@ warning[possibly-missing-submodule]: Submodule `bar` might not have been importe | 4 | reveal_type(foo.bar) # revealed: Unknown | ^^^^^^^ - | help: Consider explicitly importing `foo.bar` ``` @@ -4312,7 +4296,6 @@ warning[possibly-missing-submodule]: Submodule `bar` might not have been importe | 4 | reveal_type(baz.bar) # revealed: Unknown | ^^^^^^^ - | help: Consider explicitly importing `baz.bar` ``` @@ -4338,7 +4321,6 @@ error[unresolved-attribute]: Object of type `(...) -> Any` has no attribute `__n | 4 | x.__name__ # snapshot: unresolved-attribute | ^^^^^^^^^^ - | help: Function objects have a `__name__` attribute, but not all callable objects are functions help: See this FAQ for more information: ``` @@ -4354,7 +4336,6 @@ error[unresolved-attribute]: Object of type `(...) -> Any` has no attribute `__a | 6 | x.__annotate__ # snapshot: unresolved-attribute | ^^^^^^^^^^^^^^ - | help: Function objects have an `__annotate__` attribute, but not all callable objects are functions help: See this FAQ for more information: ``` diff --git a/crates/ty_python_semantic/resources/mdtest/binary/custom.md b/crates/ty_python_semantic/resources/mdtest/binary/custom.md index 9c42bb9893abdc..43311304774205 100644 --- a/crates/ty_python_semantic/resources/mdtest/binary/custom.md +++ b/crates/ty_python_semantic/resources/mdtest/binary/custom.md @@ -320,7 +320,6 @@ error[unsupported-operator]: Unsupported `+` operation | ---^^^--- | | | Both operands have type `` - | ``` ```py @@ -336,7 +335,6 @@ error[unsupported-operator]: Unsupported `+` operation | ---^^^--- | | | Both operands have type `` - | ``` ```py @@ -352,7 +350,6 @@ error[unsupported-operator]: Unsupported `+` operation | --^^^-- | | | Both operands have type `` - | ``` ## Subclass @@ -449,5 +446,4 @@ error[unsupported-operator]: Unsupported `+` operation | | | | | Has type `mod1.A` | Has type `mod2.A` - | ``` diff --git a/crates/ty_python_semantic/resources/mdtest/binary/instances.md b/crates/ty_python_semantic/resources/mdtest/binary/instances.md index f458b0871b900d..3b8839588ff616 100644 --- a/crates/ty_python_semantic/resources/mdtest/binary/instances.md +++ b/crates/ty_python_semantic/resources/mdtest/binary/instances.md @@ -494,7 +494,6 @@ error[unsupported-bool-conversion]: Boolean conversion is not supported for type | 7 | 10 and a and True | ^ - | info: `__bool__` on `NotBoolable` must be callable ``` diff --git a/crates/ty_python_semantic/resources/mdtest/call/abstract_method.md b/crates/ty_python_semantic/resources/mdtest/call/abstract_method.md index 6509b63edf230e..786eb0b9ba9dd9 100644 --- a/crates/ty_python_semantic/resources/mdtest/call/abstract_method.md +++ b/crates/ty_python_semantic/resources/mdtest/call/abstract_method.md @@ -28,7 +28,6 @@ error[call-abstract-method]: Cannot call `method` on class object 8 | # snapshot: call-abstract-method 9 | Foo.method() | ^^^^^^^^^^^^ `method` is an abstract classmethod with a trivial body - | ``` ## Abstract staticmethod with trivial body on class literal diff --git a/crates/ty_python_semantic/resources/mdtest/call/builtins.md b/crates/ty_python_semantic/resources/mdtest/call/builtins.md index bbf49b9c096838..923cbe87f8a8de 100644 --- a/crates/ty_python_semantic/resources/mdtest/call/builtins.md +++ b/crates/ty_python_semantic/resources/mdtest/call/builtins.md @@ -460,7 +460,6 @@ error[call-non-callable]: `NotImplemented` is not callable | --------------^^ | | | Did you mean `NotImplementedError`? - | ``` ```py @@ -477,7 +476,6 @@ error[call-non-callable]: `NotImplemented` is not callable | --------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | Did you mean `NotImplementedError`? - | ``` ## `map` with generic callbacks diff --git a/crates/ty_python_semantic/resources/mdtest/call/function.md b/crates/ty_python_semantic/resources/mdtest/call/function.md index 8893ee159c1a98..ebb48072dcb2d6 100644 --- a/crates/ty_python_semantic/resources/mdtest/call/function.md +++ b/crates/ty_python_semantic/resources/mdtest/call/function.md @@ -1471,13 +1471,11 @@ error[invalid-argument-type]: Argument to function `f` is incorrect | 15 | f(**Foo1(a=1, b="b")) | ^^^^^^^^^^^^^^^^^^ Expected `int`, found `str` - | info: Function defined here --> src/mdtest_snippet.py:11:5 | 11 | def f(**kwargs: int) -> None: ... | ^ ------------- Parameter declared here - | error[invalid-argument-type]: Argument to function `f` is incorrect @@ -1485,13 +1483,11 @@ error[invalid-argument-type]: Argument to function `f` is incorrect | 15 | f(**Foo1(a=1, b="b")) | ^^^^^^^^^^^^^^^^^^ Possible extra items in unpacked open `TypedDict` have type `object`, expected `int` - | info: Function defined here --> src/mdtest_snippet.py:11:5 | 11 | def f(**kwargs: int) -> None: ... | ^ ------------- Parameter declared here - | ``` ### TypedDict union diff --git a/crates/ty_python_semantic/resources/mdtest/call/methods.md b/crates/ty_python_semantic/resources/mdtest/call/methods.md index 2a6a46926b07c1..bfb257f9305c3a 100644 --- a/crates/ty_python_semantic/resources/mdtest/call/methods.md +++ b/crates/ty_python_semantic/resources/mdtest/call/methods.md @@ -616,13 +616,11 @@ error[missing-argument]: No argument provided for required parameter `arg` of fu | 18 | class MissingArg(RequiresArg): ... | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | info: Parameter declared here --> src/mdtest_snippet.py:13:32 | 13 | def __init_subclass__(cls, arg: int): ... | ^^^^^^^^ - | ``` ```py @@ -637,13 +635,11 @@ error[invalid-argument-type]: Argument to function `RequiresArg.__init_subclass_ | 20 | class InvalidType(RequiresArg, arg="foo"): ... | ^^^^^^^^^ Expected `int`, found `Literal["foo"]` - | info: Function defined here --> src/mdtest_snippet.py:13:9 | 13 | def __init_subclass__(cls, arg: int): ... | ^^^^^^^^^^^^^^^^^ -------- Parameter declared here - | ``` ```py @@ -668,13 +664,11 @@ error[missing-argument]: No argument provided for required parameter `arg` of fu | 24 | class IncorrectArg(RequiresArg, not_arg="foo"): | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | info: Parameter declared here --> src/mdtest_snippet.py:13:32 | 13 | def __init_subclass__(cls, arg: int): ... | ^^^^^^^^ - | error[unknown-argument]: Argument `not_arg` does not match any known parameter of function `RequiresArg.__init_subclass__` @@ -682,13 +676,11 @@ error[unknown-argument]: Argument `not_arg` does not match any known parameter o | 24 | class IncorrectArg(RequiresArg, not_arg="foo"): | ^^^^^^^^^^^^^ - | info: Function signature here --> src/mdtest_snippet.py:13:9 | 13 | def __init_subclass__(cls, arg: int): ... | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | ``` ```py @@ -712,7 +704,6 @@ error[non-callable-init-subclass]: Invalid definition of class `Bad` 38 | # snapshot: non-callable-init-subclass 39 | class Bad(NotCallableInitSubclass): | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Superclass `NotCallableInitSubclass` cannot be subclassed - | info: `__init_subclass__` on a superclass is implicitly called during creation of a class object info: See https://docs.python.org/3/reference/datamodel.html#customizing-class-creation ``` diff --git a/crates/ty_python_semantic/resources/mdtest/call/overloads.md b/crates/ty_python_semantic/resources/mdtest/call/overloads.md index 9bdfbc6145a618..7713f85ecfa97e 100644 --- a/crates/ty_python_semantic/resources/mdtest/call/overloads.md +++ b/crates/ty_python_semantic/resources/mdtest/call/overloads.md @@ -1030,7 +1030,6 @@ error[no-matching-overload]: No overload of function `f` matches arguments 39 | | a30=a, 40 | | ) | |_________^ - | info: Limit of argument type expansion reached at argument 9 info: First overload defined here --> src/overloaded.pyi:7:1 @@ -1038,7 +1037,6 @@ info: First overload defined here 7 | / @overload 8 | | def f() -> None: ... | |____________________^ First overload defined here - | info: Possible overloads for function `f`: info: () -> None info: (**kwargs: int) -> C diff --git a/crates/ty_python_semantic/resources/mdtest/call/type.md b/crates/ty_python_semantic/resources/mdtest/call/type.md index bbd7518d44a591..397fd7103797fc 100644 --- a/crates/ty_python_semantic/resources/mdtest/call/type.md +++ b/crates/ty_python_semantic/resources/mdtest/call/type.md @@ -691,7 +691,6 @@ error[inconsistent-mro]: Cannot create a consistent method resolution order (MRO | 7 | class Foo1(Generic[K, V], dict): ... # snapshot: inconsistent-mro | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Move `Generic[K, V]` to the end of the bases list | 6 | # error: [missing-type-argument] @@ -729,7 +728,6 @@ error[inconsistent-mro]: Cannot create a consistent method resolution order (MRO 16 | | # comment5 17 | | ): ... | |_^ - | help: Move `Generic[K, V]` to the end of the bases list | 11 | # comment1 @@ -754,7 +752,6 @@ error[inconsistent-mro]: Cannot create a consistent method resolution order (MRO | 19 | class Foo3(Generic[K, V], dict, metaclass=type): ... # snapshot: inconsistent-mro | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Move `Generic[K, V]` to the end of the bases list | 18 | # error: [missing-type-argument] @@ -796,7 +793,6 @@ error[inconsistent-mro]: Cannot create a consistent method resolution order (MRO 28 | | # comment7 29 | | ): ... | |_^ - | help: Move `Generic[K, V]` to the end of the bases list | 21 | # comment1 @@ -828,7 +824,6 @@ error[duplicate-base]: Duplicate base class in class `Dup` | 4 | Dup = type("Dup", (A, A), {}) | ^^^^^^^^^^^^^^^^^^^^^^^ - | ``` ## Metaclass conflicts @@ -956,7 +951,6 @@ error[instance-layout-conflict]: Class will raise `TypeError` at runtime due to | 8 | X = type("X", (A, B), {}) | ^^^^^^^^^^^^^^^^^^^^^ Bases `A` and `B` cannot be combined in multiple inheritance - | info: Two classes cannot coexist in a class's MRO if their instances have incompatible memory layouts --> src/mdtest_snippet.py:8:16 | @@ -964,7 +958,6 @@ info: Two classes cannot coexist in a class's MRO if their instances have incomp | - - `B` instances have a distinct memory layout because `B` defines non-empty `__slots__` | | | `A` instances have a distinct memory layout because `A` defines non-empty `__slots__` - | ``` When the bases are not a tuple literal (e.g., a variable), the diagnostic is emitted without diff --git a/crates/ty_python_semantic/resources/mdtest/call/union.md b/crates/ty_python_semantic/resources/mdtest/call/union.md index b878e2d5b0c20e..ff862e998f738d 100644 --- a/crates/ty_python_semantic/resources/mdtest/call/union.md +++ b/crates/ty_python_semantic/resources/mdtest/call/union.md @@ -966,13 +966,11 @@ error[invalid-argument-type]: Argument to bound method `BytesCaller.__call__` is | 21 | f(None) | ^^^^ Expected `bytes`, found `None` - | info: Method defined here --> src/mdtest_snippet.py:13:9 | 13 | def __call__(self, x: bytes) -> bytes: | ^^^^^^^^ -------- Parameter declared here - | info: Union variant `BytesCaller` is incompatible with this call site info: Attempted to call union type `(IntCaller & StrCaller) | BytesCaller` @@ -982,13 +980,11 @@ error[invalid-argument-type]: Argument to bound method `IntCaller.__call__` is i | 21 | f(None) | ^^^^ Expected `int`, found `None` - | info: Method defined here --> src/mdtest_snippet.py:5:9 | 5 | def __call__(self, x: int) -> int: | ^^^^^^^^ ------ Parameter declared here - | info: Intersection element `IntCaller` is incompatible with this call site info: Attempted to call intersection type `IntCaller & StrCaller` info: Attempted to call union type `(IntCaller & StrCaller) | BytesCaller` @@ -999,13 +995,11 @@ error[invalid-argument-type]: Argument to bound method `StrCaller.__call__` is i | 21 | f(None) | ^^^^ Expected `str`, found `None` - | info: Method defined here --> src/mdtest_snippet.py:9:9 | 9 | def __call__(self, x: str) -> str: | ^^^^^^^^ ------ Parameter declared here - | info: Intersection element `StrCaller` is incompatible with this call site info: Attempted to call intersection type `IntCaller & StrCaller` info: Attempted to call union type `(IntCaller & StrCaller) | BytesCaller` diff --git a/crates/ty_python_semantic/resources/mdtest/comparison/instances/membership_test.md b/crates/ty_python_semantic/resources/mdtest/comparison/instances/membership_test.md index f75a458a2646c2..42508636e037f5 100644 --- a/crates/ty_python_semantic/resources/mdtest/comparison/instances/membership_test.md +++ b/crates/ty_python_semantic/resources/mdtest/comparison/instances/membership_test.md @@ -226,7 +226,6 @@ error[unsupported-bool-conversion]: Boolean conversion is not supported for type | 9 | 10 in WithContains() | ^^^^^^^^^^^^^^^^^^^^ - | info: `__bool__` on `NotBoolable` must be callable ``` @@ -241,6 +240,5 @@ error[unsupported-bool-conversion]: Boolean conversion is not supported for type | 11 | 10 not in WithContains() | ^^^^^^^^^^^^^^^^^^^^^^^^ - | info: `__bool__` on `NotBoolable` must be callable ``` diff --git a/crates/ty_python_semantic/resources/mdtest/comparison/instances/rich_comparison.md b/crates/ty_python_semantic/resources/mdtest/comparison/instances/rich_comparison.md index 6eed9d733891fe..837592fb10df51 100644 --- a/crates/ty_python_semantic/resources/mdtest/comparison/instances/rich_comparison.md +++ b/crates/ty_python_semantic/resources/mdtest/comparison/instances/rich_comparison.md @@ -371,7 +371,6 @@ error[unsupported-bool-conversion]: Boolean conversion is not supported for type | 12 | 10 < Comparable() < 20 | ^^^^^^^^^^^^^^^^^ - | info: `__bool__` on `NotBoolable` must be callable ``` @@ -388,7 +387,6 @@ error[unsupported-bool-conversion]: Boolean conversion is not supported for type | 14 | 10 < Comparable() < Comparable() | ^^^^^^^^^^^^^^^^^ - | info: `__bool__` on `NotBoolable` must be callable ``` diff --git a/crates/ty_python_semantic/resources/mdtest/comparison/intersections.md b/crates/ty_python_semantic/resources/mdtest/comparison/intersections.md index 56515ecc865212..8c0630a142e90e 100644 --- a/crates/ty_python_semantic/resources/mdtest/comparison/intersections.md +++ b/crates/ty_python_semantic/resources/mdtest/comparison/intersections.md @@ -164,7 +164,6 @@ error[unsupported-operator]: Unsupported `in` operation | | | | | Has type `NonContainer1 & NonContainer2` | Has type `Literal[2]` - | ``` Do not raise an error if at least one of the positive contributions to the intersection type support @@ -206,7 +205,6 @@ error[unsupported-operator]: Unsupported `in` operation | | | | | Has type `~NonContainer1` | Has type `Literal[2]` - | ``` ### Unsupported operators for negative contributions diff --git a/crates/ty_python_semantic/resources/mdtest/comparison/unions.md b/crates/ty_python_semantic/resources/mdtest/comparison/unions.md index a2418d71b1e650..990b036dfc59ce 100644 --- a/crates/ty_python_semantic/resources/mdtest/comparison/unions.md +++ b/crates/ty_python_semantic/resources/mdtest/comparison/unions.md @@ -92,7 +92,6 @@ error[unsupported-operator]: Unsupported `in` operation | | | | | Has type `list[int] | Literal[1]` | Has type `Literal[1]` - | info: Operation fails because operator `in` is not supported between two objects of type `Literal[1]` ``` @@ -109,7 +108,6 @@ error[unsupported-operator]: Unsupported `in` operation | -^^^^- | | | Both operands have type `list[int] | Literal[1]` - | info: Operation fails because operator `in` is not supported between objects of type `list[int]` and `Literal[1]` ``` @@ -126,7 +124,6 @@ error[unsupported-operator]: Unsupported `<` operation | | | | | Has type `tuple[str] | tuple[str, str]` | Has type `tuple[int]` - | info: Operation fails because operator `<` is not supported between objects of type `int` and `str` ``` @@ -143,7 +140,6 @@ error[unsupported-operator]: Unsupported `<` operation | | | | | Has type `tuple[int]` | Has type `tuple[str] | tuple[str, str]` - | info: Operation fails because operator `<` is not supported between objects of type `str` and `int` ``` @@ -160,6 +156,5 @@ error[unsupported-operator]: Unsupported `<` operation | | | | | Has type `tuple[str] | tuple[str, str]` | Has type `tuple[int] | tuple[int, int]` - | info: Operation fails because operator `<` is not supported between objects of type `int` and `str` ``` diff --git a/crates/ty_python_semantic/resources/mdtest/comparison/unsupported.md b/crates/ty_python_semantic/resources/mdtest/comparison/unsupported.md index 8e4fd03486b230..7e55fc27b6e08e 100644 --- a/crates/ty_python_semantic/resources/mdtest/comparison/unsupported.md +++ b/crates/ty_python_semantic/resources/mdtest/comparison/unsupported.md @@ -17,7 +17,6 @@ error[unsupported-operator]: Unsupported `in` operation | | | | | Has type `Literal[7]` | Has type `Literal[1]` - | ``` ```py @@ -35,7 +34,6 @@ error[unsupported-operator]: Unsupported `not in` operation | | | | | Has type `Literal[10]` | Has type `Literal[0]` - | ``` ```py @@ -53,7 +51,6 @@ error[unsupported-operator]: Unsupported `<` operation | | | | | Has type `Literal[5]` | Has type `object` - | ``` ```py @@ -71,7 +68,6 @@ error[unsupported-operator]: Unsupported `<` operation | | | | | Has type `object` | Has type `Literal[5]` - | ``` ```py @@ -90,7 +86,6 @@ error[unsupported-operator]: Unsupported `in` operation | | | | | Has type `Literal[1, "foo"]` | Has type `Literal[42]` - | info: Operation fails because operator `in` is not supported between objects of type `Literal[42]` and `Literal[1]` ``` @@ -109,7 +104,6 @@ error[unsupported-operator]: Unsupported `<` operation | | | | | Has type `tuple[Literal[1], Literal["hello"]]` | Has type `tuple[Literal[1], Literal[2]]` - | info: Operation fails because operator `<` is not supported between the tuple elements at index 2 (of type `Literal[2]` and `Literal["hello"]`) ``` @@ -127,6 +121,5 @@ error[unsupported-operator]: Unsupported `<` operation | ------------^^^------------ | | | Both operands have type `tuple[bool, A]` - | info: Operation fails because operator `<` is not supported between the tuple elements at index 2 (both of type `A`) ``` diff --git a/crates/ty_python_semantic/resources/mdtest/dataclasses/dataclasses.md b/crates/ty_python_semantic/resources/mdtest/dataclasses/dataclasses.md index 66d70c5c690a1e..0f450075b43600 100644 --- a/crates/ty_python_semantic/resources/mdtest/dataclasses/dataclasses.md +++ b/crates/ty_python_semantic/resources/mdtest/dataclasses/dataclasses.md @@ -1282,7 +1282,6 @@ error[invalid-frozen-dataclass-subclass]: Non-frozen dataclass cannot inherit fr 8 | # snapshot: invalid-frozen-dataclass-subclass 9 | class Child(FrozenBase): | ^^^^^^----------^ Subclass `Child` is not frozen but base class `FrozenBase` is - | info: This causes the class creation to fail info: Base class definition --> src/foo.py:3:1 @@ -1291,7 +1290,6 @@ info: Base class definition | ----------------------- `FrozenBase` dataclass parameters 4 | class FrozenBase: | ^^^^^^^^^^ `FrozenBase` definition - | ``` Frozen dataclasses inheriting from non-frozen dataclasses are also illegal: @@ -2258,7 +2256,6 @@ error[missing-argument]: No argument provided for required parameter `y` | 13 | C(3, "") | ^^^^^^^^ - | error[too-many-positional-arguments]: Too many positional arguments: expected 1, got 2 @@ -2266,7 +2263,6 @@ error[too-many-positional-arguments]: Too many positional arguments: expected 1, | 13 | C(3, "") | ^^ - | ``` Declaration order still controls `KW_ONLY` when a later field name was already referenced by an diff --git a/crates/ty_python_semantic/resources/mdtest/del.md b/crates/ty_python_semantic/resources/mdtest/del.md index 6ac52f41384f96..6fad0dad95bea5 100644 --- a/crates/ty_python_semantic/resources/mdtest/del.md +++ b/crates/ty_python_semantic/resources/mdtest/del.md @@ -448,7 +448,6 @@ error[invalid-argument-type]: Cannot delete required key "name" from TypedDict ` | 19 | del m["name"] | ^^^^^^ - | info: Field defined here --> src/mdtest_snippet.py:3:7 | @@ -459,7 +458,6 @@ info: Field defined here | | | `name` declared as required here | Consider making it `NotRequired` - | info: Only keys marked as `NotRequired` (or in a TypedDict with `total=False`) can be deleted ``` @@ -488,7 +486,6 @@ error[invalid-argument-type]: Cannot delete required key "name" from TypedDict ` | 23 | del mixed["name"] | ^^^^^^ - | info: Field defined here --> src/mdtest_snippet.py:11:7 | @@ -499,7 +496,6 @@ info: Field defined here | | | `name` declared as required here | Consider making it `NotRequired` - | info: Only keys marked as `NotRequired` (or in a TypedDict with `total=False`) can be deleted ``` @@ -516,5 +512,4 @@ error[invalid-argument-type]: Cannot delete unknown key "non_existent" from Type | 25 | del mixed["non_existent"] | ^^^^^^^^^^^^^^ - | ``` diff --git a/crates/ty_python_semantic/resources/mdtest/descriptor_protocol.md b/crates/ty_python_semantic/resources/mdtest/descriptor_protocol.md index 9fd9f0c0665320..566f58f1757635 100644 --- a/crates/ty_python_semantic/resources/mdtest/descriptor_protocol.md +++ b/crates/ty_python_semantic/resources/mdtest/descriptor_protocol.md @@ -799,7 +799,6 @@ error[invalid-assignment]: Cannot assign to read-only property `immutable` on ob 5 | # snapshot: invalid-assignment 6 | DontAssignToMe().immutable = "the properties, they are a-changing" | ^^^^^^^^^^^^^^^^^^^^^^^^^^ Attempted assignment to `DontAssignToMe.immutable` here - | ``` ### Built-in `classmethod` descriptor diff --git a/crates/ty_python_semantic/resources/mdtest/diagnostics/attribute_assignment.md b/crates/ty_python_semantic/resources/mdtest/diagnostics/attribute_assignment.md index d903903d938ee2..bf7855eeba3b22 100644 --- a/crates/ty_python_semantic/resources/mdtest/diagnostics/attribute_assignment.md +++ b/crates/ty_python_semantic/resources/mdtest/diagnostics/attribute_assignment.md @@ -29,7 +29,6 @@ error[invalid-assignment]: Object of type `Literal["wrong"]` is not assignable t | 8 | instance.attr = "wrong" # snapshot: invalid-assignment | ^^^^^^^^^^^^^ - | ``` And on the class object: @@ -44,7 +43,6 @@ error[invalid-assignment]: Object of type `Literal["wrong"]` is not assignable t | 9 | C.attr = "wrong" # snapshot: invalid-assignment | ^^^^^^ - | ``` ## Pure instance attributes @@ -74,7 +72,6 @@ error[invalid-attribute-access]: Cannot assign to instance attribute `attr` from | 8 | C.attr = 1 # snapshot: invalid-attribute-access | ^^^^^^ - | ``` ## Invalid annotated assignment to attribute @@ -102,7 +99,6 @@ error[invalid-assignment]: Object of type `None` is not assignable to `str` | --- ^^^^ Incompatible value of type `None` | | | Declared type - | error[invalid-assignment]: Object of type `None` is not assignable to `str` @@ -112,7 +108,6 @@ error[invalid-assignment]: Object of type `None` is not assignable to `str` | --- ^^^^ Incompatible value of type `None` | | | Declared type - | ``` Annotations on other attribute targets are ignored, and the assignment is checked against the @@ -180,7 +175,6 @@ error[invalid-attribute-access]: Cannot assign to ClassVar `attr` from an instan | 9 | instance.attr = 1 # snapshot: invalid-attribute-access | ^^^^^^^^^^^^^ - | ``` ## Unknown attributes @@ -199,7 +193,6 @@ error[unresolved-attribute]: Unresolved attribute `non_existent` on type ` None: | ^^^^^^^ ---------- Parameter declared here - | ``` ### Invalid `__set__` method signature @@ -319,14 +307,12 @@ error[invalid-assignment]: Invalid assignment to data descriptor attribute `attr | 10 | instance.attr = 1 # snapshot: invalid-assignment | ^^^^^^^^^^^^^ No argument provided for required parameter `extra` of function `WrongDescriptor.__set__` - | info: This assignment implicitly calls `__set__` on a descriptor of type `WrongDescriptor` info: Parameter declared here --> src/mdtest_snippet.py:2:53 | 2 | def __set__(self, instance: object, value: int, extra: int) -> None: | ^^^^^^^^^^ - | ``` ### Invalid property setter argument type @@ -355,7 +341,6 @@ error[invalid-assignment]: Invalid assignment to data descriptor attribute `docu | 11 | self.document = None # snapshot: invalid-assignment | ^^^^ Expected `Document`, found `None` - | info: Argument to function `HasDocumentRef.document` is incorrect info: This assignment implicitly calls `__set__` on a descriptor of type `property` info: Function defined here @@ -363,7 +348,6 @@ info: Function defined here | 7 | def document(self, document: Document) -> None: ... | ^^^^^^^^ ------------------ Parameter declared here - | ``` ### Nested argument type @@ -385,7 +369,6 @@ error[invalid-assignment]: Invalid assignment to data descriptor attribute `x` o | 8 | c.x = (1, b"") # snapshot: invalid-assignment | ^^^^^^^^ Expected `tuple[int, str]`, found `tuple[Literal[1], Literal[b""]]` - | info: Argument to function `Descriptor.__set__` is incorrect info: This assignment implicitly calls `__set__` on a descriptor of type `Descriptor` info: the second tuple element is not compatible: `Literal[b""]` is not assignable to `str` @@ -394,7 +377,6 @@ info: Function defined here | 2 | def __set__(self, instance, value: tuple[int, str]) -> None: ... | ^^^^^^^ ---------------------- Parameter declared here - | ``` ## Setting attributes on union types @@ -429,5 +411,4 @@ error[invalid-assignment]: Object of type `Literal[1]` is not assignable to attr | 10 | C1.attr = 1 # snapshot: invalid-assignment | ^^^^^^^ - | ``` diff --git a/crates/ty_python_semantic/resources/mdtest/diagnostics/error_context.md b/crates/ty_python_semantic/resources/mdtest/diagnostics/error_context.md index eda449b7bbff73..42527351392656 100644 --- a/crates/ty_python_semantic/resources/mdtest/diagnostics/error_context.md +++ b/crates/ty_python_semantic/resources/mdtest/diagnostics/error_context.md @@ -27,7 +27,6 @@ error[invalid-assignment]: Object of type `str` is not assignable to `bytes` | ----- ^^^^^^ Incompatible value of type `str` | | | Declared type - | ``` ## Unions @@ -47,7 +46,6 @@ error[invalid-assignment]: Object of type `str | None` is not assignable to `str | --- ^^^^^^ Incompatible value of type `str | None` | | | Declared type - | info: element `None` of union `str | None` is not assignable to `str` ``` @@ -66,7 +64,6 @@ error[invalid-assignment]: Object of type `int` is not assignable to `str | None | ---------- ^^^^^^ Incompatible value of type `int` | | | Declared type - | ``` Assigning a union to a union: @@ -84,7 +81,6 @@ error[invalid-assignment]: Object of type `str | None` is not assignable to `byt | ------------ ^^^^^^ Incompatible value of type `str | None` | | | Declared type - | info: element `str` of union `str | None` is not assignable to `bytes | None` ``` @@ -126,7 +122,6 @@ error[invalid-assignment]: Object of type `HasBar & HasNeither` is not assignabl | ----------------- ^^^^^^ Incompatible value of type `HasBar & HasNeither` | | | Declared type - | info: no element of intersection `HasBar & HasNeither` is assignable to `SupportsFooAndBar` info: ├── type `HasBar` is not assignable to protocol `SupportsFooAndBar` info: │ └── protocol member `foo` is not defined on type `HasBar` @@ -149,7 +144,6 @@ error[invalid-assignment]: Object of type `HasFoo` is not assignable to `Support | -------------------------------------- ^^^^^^ Incompatible value of type `HasFoo` | | | Declared type - | info: type `HasFoo` is not assignable to element `SupportsBar` of intersection `SupportsFoo & SupportsBar` info: └── type `HasFoo` is not assignable to protocol `SupportsBar` info: └── protocol member `bar` is not defined on type `HasFoo` @@ -170,7 +164,6 @@ error[invalid-assignment]: Object of type `HasFoo & HasNeither` is not assignabl | -------------------------------------- ^^^^^^ Incompatible value of type `HasFoo & HasNeither` | | | Declared type - | info: type `HasFoo & HasNeither` is not assignable to element `SupportsBar` of intersection `SupportsFoo & SupportsBar` info: └── no element of intersection `HasFoo & HasNeither` is assignable to `SupportsBar` info: ├── type `HasFoo` is not assignable to protocol `SupportsBar` @@ -196,7 +189,6 @@ error[invalid-assignment]: Object of type `tuple[int, str, bool]` is not assigna | ----------------------- ^^^^^^ Incompatible value of type `tuple[int, str, bool]` | | | Declared type - | info: the second tuple element is not compatible: `str` is not assignable to `bytes` ``` @@ -215,7 +207,6 @@ error[invalid-assignment]: Object of type `tuple[int, str]` is not assignable to | --------------------- ^^^^^^ Incompatible value of type `tuple[int, str]` | | | Declared type - | info: a tuple of length 2 is not assignable to a tuple of length 3 ``` @@ -240,7 +231,6 @@ error[invalid-assignment]: Object of type `def source(x: int, y: str) -> None` i | ---------------------------- ^^^^^^ Incompatible value of type `def source(x: int, y: str) -> None` | | | Declared type - | info: incompatible return types: `None` is not assignable to `bool` ``` @@ -259,7 +249,6 @@ error[invalid-assignment]: Object of type `(int, str, /) -> bool` is not assigna | ---------------------------- ^^^^^^ Incompatible value of type `(int, str, /) -> bool` | | | Declared type - | info: the second parameter has an incompatible type: `bytes` is not assignable to `str` ``` @@ -278,7 +267,6 @@ error[invalid-assignment]: Object of type `(int, bytes, /) -> None` is not assig | ---------------------------- ^^^^^^ Incompatible value of type `(int, bytes, /) -> None` | | | Declared type - | info: incompatible return types: `None` is not assignable to `bool` ``` @@ -297,7 +285,6 @@ error[invalid-assignment]: Object of type `(int, str, /) -> bool` is not assigna | --------------------- ^^^^^^ Incompatible value of type `(int, str, /) -> bool` | | | Declared type - | info: unexpected extra parameter ``` @@ -318,7 +305,6 @@ error[invalid-assignment]: Object of type `def source(x: int, extra: str) -> boo | --------------------- ^^^^^^ Incompatible value of type `def source(x: int, extra: str) -> bool` | | | Declared type - | info: unexpected extra parameter `extra` ``` @@ -339,7 +325,6 @@ error[invalid-assignment]: Object of type `` is not assignable t | -------------------- ^^^^^^ Incompatible value of type `` | | | Declared type - | info: type `` has inferred callable type `(value: int) -> Number` info: └── the first parameter has an incompatible type: `str` is not assignable to `int` ``` @@ -363,7 +348,6 @@ error[invalid-argument-type]: Argument to function `accepts_callable` is incorre | 28 | accepts_callable(Foo) # snapshot | ^^^ Expected `(Any, /) -> Any`, found `` - | info: type `` has inferred callable type `(x: Any, y: Any) -> Foo` info: └── unexpected extra parameter `y` info: Function defined here @@ -371,7 +355,6 @@ info: Function defined here | 23 | def accepts_callable(callback: Callable[[Any], Any]) -> None: ... | ^^^^^^^^^^^^^^^^ ------------------------------ Parameter declared here - | ``` Assigning a bound method to a `Callable`: @@ -393,7 +376,6 @@ error[invalid-assignment]: Object of type `bound method Greeter.greet(name: str, | -------------------- ^^^^^^^^^^^^^ Incompatible value of type `bound method Greeter.greet(name: str, greeting: str = "Hello") -> str` | | | Declared type - | info: the first parameter has an incompatible type: `int` is not assignable to `str` ``` @@ -414,7 +396,6 @@ error[invalid-assignment]: Object of type `` | | | Declared type - | info: type `` has inferred callable type `(x: int) -> bool` info: └── the first parameter has an incompatible type: `str` is not assignable to `int` ``` @@ -439,7 +420,6 @@ error[invalid-assignment]: Object of type `partial[(y: str) -> bool]` is not ass | ----------------------- ^^^^^^^^^^^^^^^^^ Incompatible value of type `partial[(y: str) -> bool]` | | | Declared type - | info: the first parameter has an incompatible type: `bytes` is not assignable to `str` ``` @@ -471,7 +451,6 @@ error[invalid-method-override]: Invalid override of method `method` | 2 | def method(self, x: str) -> bool: | ---------------------------- `Parent.method` defined here - | info: parameter `x` has an incompatible type: `str` is not assignable to `bytes` info: This violates the Liskov Substitution Principle ``` @@ -500,7 +479,6 @@ error[invalid-method-override]: Invalid override of method `method` | 10 | def method(self, *, x: str, y: int) -> bool: | --------------------------------------- `ParentXY.method` defined here - | info: parameter `x` has an incompatible type: `str` is not assignable to `bytes` info: This violates the Liskov Substitution Principle ``` @@ -525,7 +503,6 @@ error[invalid-method-override]: Invalid override of method `method` | 2 | def method(self, x: str) -> bool: | ---------------------------- `Parent.method` defined here - | info: incompatible return types: `None` is not assignable to `bool` info: This violates the Liskov Substitution Principle ``` @@ -550,7 +527,6 @@ error[invalid-method-override]: Invalid override of method `method` | 2 | def method(self, x: str) -> bool: | ---------------------------- `Parent.method` defined here - | info: the parameter named `y` does not match `x` (and can be used as a keyword parameter) info: This violates the Liskov Substitution Principle ``` @@ -580,7 +556,6 @@ error[invalid-assignment]: Object of type `Person` is not assignable to `Other` | ----- ^^^^^^ Incompatible value of type `Person` | | | Declared type - | info: field "name" on TypedDict `Person` has type `str` which is not assignable to type `bytes` expected by TypedDict `Other` ``` @@ -603,7 +578,6 @@ error[invalid-assignment]: Object of type `Person` is not assignable to `PersonW | ------------- ^^^^^^ Incompatible value of type `Person` | | | Declared type - | info: required field "age" is not present in source TypedDict `Person` ``` @@ -626,7 +600,6 @@ error[invalid-assignment]: Object of type `PersonWithOptionalAge` is not assigna | ------------- ^^^^^^ Incompatible value of type `PersonWithOptionalAge` | | | Declared type - | info: field "age" is required in TypedDict `PersonWithAge` but not required in TypedDict `PersonWithOptionalAge` ``` @@ -648,7 +621,6 @@ error[invalid-assignment]: Object of type `PersonWithReadOnlyName` is not assign | ------ ^^^^^^ Incompatible value of type `PersonWithReadOnlyName` | | | Declared type - | info: field "name" is read-only in TypedDict `PersonWithReadOnlyName` but mutable in TypedDict `Person` ``` @@ -667,7 +639,6 @@ error[invalid-assignment]: Object of type `PersonWithAge` is not assignable to ` | --------------------- ^^^^^^ Incompatible value of type `PersonWithAge` | | | Declared type - | info: field "age" is required in TypedDict `PersonWithAge` but not required and mutable in TypedDict `PersonWithOptionalAge` help: The required field could be removed through a destructive operation like `del` on the target. ``` @@ -687,7 +658,6 @@ error[invalid-assignment]: Object of type `Person` is not assignable to `dict[st | -------------- ^^^^^^ Incompatible value of type `Person` | | | Declared type - | info: TypedDict `Person` is not assignable to `dict` help: A TypedDict is not usually assignable to any `dict[..]` type; `dict` types allow destructive operations like `clear()`. help: Consider using `Mapping[..]` instead of `dict[..]`. @@ -730,7 +700,6 @@ error[invalid-overload]: Implementation does not accept all arguments of this ov 17 | def method(self, value: str) -> None: ... 18 | def method(self, value: Pair[Self] | str) -> None: ... | ------ Implementation defined here - | info: Implementation signature `(self, value: Pair[Self@method] | str) -> None` is not assignable to overload signature `(self, value: Fixed) -> None` info: parameter `value` has an incompatible type: `Fixed` is not assignable to `Pair[Self@method] | str` info: └── type `Fixed` is not assignable to any element of the union `Pair[Self@method] | str` @@ -774,7 +743,6 @@ error[invalid-overload]: Implementation does not accept all arguments of this ov 17 | def method(self, value: str, later: str) -> None: ... 18 | def method(self, value: Pair[Self] | str, later: str) -> None: ... | ------ Implementation defined here - | info: Implementation signature `(self, value: Pair[Self@method] | str, later: str) -> None` is not assignable to overload signature `(self, value: Fixed, later: int) -> None` info: parameter `value` has an incompatible type: `Fixed` is not assignable to `Pair[Self@method] | str` info: └── type `Fixed` is not assignable to any element of the union `Pair[Self@method] | str` @@ -808,7 +776,6 @@ error[invalid-type-arguments]: Type `tuple[int, str, bool]` is not assignable to 6 | 7 | bad: Box[tuple[int, str, bool]] # snapshot: invalid-type-arguments | ^^^^^^^^^^^^^^^^^^^^^ - | info: the second tuple element is not compatible: `str` is not assignable to `bytes` ``` @@ -836,7 +803,6 @@ error[invalid-assignment]: Object of type `DoesNotHaveCheck` is not assignable t | ------------- ^^^^^^ Incompatible value of type `DoesNotHaveCheck` | | | Declared type - | info: type `DoesNotHaveCheck` is not assignable to protocol `SupportsCheck` info: └── protocol member `check` is not defined on type `DoesNotHaveCheck` ``` @@ -860,7 +826,6 @@ error[invalid-assignment]: Object of type `CheckWithWrongSignature` is not assig | ------------- ^^^^^^ Incompatible value of type `CheckWithWrongSignature` | | | Declared type - | info: type `CheckWithWrongSignature` is not assignable to protocol `SupportsCheck` info: └── protocol member `check` is incompatible info: └── parameter `y` has an incompatible type: `str` is not assignable to `bytes` @@ -887,7 +852,6 @@ error[invalid-assignment]: Object of type `DoesNotHaveName` is not assignable to | ------------ ^^^^^^ Incompatible value of type `DoesNotHaveName` | | | Declared type - | info: type `DoesNotHaveName` is not assignable to protocol `SupportsName` info: └── protocol member `name` is not defined on type `DoesNotHaveName` ``` @@ -910,7 +874,6 @@ error[invalid-assignment]: Object of type `SupportsSomethingElse` is not assigna | ------------- ^^^^^^ Incompatible value of type `SupportsSomethingElse` | | | Declared type - | info: protocol `SupportsSomethingElse` is not assignable to protocol `SupportsCheck` info: └── protocol member `check` is not defined on type `SupportsSomethingElse` ``` @@ -957,7 +920,6 @@ error[invalid-assignment]: Object of type `BytesName` is not assignable to `Read | ------------ ^^^^^^ Incompatible value of type `BytesName` | | | Declared type - | info: type `BytesName` is not assignable to protocol `ReadableName` info: └── protocol member `name` is incompatible info: └── read type `bytes` is not assignable to `str` @@ -976,7 +938,6 @@ error[invalid-assignment]: Object of type `ReadOnlyName` is not assignable to `W | ------------ ^^^^^^ Incompatible value of type `ReadOnlyName` | | | Declared type - | info: type `ReadOnlyName` is not assignable to protocol `WritableName` info: └── protocol member `name` is incompatible info: └── the member does not accept writes of type `str` @@ -995,7 +956,6 @@ error[invalid-assignment]: Object of type `BytesSetterName` is not assignable to | ------------ ^^^^^^ Incompatible value of type `BytesSetterName` | | | Declared type - | info: type `BytesSetterName` is not assignable to protocol `WritableName` info: └── protocol member `name` is incompatible info: └── the member does not accept writes of type `str` @@ -1031,7 +991,6 @@ error[invalid-assignment]: Object of type `ReadOnlyNameProtocol` is not assignab | ------------ ^^^^^^ Incompatible value of type `ReadOnlyNameProtocol` | | | Declared type - | info: protocol `ReadOnlyNameProtocol` is not assignable to protocol `WritableName` info: └── protocol member `name` is incompatible info: └── the member is not writable @@ -1050,7 +1009,6 @@ error[invalid-assignment]: Object of type `BytesNameProtocol` is not assignable | ------------ ^^^^^^ Incompatible value of type `BytesNameProtocol` | | | Declared type - | info: protocol `BytesNameProtocol` is not assignable to protocol `WritableName` info: └── protocol member `name` is incompatible info: └── read type `bytes` is not assignable to `str` @@ -1069,7 +1027,6 @@ error[invalid-assignment]: Object of type `BytesSetterNameProtocol` is not assig | ------------ ^^^^^^ Incompatible value of type `BytesSetterNameProtocol` | | | Declared type - | info: protocol `BytesSetterNameProtocol` is not assignable to protocol `WritableName` info: └── protocol member `name` is incompatible info: └── the member does not accept writes of type `str` @@ -1093,7 +1050,6 @@ error[invalid-assignment]: Object of type `SupportsCheckWithOtherSignature` is n | ------------- ^^^^^^ Incompatible value of type `SupportsCheckWithOtherSignature` | | | Declared type - | info: protocol `SupportsCheckWithOtherSignature` is not assignable to protocol `SupportsCheck` info: └── protocol member `check` is incompatible info: └── parameter `y` has an incompatible type: `str` is not assignable to `bytes` @@ -1127,7 +1083,6 @@ error[invalid-assignment]: Object of type `HasName` is not assignable to `String | ------------ ^^^^^^ Incompatible value of type `HasName` | | | Declared type - | info: type `HasName` is not assignable to any element of the union `str | SupportsName` info: ├── type `HasName` is not assignable to protocol `SupportsName` info: │ └── protocol member `name` is incompatible @@ -1154,7 +1109,6 @@ error[invalid-assignment]: Object of type `def source(x: tuple[int, str]) -> boo | ----------------------------------- ^^^^^^ Incompatible value of type `def source(x: tuple[int, str]) -> bool` | | | Declared type - | info: the first parameter has an incompatible type: `tuple[int, bytes]` is not assignable to `tuple[int, str]` info: └── the second tuple element is not compatible: `bytes` is not assignable to `str` ``` @@ -1184,7 +1138,6 @@ error[invalid-assignment]: Object of type `Incompatible` is not assignable to `S | ------------- ^^^^^^ Incompatible value of type `Incompatible` | | | Declared type - | info: type `Incompatible` is not assignable to protocol `SupportsCheck` info: └── protocol member `check1` is incompatible info: └── parameter `x` has an incompatible type: `str` is not assignable to `bytes` @@ -1215,7 +1168,6 @@ error[invalid-assignment]: Object of type `HasNeither` is not assignable to `Sup | ------------------------- ^^^^^^ Incompatible value of type `HasNeither` | | | Declared type - | info: type `HasNeither` is not assignable to any element of the union `SupportsFoo | SupportsBar` info: ├── type `HasNeither` is not assignable to protocol `SupportsFoo` info: │ └── protocol member `foo` is not defined on type `HasNeither` @@ -1238,7 +1190,6 @@ error[invalid-assignment]: Object of type `int` is not assignable to `str | byte | ------------------------- ^^^^^^ Incompatible value of type `int` | | | Declared type - | ``` ## Failures for multiple intersection elements @@ -1265,7 +1216,6 @@ error[invalid-assignment]: Object of type `DoesNotSupportFoo1 & DoesNotSupportFo | ----------- ^^^^^^ Incompatible value of type `DoesNotSupportFoo1 & DoesNotSupportFoo2` | | | Declared type - | info: no element of intersection `DoesNotSupportFoo1 & DoesNotSupportFoo2` is assignable to `SupportsFoo` info: ├── type `DoesNotSupportFoo1` is not assignable to protocol `SupportsFoo` info: │ └── protocol member `foo` is not defined on type `DoesNotSupportFoo1` @@ -1305,7 +1255,6 @@ error[invalid-assignment]: Object of type `IncompatibleFoo` is not assignable to | ----------------- ^^^^^^ Incompatible value of type `IncompatibleFoo` | | | Declared type - | info: type `IncompatibleFoo` is not assignable to protocol `SupportsFooAndBar` info: └── protocol member `foo` is incompatible info: └── the parameter named `name_` does not match `name` (and can be used as a keyword parameter) @@ -1328,7 +1277,6 @@ error[invalid-assignment]: Object of type `list[str]` is not assignable to `Iter | --------------- ^^^^^^ Incompatible value of type `list[str]` | | | Declared type - | info: type `list[str]` is not assignable to protocol `Iterable[bytes]` info: └── protocol member `__iter__` is incompatible info: └── incompatible return types: `Iterator[str]` is not assignable to `Iterator[bytes]` @@ -1355,7 +1303,6 @@ error[invalid-assignment]: Object of type `list[bool]` is not assignable to `lis | --------- ^^^^^^ Incompatible value of type `list[bool]` | | | Declared type - | info: `list` is invariant in its type parameter info: Consider using the covariant supertype `collections.abc.Sequence` info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/#invariant-generics @@ -1415,7 +1362,6 @@ error[invalid-assignment]: Object of type `set[bool]` is not assignable to `set[ | -------- ^^^^^^ Incompatible value of type `set[bool]` | | | Declared type - | info: `set` is invariant in its type parameter info: Consider using the covariant supertype `collections.abc.Set` info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/#invariant-generics @@ -1428,7 +1374,6 @@ error[invalid-assignment]: Object of type `dict[str, bool]` is not assignable to | -------------- ^^^^^^ Incompatible value of type `dict[str, bool]` | | | Declared type - | info: `dict` is invariant in its second type parameter info: Consider using the supertype `collections.abc.Mapping`, which is covariant in its value type info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/#invariant-generics @@ -1441,7 +1386,6 @@ error[invalid-assignment]: Object of type `dict[bool, str]` is not assignable to | -------------- ^^^^^^ Incompatible value of type `dict[bool, str]` | | | Declared type - | info: `dict` is invariant in its first type parameter info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/#invariant-generics @@ -1453,7 +1397,6 @@ error[invalid-assignment]: Object of type `dict[bool, bool]` is not assignable t | -------------- ^^^^^^ Incompatible value of type `dict[bool, bool]` | | | Declared type - | info: `dict` is invariant in its first and second type parameters info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/#invariant-generics @@ -1465,7 +1408,6 @@ error[invalid-assignment]: Object of type `defaultdict[str, bool]` is not assign | --------------------- ^^^^^^ Incompatible value of type `defaultdict[str, bool]` | | | Declared type - | info: `defaultdict` is invariant in its second type parameter info: Consider using the supertype `collections.abc.Mapping`, which is covariant in its value type info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/#invariant-generics @@ -1478,7 +1420,6 @@ error[invalid-assignment]: Object of type `defaultdict[bool, str]` is not assign | --------------------- ^^^^^^ Incompatible value of type `defaultdict[bool, str]` | | | Declared type - | info: `defaultdict` is invariant in its first type parameter info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/#invariant-generics @@ -1490,7 +1431,6 @@ error[invalid-assignment]: Object of type `OrderedDict[str, bool]` is not assign | --------------------- ^^^^^^ Incompatible value of type `OrderedDict[str, bool]` | | | Declared type - | info: `OrderedDict` is invariant in its second type parameter info: Consider using the supertype `collections.abc.Mapping`, which is covariant in its value type info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/#invariant-generics @@ -1503,7 +1443,6 @@ error[invalid-assignment]: Object of type `OrderedDict[bool, str]` is not assign | --------------------- ^^^^^^ Incompatible value of type `OrderedDict[bool, str]` | | | Declared type - | info: `OrderedDict` is invariant in its first type parameter info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/#invariant-generics @@ -1515,7 +1454,6 @@ error[invalid-assignment]: Object of type `ChainMap[str, bool]` is not assignabl | ------------------ ^^^^^^ Incompatible value of type `ChainMap[str, bool]` | | | Declared type - | info: `ChainMap` is invariant in its second type parameter info: Consider using the supertype `collections.abc.Mapping`, which is covariant in its value type info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/#invariant-generics @@ -1528,7 +1466,6 @@ error[invalid-assignment]: Object of type `ChainMap[bool, str]` is not assignabl | ------------------ ^^^^^^ Incompatible value of type `ChainMap[bool, str]` | | | Declared type - | info: `ChainMap` is invariant in its first type parameter info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/#invariant-generics @@ -1540,7 +1477,6 @@ error[invalid-assignment]: Object of type `deque[bool]` is not assignable to `de | ---------- ^^^^^^ Incompatible value of type `deque[bool]` | | | Declared type - | info: `deque` is invariant in its type parameter info: Consider using the covariant supertype `collections.abc.Sequence` info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/#invariant-generics @@ -1553,7 +1489,6 @@ error[invalid-assignment]: Object of type `Counter[bool]` is not assignable to ` | ------------ ^^^^^^ Incompatible value of type `Counter[bool]` | | | Declared type - | info: `Counter` is invariant in its type parameter info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/#invariant-generics @@ -1565,7 +1500,6 @@ error[invalid-assignment]: Object of type `MutableSequence[bool]` is not assigna | -------------------- ^^^^^^ Incompatible value of type `MutableSequence[bool]` | | | Declared type - | info: `MutableSequence` is invariant in its type parameter info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/#invariant-generics ``` @@ -1592,7 +1526,6 @@ error[invalid-assignment]: Object of type `MyContainer[bool]` is not assignable | ---------------- ^^^^^^ Incompatible value of type `MyContainer[bool]` | | | Declared type - | info: `MyContainer` is invariant in its type parameter info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/#invariant-generics ``` @@ -1612,7 +1545,6 @@ error[invalid-assignment]: Object of type `list[int]` is not assignable to `list | --------- ^^^^^^ Incompatible value of type `list[int]` | | | Declared type - | ``` We do not emit any error if the collection types are covariant: @@ -1647,7 +1579,6 @@ error[invalid-return-type]: Return type does not match returned value | --------------- Expected `tuple[int, str]` because of return type 2 | return 1, b"" # snapshot: invalid-return-type | ^^^^^^ expected `tuple[int, str]`, found `tuple[Literal[1], Literal[b""]]` - | info: the second tuple element is not compatible: `Literal[b""]` is not assignable to `str` ``` @@ -1667,7 +1598,6 @@ error[invalid-assignment]: Object of type `tuple[Literal[1], Literal[b""]]` is n | 5 | c.x = (1, b"") # snapshot | ^^^ - | info: the second tuple element is not compatible: `Literal[b""]` is not assignable to `str` ``` @@ -1688,7 +1618,6 @@ error[invalid-yield]: Yield expression type does not match annotation | -------------------------------------- Function annotated with yield type `tuple[int, str]` here 4 | yield (1, b"") # snapshot: invalid-yield | ^^^^^^^^ expression of type `tuple[Literal[1], Literal[b""]]`, expected `tuple[int, str]` - | info: the second tuple element is not compatible: `Literal[b""]` is not assignable to `str` ``` @@ -1716,7 +1645,6 @@ error[not-iterable]: Object of type `WrongIterable` is not iterable | 12 | for _ in WrongIterable(): | ^^^^^^^^^^^^^^^ - | info: Its `__iter__` method returns an object of type `WrongIterator`, which has an invalid `__next__` method info: type `WrongIterable` is not assignable to protocol `Iterable[Unknown]` info: └── protocol member `__iter__` is incompatible diff --git a/crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_argument_type.md b/crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_argument_type.md index beb1e9d0b929c1..dfe995cf9c8bcc 100644 --- a/crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_argument_type.md +++ b/crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_argument_type.md @@ -18,13 +18,11 @@ error[invalid-argument-type]: Argument to function `foo` is incorrect | 4 | foo("hello") # snapshot: invalid-argument-type | ^^^^^^^ Expected `int`, found `Literal["hello"]` - | info: Function defined here --> src/mdtest_snippet.py:1:5 | 1 | def foo(x: int) -> int: | ^^^ ------ Parameter declared here - | ``` ## Different source order @@ -45,13 +43,11 @@ error[invalid-argument-type]: Argument to function `foo` is incorrect | 2 | foo("hello") # snapshot: invalid-argument-type | ^^^^^^^ Expected `int`, found `Literal["hello"]` - | info: Function defined here --> src/mdtest_snippet.py:4:5 | 4 | def foo(x: int) -> int: | ^^^ ------ Parameter declared here - | ``` ## Different files @@ -78,13 +74,11 @@ error[invalid-argument-type]: Argument to function `foo` is incorrect | 3 | package.foo("hello") # snapshot: invalid-argument-type | ^^^^^^^ Expected `int`, found `Literal["hello"]` - | info: Function defined here --> src/package.py:1:5 | 1 | def foo(x: int) -> int: | ^^^ ------ Parameter declared here - | ``` ## Many parameters @@ -104,13 +98,11 @@ error[invalid-argument-type]: Argument to function `foo` is incorrect | 4 | foo(1, "hello", 3) # snapshot: invalid-argument-type | ^^^^^^^ Expected `int`, found `Literal["hello"]` - | info: Function defined here --> src/mdtest_snippet.py:1:5 | 1 | def foo(x: int, y: int, z: int) -> int: | ^^^ ------ Parameter declared here - | ``` ## Many parameters across multiple lines @@ -135,7 +127,6 @@ error[invalid-argument-type]: Argument to function `foo` is incorrect | 8 | foo(1, "hello", 3) # snapshot: invalid-argument-type | ^^^^^^^ Expected `int`, found `Literal["hello"]` - | info: Function defined here --> src/mdtest_snippet.py:1:5 | @@ -144,7 +135,6 @@ info: Function defined here 2 | x: int, 3 | y: int, | ------ Parameter declared here - | ``` ## Many parameters with multiple invalid arguments @@ -172,13 +162,11 @@ error[invalid-argument-type]: Argument to function `foo` is incorrect | 7 | foo("a", "b", "c") | ^^^ Expected `int`, found `Literal["a"]` - | info: Function defined here --> src/mdtest_snippet.py:1:5 | 1 | def foo(x: int, y: int, z: int) -> int: | ^^^ ------ Parameter declared here - | error[invalid-argument-type]: Argument to function `foo` is incorrect @@ -186,13 +174,11 @@ error[invalid-argument-type]: Argument to function `foo` is incorrect | 7 | foo("a", "b", "c") | ^^^ Expected `int`, found `Literal["b"]` - | info: Function defined here --> src/mdtest_snippet.py:1:5 | 1 | def foo(x: int, y: int, z: int) -> int: | ^^^ ------ Parameter declared here - | error[invalid-argument-type]: Argument to function `foo` is incorrect @@ -200,13 +186,11 @@ error[invalid-argument-type]: Argument to function `foo` is incorrect | 7 | foo("a", "b", "c") | ^^^ Expected `int`, found `Literal["c"]` - | info: Function defined here --> src/mdtest_snippet.py:1:5 | 1 | def foo(x: int, y: int, z: int) -> int: | ^^^ ------ Parameter declared here - | ``` ## Test calling a function whose type is vendored from `typeshed` @@ -226,7 +210,6 @@ error[invalid-argument-type]: Argument to function `loads` is incorrect | 3 | json.loads(5) # snapshot: invalid-argument-type | ^ Expected `str | bytes | bytearray`, found `Literal[5]` - | info: Function defined here --> stdlib/json/__init__.pyi:320:9 | @@ -234,7 +217,6 @@ info: Function defined here | ^^^^^ 321 | s: str | bytes | bytearray, | -------------------------- Parameter declared here - | ``` ## Tests for a variety of argument types @@ -259,13 +241,11 @@ error[invalid-argument-type]: Argument to function `foo` is incorrect | 4 | foo(1, "hello", 3) # snapshot: invalid-argument-type | ^^^^^^^ Expected `int`, found `Literal["hello"]` - | info: Function defined here --> src/mdtest_snippet.py:1:5 | 1 | def foo(x: int, y: int, z: int, /) -> int: | ^^^ ------ Parameter declared here - | ``` ### Variadic arguments @@ -285,13 +265,11 @@ error[invalid-argument-type]: Argument to function `foo` is incorrect | 4 | foo(1, 2, 3, "hello", 5) # snapshot: invalid-argument-type | ^^^^^^^ Expected `int`, found `Literal["hello"]` - | info: Function defined here --> src/mdtest_snippet.py:1:5 | 1 | def foo(*numbers: int) -> int: | ^^^ ------------- Parameter declared here - | ``` ### Keyword only arguments @@ -311,13 +289,11 @@ error[invalid-argument-type]: Argument to function `foo` is incorrect | 4 | foo(1, 2, z="hello") # snapshot: invalid-argument-type | ^^^^^^^^^ Expected `int`, found `Literal["hello"]` - | info: Function defined here --> src/mdtest_snippet.py:1:5 | 1 | def foo(x: int, y: int, *, z: int = 0) -> int: | ^^^ ---------- Parameter declared here - | ``` ### One keyword argument @@ -337,13 +313,11 @@ error[invalid-argument-type]: Argument to function `foo` is incorrect | 4 | foo(1, 2, "hello") # snapshot: invalid-argument-type | ^^^^^^^ Expected `int`, found `Literal["hello"]` - | info: Function defined here --> src/mdtest_snippet.py:1:5 | 1 | def foo(x: int, y: int, z: int = 0) -> int: | ^^^ ---------- Parameter declared here - | ``` ### Variadic keyword arguments @@ -361,13 +335,11 @@ error[invalid-argument-type]: Argument to function `foo` is incorrect | 4 | foo(a=1, b=2, c=3, d="hello", e=5) # snapshot: invalid-argument-type | ^^^^^^^^^ Expected `int`, found `Literal["hello"]` - | info: Function defined here --> src/mdtest_snippet.py:1:5 | 1 | def foo(**numbers: int) -> int: | ^^^ -------------- Parameter declared here - | ``` ### Mix of arguments @@ -387,13 +359,11 @@ error[invalid-argument-type]: Argument to function `foo` is incorrect | 4 | foo(1, 2, z="hello") # snapshot: invalid-argument-type | ^^^^^^^^^ Expected `int`, found `Literal["hello"]` - | info: Function defined here --> src/mdtest_snippet.py:1:5 | 1 | def foo(x: int, /, y: int, *, z: int = 0) -> int: | ^^^ ---------- Parameter declared here - | ``` ### Synthetic arguments @@ -415,13 +385,11 @@ error[invalid-argument-type]: Argument to bound method `C.__call__` is incorrect | 6 | c("wrong") # snapshot: invalid-argument-type | ^^^^^^^ Expected `int`, found `Literal["wrong"]` - | info: Method defined here --> src/mdtest_snippet.py:2:9 | 2 | def __call__(self, x: int) -> int: | ^^^^^^^^ ------ Parameter declared here - | ``` ## Calls to methods @@ -443,13 +411,11 @@ error[invalid-argument-type]: Argument to bound method `C.square` is incorrect | 6 | c.square("hello") # snapshot: invalid-argument-type | ^^^^^^^ Expected `int`, found `Literal["hello"]` - | info: Method defined here --> src/mdtest_snippet.py:2:9 | 2 | def square(self, x: int) -> int: | ^^^^^^ ------ Parameter declared here - | ``` ## Calls to protocol methods @@ -470,13 +436,11 @@ error[invalid-argument-type]: Argument to bound method `P.method` is incorrect | 7 | p.method("bad") # snapshot: invalid-argument-type | ^^^^^ Expected `int`, found `Literal["bad"]` - | info: Method defined here --> src/mdtest_snippet.py:4:9 | 4 | def method(self, value: int) -> None: ... | ^^^^^^ ---------- Parameter declared here - | ``` ## Calls to overloaded protocol methods @@ -500,13 +464,11 @@ error[invalid-argument-type]: Argument to bound method `P.method` is incorrect | 10 | p.method("bad") # snapshot: invalid-argument-type | ^^^^^ Expected `int`, found `Literal["bad"]` - | info: Matching overload defined here --> src/mdtest_snippet.py:5:9 | 5 | def method(self, value: int) -> None: ... | ^^^^^^ ---------- Parameter declared here - | info: Non-matching overloads for bound method `method`: info: (self, /, value: int, extra: int) -> None ``` @@ -537,13 +499,11 @@ error[invalid-argument-type]: Argument to function `needs_a_foo` is incorrect | 5 | needs_a_foo(Foo()) # snapshot: invalid-argument-type | ^^^^^ Expected `module.Foo`, found `main.Foo` - | info: Function defined here --> src/module.py:3:5 | 3 | def needs_a_foo(x: Foo): ... | ^^^^^^^^^^^ ------ Parameter declared here - | ``` ## TypeVars with bounds that have the same name but are from different files @@ -581,13 +541,11 @@ error[invalid-argument-type]: Argument to function `needs_a_foo` is incorrect | 6 | needs_a_foo(x) # snapshot: invalid-argument-type | ^ Expected `Foo`, found `T@f` - | info: Function defined here --> src/module.py:3:5 | 3 | def needs_a_foo(x: Foo): ... | ^^^^^^^^^^^ ------ Parameter declared here - | ``` ## Numbers special case @@ -609,13 +567,11 @@ error[invalid-argument-type]: Argument to function `f` is incorrect | 5 | f(5) # snapshot: invalid-argument-type | ^ Expected `Number`, found `Literal[5]` - | info: Function defined here --> src/mdtest_snippet.py:3:5 | 3 | def f(x: Number): ... | ^ --------- Parameter declared here - | info: Types from the `numbers` module aren't supported for static type checking help: Consider using a protocol instead, such as `typing.SupportsFloat` @@ -625,14 +581,12 @@ error[invalid-argument-type]: Argument to function `f` is incorrect | 8 | f(x) # snapshot: invalid-argument-type | ^ Expected `Number`, found `int | float` - | info: element `int` of union `int | float` is not assignable to `Number` info: Function defined here --> src/mdtest_snippet.py:3:5 | 3 | def f(x: Number): ... | ^ --------- Parameter declared here - | info: Types from the `numbers` module aren't supported for static type checking help: Consider using a protocol instead, such as `typing.SupportsFloat` ``` @@ -656,13 +610,11 @@ error[invalid-argument-type]: Argument to function `modify` is incorrect | 5 | modify(xs) # snapshot: invalid-argument-type | ^^ Expected `list[int]`, found `list[bool]` - | info: Function defined here --> src/mdtest_snippet.py:1:5 | 1 | def modify(xs: list[int]): | ^^^^^^ ------------- Parameter declared here - | info: `list` is invariant in its type parameter info: Consider using the covariant supertype `collections.abc.Sequence` info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/#invariant-generics diff --git a/crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_assignment_syntactic_variants.md b/crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_assignment_syntactic_variants.md index 6e0d318842e0c9..e945dc6f9a8567 100644 --- a/crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_assignment_syntactic_variants.md +++ b/crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_assignment_syntactic_variants.md @@ -19,7 +19,6 @@ error[invalid-assignment]: Object of type `Literal["three"]` is not assignable t | --- ^^^^^^^ Incompatible value of type `Literal["three"]` | | | Declared type - | ``` ## Unannotated assignment @@ -40,7 +39,6 @@ error[invalid-assignment]: Object of type `Literal["three"]` is not assignable t | - ^^^^^^^ Incompatible value of type `Literal["three"]` | | | Declared type `int` - | ``` ## Named expression @@ -61,7 +59,6 @@ error[invalid-assignment]: Object of type `Literal["three"]` is not assignable t | - ^^^^^^^ Incompatible value of type `Literal["three"]` | | | Declared type `int` - | ``` ## Multiline expressions @@ -90,7 +87,6 @@ error[invalid-assignment]: Object of type `Literal[15]` is not assignable to `st 7 | | ) 8 | | ) | |_^ Incompatible value of type `Literal[15]` - | ``` ## Multiple targets @@ -115,7 +111,6 @@ error[invalid-assignment]: Object of type `Literal["a"]` is not assignable to `i | - ^^^^^^^^^^ Incompatible value of type `Literal["a"]` | | | Declared type `int` - | error[invalid-assignment]: Object of type `Literal[0]` is not assignable to `str` @@ -125,7 +120,6 @@ error[invalid-assignment]: Object of type `Literal[0]` is not assignable to `str | - ^^^^^^ Incompatible value of type `Literal[0]` | | | Declared type `str` - | ``` ## Shadowing of classes and functions diff --git a/crates/ty_python_semantic/resources/mdtest/diagnostics/missing_argument.md b/crates/ty_python_semantic/resources/mdtest/diagnostics/missing_argument.md index 484ca4ca202f13..3f44b76613fb6f 100644 --- a/crates/ty_python_semantic/resources/mdtest/diagnostics/missing_argument.md +++ b/crates/ty_python_semantic/resources/mdtest/diagnostics/missing_argument.md @@ -48,13 +48,11 @@ error[missing-argument]: No argument provided for required parameter `a` of func | 3 | f() # snapshot | ^^^ - | info: Parameter declared here --> src/module.py:1:7 | 1 | def f(a, b=42): ... | ^ - | error[missing-argument]: No argument provided for required parameter `a` of function `f` @@ -62,7 +60,6 @@ error[missing-argument]: No argument provided for required parameter `a` of func | 12 | h(b=56) | ^^^^^^^ - | info: Union variant `def f(a, b=42) -> Unknown` is incompatible with this call site info: Attempted to call union type `(def f(a, b=42) -> Unknown) | (def g(a, b) -> Unknown)` @@ -72,7 +69,6 @@ error[missing-argument]: No argument provided for required parameter `a` of func | 12 | h(b=56) | ^^^^^^^ - | info: Union variant `def g(a, b) -> Unknown` is incompatible with this call site info: Attempted to call union type `(def f(a, b=42) -> Unknown) | (def g(a, b) -> Unknown)` @@ -82,13 +78,11 @@ error[missing-argument]: No argument provided for required parameter `a` of boun | 14 | Foo().method() # snapshot: missing-argument | ^^^^^^^^^^^^^^ - | info: Parameter declared here --> src/module.py:5:22 | 5 | def method(self, a): ... | ^ - | error[missing-argument]: No argument provided for required parameter `value` of bound method `P.method` @@ -96,11 +90,9 @@ error[missing-argument]: No argument provided for required parameter `value` of | 22 | p.method() # snapshot: missing-argument | ^^^^^^^^^^ - | info: Parameter declared here --> src/main.py:19:22 | 19 | def method(self, value: int) -> None: ... | ^^^^^^^^^^ - | ``` diff --git a/crates/ty_python_semantic/resources/mdtest/diagnostics/semantic_syntax_errors.md b/crates/ty_python_semantic/resources/mdtest/diagnostics/semantic_syntax_errors.md index a118b3af0f7d5f..a12a65f66425f0 100644 --- a/crates/ty_python_semantic/resources/mdtest/diagnostics/semantic_syntax_errors.md +++ b/crates/ty_python_semantic/resources/mdtest/diagnostics/semantic_syntax_errors.md @@ -27,7 +27,6 @@ error[invalid-syntax]: cannot use an asynchronous comprehension inside of a sync | 6 | return {n: [x async for x in elements(n)] for n in range(3)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | ``` If all of the comprehensions are `async`, on the other hand, the code was still valid: @@ -44,7 +43,6 @@ error[not-iterable]: Object of type `range` is not async-iterable | 9 | return [[x async for x in elements(n)] async for n in range(3)] | ^^^^^^^^ - | info: It has no `__aiter__` method ``` @@ -497,7 +495,6 @@ error[invalid-syntax]: `break` outside loop | 1 | break # snapshot: invalid-syntax | ^^^^^ - | error[invalid-syntax]: `continue` outside loop @@ -505,7 +502,6 @@ error[invalid-syntax]: `continue` outside loop | 2 | continue # snapshot: invalid-syntax | ^^^^^^^^ - | error[invalid-syntax]: `break` outside loop @@ -513,7 +509,6 @@ error[invalid-syntax]: `break` outside loop | 9 | break # snapshot: invalid-syntax | ^^^^^ - | error[invalid-syntax]: `continue` outside loop @@ -521,7 +516,6 @@ error[invalid-syntax]: `continue` outside loop | 10 | continue # snapshot: invalid-syntax | ^^^^^^^^ - | error[invalid-syntax]: `break` outside loop @@ -529,7 +523,6 @@ error[invalid-syntax]: `break` outside loop | 14 | break # snapshot: invalid-syntax | ^^^^^ - | error[invalid-syntax]: `continue` outside loop @@ -537,7 +530,6 @@ error[invalid-syntax]: `continue` outside loop | 15 | continue # snapshot: invalid-syntax | ^^^^^^^^ - | ``` ## name cannot refer to a parameter and a global variable @@ -582,7 +574,6 @@ error[invalid-syntax]: name `a` cannot refer to a parameter and a global variabl | 4 | global a # snapshot: invalid-syntax | ^ - | error[invalid-syntax]: name `a` cannot refer to a parameter and a global variable @@ -590,7 +581,6 @@ error[invalid-syntax]: name `a` cannot refer to a parameter and a global variabl | 8 | global a # snapshot: invalid-syntax | ^ - | error[invalid-syntax]: name `a` cannot refer to a parameter and a global variable @@ -598,7 +588,6 @@ error[invalid-syntax]: name `a` cannot refer to a parameter and a global variabl | 16 | global a # snapshot: invalid-syntax | ^ - | error[invalid-syntax]: name `a` cannot refer to a parameter and a global variable @@ -606,7 +595,6 @@ error[invalid-syntax]: name `a` cannot refer to a parameter and a global variabl | 22 | global a # snapshot: invalid-syntax | ^ - | error[invalid-syntax]: name `a` cannot refer to a parameter and a global variable @@ -614,5 +602,4 @@ error[invalid-syntax]: name `a` cannot refer to a parameter and a global variabl | 27 | global a # snapshot: invalid-syntax | ^ - | ``` diff --git a/crates/ty_python_semantic/resources/mdtest/diagnostics/shadowing.md b/crates/ty_python_semantic/resources/mdtest/diagnostics/shadowing.md index c4a7889e688fc6..d6cd3d037877d5 100644 --- a/crates/ty_python_semantic/resources/mdtest/diagnostics/shadowing.md +++ b/crates/ty_python_semantic/resources/mdtest/diagnostics/shadowing.md @@ -19,7 +19,6 @@ error[invalid-assignment]: Object of type `Literal[1]` is not assignable to `` - | info: Implicit shadowing of class `C`. Add an annotation to make it explicit if this is intentional ``` @@ -39,7 +38,6 @@ error[invalid-assignment]: Object of type `Literal[1]` is not assignable to `def | - ^ Incompatible value of type `Literal[1]` | | | Declared type `def f() -> Unknown` - | info: Implicit shadowing of function `f`. Add an annotation to make it explicit if this is intentional ``` @@ -58,5 +56,4 @@ error[invalid-assignment]: Object of type `` is not assignable to a | 4 | config.optionxform = str # snapshot: invalid-assignment | ^^^^^^^^^^^^^^^^^^ - | ``` diff --git a/crates/ty_python_semantic/resources/mdtest/diagnostics/too_many_positionals.md b/crates/ty_python_semantic/resources/mdtest/diagnostics/too_many_positionals.md index b1bc18eb4873b0..e2fa9554106712 100644 --- a/crates/ty_python_semantic/resources/mdtest/diagnostics/too_many_positionals.md +++ b/crates/ty_python_semantic/resources/mdtest/diagnostics/too_many_positionals.md @@ -40,13 +40,11 @@ error[too-many-positional-arguments]: Too many positional arguments to function | 3 | f(1, 2, 3) # snapshot: too-many-positional-arguments | ^ - | info: Function signature here --> src/module.py:1:5 | 1 | def f(a, b=42): ... | ^^^^^^^^^^ - | error[too-many-positional-arguments]: Too many positional arguments to function `f`: expected 2, got 3 @@ -54,7 +52,6 @@ error[too-many-positional-arguments]: Too many positional arguments to function | 12 | h(1, 2, 3) | ^ - | info: Union variant `def f(a, b=42) -> Unknown` is incompatible with this call site info: Attempted to call union type `(def f(a, b=42) -> Unknown) | (def g(a, b) -> Unknown)` @@ -64,7 +61,6 @@ error[too-many-positional-arguments]: Too many positional arguments to function | 12 | h(1, 2, 3) | ^ - | info: Union variant `def g(a, b) -> Unknown` is incompatible with this call site info: Attempted to call union type `(def f(a, b=42) -> Unknown) | (def g(a, b) -> Unknown)` @@ -74,11 +70,9 @@ error[too-many-positional-arguments]: Too many positional arguments to bound met | 14 | Foo().method(1, 2) # snapshot: too-many-positional-arguments | ^ - | info: Method signature here --> src/module.py:5:9 | 5 | def method(self, a): ... | ^^^^^^^^^^^^^^^ - | ``` diff --git a/crates/ty_python_semantic/resources/mdtest/diagnostics/unpacking.md b/crates/ty_python_semantic/resources/mdtest/diagnostics/unpacking.md index 205aafbd60c88d..c616be1686f122 100644 --- a/crates/ty_python_semantic/resources/mdtest/diagnostics/unpacking.md +++ b/crates/ty_python_semantic/resources/mdtest/diagnostics/unpacking.md @@ -12,7 +12,6 @@ error[not-iterable]: Object of type `Literal[1]` is not iterable | 1 | a, b = 1 # snapshot: not-iterable | ^ - | info: It doesn't have an `__iter__` method or a `__getitem__` method ``` @@ -30,7 +29,6 @@ error[invalid-assignment]: Too many values to unpack | ^^^^ --------- Got 3 | | | Expected 2 - | ``` ## Exactly too few values to unpack @@ -47,7 +45,6 @@ error[invalid-assignment]: Not enough values to unpack | ^^^^ ---- Got 1 | | | Expected 2 - | ``` ## Too few values to unpack @@ -64,5 +61,4 @@ error[invalid-assignment]: Not enough values to unpack | ^^^^^^^^^^^^^ ------ Got 2 | | | Expected at least 3 - | ``` diff --git a/crates/ty_python_semantic/resources/mdtest/directives/assert_never.md b/crates/ty_python_semantic/resources/mdtest/directives/assert_never.md index a7c63452ab6b73..61ed08ddb6d4c7 100644 --- a/crates/ty_python_semantic/resources/mdtest/directives/assert_never.md +++ b/crates/ty_python_semantic/resources/mdtest/directives/assert_never.md @@ -34,7 +34,6 @@ error[type-assertion-failure]: Argument does not have asserted type `Never` | ^^^^^^^^^^^^^-^ | | | Inferred type of argument is `Literal[0]` - | info: `Never` and `Literal[0]` are not equivalent types ``` @@ -51,7 +50,6 @@ error[type-assertion-failure]: Argument does not have asserted type `Never` | ^^^^^^^^^^^^^--^ | | | Inferred type of argument is `Literal[""]` - | info: `Never` and `Literal[""]` are not equivalent types ``` @@ -68,7 +66,6 @@ error[type-assertion-failure]: Argument does not have asserted type `Never` | ^^^^^^^^^^^^^----^ | | | Inferred type of argument is `None` - | info: `Never` and `None` are not equivalent types ``` @@ -85,7 +82,6 @@ error[type-assertion-failure]: Argument does not have asserted type `Never` | ^^^^^^^^^^^^^--^ | | | Inferred type of argument is `tuple[()]` - | info: `Never` and `tuple[()]` are not equivalent types ``` @@ -102,7 +98,6 @@ error[type-assertion-failure]: Argument does not have asserted type `Never` | ^^^^^^^^^^^^^--------------------^ | | | Inferred type of argument is `Literal[1]` - | info: `Never` and `Literal[1]` are not equivalent types ``` @@ -119,7 +114,6 @@ error[type-assertion-failure]: Argument does not have asserted type `Never` | ^^^^^^^^^^^^^----^ | | | Inferred type of argument is `Any` - | info: `Never` and `Any` are not equivalent types ``` @@ -136,7 +130,6 @@ error[type-assertion-failure]: Argument does not have asserted type `Never` | ^^^^^^^^^^^^^-------^ | | | Inferred type of argument is `Unknown` - | info: `Never` and `Unknown` are not equivalent types ``` diff --git a/crates/ty_python_semantic/resources/mdtest/directives/assert_type.md b/crates/ty_python_semantic/resources/mdtest/directives/assert_type.md index 2b43c896850f9b..ae51bba28fd137 100644 --- a/crates/ty_python_semantic/resources/mdtest/directives/assert_type.md +++ b/crates/ty_python_semantic/resources/mdtest/directives/assert_type.md @@ -19,7 +19,6 @@ error[type-assertion-failure]: Argument does not have asserted type `str` | ^^^^^^^^^^^^-^^^^^^ | | | Inferred type is `int` - | info: `str` and `int` are not equivalent types ``` @@ -38,7 +37,6 @@ error[type-assertion-failure]: Argument does not have asserted type `int` | ^^^^^^^^^^^^-^^^^^^ | | | Inferred type is `bool` - | info: `bool` is a subtype of `int`, but they are not equivalent ``` @@ -106,7 +104,6 @@ error[type-assertion-failure]: Argument does not have asserted type `Bar` | ^^^^^^^^^^^^-^^^^^^ | | | Inferred type is `Foo` - | info: `Bar` and `Foo` are not equivalent types ``` @@ -123,7 +120,6 @@ error[assert-type-unspellable-subtype]: Argument does not have asserted type `Ba | ^^^^^^^^^^^^-^^^^^^ | | | Inferred type is `Foo & Bar` - | info: `Foo & Bar` is a subtype of `Bar`, but they are not equivalent ``` @@ -141,7 +137,6 @@ error[type-assertion-failure]: Argument does not have asserted type `Baz` | ^^^^^^^^^^^^-^^^^^^ | | | Inferred type is `Foo & Bar` - | info: `Baz` and `Foo & Bar` are not equivalent types ``` diff --git a/crates/ty_python_semantic/resources/mdtest/directives/cast.md b/crates/ty_python_semantic/resources/mdtest/directives/cast.md index 3a1837f0b26fbe..d4a148d0093aa9 100644 --- a/crates/ty_python_semantic/resources/mdtest/directives/cast.md +++ b/crates/ty_python_semantic/resources/mdtest/directives/cast.md @@ -113,7 +113,6 @@ warning[redundant-cast]: Value is already of type `int` | 5 | cast(int, secrets.randbelow(10)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove the redundant `cast` | 4 | # snapshot: redundant-cast @@ -134,7 +133,6 @@ warning[redundant-cast]: Value is already of type `int` | 7 | cast(val=secrets.randbelow(10), typ=int) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove the redundant `cast` | 6 | # snapshot: redundant-cast @@ -156,7 +154,6 @@ warning[redundant-cast]: Value is already of type `int` | 10 | return cast(int, x + y) * z | ^^^^^^^^^^^^^^^^ - | help: Remove the redundant `cast` | 9 | # snapshot: redundant-cast @@ -178,7 +175,6 @@ warning[redundant-cast]: Value is already of type `int` | 13 | return -cast(int, x + y) | ^^^^^^^^^^^^^^^^ - | help: Remove the redundant `cast` | 12 | # snapshot: redundant-cast @@ -200,7 +196,6 @@ warning[redundant-cast]: Value is already of type `int` | 16 | print(cast(int, x + y)) | ^^^^^^^^^^^^^^^^ - | help: Remove the redundant `cast` | 15 | # snapshot: redundant-cast diff --git a/crates/ty_python_semantic/resources/mdtest/enums.md b/crates/ty_python_semantic/resources/mdtest/enums.md index 943162c595895f..17830ccbed6241 100644 --- a/crates/ty_python_semantic/resources/mdtest/enums.md +++ b/crates/ty_python_semantic/resources/mdtest/enums.md @@ -2452,7 +2452,6 @@ warning[mismatched-type-name]: The name passed to `Enum` must match the variable | 8 | Mismatch = Enum("WrongName", "A B") | ^^^^^^^^^^^ Expected "Mismatch", got "WrongName" - | ``` If the name is not a string literal, we also emit a diagnostic: @@ -2469,7 +2468,6 @@ warning[mismatched-type-name]: The name passed to `Enum` must match the variable | 11 | DynamicMismatch = Enum(name, "A B") | ^^^^ Expected "DynamicMismatch", got variable of type `str` - | ``` ### List/tuple of tuples diff --git a/crates/ty_python_semantic/resources/mdtest/expression/yield_and_yield_from.md b/crates/ty_python_semantic/resources/mdtest/expression/yield_and_yield_from.md index 930cd8b0b3efa3..c72210d37d6a1e 100644 --- a/crates/ty_python_semantic/resources/mdtest/expression/yield_and_yield_from.md +++ b/crates/ty_python_semantic/resources/mdtest/expression/yield_and_yield_from.md @@ -216,7 +216,6 @@ error[invalid-yield]: Yield expression type does not match annotation 4 | # snapshot: invalid-yield 5 | yield "" | ^^ expression of type `Literal[""]`, expected `int` - | ``` ### Invalid annotation @@ -284,7 +283,6 @@ error[invalid-yield]: Send type does not match annotation 7 | # snapshot: invalid-yield 8 | yield from inner() | ^^^^^^^ generator with send type `int`, expected `str` - | ``` ### Non generator function with `Generator` annotation @@ -308,7 +306,6 @@ error[invalid-return-type]: Return type does not match returned value 4 | # snapshot: invalid-return-type 5 | return 1 | ^ expected `Generator[int, int, None]`, found `Literal[1]` - | info: type `Literal[1]` is not assignable to protocol `Generator[int, int, None]` info: └── protocol member `__iter__` is not defined on type `Literal[1]` ``` diff --git a/crates/ty_python_semantic/resources/mdtest/generics/legacy/classes.md b/crates/ty_python_semantic/resources/mdtest/generics/legacy/classes.md index a75580cb52046d..5d198e0e98ef1d 100644 --- a/crates/ty_python_semantic/resources/mdtest/generics/legacy/classes.md +++ b/crates/ty_python_semantic/resources/mdtest/generics/legacy/classes.md @@ -124,7 +124,6 @@ error[shadowed-type-variable]: Generic class `InnerClass` uses ParamSpec `P` alr 71 | # snapshot: shadowed-type-variable 72 | class InnerClass(SingleParamSpec[P]): ... | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `P` used in class definition here - | ``` If you don't specialize a generic base class, we use the default specialization, which maps each diff --git a/crates/ty_python_semantic/resources/mdtest/generics/legacy/functions.md b/crates/ty_python_semantic/resources/mdtest/generics/legacy/functions.md index 5d603d3ab77a76..f4b677b8ca6ca9 100644 --- a/crates/ty_python_semantic/resources/mdtest/generics/legacy/functions.md +++ b/crates/ty_python_semantic/resources/mdtest/generics/legacy/functions.md @@ -229,13 +229,11 @@ error[invalid-argument-type]: Argument to function `f` is incorrect | 11 | reveal_type(f("string")) # revealed: Unknown | ^^^^^^^^ Argument type `Literal["string"]` does not satisfy upper bound `int` of type variable `T` - | info: Type variable defined here --> src/mdtest_snippet.py:3:1 | 3 | T = TypeVar("T", bound=int) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | ``` A bound can also be a union of protocols. If inference produces a union for the type variable, each @@ -282,13 +280,11 @@ error[invalid-argument-type]: Argument to function `f` is incorrect | 12 | reveal_type(f("string")) # revealed: Unknown | ^^^^^^^^ Argument type `Literal["string"]` does not satisfy constraints (`int`, `None`) of type variable `T` - | info: Type variable defined here --> src/mdtest_snippet.py:3:1 | 3 | T = TypeVar("T", int, None) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | ``` ## Typevar constraints diff --git a/crates/ty_python_semantic/resources/mdtest/generics/legacy/variables.md b/crates/ty_python_semantic/resources/mdtest/generics/legacy/variables.md index 20ef991b5110de..6be22a8e11cb07 100644 --- a/crates/ty_python_semantic/resources/mdtest/generics/legacy/variables.md +++ b/crates/ty_python_semantic/resources/mdtest/generics/legacy/variables.md @@ -696,7 +696,6 @@ error[invalid-legacy-type-variable]: A `TypeVar` cannot specify variance when `i | 48 | CovariantAndInferred = TypeVar("CovariantAndInferred", covariant=True, infer_variance=True) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | ``` ### Boolean parameters must be unambiguous diff --git a/crates/ty_python_semantic/resources/mdtest/generics/legacy/variance.md b/crates/ty_python_semantic/resources/mdtest/generics/legacy/variance.md index 0407d2af213683..a047ae784c9bbd 100644 --- a/crates/ty_python_semantic/resources/mdtest/generics/legacy/variance.md +++ b/crates/ty_python_semantic/resources/mdtest/generics/legacy/variance.md @@ -365,7 +365,6 @@ error[invalid-generic-class]: Variance of type variable `T_co` is incompatible w | 18 | class BadInvariantCo(Invariant[T_co]): ... | ^^^^^^^^^^^^^^^ - | help: Type variable `T_co` is declared as covariant, but base class `Invariant` requires it to be invariant @@ -374,7 +373,6 @@ error[invalid-generic-class]: Variance of type variable `T_contra` is incompatib | 21 | class BadInvariantContra(Invariant[T_contra]): ... | ^^^^^^^^^^^^^^^^^^^ - | help: Type variable `T_contra` is declared as contravariant, but base class `Invariant` requires it to be invariant @@ -383,7 +381,6 @@ error[invalid-generic-class]: Variance of type variable `T_contra` is incompatib | 24 | class BadCovariant(Covariant[T_contra]): ... | ^^^^^^^^^^^^^^^^^^^ - | help: Type variable `T_contra` is declared as contravariant, but base class `Covariant` requires it to be covariant @@ -392,7 +389,6 @@ error[invalid-generic-class]: Variance of type variable `T_co` is incompatible w | 27 | class BadContravariant(Contravariant[T_co]): ... | ^^^^^^^^^^^^^^^^^^^ - | help: Type variable `T_co` is declared as covariant, but base class `Contravariant` requires it to be contravariant ``` diff --git a/crates/ty_python_semantic/resources/mdtest/generics/pep695/aliases.md b/crates/ty_python_semantic/resources/mdtest/generics/pep695/aliases.md index 169ebff7d7169e..5d92ddcddd0b7a 100644 --- a/crates/ty_python_semantic/resources/mdtest/generics/pep695/aliases.md +++ b/crates/ty_python_semantic/resources/mdtest/generics/pep695/aliases.md @@ -372,7 +372,6 @@ error[not-subscriptable]: Cannot specialize non-generic type alias `AliasA` | ------^^^^^ | | | Alias to `A`, which is not generic - | ``` ```py @@ -388,7 +387,6 @@ error[not-subscriptable]: Cannot specialize non-generic type alias `AliasB` | ------^^^^^ | | | Alias to `B[int]`, which is already specialized - | ``` ## Aliases are not callable @@ -712,7 +710,6 @@ error[invalid-type-variable-default]: Type parameters with defaults cannot follo | --- ^^^^^^^ `T` has a default | | | `Ts` is a TypeVarTuple - | info: See https://typing.python.org/en/latest/spec/generics.html#defaults-following-typevartuple ``` @@ -729,7 +726,6 @@ error[invalid-type-variable-default]: Type parameters with defaults cannot follo | --- ^^^^^^^^ `T2` has a default | | | `Ts` is a TypeVarTuple - | info: See https://typing.python.org/en/latest/spec/generics.html#defaults-following-typevartuple ``` @@ -747,7 +743,6 @@ error[invalid-type-variable-default]: Type parameters with defaults cannot follo | | | | | `T1` has a default | `Ts` is a TypeVarTuple - | info: See https://typing.python.org/en/latest/spec/generics.html#defaults-following-typevartuple ``` @@ -766,7 +761,6 @@ error[invalid-type-variable-default]: Type parameters with defaults cannot follo | --- ^^^^^^^^^^^^^^^^^^^^^^ `Ts` has a default | | | `Us` is a TypeVarTuple - | info: See https://typing.python.org/en/latest/spec/generics.html#defaults-following-typevartuple ``` diff --git a/crates/ty_python_semantic/resources/mdtest/generics/pep695/functions.md b/crates/ty_python_semantic/resources/mdtest/generics/pep695/functions.md index 3b34f8ed4b509f..17f86e44021d74 100644 --- a/crates/ty_python_semantic/resources/mdtest/generics/pep695/functions.md +++ b/crates/ty_python_semantic/resources/mdtest/generics/pep695/functions.md @@ -271,13 +271,11 @@ error[invalid-argument-type]: Argument to function `f` is incorrect | 9 | reveal_type(f("string")) # revealed: Unknown | ^^^^^^^^ Argument type `Literal["string"]` does not satisfy upper bound `int` of type variable `T` - | info: Type variable defined here --> src/mdtest_snippet.py:3:7 | 3 | def f[T: int](x: T) -> T: | ^^^^^^ - | ``` ## Inferring a constrained typevar @@ -301,13 +299,11 @@ error[invalid-argument-type]: Argument to function `f` is incorrect | 10 | reveal_type(f("string")) # revealed: Unknown | ^^^^^^^^ Argument type `Literal["string"]` does not satisfy constraints (`int`, `None`) of type variable `T` - | info: Type variable defined here --> src/mdtest_snippet.py:3:7 | 3 | def f[T: (int, None)](x: T) -> T: | ^^^^^^^^^^^^^^ - | ``` ## Typevar constraints diff --git a/crates/ty_python_semantic/resources/mdtest/generics/scoping.md b/crates/ty_python_semantic/resources/mdtest/generics/scoping.md index 814dc4af70b78c..927cd71d32a0ce 100644 --- a/crates/ty_python_semantic/resources/mdtest/generics/scoping.md +++ b/crates/ty_python_semantic/resources/mdtest/generics/scoping.md @@ -310,7 +310,6 @@ error[shadowed-type-variable]: Generic function `bad` uses TypeVarTuple `Ts` alr | 1 | def outer[*Ts](*args: *Ts) -> None: | ------------------------------ TypeVarTuple `Ts` is bound in this enclosing scope - | ``` ### Generic method within generic class diff --git a/crates/ty_python_semantic/resources/mdtest/implicit_type_aliases.md b/crates/ty_python_semantic/resources/mdtest/implicit_type_aliases.md index 6170ff29d54588..5a714aaafca9b8 100644 --- a/crates/ty_python_semantic/resources/mdtest/implicit_type_aliases.md +++ b/crates/ty_python_semantic/resources/mdtest/implicit_type_aliases.md @@ -881,7 +881,6 @@ error[not-subscriptable]: Cannot subscript non-generic type alias `ListOfInts2` | -----------^^^^^ | | | Alias to `list[int]`, which is already specialized - | ``` ```py @@ -899,7 +898,6 @@ error[not-subscriptable]: Cannot subscript non-generic type `` | ---------^^^^^ | | | Type is already specialized - | ``` ### Multiple definitions diff --git a/crates/ty_python_semantic/resources/mdtest/liskov.md b/crates/ty_python_semantic/resources/mdtest/liskov.md index 395b6710830ebe..fedbb4a604ca03 100644 --- a/crates/ty_python_semantic/resources/mdtest/liskov.md +++ b/crates/ty_python_semantic/resources/mdtest/liskov.md @@ -53,7 +53,6 @@ error[invalid-method-override]: Invalid override of method `method` | 2 | def method(self) -> int: ... | ------------------- `Super.method` defined here - | info: incompatible return types: `object` is not assignable to `int` info: This violates the Liskov Substitution Principle ``` @@ -76,7 +75,6 @@ error[invalid-method-override]: Invalid override of method `method` | 2 | def method(self) -> int: ... | ------------------- `Super.method` defined here - | info: incompatible return types: `str` is not assignable to `int` info: This violates the Liskov Substitution Principle ``` @@ -171,7 +169,6 @@ error[invalid-method-override]: Invalid override of method `method` | 2 | def method(self, x: int, /): ... | ----------------------- `Super.method` defined here - | info: This violates the Liskov Substitution Principle ``` @@ -193,7 +190,6 @@ error[invalid-method-override]: Invalid override of method `method` | 2 | def method(self, x: int, /): ... | ----------------------- `Super.method` defined here - | info: unexpected extra parameter `y` info: This violates the Liskov Substitution Principle ``` @@ -216,7 +212,6 @@ error[invalid-method-override]: Invalid override of method `method` | 2 | def method(self, x: int, /): ... | ----------------------- `Super.method` defined here - | info: parameter `x` is keyword-only but must also accept positional arguments info: This violates the Liskov Substitution Principle ``` @@ -239,7 +234,6 @@ error[invalid-method-override]: Invalid override of method `method` | 2 | def method(self, x: int, /): ... | ----------------------- `Super.method` defined here - | info: parameter `x` has an incompatible type: `int` is not assignable to `bool` info: This violates the Liskov Substitution Principle ``` @@ -264,7 +258,6 @@ error[invalid-method-override]: Invalid override of method `method2` 45 | class Sub16(Super2): 46 | def method2(self, x, /): ... # snapshot: invalid-method-override | ^^^^^^^^^^^^^^^^^^^ Definition is incompatible with `Super2.method2` - | info: parameter `x` is positional-only but must also accept keyword arguments info: This violates the Liskov Substitution Principle ``` @@ -288,7 +281,6 @@ error[invalid-method-override]: Invalid override of method `method2` 47 | class Sub17(Super2): 48 | def method2(self, *, x): ... # snapshot: invalid-method-override | ^^^^^^^^^^^^^^^^^^^ Definition is incompatible with `Super2.method2` - | info: parameter `x` is keyword-only but must also accept positional arguments info: This violates the Liskov Substitution Principle ``` @@ -322,7 +314,6 @@ error[invalid-method-override]: Invalid override of method `method3` 54 | class Sub19(Super3): 55 | def method3(self, x, /): ... # snapshot: invalid-method-override | ^^^^^^^^^^^^^^^^^^^ Definition is incompatible with `Super3.method3` - | info: This violates the Liskov Substitution Principle ``` @@ -355,7 +346,6 @@ error[invalid-method-override]: Invalid override of method `method` 61 | class Sub21(Super4): 62 | def method(self, *args): ... # snapshot: invalid-method-override | ^^^^^^^^^^^^^^^^^^^ Definition is incompatible with `Super4.method` - | info: This violates the Liskov Substitution Principle ``` @@ -377,7 +367,6 @@ error[invalid-method-override]: Invalid override of method `method` | 57 | def method(self, *args: int, **kwargs: str): ... | --------------------------------------- `Super4.method` defined here - | info: This violates the Liskov Substitution Principle ``` @@ -675,7 +664,6 @@ error[invalid-method-override]: Base classes for class `BasicConflict` define me 9 | 10 | class BasicConflict(ReturnsStr, ReturnsInt): ... # snapshot: invalid-method-override | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ReturnsStr.method` is incompatible with `ReturnsInt.method` - | info: incompatible return types: `str` is not assignable to `int` info: This violates the Liskov Substitution Principle ``` @@ -927,7 +915,6 @@ error[invalid-method-override]: Base classes for class `ClassInstanceConflict` d | 2 | def kind(self, value: int) -> int: ... | ---- `InstanceMethod.kind` defined here - | info: `ClassMethod.kind` is a classmethod but `InstanceMethod.kind` is an instance method info: This violates the Liskov Substitution Principle ``` @@ -1068,7 +1055,6 @@ error[invalid-method-override]: Base classes for class `Combined` define method | 2 | def method(self) -> int: ... | ------ `right.Base.method` defined here - | info: incompatible return types: `str` is not assignable to `int` info: This violates the Liskov Substitution Principle ``` @@ -1164,7 +1150,6 @@ error[invalid-method-override]: Invalid override of method `method` 6 | class Parent(Grandparent): 7 | def method(self, x: str) -> None: ... # snapshot: invalid-method-override | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Definition is incompatible with `Grandparent.method` - | info: parameter `x` has an incompatible type: `int` is not assignable to `str` info: This violates the Liskov Substitution Principle @@ -1179,7 +1164,6 @@ error[invalid-method-override]: Invalid override of method `method` | 7 | def method(self, x: str) -> None: ... # snapshot: invalid-method-override | ---------------------------- `Parent.method` defined here - | info: parameter `x` has an incompatible type: `str` is not assignable to `int` info: This violates the Liskov Substitution Principle @@ -1194,7 +1178,6 @@ error[invalid-method-override]: Invalid override of method `method` | 7 | def method(self, x: str) -> None: ... # snapshot: invalid-method-override | ---------------------------- `Parent.method` defined here - | info: parameter `x` has an incompatible type: `str` is not assignable to `bytes` info: This violates the Liskov Substitution Principle @@ -1208,7 +1191,6 @@ error[invalid-method-override]: Invalid override of method `method` 27 | class ParentWithReturnType(GrandparentWithReturnType): 28 | def method(self) -> str: ... # snapshot: invalid-method-override | ^^^^^^^^^^^^^^^^^^^ Definition is incompatible with `GrandparentWithReturnType.method` - | info: incompatible return types: `str` is not assignable to `int` info: This violates the Liskov Substitution Principle @@ -1224,7 +1206,6 @@ error[invalid-method-override]: Invalid override of method `method` 32 | # but not with `ParentWithReturnType.method`. We report against the immediate parent. 33 | def method(self) -> int: ... # snapshot: invalid-method-override | ^^^^^^^^^^^^^^^^^^^ Definition is incompatible with `ParentWithReturnType.method` - | info: incompatible return types: `int` is not assignable to `str` info: This violates the Liskov Substitution Principle @@ -1239,7 +1220,6 @@ error[invalid-method-override]: Invalid override of method `method` | 4 | def method(self, x: int) -> None: ... | ---------------------------- `Grandparent.method` defined here - | info: parameter `x` has an incompatible type: `int` is not assignable to `str` info: This violates the Liskov Substitution Principle ``` @@ -1276,7 +1256,6 @@ error[invalid-method-override]: Invalid override of method `get` 4 | class B(A): 5 | def get(self, default, /): ... # snapshot: invalid-method-override | ^^^^^^^^^^^^^^^^^^^^^ Definition is incompatible with `A.get` - | info: parameter `default` is positional-only but must also accept keyword arguments info: This violates the Liskov Substitution Principle ``` @@ -1477,7 +1456,6 @@ error[invalid-method-override]: Invalid override of method `method` | 7 | def method(self: HasValue, argument: int) -> None: ... | --------------------------------------------- `Mixin.method` defined here - | info: parameter `argument` has an incompatible type: `int` is not assignable to `str` info: This violates the Liskov Substitution Principle ``` @@ -1613,7 +1591,6 @@ error[invalid-method-override]: Invalid override of method `foo` | 2 | def foo(self, x): ... | ------------ `one.A.foo` defined here - | info: the parameter named `y` does not match `x` (and can be used as a keyword parameter) info: This violates the Liskov Substitution Principle ``` @@ -1719,7 +1696,6 @@ error[invalid-method-override]: Invalid override of method `x` | 1 | def x(self, y: str): ... | --------------- Signature of `B.x` - | info: parameter `y` has an incompatible type: `int` is not assignable to `str` info: This violates the Liskov Substitution Principle @@ -1738,7 +1714,6 @@ error[invalid-method-override]: Invalid override of method `x` | 1 | def x(self, y: str): ... | --------------- Signature of `C.x` - | info: parameter `y` has an incompatible type: `str` is not assignable to `int` info: This violates the Liskov Substitution Principle ``` @@ -1763,7 +1738,6 @@ error[invalid-method-override]: Invalid override of method `__eq__` | 136 | def __eq__(self, value: object, /) -> bool: ... | -------------------------------------- `object.__eq__` defined here - | info: parameter `value` has an incompatible type: `object` is not assignable to `Bad` info: This violates the Liskov Substitution Principle help: It is recommended for `__eq__` to work with arbitrary objects, for example: @@ -1847,7 +1821,6 @@ error[invalid-method-override]: Invalid override of method `_asdict` | 41 | def _asdict(self) -> tuple[int, ...]: ... # snapshot: invalid-method-override | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Definition is incompatible with `Baz._asdict` - | info: incompatible return types: `tuple[int, ...]` is not assignable to `dict[str, Any]` info: This violates the Liskov Substitution Principle info: `Baz._asdict` is a generated method created because `Baz` inherits from `typing.NamedTuple` @@ -1855,7 +1828,6 @@ info: `Baz._asdict` is a generated method created because `Baz` inherits from `t | 37 | class Baz(NamedTuple): | ^^^^^^^^^^^^^^^ Definition of `Baz` - | ``` ## Staticmethods and classmethods @@ -1903,7 +1875,6 @@ error[invalid-method-override]: Invalid override of method `class_method` | 4 | def class_method(cls, x: int) -> int: ... | -------------------------------- `Parent.class_method` defined here - | info: incompatible return types: `object` is not assignable to `int` info: This violates the Liskov Substitution Principle ``` @@ -1925,7 +1896,6 @@ error[invalid-method-override]: Invalid override of method `static_method` | 6 | def static_method(x: int) -> int: ... | ---------------------------- `Parent.static_method` defined here - | info: incompatible return types: `object` is not assignable to `int` info: This violates the Liskov Substitution Principle ``` @@ -1949,7 +1919,6 @@ error[invalid-method-override]: Invalid override of method `instance_method` | 2 | def instance_method(self, x: int) -> int: ... | ------------------------------------ `Parent.instance_method` defined here - | info: `BadChild1A.instance_method` is a staticmethod but `Parent.instance_method` is an instance method info: This violates the Liskov Substitution Principle ``` @@ -1970,7 +1939,6 @@ error[invalid-method-override]: Invalid override of method `static_method` | 6 | def static_method(x: int) -> int: ... | ---------------------------- `Parent.static_method` defined here - | info: `BadChild1B.static_method` is an instance method but `Parent.static_method` is a staticmethod info: This violates the Liskov Substitution Principle ``` @@ -2019,7 +1987,6 @@ error[invalid-method-override]: Invalid override of method `class_method` | 4 | def class_method(cls, x: int) -> int: ... | -------------------------------- `Parent.class_method` defined here - | info: `BadChild3A.class_method` is a staticmethod but `Parent.class_method` is a classmethod info: This violates the Liskov Substitution Principle ``` @@ -2041,7 +2008,6 @@ error[invalid-method-override]: Invalid override of method `static_method` | 6 | def static_method(x: int) -> int: ... | ---------------------------- `Parent.static_method` defined here - | info: `BadChild3B.static_method` is a classmethod but `Parent.static_method` is a staticmethod info: This violates the Liskov Substitution Principle ``` diff --git a/crates/ty_python_semantic/resources/mdtest/loops/async_for.md b/crates/ty_python_semantic/resources/mdtest/loops/async_for.md index 22ae4e977e9617..df30433d401faf 100644 --- a/crates/ty_python_semantic/resources/mdtest/loops/async_for.md +++ b/crates/ty_python_semantic/resources/mdtest/loops/async_for.md @@ -80,7 +80,6 @@ error[not-iterable]: Object of type `NotAsyncIterable` is not async-iterable | 5 | async for x in NotAsyncIterable(): | ^^^^^^^^^^^^^^^^^^ - | info: It has no `__aiter__` method ``` @@ -107,7 +106,6 @@ error[not-iterable]: Object of type `Iterator` is not async-iterable | 11 | async for x in Iterator(): | ^^^^^^^^^^ - | info: It has no `__aiter__` method ``` @@ -132,7 +130,6 @@ error[not-iterable]: Object of type `AsyncIterable` is not async-iterable | 9 | async for x in AsyncIterable(): | ^^^^^^^^^^^^^^^ - | info: Its `__aiter__` method returns an object of type `NoAnext`, which has no `__anext__` method ``` @@ -160,7 +157,6 @@ error[not-iterable]: Object of type `AsyncIterable` may not be async-iterable | 12 | async for x in AsyncIterable(): | ^^^^^^^^^^^^^^^ - | info: Its `__aiter__` method returns an object of type `PossiblyUnboundAnext`, which may not have a `__anext__` method info: type `AsyncIterable` is not assignable to protocol `AsyncIterable[Unknown]` info: └── protocol member `__aiter__` is incompatible @@ -193,7 +189,6 @@ error[not-iterable]: Object of type `PossiblyUnboundAiter` may not be async-iter | 12 | async for x in PossiblyUnboundAiter(): | ^^^^^^^^^^^^^^^^^^^^^^ - | info: Its `__aiter__` attribute (with type `bound method PossiblyUnboundAiter.__aiter__() -> AsyncIterable`) may not be callable ``` @@ -220,7 +215,6 @@ error[not-iterable]: Object of type `AsyncIterable` is not async-iterable | 11 | async for x in AsyncIterable(): | ^^^^^^^^^^^^^^^ - | info: Its `__aiter__` method has an invalid signature info: type `AsyncIterable` is not assignable to protocol `AsyncIterable[Unknown]` info: └── protocol member `__aiter__` is incompatible @@ -251,7 +245,6 @@ error[not-iterable]: Object of type `AsyncIterable` is not async-iterable | 11 | async for x in AsyncIterable(): | ^^^^^^^^^^^^^^^ - | info: Its `__aiter__` method returns an object of type `AsyncIterator`, which has an invalid `__anext__` method info: type `AsyncIterable` is not assignable to protocol `AsyncIterable[Unknown]` info: └── protocol member `__aiter__` is incompatible diff --git a/crates/ty_python_semantic/resources/mdtest/loops/for.md b/crates/ty_python_semantic/resources/mdtest/loops/for.md index ec2d673fdf4787..2a4e3f7fa773f0 100644 --- a/crates/ty_python_semantic/resources/mdtest/loops/for.md +++ b/crates/ty_python_semantic/resources/mdtest/loops/for.md @@ -348,7 +348,6 @@ error[not-iterable]: Object of type `NotIterable` is not iterable | 9 | for x in NotIterable(): | ^^^^^^^^^^^^^ - | info: Its `__iter__` attribute has type `int | None`, which is not callable ``` @@ -366,7 +365,6 @@ error[not-iterable]: Object of type `Literal[123]` is not iterable | 2 | for x in nonsense: # snapshot: not-iterable | ^^^^^^^^ - | info: It doesn't have an `__iter__` method or a `__getitem__` method ``` @@ -388,7 +386,6 @@ error[not-iterable]: Object of type `NotIterable` is not iterable | 6 | for x in NotIterable(): # snapshot: not-iterable | ^^^^^^^^^^^^^ - | info: Its `__iter__` attribute has type `None`, which is not callable ``` @@ -577,7 +574,6 @@ error[not-iterable]: Object of type `Test | Literal[42]` may not be iterable | 13 | for x in iterable: | ^^^^^^^^ - | info: It may not have an `__iter__` method and it doesn't have a `__getitem__` method info: `Literal[42]` does not implement `__iter__` ``` @@ -610,7 +606,6 @@ error[not-iterable]: Object of type `Test | Test2` may not be iterable | 16 | for x in iterable: | ^^^^^^^^ - | info: Its `__iter__` method returns an object of type `TestIter | int`, which may not have a `__next__` method info: element `Test2` of union `Test | Test2` is not assignable to `Iterable[Unknown]` info: └── type `Test2` is not assignable to protocol `Iterable[Unknown]` @@ -651,7 +646,6 @@ error[not-iterable]: Object of type `Test | NotIter` may not be iterable | 15 | for x in iterable: | ^^^^^^^^ - | info: Its `__iter__` attribute (with type `(bound method Test.__iter__() -> TestIter) | int`) may not be callable ``` @@ -894,7 +888,6 @@ error[not-iterable]: Object of type `Iterable` is not iterable | 10 | for x in Iterable(): | ^^^^^^^^^^ - | info: Its `__iter__` method has an invalid signature info: type `Iterable` is not assignable to protocol `Iterable[Unknown]` info: └── protocol member `__iter__` is incompatible @@ -920,7 +913,6 @@ error[not-iterable]: Object of type `Bad` is not iterable | 6 | for x in Bad(): | ^^^^^ - | info: Its `__iter__` method returns an object of type `int`, which has no `__next__` method ``` @@ -971,7 +963,6 @@ error[not-iterable]: Object of type `Iterable1` is not iterable | 17 | for x in Iterable1(): | ^^^^^^^^^^^ - | info: Its `__iter__` method returns an object of type `Iterator1`, which has an invalid `__next__` method info: type `Iterable1` is not assignable to protocol `Iterable[Unknown]` info: └── protocol member `__iter__` is incompatible @@ -994,7 +985,6 @@ error[not-iterable]: Object of type `Iterable2` is not iterable | 20 | for y in Iterable2(): | ^^^^^^^^^^^ - | info: Its `__iter__` method returns an object of type `Iterator2`, which has a `__next__` attribute that is not callable ``` @@ -1026,7 +1016,6 @@ error[not-iterable]: Object of type `Iterable` may not be iterable | 16 | for x in 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 ``` @@ -1086,7 +1075,6 @@ error[not-iterable]: Object of type `Iterable` may not be iterable | 15 | for x in Iterable(): | ^^^^^^^^^^ - | info: It may not have an `__iter__` method or a `__getitem__` method ``` @@ -1107,7 +1095,6 @@ error[not-iterable]: Object of type `Bad` is not iterable | 5 | for x in Bad(): | ^^^^^ - | info: It has no `__iter__` method and its `__getitem__` attribute has type `None`, which is not callable ``` @@ -1146,7 +1133,6 @@ error[not-iterable]: Object of type `Iterable1` may not be iterable | 22 | for x in Iterable1(): | ^^^^^^^^^^^ - | info: It has no `__iter__` method and its `__getitem__` attribute is invalid info: `__getitem__` has type `CustomCallable`, which is not callable ``` @@ -1164,7 +1150,6 @@ error[not-iterable]: Object of type `Iterable2` may not be iterable | 26 | for y in Iterable2(): | ^^^^^^^^^^^ - | info: It has no `__iter__` method and its `__getitem__` attribute is invalid info: `__getitem__` has type `(bound method Iterable2.__getitem__(key: int) -> int) | None`, which is not callable ``` @@ -1189,7 +1174,6 @@ error[not-iterable]: Object of type `Iterable` is not iterable | 8 | for x in Iterable(): | ^^^^^^^^^^ - | info: It has no `__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 ``` @@ -1245,7 +1229,6 @@ error[not-iterable]: Object of type `Iterable1` may not be iterable | 16 | for x in Iterable1(): | ^^^^^^^^^^^ - | info: Its `__iter__` method may have an invalid signature info: type `Iterable1` is not assignable to protocol `Iterable[Unknown]` info: └── protocol member `__iter__` is incompatible @@ -1275,7 +1258,6 @@ error[not-iterable]: Object of type `Iterable2` may not be iterable | 27 | for x in Iterable2(): | ^^^^^^^^^^^ - | info: Its `__iter__` attribute (with type `(bound method Iterable2.__iter__() -> Iterator) | None`) may not be callable ``` @@ -1319,7 +1301,6 @@ error[not-iterable]: Object of type `Iterable1` may not be iterable | 28 | for x in Iterable1(): | ^^^^^^^^^^^ - | info: Its `__iter__` method returns an object of type `Iterator1`, which may have an invalid `__next__` method info: type `Iterable1` is not assignable to protocol `Iterable[Unknown]` info: └── protocol member `__iter__` is incompatible @@ -1343,7 +1324,6 @@ error[not-iterable]: Object of type `Iterable2` may not be iterable | 31 | for y in Iterable2(): | ^^^^^^^^^^^ - | info: Its `__iter__` method returns an object of type `Iterator2`, which has a `__next__` attribute that may not be callable info: type `Iterable2` is not assignable to protocol `Iterable[Unknown]` info: └── protocol member `__iter__` is incompatible @@ -1385,7 +1365,6 @@ error[not-iterable]: Object of type `Iterable1` may not be iterable | 20 | for x in Iterable1(): | ^^^^^^^^^^^ - | 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 ``` @@ -1402,7 +1381,6 @@ error[not-iterable]: Object of type `Iterable2` may not be iterable | 24 | for y in Iterable2(): | ^^^^^^^^^^^ - | 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 ``` @@ -1451,7 +1429,6 @@ error[not-iterable]: Object of type `Iterable1` may not be iterable | 31 | for x in Iterable1(): | ^^^^^^^^^^^ - | 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 ``` @@ -1467,7 +1444,6 @@ error[not-iterable]: Object of type `Iterable2` may not be iterable | 35 | for y in Iterable2(): | ^^^^^^^^^^^ - | 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 ``` diff --git a/crates/ty_python_semantic/resources/mdtest/metaclass.md b/crates/ty_python_semantic/resources/mdtest/metaclass.md index 9cdb4bb03a9156..254771c4d2b015 100644 --- a/crates/ty_python_semantic/resources/mdtest/metaclass.md +++ b/crates/ty_python_semantic/resources/mdtest/metaclass.md @@ -787,7 +787,6 @@ error[invalid-metaclass]: Metaclass type `int` is not callable | 3 | class B(metaclass=n): | ^^^^^^^^^^^ - | ``` ## Cyclic diff --git a/crates/ty_python_semantic/resources/mdtest/narrow/isinstance.md b/crates/ty_python_semantic/resources/mdtest/narrow/isinstance.md index 0777762912b3fe..bf3f23c2b22bbe 100644 --- a/crates/ty_python_semantic/resources/mdtest/narrow/isinstance.md +++ b/crates/ty_python_semantic/resources/mdtest/narrow/isinstance.md @@ -125,7 +125,6 @@ error[invalid-argument-type]: Invalid second argument to `isinstance` | ^^^^^^^^^^^^^^---------------^ | | | This `UnionType` instance contains non-class elements - | info: A `UnionType` instance can only be used as the second argument to `isinstance` if all elements are class objects info: Element `` in the union is not a class object ``` @@ -144,7 +143,6 @@ error[invalid-argument-type]: Invalid second argument to `isinstance` | ^^^^^^^^^^^^^^-------------------------------^ | | | This `UnionType` instance contains non-class elements - | info: A `UnionType` instance can only be used as the second argument to `isinstance` if all elements are class objects info: Elements `` and `` in the union are not class objects ``` @@ -163,7 +161,6 @@ error[invalid-argument-type]: Invalid second argument to `isinstance` | ^^^^^^^^^^^^^^----------------------------^ | | | This `UnionType` instance contains non-class elements - | info: A `UnionType` instance can only be used as the second argument to `isinstance` if all elements are class objects info: Element `` in the union, and 2 more elements, are not class objects ``` @@ -192,7 +189,6 @@ error[invalid-argument-type]: Invalid second argument to `isinstance` | ^^^^^^^^^^^^^^^^^^^^-----------------^^ | | | This `UnionType` instance contains non-class elements - | info: A `UnionType` instance can only be used as the second argument to `isinstance` if all elements are class objects info: Element `` in the union is not a class object ``` @@ -216,7 +212,6 @@ error[invalid-argument-type]: Invalid second argument to `isinstance` | ^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------^^^ | | | This `UnionType` instance contains non-class elements - | info: A `UnionType` instance can only be used as the second argument to `isinstance` if all elements are class objects info: Element `` in the union is not a class object ``` @@ -240,7 +235,6 @@ error[invalid-argument-type]: Invalid second argument to `isinstance` | 31 | if isinstance(x, classes): | ^^^^^^^^^^^^^^^^^^^^^^ - | info: A `UnionType` instance can only be used as the second argument to `isinstance` if all elements are class objects info: Element `` in the union `list[int] | bytes` is not a class object ``` diff --git a/crates/ty_python_semantic/resources/mdtest/narrow/issubclass.md b/crates/ty_python_semantic/resources/mdtest/narrow/issubclass.md index 31e85139400e1d..3209b9fdbfef90 100644 --- a/crates/ty_python_semantic/resources/mdtest/narrow/issubclass.md +++ b/crates/ty_python_semantic/resources/mdtest/narrow/issubclass.md @@ -187,7 +187,6 @@ error[invalid-argument-type]: Invalid second argument to `issubclass` | ^^^^^^^^^^^^^^---------------^ | | | This `UnionType` instance contains non-class elements - | info: A `UnionType` instance can only be used as the second argument to `issubclass` if all elements are class objects info: Element `` in the union is not a class object ``` @@ -211,7 +210,6 @@ error[invalid-argument-type]: Invalid second argument to `issubclass` | ^^^^^^^^^^^^^^^^^^^^-----------------^^ | | | This `UnionType` instance contains non-class elements - | info: A `UnionType` instance can only be used as the second argument to `issubclass` if all elements are class objects info: Element `` in the union is not a class object ``` @@ -235,7 +233,6 @@ error[invalid-argument-type]: Invalid second argument to `issubclass` | ^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------^^^ | | | This `UnionType` instance contains non-class elements - | info: A `UnionType` instance can only be used as the second argument to `issubclass` if all elements are class objects info: Element `` in the union is not a class object ``` @@ -259,7 +256,6 @@ error[invalid-argument-type]: Invalid second argument to `issubclass` | 23 | if issubclass(x, classes): | ^^^^^^^^^^^^^^^^^^^^^^ - | info: A `UnionType` instance can only be used as the second argument to `issubclass` if all elements are class objects info: Element `` in the union `list[int] | bytes` is not a class object ``` diff --git a/crates/ty_python_semantic/resources/mdtest/notebook.md b/crates/ty_python_semantic/resources/mdtest/notebook.md index 7d9f840af08332..cd3dcee5cd0d55 100644 --- a/crates/ty_python_semantic/resources/mdtest/notebook.md +++ b/crates/ty_python_semantic/resources/mdtest/notebook.md @@ -40,5 +40,4 @@ error[invalid-syntax]: Expected class, function definition or async function def | 2 | @staticmethod | ^ - | ``` diff --git a/crates/ty_python_semantic/resources/mdtest/overloads.md b/crates/ty_python_semantic/resources/mdtest/overloads.md index 52630e86625ed5..ec4e76c1794bf7 100644 --- a/crates/ty_python_semantic/resources/mdtest/overloads.md +++ b/crates/ty_python_semantic/resources/mdtest/overloads.md @@ -1242,7 +1242,6 @@ error[invalid-overload]: Implementation does not accept all arguments of this ov | ^^^^^^^^ 10 | def _extract(self, row_key: int | None = None, column_key: int | None = None) -> object: | -------- Implementation defined here - | info: Implementation signature `(self, row_key: int | None = None, column_key: int | None = None) -> object` is not assignable to overload signature `(self, column_key: int) -> object` info: the parameter named `row_key` does not match `column_key` (and can be used as a keyword parameter) @@ -1254,7 +1253,6 @@ error[invalid-overload]: Implementation does not accept all arguments of this ov | ^^^^^^ 19 | def update(self, params=(), /, **kwds) -> None: | ------ Implementation defined here - | info: Implementation signature `(self, params=..., /, **kwds) -> None` is not assignable to overload signature `(self, **kwds: Iterable[str]) -> None` info: parameter `self` is positional-only but must also accept keyword arguments ``` @@ -1291,7 +1289,6 @@ error[invalid-overload]: Overload return type is not assignable to implementatio 7 | def return_tuple(x: str) -> tuple[int]: ... 8 | def return_tuple(x: int | str) -> tuple[int]: | ------------ Implementation defined here - | info: Overload returns `tuple[str]`, which is not assignable to implementation return type `tuple[int]` info: the first tuple element is not compatible: `str` is not assignable to `int` ``` diff --git a/crates/ty_python_semantic/resources/mdtest/override.md b/crates/ty_python_semantic/resources/mdtest/override.md index 6ba91b5c4a8f0d..6ebc2647aa0d22 100644 --- a/crates/ty_python_semantic/resources/mdtest/override.md +++ b/crates/ty_python_semantic/resources/mdtest/override.md @@ -592,7 +592,6 @@ error[missing-override-decorator]: Method `method` overrides `Parent.method` but 6 | class Child(Parent): 7 | def method(self) -> None: ... # snapshot: missing-override-decorator | ^^^^^^ - | info: Decorate the method with `@typing_extensions.override` to make the override explicit ``` @@ -630,7 +629,6 @@ error[missing-override-decorator]: Method `method` overrides `Parent.method` but 6 | class Child(Parent): 7 | def method(self) -> None: ... # snapshot: missing-override-decorator | ^^^^^^ - | info: Decorate the method with `@typing.override` to make the override explicit ``` diff --git a/crates/ty_python_semantic/resources/mdtest/paramspec_subcall_error_location.md b/crates/ty_python_semantic/resources/mdtest/paramspec_subcall_error_location.md index f5b35cc3f6ed20..284d97e487a237 100644 --- a/crates/ty_python_semantic/resources/mdtest/paramspec_subcall_error_location.md +++ b/crates/ty_python_semantic/resources/mdtest/paramspec_subcall_error_location.md @@ -30,13 +30,11 @@ error[invalid-argument-type]: Argument to function `foo` is incorrect | 9 | foo(fn1, "a", 2, c="c", unknown=1) | ^^^ Expected `int`, found `Literal["a"]` - | info: Function defined here --> src/mdtest_snippet.py:3:5 | 3 | def foo[**P, T](fn: Callable[P, T], *args: P.args, **kwargs: P.kwargs): ... | ^^^ ------------------ Parameter declared here - | error[invalid-argument-type]: Argument to function `foo` is incorrect @@ -44,13 +42,11 @@ error[invalid-argument-type]: Argument to function `foo` is incorrect | 9 | foo(fn1, "a", 2, c="c", unknown=1) | ^^^^^ Expected `int`, found `Literal["c"]` - | info: Function defined here --> src/mdtest_snippet.py:3:5 | 3 | def foo[**P, T](fn: Callable[P, T], *args: P.args, **kwargs: P.kwargs): ... | ^^^ ------------------ Parameter declared here - | error[unknown-argument]: Argument `unknown` does not match any known parameter of function `foo` @@ -58,13 +54,11 @@ error[unknown-argument]: Argument `unknown` does not match any known parameter o | 9 | foo(fn1, "a", 2, c="c", unknown=1) | ^^^^^^^^^ - | info: Function signature here --> src/mdtest_snippet.py:3:5 | 3 | def foo[**P, T](fn: Callable[P, T], *args: P.args, **kwargs: P.kwargs): ... | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | ``` ```py @@ -80,13 +74,11 @@ error[too-many-positional-arguments]: Too many positional arguments to function | 13 | foo(fn2, 1, 2, 3) | ^ - | info: Function signature here --> src/mdtest_snippet.py:3:5 | 3 | def foo[**P, T](fn: Callable[P, T], *args: P.args, **kwargs: P.kwargs): ... | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | ``` ```py @@ -102,13 +94,11 @@ error[positional-only-parameter-as-kwarg]: Positional-only parameter 1 (`a`) pas | 17 | foo(fn3, a=1) | ^^^ - | info: Function signature here --> src/mdtest_snippet.py:3:5 | 3 | def foo[**P, T](fn: Callable[P, T], *args: P.args, **kwargs: P.kwargs): ... | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | ``` ```py @@ -128,13 +118,11 @@ error[missing-argument]: No argument provided for required parameter `b` of func | 22 | foo(fn4, 1, a=2) | ^^^^^^^^^^^^^^^^ - | info: Parameter declared here --> src/mdtest_snippet.py:3:37 | 3 | def foo[**P, T](fn: Callable[P, T], *args: P.args, **kwargs: P.kwargs): ... | ^^^^^^^^^^^^^ - | error[parameter-already-assigned]: Multiple values provided for parameter `a` of function `foo` @@ -142,7 +130,6 @@ error[parameter-already-assigned]: Multiple values provided for parameter `a` of | 22 | foo(fn4, 1, a=2) | ^^^ - | error[missing-argument]: No arguments provided for required parameters `a`, `b` of function `foo` @@ -150,13 +137,11 @@ error[missing-argument]: No arguments provided for required parameters `a`, `b` | 25 | foo(fn4) | ^^^^^^^^ - | info: Parameters declared here --> src/mdtest_snippet.py:3:16 | 3 | def foo[**P, T](fn: Callable[P, T], *args: P.args, **kwargs: P.kwargs): ... | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | ``` ## Methods diff --git a/crates/ty_python_semantic/resources/mdtest/pep613_type_aliases.md b/crates/ty_python_semantic/resources/mdtest/pep613_type_aliases.md index acb2b5726d2d20..b7bc652d2f3732 100644 --- a/crates/ty_python_semantic/resources/mdtest/pep613_type_aliases.md +++ b/crates/ty_python_semantic/resources/mdtest/pep613_type_aliases.md @@ -533,7 +533,6 @@ error[invalid-type-form]: `Unpack` is not allowed in type alias values | 14 | differently_bad: TypeAlias = Unpack[tuple[int, ...]] # snapshot: invalid-type-form | ^^^^^^^^^^^^^^^^^^^^^^^ - | info: See the following page for a reference on valid type expressions: info: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions ``` diff --git a/crates/ty_python_semantic/resources/mdtest/pep695_type_aliases.md b/crates/ty_python_semantic/resources/mdtest/pep695_type_aliases.md index bdb917e8c64ecf..882ceeb661b832 100644 --- a/crates/ty_python_semantic/resources/mdtest/pep695_type_aliases.md +++ b/crates/ty_python_semantic/resources/mdtest/pep695_type_aliases.md @@ -261,7 +261,6 @@ error[unsupported-operator]: Unsupported `|` operation | | | | | Has type `` | Has type `Literal["int"]` - | info: A type alias scope is lazy but will be executed at runtime if the `__value__` property is accessed ``` diff --git a/crates/ty_python_semantic/resources/mdtest/properties.md b/crates/ty_python_semantic/resources/mdtest/properties.md index 44afc2c50217de..93edff1d38e2aa 100644 --- a/crates/ty_python_semantic/resources/mdtest/properties.md +++ b/crates/ty_python_semantic/resources/mdtest/properties.md @@ -313,7 +313,6 @@ error[invalid-assignment]: Cannot delete read-only property `attr` on object of | 3 | def attr(self) -> int: | ---- Property `C.attr` defined here with no deleter - | ``` ## Limitations @@ -459,13 +458,11 @@ error[invalid-argument-type]: Argument to function `C.attr` is incorrect | 31 | type(attr_property).__set__(attr_property, c, 1) | ^ Expected `str`, found `Literal[1]` - | info: Function defined here --> src/mdtest_snippet.py:10:9 | 10 | def attr(self, value: str) -> None: | ^^^^ ---------- Parameter declared here - | ``` which is also equivalent to the following expressions: diff --git a/crates/ty_python_semantic/resources/mdtest/protocols.md b/crates/ty_python_semantic/resources/mdtest/protocols.md index 0bfa70f44bfb7d..562344fcadfbfa 100644 --- a/crates/ty_python_semantic/resources/mdtest/protocols.md +++ b/crates/ty_python_semantic/resources/mdtest/protocols.md @@ -1066,13 +1066,11 @@ warning[ambiguous-protocol-member]: Cannot assign to an undeclared attribute in | 326 | self.augmented += 1 # snapshot: ambiguous-protocol-member | ^^^^^^^^^^^^^^ `augmented` is not declared as a protocol member - | info: Assigning to an undeclared attribute in a protocol method leads to an ambiguous interface --> src/mdtest_snippet.py:318:7 | 318 | class AssignmentForms(Protocol): | ^^^^^^^^^^^^^^^^^^^^^^^^^ `AssignmentForms` declared as a protocol here - | info: No declarations found for `augmented` in the body of `AssignmentForms` or any of its superclasses ``` @@ -4241,7 +4239,6 @@ error[invalid-assignment]: Object of type `` is not assi | ------------- ^^^^^^^^^^^^^^ Incompatible value of type `` | | | Declared type - | info: type `` is not assignable to protocol `Iterable[int]` info: └── protocol member `__iter__` is not defined on type `` info: └── special methods must be defined on the meta-type when matching a protocol diff --git a/crates/ty_python_semantic/resources/mdtest/regression/3525_character_split_notebook.md b/crates/ty_python_semantic/resources/mdtest/regression/3525_character_split_notebook.md index b7afa71b2461f5..e3909af220a72f 100644 --- a/crates/ty_python_semantic/resources/mdtest/regression/3525_character_split_notebook.md +++ b/crates/ty_python_semantic/resources/mdtest/regression/3525_character_split_notebook.md @@ -36,7 +36,6 @@ warning[unused-ignore-comment]: Unused `ty: ignore` directive | 2 | x = 1 # ty: ignore[unresolved-reference] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove the unused suppression comment ::: cell 2 | diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Annotated_subscript_\342\200\246_(98082f2161ea366f).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Annotated_subscript_\342\200\246_(98082f2161ea366f).snap" index bba81a96273f3c..5b6dd364dda29d 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Annotated_subscript_\342\200\246_(98082f2161ea366f).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Annotated_subscript_\342\200\246_(98082f2161ea366f).snap" @@ -27,7 +27,6 @@ error[invalid-assignment]: Invalid subscript assignment with key of type `Litera | 4 | numbers[0]: str = "three" | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | ``` @@ -37,6 +36,5 @@ error[invalid-type-form]: Type annotations are not allowed on subscripted expres | 4 | numbers[0]: str = "three" | ^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_key_type_-_For_a_`dict`_(4aa9d1d82d07fcf1).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_key_type_-_For_a_`dict`_(4aa9d1d82d07fcf1).snap" index 7305b144c33687..d5facda9bfa106 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_key_type_-_For_a_`dict`_(4aa9d1d82d07fcf1).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_key_type_-_For_a_`dict`_(4aa9d1d82d07fcf1).snap" @@ -27,6 +27,5 @@ error[invalid-assignment]: Invalid subscript assignment with key of type `Litera | ^^^^^^^-^^^^^ | | | Expected key of type `str`, got `Literal[0]` - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_key_type_-_For_a_`list`_(752cfa73fb34c1c).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_key_type_-_For_a_`list`_(752cfa73fb34c1c).snap" index 0b0e770975fadf..fd77ebe5023ce8 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_key_type_-_For_a_`list`_(752cfa73fb34c1c).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_key_type_-_For_a_`list`_(752cfa73fb34c1c).snap" @@ -25,6 +25,5 @@ error[invalid-assignment]: Invalid subscript assignment with key of type `Litera | 2 | numbers["zero"] = 3 # error: [invalid-assignment] | ^^^^^^^^^^^^^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_key_type_for\342\200\246_(815dae276e2fd2b7).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_key_type_for\342\200\246_(815dae276e2fd2b7).snap" index ba4a84aedf0245..f6b047e6fe14cd 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_key_type_for\342\200\246_(815dae276e2fd2b7).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_key_type_for\342\200\246_(815dae276e2fd2b7).snap" @@ -30,6 +30,5 @@ error[invalid-key]: TypedDict `Config` can only be subscripted with a string lit | 7 | config[0] = 3 # error: [invalid-key] | ^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_value_type_-_For_a_`dict`_(177872afa1956fef).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_value_type_-_For_a_`dict`_(177872afa1956fef).snap" index e7464a9ce45ff3..9670e1f60f7e19 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_value_type_-_For_a_`dict`_(177872afa1956fef).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_value_type_-_For_a_`dict`_(177872afa1956fef).snap" @@ -27,6 +27,5 @@ error[invalid-assignment]: Invalid subscript assignment with key of type `Litera | ^^^^^^^^^^^^^^^^^^^^------- | | | Expected value of type `int`, got `Literal["three"]` - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_value_type_-_For_a_`list`_(e7ebbd4af387837c).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_value_type_-_For_a_`list`_(e7ebbd4af387837c).snap" index a0362842b3105e..2f085bcce70ba5 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_value_type_-_For_a_`list`_(e7ebbd4af387837c).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_value_type_-_For_a_`list`_(e7ebbd4af387837c).snap" @@ -25,6 +25,5 @@ error[invalid-assignment]: Invalid subscript assignment with key of type `Litera | 2 | numbers[0] = "three" # error: [invalid-assignment] | ^^^^^^^^^^^^^^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_value_type_f\342\200\246_(155d53762388f9ad).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_value_type_f\342\200\246_(155d53762388f9ad).snap" index 7b7a1ba07f25a2..c50782f01483a5 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_value_type_f\342\200\246_(155d53762388f9ad).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_value_type_f\342\200\246_(155d53762388f9ad).snap" @@ -33,12 +33,10 @@ error[invalid-assignment]: Invalid assignment to key "retries" with declared typ | | | | | key has declared type `int` | TypedDict `Config` - | info: Item declaration --> src/mdtest_snippet.py:4:5 | 4 | retries: int | ------------ Item declared here - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Misspelled_key_for_`\342\200\246_(7cf0fa634e2a2d59).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Misspelled_key_for_`\342\200\246_(7cf0fa634e2a2d59).snap" index bc656372fa901e..2e0d30897d9b08 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Misspelled_key_for_`\342\200\246_(7cf0fa634e2a2d59).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Misspelled_key_for_`\342\200\246_(7cf0fa634e2a2d59).snap" @@ -33,7 +33,6 @@ error[invalid-key]: Unknown key "Retries" for TypedDict `Config` | | | TypedDict `Config` | - | 6 | def _(config: Config) -> None: - config["Retries"] = 30.0 # error: [invalid-key] 7 + config["retries"] = 30.0 # error: [invalid-key] diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_No_`__setitem__`_met\342\200\246_(468f62a3bdd1d60c).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_No_`__setitem__`_met\342\200\246_(468f62a3bdd1d60c).snap" index 28293ef4ab52ca..0304377faf8cef 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_No_`__setitem__`_met\342\200\246_(468f62a3bdd1d60c).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_No_`__setitem__`_met\342\200\246_(468f62a3bdd1d60c).snap" @@ -29,7 +29,6 @@ error[invalid-assignment]: Cannot assign to a subscript on an object of type `Re | 6 | config["retries"] = 3 # error: [invalid-assignment] | ^^^^^^^^^^^^^^^^^ - | help: Consider adding a `__setitem__` method to `ReadOnlyDict`. ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Possibly_missing_`__\342\200\246_(efd3f0c02e9b89e9).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Possibly_missing_`__\342\200\246_(efd3f0c02e9b89e9).snap" index e7bc46be47f766..890d507ff6b1ab 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Possibly_missing_`__\342\200\246_(efd3f0c02e9b89e9).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Possibly_missing_`__\342\200\246_(efd3f0c02e9b89e9).snap" @@ -25,7 +25,6 @@ error[invalid-assignment]: Cannot assign to a subscript on an object of type `No | 2 | config["retries"] = 3 # error: [invalid-assignment] | ^^^^^^^^^^^^^^^^^ - | info: The full type of the subscripted object is `dict[str, int] | None` info: `None` does not have a `__setitem__` method. diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Unknown_key_for_all_\342\200\246_(8a0f0e8ceccc51b2).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Unknown_key_for_all_\342\200\246_(8a0f0e8ceccc51b2).snap" index e05945c548db2e..1c327fa2dc1380 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Unknown_key_for_all_\342\200\246_(8a0f0e8ceccc51b2).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Unknown_key_for_all_\342\200\246_(8a0f0e8ceccc51b2).snap" @@ -39,7 +39,6 @@ error[invalid-key]: Unknown key "nane" for TypedDict `Animal` | ----- ^^^^^^ Unknown key "nane" | | | TypedDict `Animal` in union type `Person | Animal` - | ``` @@ -51,6 +50,5 @@ error[invalid-key]: Unknown key "nane" for TypedDict `Person` | ----- ^^^^^^ Unknown key "nane" | | | TypedDict `Person` in union type `Person | Animal` - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Unknown_key_for_one_\342\200\246_(b515711c0a451a86).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Unknown_key_for_one_\342\200\246_(b515711c0a451a86).snap" index 644493850813a4..efcd16a430cae1 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Unknown_key_for_one_\342\200\246_(b515711c0a451a86).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Unknown_key_for_one_\342\200\246_(b515711c0a451a86).snap" @@ -37,6 +37,5 @@ error[invalid-key]: Unknown key "legs" for TypedDict `Person` | ----- ^^^^^^ Unknown key "legs" | | | TypedDict `Person` in union type `Person | Animal` - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Wrong_value_type_for\342\200\246_(57372b65e30392a8).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Wrong_value_type_for\342\200\246_(57372b65e30392a8).snap" index 09ccb445d4ff41..5ab94cc973a0a1 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Wrong_value_type_for\342\200\246_(57372b65e30392a8).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Wrong_value_type_for\342\200\246_(57372b65e30392a8).snap" @@ -27,7 +27,6 @@ error[invalid-assignment]: Invalid subscript assignment with key of type `Litera | ^^^^^^^^^^^^^^^^^^^^- | | | Expected value of type `str`, got `Literal[3]` - | info: The full type of the subscripted object is `dict[str, int] | dict[str, str]` ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Wrong_value_type_for\342\200\246_(ffe39a3bae68cfe4).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Wrong_value_type_for\342\200\246_(ffe39a3bae68cfe4).snap" index dd6482e43330b0..60fc8391613ac0 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Wrong_value_type_for\342\200\246_(ffe39a3bae68cfe4).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Wrong_value_type_for\342\200\246_(ffe39a3bae68cfe4).snap" @@ -29,7 +29,6 @@ error[invalid-assignment]: Invalid subscript assignment with key of type `Litera | ^^^^^^^^^^^^^^^^^^^^--- | | | Expected value of type `int`, got `float` - | info: The full type of the subscripted object is `dict[str, int] | dict[str, str]` ``` @@ -42,7 +41,6 @@ error[invalid-assignment]: Invalid subscript assignment with key of type `Litera | ^^^^^^^^^^^^^^^^^^^^--- | | | Expected value of type `str`, got `float` - | info: The full type of the subscripted object is `dict[str, int] | dict[str, str]` ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/async.md_-_Async_with_statement\342\200\246_-_Context_expression_w\342\200\246_(28ef812089a32e6a).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/async.md_-_Async_with_statement\342\200\246_-_Context_expression_w\342\200\246_(28ef812089a32e6a).snap" index 55ca624cf804b8..856f10ff3ff7b5 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/async.md_-_Async_with_statement\342\200\246_-_Context_expression_w\342\200\246_(28ef812089a32e6a).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/async.md_-_Async_with_statement\342\200\246_-_Context_expression_w\342\200\246_(28ef812089a32e6a).snap" @@ -35,7 +35,6 @@ error[invalid-context-manager]: Object of type `Manager1 | NotAContextManager` c | 11 | async with context_expr as f: | ^^^^^^^^^^^^ - | info: `NotAContextManager` does not implement `__aenter__` or `__aexit__` ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Exception_Handling_-_Invalid_exception_ha\342\200\246_(d394c561bdd35078).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Exception_Handling_-_Invalid_exception_ha\342\200\246_(d394c561bdd35078).snap" index 3619f8434e5d27..2f433a830b6cc9 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Exception_Handling_-_Invalid_exception_ha\342\200\246_(d394c561bdd35078).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Exception_Handling_-_Invalid_exception_ha\342\200\246_(d394c561bdd35078).snap" @@ -57,7 +57,6 @@ error[invalid-exception-caught]: Invalid object caught in an exception handler | 4 | except 3 as e: | ^ Object has type `Literal[3]` - | info: Can only catch a subclass of `BaseException` or tuple of `BaseException` subclasses ``` @@ -71,7 +70,6 @@ error[invalid-exception-caught]: Invalid tuple caught in an exception handler | | | | | Invalid element of type `Literal[b"bar"]` | Invalid element of type `Literal["foo"]` - | info: Can only catch a subclass of `BaseException` or tuple of `BaseException` subclasses ``` @@ -82,7 +80,6 @@ error[invalid-exception-caught]: Invalid object caught in an exception handler | 21 | except x as e: | ^ Object has type `type[str]` - | info: Can only catch a subclass of `BaseException` or tuple of `BaseException` subclasses ``` @@ -93,7 +90,6 @@ error[invalid-exception-caught]: Invalid tuple caught in an exception handler | 24 | except y as f: | ^ Object has type `tuple[type[OSError], type[RuntimeError], int]` - | info: Can only catch a subclass of `BaseException` or tuple of `BaseException` subclasses ``` @@ -104,7 +100,6 @@ error[invalid-exception-caught]: Invalid tuple caught in an exception handler | 27 | except z as g: | ^ Object has type `tuple[type[str], ...]` - | info: Can only catch a subclass of `BaseException` or tuple of `BaseException` subclasses ``` @@ -115,7 +110,6 @@ error[invalid-exception-caught]: Invalid object caught in an exception handler | 33 | except int: | ^^^ Object has type `` - | info: Can only catch a subclass of `BaseException` or tuple of `BaseException` subclasses ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Exception_Handling_-_Special-cased_diagno\342\200\246_(a97274530a7f61c1).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Exception_Handling_-_Special-cased_diagno\342\200\246_(a97274530a7f61c1).snap" index cb14d8e188c943..3984c55baecf65 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Exception_Handling_-_Special-cased_diagno\342\200\246_(a97274530a7f61c1).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Exception_Handling_-_Special-cased_diagno\342\200\246_(a97274530a7f61c1).snap" @@ -33,7 +33,6 @@ error[invalid-raise]: Cannot raise `NotImplemented` | 4 | raise NotImplemented from NotImplemented | ^^^^^^^^^^^^^^ Did you mean `NotImplementedError`? - | info: Can only raise an instance or subclass of `BaseException` ``` @@ -44,7 +43,6 @@ error[invalid-raise]: Cannot use `NotImplemented` as an exception cause | 4 | raise NotImplemented from NotImplemented | ^^^^^^^^^^^^^^ Did you mean `NotImplementedError`? - | info: An exception cause must be an instance of `BaseException`, subclass of `BaseException`, or `None` ``` @@ -55,7 +53,6 @@ error[invalid-exception-caught]: Cannot catch `NotImplemented` in an exception h | 6 | except NotImplemented: | ^^^^^^^^^^^^^^ Did you mean `NotImplementedError`? - | info: Can only catch a subclass of `BaseException` or tuple of `BaseException` subclasses ``` @@ -69,7 +66,6 @@ error[invalid-exception-caught]: Invalid tuple caught in an exception handler | | | Invalid element of type `NotImplementedType` | Did you mean `NotImplementedError`? - | info: Can only catch a subclass of `BaseException` or tuple of `BaseException` subclasses ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Attempting_to_import\342\200\246_(2fcfcf567587a056).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Attempting_to_import\342\200\246_(2fcfcf567587a056).snap" index ba7d471ac4b39f..3da3fe923c0422 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Attempting_to_import\342\200\246_(2fcfcf567587a056).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Attempting_to_import\342\200\246_(2fcfcf567587a056).snap" @@ -26,7 +26,6 @@ error[unresolved-import]: Cannot resolve imported module `tomllib` | 1 | import tomllib # error: [unresolved-import] | ^^^^^^^ - | info: The stdlib module `tomllib` is only available on Python 3.11+ info: Python 3.10 was assumed when resolving modules because it was specified on the command line @@ -38,7 +37,6 @@ error[unresolved-import]: Cannot resolve imported module `string.templatelib` | 2 | from string.templatelib import Template # error: [unresolved-import] | ^^^^^^^^^^^^^^^^^^ - | info: The stdlib module `string.templatelib` is only available on Python 3.14+ info: Python 3.10 was assumed when resolving modules because it was specified on the command line @@ -50,7 +48,6 @@ error[unresolved-import]: Module `importlib.resources` has no member `abc` | 3 | from importlib.resources import abc # error: [unresolved-import] | ^^^ - | info: The stdlib module `importlib.resources` only has a `abc` submodule on Python 3.11+ info: Python 3.10 was assumed when resolving modules because it was specified on the command line diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Attempting_to_import\342\200\246_(c14954eefd15211f).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Attempting_to_import\342\200\246_(c14954eefd15211f).snap" index 2155b6dcf1cc14..1c0e66e13e79e1 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Attempting_to_import\342\200\246_(c14954eefd15211f).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Attempting_to_import\342\200\246_(c14954eefd15211f).snap" @@ -25,7 +25,6 @@ error[unresolved-import]: Cannot resolve imported module `aifc` | 1 | import aifc # error: [unresolved-import] | ^^^^ - | info: The stdlib module `aifc` is only available on Python <=3.12 info: Python 3.13 was assumed when resolving modules because it was specified on the command line @@ -37,7 +36,6 @@ error[unresolved-import]: Cannot resolve imported module `distutils` | 2 | from distutils import sysconfig # error: [unresolved-import] | ^^^^^^^^^ - | info: The stdlib module `distutils` is only available on Python <=3.11 info: Python 3.13 was assumed when resolving modules because it was specified on the command line diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Attempting_to_import\342\200\246_(dba22bd97137ee38).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Attempting_to_import\342\200\246_(dba22bd97137ee38).snap" index 068a1b412456ee..da2e29279d5670 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Attempting_to_import\342\200\246_(dba22bd97137ee38).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Attempting_to_import\342\200\246_(dba22bd97137ee38).snap" @@ -27,7 +27,6 @@ error[unresolved-import]: Cannot resolve imported module `compression.zstd` | 1 | import compression.zstd # error: [unresolved-import] | ^^^^^^^^^^^^^^^^ - | info: The stdlib module `compression` is only available on Python 3.14+ info: Python 3.10 was assumed when resolving modules because it was specified on the command line @@ -39,7 +38,6 @@ error[unresolved-import]: Cannot resolve imported module `compression` | 2 | from compression import zstd # error: [unresolved-import] | ^^^^^^^^^^^ - | info: The stdlib module `compression` is only available on Python 3.14+ info: Python 3.10 was assumed when resolving modules because it was specified on the command line @@ -51,7 +49,6 @@ error[unresolved-import]: Cannot resolve imported module `compression.fakebutwho | 3 | import compression.fakebutwhocansay # error: [unresolved-import] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | info: The stdlib module `compression` is only available on Python 3.14+ info: Python 3.10 was assumed when resolving modules because it was specified on the command line @@ -63,7 +60,6 @@ error[unresolved-import]: Cannot resolve imported module `compression` | 4 | from compression import fakebutwhocansay # error: [unresolved-import] | ^^^^^^^^^^^ - | info: The stdlib module `compression` is only available on Python 3.14+ info: Python 3.10 was assumed when resolving modules because it was specified on the command line diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Multiple_objects_imp\342\200\246_(cbfbf5ff94e6e104).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Multiple_objects_imp\342\200\246_(cbfbf5ff94e6e104).snap" index 47fdfa10bb4421..a2d0cc2dbc1195 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Multiple_objects_imp\342\200\246_(cbfbf5ff94e6e104).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Multiple_objects_imp\342\200\246_(cbfbf5ff94e6e104).snap" @@ -25,7 +25,6 @@ error[unresolved-import]: Cannot resolve imported module `does_not_exist` | 2 | from does_not_exist import foo, bar, baz | ^^^^^^^^^^^^^^ - | info: Searched in the following paths during module resolution: info: 1. /src (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Unresolvable_module_\342\200\246_(846453deaca1071c).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Unresolvable_module_\342\200\246_(846453deaca1071c).snap" index 58dd439bb8aea9..1894f0f5ac2dca 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Unresolvable_module_\342\200\246_(846453deaca1071c).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Unresolvable_module_\342\200\246_(846453deaca1071c).snap" @@ -24,7 +24,6 @@ error[unresolved-import]: Cannot resolve imported module `zqzqzqzqzqzqzq` | 1 | import zqzqzqzqzqzqzq # error: [unresolved-import] "Cannot resolve imported module `zqzqzqzqzqzqzq`" | ^^^^^^^^^^^^^^ - | info: Searched in the following paths during module resolution: info: 1. /src (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Unresolvable_submodu\342\200\246_(4fad4be9778578b7).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Unresolvable_submodu\342\200\246_(4fad4be9778578b7).snap" index 63d9b19ef1c811..f607150f14b44f 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Unresolvable_submodu\342\200\246_(4fad4be9778578b7).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/basic.md_-_Structures_-_Unresolvable_submodu\342\200\246_(4fad4be9778578b7).snap" @@ -33,7 +33,6 @@ error[unresolved-import]: Cannot resolve imported module `a.foo` | 2 | import a.foo # error: [unresolved-import] "Cannot resolve imported module `a.foo`" | ^^^^^ - | info: Searched in the following paths during module resolution: info: 1. /src (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) @@ -47,7 +46,6 @@ error[unresolved-import]: Cannot resolve imported module `b.foo` | 5 | import b.foo # error: [unresolved-import] "Cannot resolve imported module `b.foo`" | ^^^^^ - | info: Searched in the following paths during module resolution: info: 1. /src (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___Leg\342\200\246_-_Diagnostics_for_bad_\342\200\246_(2ceba7b720e21b8b).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___Leg\342\200\246_-_Diagnostics_for_bad_\342\200\246_(2ceba7b720e21b8b).snap" index 47ae403330bab7..32cdd45d556f19 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___Leg\342\200\246_-_Diagnostics_for_bad_\342\200\246_(2ceba7b720e21b8b).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___Leg\342\200\246_-_Diagnostics_for_bad_\342\200\246_(2ceba7b720e21b8b).snap" @@ -47,7 +47,6 @@ error[invalid-type-arguments]: Type `int` is not assignable to upper bound `str` | 3 | T = TypeVar("T", bound=str) | - Type variable defined here - | ``` @@ -62,6 +61,5 @@ error[invalid-type-arguments]: Type `str` does not satisfy constraints `int`, `b | 4 | U = TypeVar("U", int, bytes) | - Type variable defined here - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___Leg\342\200\246_-_Errors_for_inconsist\342\200\246_(557742f3cd2464b2).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___Leg\342\200\246_-_Errors_for_inconsist\342\200\246_(557742f3cd2464b2).snap" index a9dead94b7323c..2169103cd6a5a0 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___Leg\342\200\246_-_Errors_for_inconsist\342\200\246_(557742f3cd2464b2).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___Leg\342\200\246_-_Errors_for_inconsist\342\200\246_(557742f3cd2464b2).snap" @@ -85,7 +85,6 @@ error[invalid-generic-class]: Inconsistent type arguments for `Grandparent` amon | | | | | Later class base is `Grandparent[T2@BadChild, T1@BadChild]` | Earlier class base inherits from `Grandparent[T1@BadChild, T2@BadChild]` - | ``` @@ -98,7 +97,6 @@ error[invalid-generic-class]: Inconsistent type arguments for `Grandparent` amon | | | | | Later class base is `Grandparent[T2@BadChild2, int]` | Earlier class base inherits from `Grandparent[T1@BadChild2, T2@BadChild2]` - | ``` @@ -111,7 +109,6 @@ error[invalid-generic-class]: Inconsistent type arguments for `Grandparent` amon | | | | | Later class base inherits from `Grandparent[T2@BadChild3, T1@BadChild3]` | Earlier class base inherits from `Grandparent[T1@BadChild3, T2@BadChild3]` - | ``` @@ -121,7 +118,6 @@ info[missing-type-argument]: Missing type arguments for generic class `Parent` ( | 29 | class Fine(Parent, Grandparent[T1, T2]): ... # error: [missing-type-argument] | ^^^^^^ - | ``` @@ -131,7 +127,6 @@ info[missing-type-argument]: Missing type arguments for generic class `Parent3` | 30 | class AlsoFine(Parent3, Parent4[T1, T2]): ... # error: [missing-type-argument] | ^^^^^^^ - | ``` @@ -141,7 +136,6 @@ info[missing-type-argument]: Missing type arguments for generic class `Parent` ( | 35 | class Dandy(Parent, Parent3, Parent4): ... | ^^^^^^ - | ``` @@ -151,7 +145,6 @@ info[missing-type-argument]: Missing type arguments for generic class `Parent3` | 35 | class Dandy(Parent, Parent3, Parent4): ... | ^^^^^^^ - | ``` @@ -161,7 +154,6 @@ info[missing-type-argument]: Missing type arguments for generic class `Parent4` | 35 | class Dandy(Parent, Parent3, Parent4): ... | ^^^^^^^ - | ``` @@ -174,7 +166,6 @@ error[invalid-generic-class]: Inconsistent type arguments for `Grandparent` amon | | | | | Later class base inherits from `Grandparent[T2@BadChild4, T1@BadChild4]` | Earlier class base inherits from `Grandparent[T1@BadChild4, T2@BadChild4]` - | ``` @@ -184,7 +175,6 @@ info[missing-type-argument]: Missing type arguments for generic class `Parent` ( | 42 | class BadChild4(Parent, Parent3[T1, T2], Parent4[T2, T1]): ... | ^^^^^^ - | ``` @@ -197,7 +187,6 @@ error[invalid-generic-class]: Inconsistent type arguments for `Grandparent` amon | | | | | Later class base inherits from `Grandparent[T2@BadChild5, T1@BadChild5]` | Earlier class base inherits from `Grandparent[T1@BadChild5, T2@BadChild5]` - | ``` @@ -210,7 +199,6 @@ error[invalid-generic-class]: Inconsistent type arguments for `Grandparent` amon | | | | | Later class base inherits from `Grandparent[T2@BadChild6, T1@BadChild6]` | Earlier class base inherits from `Grandparent[T1@BadChild6, T2@BadChild6]` - | ``` @@ -220,7 +208,6 @@ info[missing-type-argument]: Missing type arguments for generic class `Parent3` | 49 | class BadChild6(Parent[T1, T2], Parent3, Parent4[T2, T1]): ... | ^^^^^^^ - | ``` @@ -233,7 +220,6 @@ error[invalid-generic-class]: Inconsistent type arguments for `Grandparent` amon | | | | | Later class base inherits from `Grandparent[T2@BadChild7, T1@BadChild7]` | Earlier class base inherits from `Grandparent[T1@BadChild7, T2@BadChild7]` - | ``` @@ -246,7 +232,6 @@ error[invalid-generic-class]: Inconsistent type arguments for `Grandparent` amon | | | | | Later class base inherits from `Grandparent[T2@BadChild8, T1@BadChild8]` | Earlier class base inherits from `Grandparent[T1@BadChild8, T2@BadChild8]` - | ``` @@ -256,7 +241,6 @@ info[missing-type-argument]: Missing type arguments for generic class `Parent4` | 56 | class BadChild8(Parent[T1, T2], Parent3[T2, T1], Parent4): ... | ^^^^^^^ - | ``` @@ -269,6 +253,5 @@ error[invalid-generic-class]: Inconsistent type arguments for `Grandparent` amon | | | | | Later class base inherits from `Grandparent[T2@BadChild9, T1@BadChild9]` | Earlier class base inherits from `Grandparent[T1@BadChild9, T2@BadChild9]` - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___Leg\342\200\246_-_Specializing_generic\342\200\246_(5a066394f338af48).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___Leg\342\200\246_-_Specializing_generic\342\200\246_(5a066394f338af48).snap" index 5d28b0b4313b1e..627aa2e7b91221 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___Leg\342\200\246_-_Specializing_generic\342\200\246_(5a066394f338af48).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___Leg\342\200\246_-_Specializing_generic\342\200\246_(5a066394f338af48).snap" @@ -108,7 +108,6 @@ error[invalid-type-arguments]: Too many type arguments to class `C`: expected 1, | 11 | reveal_type(C[int, int]()) # revealed: C[Unknown] | ^^^ - | ``` @@ -123,7 +122,6 @@ error[invalid-type-arguments]: Type `str` is not assignable to upper bound `int` | 14 | BoundedT = TypeVar("BoundedT", bound=int) | -------- Type variable defined here - | ``` @@ -138,7 +136,6 @@ error[invalid-type-arguments]: Type `int | str` is not assignable to upper bound | 14 | BoundedT = TypeVar("BoundedT", bound=int) | -------- Type variable defined here - | info: element `str` of union `int | str` is not assignable to `int` ``` @@ -154,7 +151,6 @@ error[invalid-type-arguments]: Type `object` does not satisfy constraints `int`, | 34 | ConstrainedT = TypeVar("ConstrainedT", int, str) | ------------ Type variable defined here - | ``` @@ -164,7 +160,6 @@ error[invalid-type-arguments]: Too many type arguments to class `WithDefault`: e | 60 | reveal_type(WithDefault[str, str, str]()) # revealed: WithDefault[Unknown, Unknown] | ^^^ - | ``` @@ -181,7 +176,6 @@ error[invalid-generic-class]: Default of `WithDefaultT2` cannot reference later | ----------------------------------------------------- `WithDefaultT1` defined here 64 | WithDefaultT2 = TypeVar("WithDefaultT2", default=WithDefaultT1) | --------------------------------------------------------------- `WithDefaultT2` defined here - | ``` @@ -198,7 +192,6 @@ error[invalid-generic-class]: Default of `WithDefaultT2` cannot reference later | ----------------------------------------------------- `WithDefaultT1` defined here 64 | WithDefaultT2 = TypeVar("WithDefaultT2", default=WithDefaultT1) | --------------------------------------------------------------- `WithDefaultT2` defined here - | ``` @@ -213,6 +206,5 @@ error[invalid-generic-class]: Default of `Start2T` cannot reference out-of-scope | 81 | Start2T = TypeVar("Start2T", default="StopT") | --------------------------------------------- `Start2T` defined here - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___PEP\342\200\246_-_Default_type_paramet\342\200\246_(6bb09b09c131074).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___PEP\342\200\246_-_Default_type_paramet\342\200\246_(6bb09b09c131074).snap" index c77a605eb2f680..101bcd35c03b61 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___PEP\342\200\246_-_Default_type_paramet\342\200\246_(6bb09b09c131074).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___PEP\342\200\246_-_Default_type_paramet\342\200\246_(6bb09b09c131074).snap" @@ -54,7 +54,6 @@ error[invalid-type-variable-default]: Type parameters with defaults cannot follo | --- ^^^^^^^ `T` has a default | | | `Ts` is a TypeVarTuple - | info: See https://typing.python.org/en/latest/spec/generics.html#defaults-following-typevartuple ``` @@ -67,7 +66,6 @@ error[invalid-type-variable-default]: Type parameters with defaults cannot follo | --- ^^^^^^^^ `T2` has a default | | | `Ts` is a TypeVarTuple - | info: See https://typing.python.org/en/latest/spec/generics.html#defaults-following-typevartuple ``` @@ -81,7 +79,6 @@ error[invalid-type-variable-default]: Type parameters with defaults cannot follo | | | | | `T1` has a default | `Ts` is a TypeVarTuple - | info: See https://typing.python.org/en/latest/spec/generics.html#defaults-following-typevartuple ``` @@ -94,7 +91,6 @@ error[invalid-type-variable-default]: Type parameters with defaults cannot follo | --- ^^^^^^^^^^^^^^^^ `P` has a default | | | `Ts` is a TypeVarTuple - | info: See https://typing.python.org/en/latest/spec/generics.html#defaults-following-typevartuple ``` @@ -108,7 +104,6 @@ error[invalid-type-variable-default]: Type parameters with defaults cannot follo | | | | | `T1` has a default | `Ts` is a TypeVarTuple - | info: See https://typing.python.org/en/latest/spec/generics.html#defaults-following-typevartuple ``` @@ -123,7 +118,6 @@ error[invalid-type-variable-default]: Type parameters with defaults cannot follo | | | `T2` also has a default | | `T1` has a default | `Ts` is a TypeVarTuple - | info: See https://typing.python.org/en/latest/spec/generics.html#defaults-following-typevartuple ``` @@ -136,7 +130,6 @@ error[invalid-type-form]: Generic class `Grault` cannot have multiple `TypeVarTu | --- ^^^^^^^^^^^^^^^^^^^^^^ `Ts` is an additional TypeVarTuple | | | `Us` is the first TypeVarTuple - | info: See https://typing.python.org/en/latest/spec/generics.html#multiple-type-variable-tuples-not-allowed ``` @@ -149,7 +142,6 @@ error[invalid-type-variable-default]: Type parameters with defaults cannot follo | --- ^^^^^^^^^^^^^^^^^^^^^^ `Ts` has a default | | | `Us` is a TypeVarTuple - | info: See https://typing.python.org/en/latest/spec/generics.html#defaults-following-typevartuple ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___PEP\342\200\246_-_Diagnostics_for_bad_\342\200\246_(cf706b07cf0ec31f).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___PEP\342\200\246_-_Diagnostics_for_bad_\342\200\246_(cf706b07cf0ec31f).snap" index 8f16be32649030..65e0a3b234b9a5 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___PEP\342\200\246_-_Diagnostics_for_bad_\342\200\246_(cf706b07cf0ec31f).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___PEP\342\200\246_-_Diagnostics_for_bad_\342\200\246_(cf706b07cf0ec31f).snap" @@ -42,7 +42,6 @@ error[invalid-type-arguments]: Type `int` is not assignable to upper bound `str` | 1 | class Bounded[T: str]: | - Type variable defined here - | ``` @@ -57,6 +56,5 @@ error[invalid-type-arguments]: Type `str` does not satisfy constraints `int`, `b | 4 | class Constrained[U: (int, bytes)]: | - Type variable defined here - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___PEP\342\200\246_-_Scoping_of_typevars_-_No_back-references_(9051beb16a623d36).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___PEP\342\200\246_-_Scoping_of_typevars_-_No_back-references_(9051beb16a623d36).snap" index 7841c6b0343f8f..a3573d2ea09177 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___PEP\342\200\246_-_Scoping_of_typevars_-_No_back-references_(9051beb16a623d36).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___PEP\342\200\246_-_Scoping_of_typevars_-_No_back-references_(9051beb16a623d36).snap" @@ -47,7 +47,6 @@ error[invalid-type-variable-bound]: TypeVar upper bound cannot be generic | 2 | class C[S: T, T]: | ^ - | ``` @@ -57,7 +56,6 @@ error[invalid-type-variable-bound]: TypeVar upper bound cannot be generic | 6 | class D[S, T: S]: | ^ - | ``` @@ -67,7 +65,6 @@ error[invalid-type-variable-constraints]: TypeVar constraint cannot be generic | 10 | class E[S: (int, T), T]: | ^ - | ``` @@ -79,7 +76,6 @@ error[invalid-generic-class]: Default of `S` cannot reference later type paramet | ^^^ ----- ------- `T` defined here | | | `S` defined here - | ``` @@ -91,6 +87,5 @@ error[invalid-generic-class]: Default of `S` cannot reference later type paramet | ^^^^^^^ ----------- ------- `T` defined here | | | `S` defined here - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/concatenate.md_-_`typing.Concatenate`_-_Invalid_uses_of_`Con\342\200\246_-_Last_argument_must_b\342\200\246_(dc429fc3e8c18eaf).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/concatenate.md_-_`typing.Concatenate`_-_Invalid_uses_of_`Con\342\200\246_-_Last_argument_must_b\342\200\246_(dc429fc3e8c18eaf).snap" index a1382a80914c9f..9b98036efb6e33 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/concatenate.md_-_`typing.Concatenate`_-_Invalid_uses_of_`Con\342\200\246_-_Last_argument_must_b\342\200\246_(dc429fc3e8c18eaf).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/concatenate.md_-_`typing.Concatenate`_-_Invalid_uses_of_`Con\342\200\246_-_Last_argument_must_b\342\200\246_(dc429fc3e8c18eaf).snap" @@ -45,7 +45,6 @@ error[invalid-type-arguments]: The last argument to `typing.Concatenate` must be | 7 | def _(c: Callable[Concatenate[int, str], bool]): ... | ^^^ Got `str` - | ``` @@ -55,7 +54,6 @@ error[invalid-type-arguments]: The last argument to `typing.Concatenate` must be | 10 | reveal_type(Foo[Concatenate[int, str]].attr) # revealed: (...) -> None | ^^^ Got `str` - | ``` @@ -65,7 +63,6 @@ error[invalid-type-form]: `typing.Concatenate` is not allowed in this context in | 13 | reveal_type(Foo[Concatenate[int, Concatenate]].attr) # revealed: (...) -> None | ^^^^^^^^^^^ - | info: `typing.Concatenate` is only valid: info: - as the first argument to `Callable` info: - as a type argument for a `ParamSpec` parameter @@ -78,7 +75,6 @@ error[invalid-type-form]: `typing.Concatenate` is not allowed in this context in | 16 | reveal_type(Foo[Concatenate[int, Concatenate[()]]].attr) # revealed: (...) -> None | ^^^^^^^^^^^^^^^ - | info: `typing.Concatenate` is only valid: info: - as the first argument to `Callable` info: - as a type argument for a `ParamSpec` parameter @@ -91,7 +87,6 @@ error[invalid-type-form]: `typing.Concatenate` is not allowed in this context in | 19 | reveal_type(Foo[Concatenate[int, Concatenate[int]]].attr) # revealed: (...) -> None | ^^^^^^^^^^^^^^^^ - | info: `typing.Concatenate` is only valid: info: - as the first argument to `Callable` info: - as a type argument for a `ParamSpec` parameter @@ -104,7 +99,6 @@ error[invalid-type-form]: `typing.Concatenate` is not allowed in this context in | 22 | reveal_type(Foo[Concatenate[int, Concatenate[int, str]]].attr) # revealed: (...) -> None | ^^^^^^^^^^^^^^^^^^^^^ - | info: `typing.Concatenate` is only valid: info: - as the first argument to `Callable` info: - as a type argument for a `ParamSpec` parameter diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/concatenate.md_-_`typing.Concatenate`_-_Invalid_uses_of_`Con\342\200\246_-_Nested_`Concatenate`_(86093b62e6e6874c).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/concatenate.md_-_`typing.Concatenate`_-_Invalid_uses_of_`Con\342\200\246_-_Nested_`Concatenate`_(86093b62e6e6874c).snap" index 078e61c2743eb6..ea11c86addc502 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/concatenate.md_-_`typing.Concatenate`_-_Invalid_uses_of_`Con\342\200\246_-_Nested_`Concatenate`_(86093b62e6e6874c).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/concatenate.md_-_`typing.Concatenate`_-_Invalid_uses_of_`Con\342\200\246_-_Nested_`Concatenate`_(86093b62e6e6874c).snap" @@ -34,7 +34,6 @@ error[invalid-type-form]: `typing.Concatenate` is not allowed in this context in | 5 | c: Callable[Concatenate[Concatenate[int, ...], P], None], | ^^^^^^^^^^^^^^^^^^^^^ - | info: `typing.Concatenate` is only valid: info: - as the first argument to `Callable` info: - as a type argument for a `ParamSpec` parameter @@ -47,7 +46,6 @@ error[invalid-type-form]: `typing.Concatenate` is not allowed in this context in | 7 | d: Callable[Concatenate[Concatenate, P], int], | ^^^^^^^^^^^ - | info: `typing.Concatenate` is only valid: info: - as the first argument to `Callable` info: - as a type argument for a `ParamSpec` parameter @@ -60,7 +58,6 @@ error[invalid-type-form]: `typing.Concatenate` is not allowed in this context in | 9 | e: Callable[Concatenate[int, Concatenate[int, ...]], None], | ^^^^^^^^^^^^^^^^^^^^^ - | info: `typing.Concatenate` is only valid: info: - as the first argument to `Callable` info: - as a type argument for a `ParamSpec` parameter diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/concatenate.md_-_`typing.Concatenate`_-_Invalid_uses_of_`Con\342\200\246_-_Standalone_annotatio\342\200\246_(bb5fe70ded875e4).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/concatenate.md_-_`typing.Concatenate`_-_Invalid_uses_of_`Con\342\200\246_-_Standalone_annotatio\342\200\246_(bb5fe70ded875e4).snap" index 51a5e5ae30360c..fd0155652e4ad7 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/concatenate.md_-_`typing.Concatenate`_-_Invalid_uses_of_`Con\342\200\246_-_Standalone_annotatio\342\200\246_(bb5fe70ded875e4).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/concatenate.md_-_`typing.Concatenate`_-_Invalid_uses_of_`Con\342\200\246_-_Standalone_annotatio\342\200\246_(bb5fe70ded875e4).snap" @@ -51,7 +51,6 @@ error[invalid-type-form]: `typing.Concatenate` is not allowed in this context in | 6 | def invalid0(x: Concatenate): ... | ^^^^^^^^^^^ - | info: `typing.Concatenate` is only valid: info: - as the first argument to `Callable` info: - as a type argument for a `ParamSpec` parameter @@ -64,7 +63,6 @@ error[invalid-type-form]: `typing.Concatenate` is not allowed in this context in | 9 | def invalid1(x: Concatenate[int]): ... | ^^^^^^^^^^^^^^^^ - | info: `typing.Concatenate` is only valid: info: - as the first argument to `Callable` info: - as a type argument for a `ParamSpec` parameter @@ -77,7 +75,6 @@ error[invalid-type-form]: `typing.Concatenate` is not allowed in this context in | 12 | def invalid2(x: Concatenate[int, ...]) -> None: ... | ^^^^^^^^^^^^^^^^^^^^^ - | info: `typing.Concatenate` is only valid: info: - as the first argument to `Callable` info: - as a type argument for a `ParamSpec` parameter @@ -90,7 +87,6 @@ error[invalid-type-form]: `typing.Concatenate` is not allowed in this context in | 15 | def invalid3() -> Concatenate[int, ...]: ... | ^^^^^^^^^^^^^^^^^^^^^ - | info: `typing.Concatenate` is only valid: info: - as the first argument to `Callable` info: - as a type argument for a `ParamSpec` parameter @@ -103,7 +99,6 @@ error[invalid-type-form]: `typing.Concatenate` is not allowed in this context in | 18 | def invalid4() -> Concatenate[()]: ... | ^^^^^^^^^^^^^^^ - | info: `typing.Concatenate` is only valid: info: - as the first argument to `Callable` info: - as a type argument for a `ParamSpec` parameter @@ -116,7 +111,6 @@ error[invalid-type-form]: `typing.Concatenate` is not allowed in this context in | 21 | a: Concatenate | ^^^^^^^^^^^ - | info: `typing.Concatenate` is only valid: info: - as the first argument to `Callable` info: - as a type argument for a `ParamSpec` parameter @@ -129,7 +123,6 @@ error[invalid-type-form]: `typing.Concatenate` is not allowed in this context in | 25 | b: Concatenate[int, P] | ^^^^^^^^^^^^^^^^^^^ - | info: `typing.Concatenate` is only valid: info: - as the first argument to `Callable` info: - as a type argument for a `ParamSpec` parameter @@ -142,7 +135,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a p | 28 | def invalid5[**P](x: Foo[Concatenate[P, ...]]) -> None: ... | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/concatenate.md_-_`typing.Concatenate`_-_Invalid_uses_of_`Con\342\200\246_-_Too_few_arguments_(efcf77cdbde3ff86).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/concatenate.md_-_`typing.Concatenate`_-_Invalid_uses_of_`Con\342\200\246_-_Too_few_arguments_(efcf77cdbde3ff86).snap" index ee8239753353d2..b39470307cf862 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/concatenate.md_-_`typing.Concatenate`_-_Invalid_uses_of_`Con\342\200\246_-_Too_few_arguments_(efcf77cdbde3ff86).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/concatenate.md_-_`typing.Concatenate`_-_Invalid_uses_of_`Con\342\200\246_-_Too_few_arguments_(efcf77cdbde3ff86).snap" @@ -74,7 +74,6 @@ error[invalid-type-form]: `typing.Concatenate` requires at least 2 arguments whe | 8 | a: Callable[Concatenate[()], int], | ^^^^^^^^^^^^^^^ - | ``` @@ -84,7 +83,6 @@ error[invalid-type-form]: `typing.Concatenate` requires at least 2 arguments whe | 10 | b: Callable[Concatenate[int], int], | ^^^^^^^^^^^^^^^^ - | ``` @@ -94,7 +92,6 @@ error[invalid-type-form]: `typing.Concatenate` requires at least 2 arguments whe | 12 | c: Callable[Concatenate[(int,)], int], | ^^^^^^^^^^^^^^^^^^^ - | ``` @@ -104,7 +101,6 @@ error[invalid-type-form]: `typing.Concatenate` requires at least two arguments w | 14 | d: Callable[Concatenate, int], | ^^^^^^^^^^^ - | ``` @@ -114,7 +110,6 @@ error[invalid-type-form]: `typing.Concatenate` requires at least 2 arguments whe | 21 | reveal_type(Foo[Concatenate[()]].attr) # revealed: (...) -> None | ^^^^^^^^^^^^^^^ - | ``` @@ -124,7 +119,6 @@ error[invalid-type-form]: `typing.Concatenate` requires at least 2 arguments whe | 23 | reveal_type(Foo[Concatenate[int]].attr) # revealed: (...) -> None | ^^^^^^^^^^^^^^^^ - | ``` @@ -134,7 +128,6 @@ error[invalid-type-form]: `typing.Concatenate` requires at least 2 arguments whe | 25 | reveal_type(Foo[Concatenate[(int,)]].attr) # revealed: (...) -> None | ^^^^^^^^^^^^^^^^^^^ - | ``` @@ -144,7 +137,6 @@ error[invalid-type-form]: `typing.Concatenate` requires at least two arguments w | 27 | reveal_type(Foo[Concatenate].attr) # revealed: (...) -> None | ^^^^^^^^^^^ - | ``` @@ -154,7 +146,6 @@ error[invalid-type-form]: `typing.Concatenate` is not allowed in this context in | 29 | reveal_type(Foo[[Concatenate]].attr) # revealed: (Unknown, /) -> None | ^^^^^^^^^^^ - | info: `typing.Concatenate` is only valid: info: - as the first argument to `Callable` info: - as a type argument for a `ParamSpec` parameter @@ -167,7 +158,6 @@ error[invalid-type-form]: `typing.Concatenate` is not allowed in this context in | 31 | reveal_type(Foo[[Concatenate, int]].attr) # revealed: (Unknown, int, /) -> None | ^^^^^^^^^^^ - | info: `typing.Concatenate` is only valid: info: - as the first argument to `Callable` info: - as a type argument for a `ParamSpec` parameter @@ -180,7 +170,6 @@ error[invalid-type-form]: `typing.Concatenate` is not allowed in this context in | 34 | reveal_type(Foo[[Concatenate[int], str]].attr) # revealed: (Unknown, str, /) -> None | ^^^^^^^^^^^^^^^^ - | info: `typing.Concatenate` is only valid: info: - as the first argument to `Callable` info: - as a type argument for a `ParamSpec` parameter @@ -193,7 +182,6 @@ error[invalid-type-form]: `typing.Concatenate` is not allowed in this context in | 36 | reveal_type(Foo[[Concatenate[int, str], str]].attr) # revealed: (Unknown, str, /) -> None | ^^^^^^^^^^^^^^^^^^^^^ - | info: `typing.Concatenate` is only valid: info: - as the first argument to `Callable` info: - as a type argument for a `ParamSpec` parameter @@ -206,7 +194,6 @@ error[invalid-type-form]: `typing.Concatenate` is not allowed in this context in | 38 | reveal_type(Foo[[Concatenate[()], str]].attr) # revealed: (Unknown, str, /) -> None | ^^^^^^^^^^^^^^^ - | info: `typing.Concatenate` is only valid: info: - as the first argument to `Callable` info: - as a type argument for a `ParamSpec` parameter @@ -219,7 +206,6 @@ error[invalid-type-form]: `typing.Concatenate` requires at least two arguments w | 48 | reveal_type(Bar[Concatenate, Concatenate].a) # revealed: (...) -> int | ^^^^^^^^^^^ - | ``` @@ -229,7 +215,6 @@ error[invalid-type-form]: `typing.Concatenate` requires at least two arguments w | 48 | reveal_type(Bar[Concatenate, Concatenate].a) # revealed: (...) -> int | ^^^^^^^^^^^ - | ``` @@ -239,7 +224,6 @@ error[invalid-type-form]: `typing.Concatenate` is not allowed in this context in | 51 | reveal_type(Bar[[Concatenate], [Concatenate]].a) # revealed: (Unknown, /) -> int | ^^^^^^^^^^^ - | info: `typing.Concatenate` is only valid: info: - as the first argument to `Callable` info: - as a type argument for a `ParamSpec` parameter @@ -252,7 +236,6 @@ error[invalid-type-form]: `typing.Concatenate` is not allowed in this context in | 51 | reveal_type(Bar[[Concatenate], [Concatenate]].a) # revealed: (Unknown, /) -> int | ^^^^^^^^^^^ - | info: `typing.Concatenate` is only valid: info: - as the first argument to `Callable` info: - as a type argument for a `ParamSpec` parameter diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/deprecated.md_-_Tests_for_the_`@depr\342\200\246_-_Introduction_(cff2724f4c9d28c4).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/deprecated.md_-_Tests_for_the_`@depr\342\200\246_-_Introduction_(cff2724f4c9d28c4).snap" index 45e9ea16871040..4564dd574983f9 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/deprecated.md_-_Tests_for_the_`@depr\342\200\246_-_Introduction_(cff2724f4c9d28c4).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/deprecated.md_-_Tests_for_the_`@depr\342\200\246_-_Introduction_(cff2724f4c9d28c4).snap" @@ -45,7 +45,6 @@ warning[deprecated]: The function `myfunc` is deprecated | 6 | myfunc(1) # error: [deprecated] "use OtherClass" | ^^^^^^ use OtherClass - | ``` @@ -55,7 +54,6 @@ warning[deprecated]: The class `MyClass` is deprecated | 12 | MyClass() # error: [deprecated] "use BetterClass" | ^^^^^^^ use BetterClass - | ``` @@ -65,7 +63,6 @@ warning[deprecated]: The function `afunc` is deprecated | 21 | MyClass.afunc() # error: [deprecated] "use something else" | ^^^^^ use something else - | ``` @@ -75,6 +72,5 @@ warning[deprecated]: The function `amethod` is deprecated | 22 | MyClass().amethod() # error: [deprecated] "don't use this!" | ^^^^^^^ don't use this! - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/deprecated.md_-_Tests_for_the_`@depr\342\200\246_-_Syntax_(142fa2948c3c6cf1).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/deprecated.md_-_Tests_for_the_`@depr\342\200\246_-_Syntax_(142fa2948c3c6cf1).snap" index d84fa4f3024531..624cc4b50a8023 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/deprecated.md_-_Tests_for_the_`@depr\342\200\246_-_Syntax_(142fa2948c3c6cf1).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/deprecated.md_-_Tests_for_the_`@depr\342\200\246_-_Syntax_(142fa2948c3c6cf1).snap" @@ -73,7 +73,6 @@ error[invalid-argument-type]: Argument to class `deprecated` is incorrect | 3 | @deprecated # error: [invalid-argument-type] "LiteralString" | ^^^^^^^^^^^ Expected `LiteralString`, found `def invalid_deco() -> Unknown` - | ``` @@ -83,13 +82,11 @@ error[missing-argument]: No argument provided for required parameter `arg` of bo | 6 | invalid_deco() # error: [missing-argument] | ^^^^^^^^^^^^^^ - | info: Parameter declared here --> stdlib/typing_extensions.pyi:1220:28 | 1220 | def __call__(self, arg: _T, /) -> _T: ... | ^^^^^^^ - | ``` @@ -99,7 +96,6 @@ error[missing-argument]: No argument provided for required parameter `message` o | 9 | @deprecated() # error: [missing-argument] "message" | ^^^^^^^^^^^^ - | ``` @@ -109,7 +105,6 @@ warning[deprecated]: The function `invalid_deco` is deprecated | 20 | invalid_deco() # error: [deprecated] "message" | ^^^^^^^^^^^^ message - | ``` @@ -119,7 +114,6 @@ warning[deprecated]: The function `valid_deco` is deprecated | 29 | valid_deco() # error: [deprecated] | ^^^^^^^^^^ - | ``` @@ -129,7 +123,6 @@ error[invalid-argument-type]: Argument to class `deprecated` is incorrect | 35 | @deprecated(opaque()) # error: [invalid-argument-type] "LiteralString" | ^^^^^^^^ Expected `LiteralString`, found `str` - | ``` @@ -139,7 +132,6 @@ error[unknown-argument]: Argument `dsfsdf` does not match any known parameter of | 41 | @deprecated("some message", dsfsdf="whatever") # error: [unknown-argument] "dsfsdf" | ^^^^^^^^^^^^^^^^^ - | ``` @@ -149,6 +141,5 @@ warning[deprecated]: The function `valid_deco` is deprecated | 50 | valid_deco() # error: [deprecated] "some message" | ^^^^^^^^^^ some message - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Abstract_method_in_g\342\200\246_(6d8b024dda7ced11).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Abstract_method_in_g\342\200\246_(6d8b024dda7ced11).snap" index 97d474c324dbd4..886437d06db308 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Abstract_method_in_g\342\200\246_(6d8b024dda7ced11).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Abstract_method_in_g\342\200\246_(6d8b024dda7ced11).snap" @@ -45,6 +45,5 @@ error[abstract-method-in-final-class]: Final class `Child` has unimplemented abs | ------ 12 | class Child(Parent): # error: [abstract-method-in-final-class] | ^^^^^ `method` is unimplemented - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Basic_case_with_ABC_(21e412599c45972a).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Basic_case_with_ABC_(21e412599c45972a).snap" index 4a35aa96b91fae..37388abf6f14d6 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Basic_case_with_ABC_(21e412599c45972a).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Basic_case_with_ABC_(21e412599c45972a).snap" @@ -41,6 +41,5 @@ error[abstract-method-in-final-class]: Final class `Derived` has unimplemented a | ------ 10 | class Derived(Base): # error: [abstract-method-in-final-class] "Final class `Derived` has unimplemented abstract method `foo`" | ^^^^^^^ `foo` is unimplemented - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(ecae0f4510696c95).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(ecae0f4510696c95).snap" index 6d678dfab67273..047c946360ab05 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(ecae0f4510696c95).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(ecae0f4510696c95).snap" @@ -55,7 +55,6 @@ error[abstract-method-in-final-class]: Final class `Abstract` has unimplemented 7 | / @abstractmethod 8 | | def aaaaaaaaaa(self) -> int: ... | |____________________________________- `aaaaaaaaaa` declared as abstract - | info: rule `abstract-method-in-final-class` is enabled by default ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(f807ff3716d8ab0d).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(f807ff3716d8ab0d).snap" index 68cb8fa1f519c2..3550f7d2707193 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(f807ff3716d8ab0d).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(f807ff3716d8ab0d).snap" @@ -55,7 +55,6 @@ error[abstract-method-in-final-class]: Final class `Abstract` has unimplemented 7 | / @abstractmethod 8 | | def aaaaaaaaaa(self) -> int: ... | |____________________________________- `aaaaaaaaaa` declared as abstract - | info: Use `--verbose` to see all 10 unimplemented abstract methods ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Multiple_abstract_me\342\200\246_(feafee9a4abbe8d1).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Multiple_abstract_me\342\200\246_(feafee9a4abbe8d1).snap" index a48f5f60c84bd9..cc943c02636c9f 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Multiple_abstract_me\342\200\246_(feafee9a4abbe8d1).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Multiple_abstract_me\342\200\246_(feafee9a4abbe8d1).snap" @@ -53,7 +53,6 @@ error[abstract-method-in-final-class]: Final class `MissingAll` has unimplemente 5 | / @abstractmethod 6 | | def foo(self) -> int: ... | |_____________________________- `foo` declared as abstract on superclass `Base` - | ``` @@ -71,6 +70,5 @@ error[abstract-method-in-final-class]: Final class `PartiallyImplemented` has un 9 | / @abstractmethod 10 | | def baz(self) -> None: ... | |______________________________- `baz` declared as abstract on superclass `Base` - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Protocol_with_implic\342\200\246_(e373f31c7a7d88e7).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Protocol_with_implic\342\200\246_(e373f31c7a7d88e7).snap" index 599aeabe428a1c..74d69091de5aa7 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Protocol_with_implic\342\200\246_(e373f31c7a7d88e7).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Protocol_with_implic\342\200\246_(e373f31c7a7d88e7).snap" @@ -178,13 +178,11 @@ error[abstract-method-in-final-class]: Final class `Q` has unimplemented abstrac | ------ 14 | class Q(P): ... # error: [abstract-method-in-final-class] | ^ `still_abstractmethod` is unimplemented - | info: `P.still_abstractmethod` is implicitly abstract because `P` is a `Protocol` class and `still_abstractmethod` lacks an implementation --> src/mdtest_snippet.py:3:7 | 3 | class P(Protocol): | ----------- `P` declared here - | help: Change the body of `still_abstractmethod` to `return` or `return None` if it was not intended to be abstract ``` @@ -200,13 +198,11 @@ error[abstract-method-in-final-class]: Final class `S` has unimplemented abstrac | ------ 21 | class S(R): ... # error: [abstract-method-in-final-class] | ^ `also_still_abstractmethod` is unimplemented - | info: `R.also_still_abstractmethod` is implicitly abstract because `R` is a `Protocol` class and `also_still_abstractmethod` lacks an implementation --> src/mdtest_snippet.py:16:7 | 16 | class R(Protocol): | ----------- `R` declared here - | help: Change the body of `also_still_abstractmethod` to `return` or `return None` if it was not intended to be abstract ``` @@ -223,13 +219,11 @@ error[abstract-method-in-final-class]: Final class `RaisesSub` has unimplemented | ------ 28 | class RaisesSub(Raises): ... # error: [abstract-method-in-final-class] | ^^^^^^^^^ `even_this_is_abstract` is unimplemented - | info: `Raises.even_this_is_abstract` is implicitly abstract because `Raises` is a `Protocol` class and `even_this_is_abstract` lacks an implementation --> src/mdtest_snippet.py:23:7 | 23 | class Raises(Protocol): | ---------------- `Raises` declared here - | ``` @@ -245,13 +239,11 @@ error[abstract-method-in-final-class]: Final class `AlsoRaisesSub` has unimpleme | ------ 35 | class AlsoRaisesSub(AlsoRaises): ... # error: [abstract-method-in-final-class] | ^^^^^^^^^^^^^ `also_abstractmethod` is unimplemented - | info: `AlsoRaises.also_abstractmethod` is implicitly abstract because `AlsoRaises` is a `Protocol` class and `also_abstractmethod` lacks an implementation --> src/mdtest_snippet.py:30:7 | 30 | class AlsoRaises(Protocol): | -------------------- `AlsoRaises` declared here - | ``` @@ -267,13 +259,11 @@ error[abstract-method-in-final-class]: Final class `StrangeSub` has unimplemente | ------ 45 | class StrangeSub(Strange): ... # error: [abstract-method-in-final-class] | ^^^^^^^^^^ `weird_abstractmethod` is unimplemented - | info: `Strange.weird_abstractmethod` is implicitly abstract because `Strange` is a `Protocol` class and `weird_abstractmethod` lacks an implementation --> src/mdtest_snippet.py:40:11 | 40 | class Strange(Protocol): | ----------------- `Strange` declared here - | ``` @@ -288,13 +278,11 @@ error[abstract-method-in-final-class]: Final class `HasOverloadSub` has unimplem | ------ 54 | class HasOverloadSub(HasOverloads): ... # error: [abstract-method-in-final-class] | ^^^^^^^^^^^^^^ `foo` is unimplemented - | info: `HasOverloads.foo` is implicitly abstract because `HasOverloads` is a `Protocol` class and `foo` lacks an implementation --> src/mdtest_snippet.py:47:7 | 47 | class HasOverloads(Protocol): | ---------------------- `HasOverloads` declared here - | ``` @@ -311,13 +299,11 @@ error[abstract-method-in-final-class]: Final class `HasAbstractSub` has unimplem | 72 | def a(self) -> int: ... | ----------------------- `a` declared as abstract on superclass `HasAbstract` - | info: `HasAbstract.a` is implicitly abstract because `HasAbstract` is a `Protocol` class and `a` lacks an implementation --> src/mdtest_snippet.py:71:7 | 71 | class HasAbstract(Protocol): | --------------------- `HasAbstract` declared here - | ``` @@ -335,13 +321,11 @@ error[abstract-method-in-final-class]: Final class `HasAbstract2Sub` has unimple 75 | / def a(self) -> int: 76 | | pass | |____________- `a` declared as abstract on superclass `HasAbstract2` - | info: `HasAbstract2.a` is implicitly abstract because `HasAbstract2` is a `Protocol` class and `a` lacks an implementation --> src/mdtest_snippet.py:74:7 | 74 | class HasAbstract2(Protocol): | ---------------------- `HasAbstract2` declared here - | ``` @@ -358,13 +342,11 @@ error[abstract-method-in-final-class]: Final class `HasAbstract3Sub` has unimple | 83 | def a(self) -> int: | ------------------ `a` declared as abstract on superclass `HasAbstract4` - | info: `HasAbstract4.a` is implicitly abstract because `HasAbstract4` is a `Protocol` class and `a` lacks an implementation --> src/mdtest_snippet.py:82:7 | 82 | class HasAbstract4(Protocol): | ---------------------- `HasAbstract4` declared here - | ``` @@ -381,13 +363,11 @@ error[abstract-method-in-final-class]: Final class `HasAbstract4Sub` has unimple | 83 | def a(self) -> int: | ------------------ `a` declared as abstract on superclass `HasAbstract4` - | info: `HasAbstract4.a` is implicitly abstract because `HasAbstract4` is a `Protocol` class and `a` lacks an implementation --> src/mdtest_snippet.py:82:7 | 82 | class HasAbstract4(Protocol): | ---------------------- `HasAbstract4` declared here - | ``` @@ -404,13 +384,11 @@ error[abstract-method-in-final-class]: Final class `HasAbstract5Sub` has unimple | 88 | def a(self) -> int: | ------------------ `a` declared as abstract on superclass `HasAbstract5` - | info: `HasAbstract5.a` is implicitly abstract because `HasAbstract5` is a `Protocol` class and `a` lacks an implementation --> src/mdtest_snippet.py:87:7 | 87 | class HasAbstract5(Protocol): | ---------------------- `HasAbstract5` declared here - | ``` @@ -427,13 +405,11 @@ error[abstract-method-in-final-class]: Final class `HasAbstract6Sub` has unimple | 93 | def a(self) -> int: | ------------------ `a` declared as abstract on superclass `HasAbstract6` - | info: `HasAbstract6.a` is implicitly abstract because `HasAbstract6` is a `Protocol` class and `a` lacks an implementation --> src/mdtest_snippet.py:92:7 | 92 | class HasAbstract6(Protocol): | ---------------------- `HasAbstract6` declared here - | ``` @@ -451,13 +427,11 @@ error[abstract-method-in-final-class]: Final class `HasAbstract7Sub` has unimple 105 | / def a(self) -> int: 106 | | raise NotImplementedError | |_________________________________- `a` declared as abstract on superclass `HasAbstract7` - | info: `HasAbstract7.a` is implicitly abstract because `HasAbstract7` is a `Protocol` class and `a` lacks an implementation --> src/mdtest_snippet.py:104:7 | 104 | class HasAbstract7(Protocol): | ---------------------- `HasAbstract7` declared here - | ``` @@ -475,13 +449,11 @@ error[abstract-method-in-final-class]: Final class `HasAbstract8Sub` has unimple 109 | / def a(self) -> int: 110 | | raise NotImplementedError() | |___________________________________- `a` declared as abstract on superclass `HasAbstract8` - | info: `HasAbstract8.a` is implicitly abstract because `HasAbstract8` is a `Protocol` class and `a` lacks an implementation --> src/mdtest_snippet.py:108:7 | 108 | class HasAbstract8(Protocol): | ---------------------- `HasAbstract8` declared here - | ``` @@ -498,13 +470,11 @@ error[abstract-method-in-final-class]: Final class `HasAbstract9Sub` has unimple | 113 | def a(self) -> int: | ------------------ `a` declared as abstract on superclass `HasAbstract9` - | info: `HasAbstract9.a` is implicitly abstract because `HasAbstract9` is a `Protocol` class and `a` lacks an implementation --> src/mdtest_snippet.py:112:7 | 112 | class HasAbstract9(Protocol): | ---------------------- `HasAbstract9` declared here - | ``` @@ -521,12 +491,10 @@ error[abstract-method-in-final-class]: Final class `HasAbstract10Sub` has unimpl | 118 | def a(self) -> int: | ------------------ `a` declared as abstract on superclass `HasAbstract10` - | info: `HasAbstract10.a` is implicitly abstract because `HasAbstract10` is a `Protocol` class and `a` lacks an implementation --> src/mdtest_snippet.py:117:7 | 117 | class HasAbstract10(Protocol): | ----------------------- `HasAbstract10` declared here - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_possibly-undefined\342\200\246_(fc7b496fd1986deb).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_possibly-undefined\342\200\246_(fc7b496fd1986deb).snap" index fe1a18dfe390ca..bde456cf8292cc 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_possibly-undefined\342\200\246_(fc7b496fd1986deb).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_possibly-undefined\342\200\246_(fc7b496fd1986deb).snap" @@ -96,7 +96,6 @@ error[override-of-final-method]: Cannot override `A.method1` | 40 | def method1(self) -> None: ... # error: [override-of-final-method] | ^^^^^^^ Overrides a definition from superclass `A` - | info: `A.method1` is decorated with `@final`, forbidding overrides --> src/mdtest_snippet.py:8:9 | @@ -104,7 +103,6 @@ info: `A.method1` is decorated with `@final`, forbidding overrides | ------ 9 | def method1(self) -> None: ... | ------- `A.method1` defined here - | help: Remove the override of `method1` | 39 | class B(A): @@ -122,7 +120,6 @@ error[override-of-final-method]: Cannot override `A.method2` | 41 | def method2(self) -> None: ... # error: [override-of-final-method] | ^^^^^^^ Overrides a definition from superclass `A` - | info: `A.method2` is decorated with `@final`, forbidding overrides --> src/mdtest_snippet.py:18:9 | @@ -130,7 +127,6 @@ info: `A.method2` is decorated with `@final`, forbidding overrides | ------ 19 | def method2(self) -> None: ... | ------- `A.method2` defined here - | help: Remove the override of `method2` | 40 | def method1(self) -> None: ... # error: [override-of-final-method] @@ -148,7 +144,6 @@ error[override-of-final-method]: Cannot override `A.method3` | 42 | def method3(self) -> None: ... # error: [override-of-final-method] | ^^^^^^^ Overrides a definition from superclass `A` - | info: `A.method3` is decorated with `@final`, forbidding overrides --> src/mdtest_snippet.py:22:9 | @@ -156,7 +151,6 @@ info: `A.method3` is decorated with `@final`, forbidding overrides | ------ 23 | def method3(self) -> None: ... | ------- `A.method3` defined here - | help: Remove the override of `method3` | 41 | def method2(self) -> None: ... # error: [override-of-final-method] @@ -174,7 +168,6 @@ error[override-of-final-method]: Cannot override `A.method4` | 49 | method4 = 42 | ^^^^^^^ Overrides a definition from superclass `A` - | info: `A.method4` is decorated with `@final`, forbidding overrides --> src/mdtest_snippet.py:33:9 | @@ -182,7 +175,6 @@ info: `A.method4` is decorated with `@final`, forbidding overrides | ------ 34 | def method4(self) -> None: ... | ------- `A.method4` defined here - | help: Remove the override of `method4` ``` @@ -193,7 +185,6 @@ error[override-of-final-method]: Cannot override `A.method1` | 55 | def method1(self) -> None: ... # error: [override-of-final-method] | ^^^^^^^ Overrides a definition from superclass `A` - | info: `A.method1` is decorated with `@final`, forbidding overrides --> src/mdtest_snippet.py:8:9 | @@ -201,7 +192,6 @@ info: `A.method1` is decorated with `@final`, forbidding overrides | ------ 9 | def method1(self) -> None: ... | ------- `A.method1` defined here - | help: Remove the override of `method1` ``` @@ -212,7 +202,6 @@ error[override-of-final-method]: Cannot override `A.method2` | 61 | def method2(self) -> None: ... # error: [override-of-final-method] | ^^^^^^^ Overrides a definition from superclass `A` - | info: `A.method2` is decorated with `@final`, forbidding overrides --> src/mdtest_snippet.py:18:9 | @@ -220,7 +209,6 @@ info: `A.method2` is decorated with `@final`, forbidding overrides | ------ 19 | def method2(self) -> None: ... | ------- `A.method2` defined here - | help: Remove the override of `method2` ``` @@ -231,7 +219,6 @@ error[override-of-final-method]: Cannot override `A.method3` | 67 | def method3(self) -> None: ... # error: [override-of-final-method] | ^^^^^^^ Overrides a definition from superclass `A` - | info: `A.method3` is decorated with `@final`, forbidding overrides --> src/mdtest_snippet.py:22:9 | @@ -239,7 +226,6 @@ info: `A.method3` is decorated with `@final`, forbidding overrides | ------ 23 | def method3(self) -> None: ... | ------- `A.method3` defined here - | help: Remove the override of `method3` ``` @@ -250,7 +236,6 @@ error[override-of-final-method]: Cannot override `A.method4` | 71 | method4 = 42 # error: [override-of-final-method] | ^^^^^^^ Overrides a definition from superclass `A` - | info: `A.method4` is decorated with `@final`, forbidding overrides --> src/mdtest_snippet.py:33:9 | @@ -258,7 +243,6 @@ info: `A.method4` is decorated with `@final`, forbidding overrides | ------ 34 | def method4(self) -> None: ... | ------- `A.method4` defined here - | help: Remove the override of `method4` ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Cannot_override_a_me\342\200\246_(338615109711a91b).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Cannot_override_a_me\342\200\246_(338615109711a91b).snap" index b744a5683dde67..4e28e306ede31a 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Cannot_override_a_me\342\200\246_(338615109711a91b).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Cannot_override_a_me\342\200\246_(338615109711a91b).snap" @@ -136,7 +136,6 @@ error[override-of-final-method]: Cannot override `Parent.foo` | 42 | def foo(self): ... | ^^^ Overrides a definition from superclass `Parent` - | info: `Parent.foo` is decorated with `@final`, forbidding overrides --> src/mdtest_snippet.pyi:7:5 | @@ -144,7 +143,6 @@ info: `Parent.foo` is decorated with `@final`, forbidding overrides | ------ 8 | def foo(self): ... | --- `Parent.foo` defined here - | help: Remove the override of `foo` | 41 | # error: [override-of-final-method] "Cannot override final member `foo` from superclass `Parent`" @@ -162,7 +160,6 @@ error[override-of-final-method]: Cannot override `Parent.my_property1` | 44 | def my_property1(self) -> int: ... # error: [override-of-final-method] | ^^^^^^^^^^^^ Overrides a definition from superclass `Parent` - | info: `Parent.my_property1` is decorated with `@final`, forbidding overrides --> src/mdtest_snippet.pyi:9:5 | @@ -171,7 +168,6 @@ info: `Parent.my_property1` is decorated with `@final`, forbidding overrides 10 | @property 11 | def my_property1(self) -> int: ... | ------------ `Parent.my_property1` defined here - | help: Remove the override of `my_property1` ``` @@ -182,7 +178,6 @@ error[override-of-final-method]: Cannot override `Parent.my_property2` | 46 | def my_property2(self) -> int: ... # error: [override-of-final-method] | ^^^^^^^^^^^^ Overrides a definition from superclass `Parent` - | info: `Parent.my_property2` is decorated with `@final`, forbidding overrides --> src/mdtest_snippet.pyi:13:5 | @@ -190,7 +185,6 @@ info: `Parent.my_property2` is decorated with `@final`, forbidding overrides | ------ 14 | def my_property2(self) -> int: ... | ------------ `Parent.my_property2` defined here - | help: Remove the getter and setter for `my_property2` ``` @@ -201,7 +195,6 @@ error[override-of-final-method]: Cannot override `Parent.my_property3` | 50 | def my_property3(self) -> int: ... # error: [override-of-final-method] | ^^^^^^^^^^^^ Overrides a definition from superclass `Parent` - | info: `Parent.my_property3` is decorated with `@final`, forbidding overrides --> src/mdtest_snippet.pyi:16:5 | @@ -209,7 +202,6 @@ info: `Parent.my_property3` is decorated with `@final`, forbidding overrides | ------ 17 | def my_property3(self) -> int: ... | ------------ `Parent.my_property3` defined here - | help: Remove the override of `my_property3` ``` @@ -220,7 +212,6 @@ error[override-of-final-method]: Cannot override `Parent.class_method1` | 54 | def class_method1(cls) -> int: ... # error: [override-of-final-method] | ^^^^^^^^^^^^^ Overrides a definition from superclass `Parent` - | info: `Parent.class_method1` is decorated with `@final`, forbidding overrides --> src/mdtest_snippet.pyi:18:5 | @@ -229,7 +220,6 @@ info: `Parent.class_method1` is decorated with `@final`, forbidding overrides 19 | @classmethod 20 | def class_method1(cls) -> int: ... | ------------- `Parent.class_method1` defined here - | help: Remove the override of `class_method1` | 52 | def my_property3(self) -> None: ... @@ -248,7 +238,6 @@ error[override-of-final-method]: Cannot override `Parent.static_method1` | 56 | def static_method1() -> int: ... # error: [override-of-final-method] | ^^^^^^^^^^^^^^ Overrides a definition from superclass `Parent` - | info: `Parent.static_method1` is decorated with `@final`, forbidding overrides --> src/mdtest_snippet.pyi:24:5 | @@ -257,7 +246,6 @@ info: `Parent.static_method1` is decorated with `@final`, forbidding overrides 25 | @staticmethod 26 | def static_method1() -> int: ... | -------------- `Parent.static_method1` defined here - | help: Remove the override of `static_method1` | 54 | def class_method1(cls) -> int: ... # error: [override-of-final-method] @@ -276,7 +264,6 @@ error[override-of-final-method]: Cannot override `Parent.class_method2` | 58 | def class_method2(cls) -> int: ... # error: [override-of-final-method] | ^^^^^^^^^^^^^ Overrides a definition from superclass `Parent` - | info: `Parent.class_method2` is decorated with `@final`, forbidding overrides --> src/mdtest_snippet.pyi:22:5 | @@ -284,7 +271,6 @@ info: `Parent.class_method2` is decorated with `@final`, forbidding overrides | ------ 23 | def class_method2(cls) -> int: ... | ------------- `Parent.class_method2` defined here - | help: Remove the override of `class_method2` | 56 | def static_method1() -> int: ... # error: [override-of-final-method] @@ -303,7 +289,6 @@ error[override-of-final-method]: Cannot override `Parent.static_method2` | 60 | def static_method2() -> int: ... # error: [override-of-final-method] | ^^^^^^^^^^^^^^ Overrides a definition from superclass `Parent` - | info: `Parent.static_method2` is decorated with `@final`, forbidding overrides --> src/mdtest_snippet.pyi:28:5 | @@ -311,7 +296,6 @@ info: `Parent.static_method2` is decorated with `@final`, forbidding overrides | ------ 29 | def static_method2() -> int: ... | -------------- `Parent.static_method2` defined here - | help: Remove the override of `static_method2` | 58 | def class_method2(cls) -> int: ... # error: [override-of-final-method] @@ -335,7 +319,6 @@ error[invalid-method-override]: Invalid override of method `foo` | 8 | def foo(self): ... | --------- `Parent.foo` defined here - | info: `Grandchild.foo` is a staticmethod but `Parent.foo` is an instance method info: This violates the Liskov Substitution Principle @@ -347,7 +330,6 @@ error[override-of-final-method]: Cannot override `Parent.foo` | 75 | def foo(): ... | ^^^ Overrides a definition from superclass `Parent` - | info: `Parent.foo` is decorated with `@final`, forbidding overrides --> src/mdtest_snippet.pyi:7:5 | @@ -355,7 +337,6 @@ info: `Parent.foo` is decorated with `@final`, forbidding overrides | ------ 8 | def foo(self): ... | --- `Parent.foo` defined here - | help: Remove the override of `foo` | 71 | # concern of Liskov. @@ -376,7 +357,6 @@ error[override-of-final-method]: Cannot override `Parent.my_property1` | 79 | def my_property1(self) -> str: ... | ^^^^^^^^^^^^ Overrides a definition from superclass `Parent` - | info: `Parent.my_property1` is decorated with `@final`, forbidding overrides --> src/mdtest_snippet.pyi:9:5 | @@ -385,7 +365,6 @@ info: `Parent.my_property1` is decorated with `@final`, forbidding overrides 10 | @property 11 | def my_property1(self) -> int: ... | ------------ `Parent.my_property1` defined here - | help: Remove the override of `my_property1` ``` @@ -396,7 +375,6 @@ error[override-of-final-method]: Cannot override `Parent.class_method1` | 82 | class_method1 = None | ^^^^^^^^^^^^^ Overrides a definition from superclass `Parent` - | info: `Parent.class_method1` is decorated with `@final`, forbidding overrides --> src/mdtest_snippet.pyi:18:5 | @@ -405,7 +383,6 @@ info: `Parent.class_method1` is decorated with `@final`, forbidding overrides 19 | @classmethod 20 | def class_method1(cls) -> int: ... | ------------- `Parent.class_method1` defined here - | help: Remove the override of `class_method1` ``` @@ -416,7 +393,6 @@ error[override-of-final-method]: Cannot override `Foo.bar` | 113 | def bar(self): ... # error: [override-of-final-method] | ^^^ Overrides a definition from superclass `Foo` - | info: `Foo.bar` is decorated with `@final`, forbidding overrides --> src/mdtest_snippet.pyi:91:5 | @@ -427,7 +403,6 @@ info: `Foo.bar` is decorated with `@final`, forbidding overrides | 110 | def bar(self): ... | --- `Foo.bar` defined here - | help: Remove the override of `bar` | 112 | class Baz(Foo): diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Diagnostic_edge_case\342\200\246_(2389d52c5ecfa2bd).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Diagnostic_edge_case\342\200\246_(2389d52c5ecfa2bd).snap" index 118991dde6d7c4..3e3f8481ac8c17 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Diagnostic_edge_case\342\200\246_(2389d52c5ecfa2bd).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Diagnostic_edge_case\342\200\246_(2389d52c5ecfa2bd).snap" @@ -37,7 +37,6 @@ error[override-of-final-method]: Cannot override `module1.Foo.f` | 4 | def f(self): ... # error: [override-of-final-method] | ^ Overrides a definition from superclass `module1.Foo` - | info: `module1.Foo.f` is decorated with `@final`, forbidding overrides --> src/module1.py:4:5 | @@ -45,7 +44,6 @@ info: `module1.Foo.f` is decorated with `@final`, forbidding overrides | ------ 5 | def f(self): ... | - `module1.Foo.f` defined here - | help: Remove the override of `f` | 3 | class Foo(module1.Foo): diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Only_the_first_`@fin\342\200\246_(9863b583f4c651c5).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Only_the_first_`@fin\342\200\246_(9863b583f4c651c5).snap" index 74f25111d2f26a..47bd4c9ad4fbc8 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Only_the_first_`@fin\342\200\246_(9863b583f4c651c5).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Only_the_first_`@fin\342\200\246_(9863b583f4c651c5).snap" @@ -37,7 +37,6 @@ error[override-of-final-method]: Cannot override `A.f` | 9 | def f(self): ... # error: [override-of-final-method] | ^ Overrides a definition from superclass `A` - | info: `A.f` is decorated with `@final`, forbidding overrides --> src/mdtest_snippet.py:4:5 | @@ -45,7 +44,6 @@ info: `A.f` is decorated with `@final`, forbidding overrides | ------ 5 | def f(self): ... | - `A.f` defined here - | help: Remove the override of `f` | 7 | class B(A): @@ -64,7 +62,6 @@ error[override-of-final-method]: Cannot override `B.f` | 14 | def f(self): ... # error: [override-of-final-method] | ^ Overrides a definition from superclass `B` - | info: `B.f` is decorated with `@final`, forbidding overrides --> src/mdtest_snippet.py:8:5 | @@ -72,7 +69,6 @@ info: `B.f` is decorated with `@final`, forbidding overrides | ------ 9 | def f(self): ... # error: [override-of-final-method] | - `B.f` defined here - | help: Remove the override of `f` | 11 | class C(B): diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Overloaded_methods_d\342\200\246_(861757f48340ed92).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Overloaded_methods_d\342\200\246_(861757f48340ed92).snap" index 5bfde0fbfacd0f..065ada538e9129 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Overloaded_methods_d\342\200\246_(861757f48340ed92).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Overloaded_methods_d\342\200\246_(861757f48340ed92).snap" @@ -135,7 +135,6 @@ error[override-of-final-method]: Cannot override `Good.bar` | 19 | def bar(self, x: int) -> int: ... # error: [override-of-final-method] | ^^^ Overrides a definition from superclass `Good` - | info: `Good.bar` is decorated with `@final`, forbidding overrides --> src/stub.pyi:5:5 | @@ -143,7 +142,6 @@ info: `Good.bar` is decorated with `@final`, forbidding overrides | ------ 6 | def bar(self, x: str) -> str: ... | --- `Good.bar` defined here - | help: Remove all overloads for `bar` | 15 | class ChildOfGood(Good): @@ -165,7 +163,6 @@ error[override-of-final-method]: Cannot override `Good.baz` | 23 | def baz(self, x: int) -> int: ... # error: [override-of-final-method] | ^^^ Overrides a definition from superclass `Good` - | info: `Good.baz` is decorated with `@final`, forbidding overrides --> src/stub.pyi:9:5 | @@ -174,7 +171,6 @@ info: `Good.baz` is decorated with `@final`, forbidding overrides 10 | @overload 11 | def baz(self, x: str) -> str: ... | --- `Good.baz` defined here - | help: Remove all overloads for `baz` | 19 | def bar(self, x: int) -> int: ... # error: [override-of-final-method] @@ -203,7 +199,6 @@ error[invalid-overload]: `@final` decorator should be applied only to the first 30 | # error: [invalid-overload] 31 | def bar(self, x: int) -> int: ... | ^^^ - | ``` @@ -220,7 +215,6 @@ error[invalid-overload]: `@final` decorator should be applied only to the first 36 | # error: [invalid-overload] 37 | def baz(self, x: int) -> int: ... | ^^^ - | ``` @@ -230,13 +224,11 @@ error[override-of-final-method]: Cannot override `Bad.bar` | 43 | def bar(self, x: int) -> int: ... # error: [override-of-final-method] | ^^^ Overrides a definition from superclass `Bad` - | info: `Bad.bar` is decorated with `@final`, forbidding overrides --> src/stub.pyi:27:9 | 27 | def bar(self, x: str) -> str: ... | --- `Bad.bar` defined here - | help: Remove all overloads for `bar` | 39 | class ChildOfBad(Bad): @@ -258,13 +250,11 @@ error[override-of-final-method]: Cannot override `Bad.baz` | 47 | def baz(self, x: int) -> int: ... # error: [override-of-final-method] | ^^^ Overrides a definition from superclass `Bad` - | info: `Bad.baz` is decorated with `@final`, forbidding overrides --> src/stub.pyi:33:9 | 33 | def baz(self, x: str) -> str: ... | --- `Bad.baz` defined here - | help: Remove all overloads for `baz` | 43 | def bar(self, x: int) -> int: ... # error: [override-of-final-method] @@ -285,7 +275,6 @@ error[override-of-final-method]: Cannot override `Good.f` | 19 | def f(self, x: int | str) -> int | str: | ^ Overrides a definition from superclass `Good` - | info: `Good.f` is decorated with `@final`, forbidding overrides --> src/main.py:8:5 | @@ -293,7 +282,6 @@ info: `Good.f` is decorated with `@final`, forbidding overrides | ------ 9 | def f(self, x: int | str) -> int | str: | - `Good.f` defined here - | help: Remove all overloads and the implementation for `f` | 12 | class ChildOfGood(Good): @@ -328,7 +316,6 @@ error[invalid-overload]: `@final` decorator should be applied only to the overlo 27 | def f(self, x: int) -> int: ... 28 | def f(self, x: int | str) -> int | str: | - Implementation defined here - | ``` @@ -346,7 +333,6 @@ error[invalid-overload]: `@final` decorator should be applied only to the overlo 35 | def g(self, x: int) -> int: ... 36 | def g(self, x: int | str) -> int | str: | - Implementation defined here - | ``` @@ -362,7 +348,6 @@ error[invalid-overload]: `@final` decorator should be applied only to the overlo | ^ 44 | def h(self, x: int | str) -> int | str: | - Implementation defined here - | ``` @@ -378,7 +363,6 @@ error[invalid-overload]: `@final` decorator should be applied only to the overlo | ^ 52 | def i(self, x: int | str) -> int | str: | - Implementation defined here - | ``` @@ -388,13 +372,11 @@ error[override-of-final-method]: Cannot override `Bad.f` | 57 | f = None # error: [override-of-final-method] | ^ Overrides a definition from superclass `Bad` - | info: `Bad.f` is decorated with `@final`, forbidding overrides --> src/main.py:28:9 | 28 | def f(self, x: int | str) -> int | str: | - `Bad.f` defined here - | help: Remove the override of `f` ``` @@ -405,13 +387,11 @@ error[override-of-final-method]: Cannot override `Bad.g` | 58 | g = None # error: [override-of-final-method] | ^ Overrides a definition from superclass `Bad` - | info: `Bad.g` is decorated with `@final`, forbidding overrides --> src/main.py:36:9 | 36 | def g(self, x: int | str) -> int | str: | - `Bad.g` defined here - | help: Remove the override of `g` ``` @@ -422,13 +402,11 @@ error[override-of-final-method]: Cannot override `Bad.h` | 59 | h = None # error: [override-of-final-method] | ^ Overrides a definition from superclass `Bad` - | info: `Bad.h` is decorated with `@final`, forbidding overrides --> src/main.py:44:9 | 44 | def h(self, x: int | str) -> int | str: | - `Bad.h` defined here - | help: Remove the override of `h` ``` @@ -439,13 +417,11 @@ error[override-of-final-method]: Cannot override `Bad.i` | 60 | i = None # error: [override-of-final-method] | ^ Overrides a definition from superclass `Bad` - | info: `Bad.i` is decorated with `@final`, forbidding overrides --> src/main.py:52:9 | 52 | def i(self, x: int | str) -> int | str: | - `Bad.i` defined here - | help: Remove the override of `i` ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Overloads_in_statica\342\200\246_(29a698d9deaf7318).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Overloads_in_statica\342\200\246_(29a698d9deaf7318).snap" index 48b157a1827cb8..4df9b8fbff9b46 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Overloads_in_statica\342\200\246_(29a698d9deaf7318).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Overloads_in_statica\342\200\246_(29a698d9deaf7318).snap" @@ -61,7 +61,6 @@ error[override-of-final-method]: Cannot override `Foo.method` | 31 | def method(self, x: str) -> str: ... # error: [override-of-final-method] | ^^^^^^ Overrides a definition from superclass `Foo` - | info: `Foo.method` is decorated with `@final`, forbidding overrides --> src/mdtest_snippet.pyi:7:9 | @@ -69,7 +68,6 @@ info: `Foo.method` is decorated with `@final`, forbidding overrides | ------ 8 | def method(self, x: int) -> int: ... | ------ `Foo.method` defined here - | help: Remove all overloads for `method` | 27 | class Bar(Foo): diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Overriding_a_`@final\342\200\246_(c004aaab38745318).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Overriding_a_`@final\342\200\246_(c004aaab38745318).snap" index ba4dbf723196b3..d4f5078b9db475 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Overriding_a_`@final\342\200\246_(c004aaab38745318).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Overriding_a_`@final\342\200\246_(c004aaab38745318).snap" @@ -44,7 +44,6 @@ error[override-of-final-method]: Cannot override `Base.method` | 5 | method = replacement_method # error: [override-of-final-method] | ^^^^^^ Overrides a definition from superclass `Base` - | info: `Base.method` is decorated with `@final`, forbidding overrides --> src/base.py:4:5 | @@ -52,7 +51,6 @@ info: `Base.method` is decorated with `@final`, forbidding overrides | ------ 5 | def method(self) -> None: ... | ------ `Base.method` defined here - | help: Remove the override of `method` ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/function.md_-_Call_expression_-_PEP-484_convention_f\342\200\246_(ee99fadd6476677e).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/function.md_-_Call_expression_-_PEP-484_convention_f\342\200\246_(ee99fadd6476677e).snap" index 420e29e2d498a3..30c6a9c64c319d 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/function.md_-_Call_expression_-_PEP-484_convention_f\342\200\246_(ee99fadd6476677e).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/function.md_-_Call_expression_-_PEP-484_convention_f\342\200\246_(ee99fadd6476677e).snap" @@ -89,13 +89,11 @@ error[positional-only-parameter-as-kwarg]: Positional-only parameter 1 (`__x`) p | 5 | f(__x=1) | ^^^^^ - | info: Function signature here --> src/mdtest_snippet.py:1:5 | 1 | def f(__x: int): ... | ^^^^^^^^^^^ - | ``` @@ -107,7 +105,6 @@ warning[invalid-legacy-positional-parameter]: Invalid use of the legacy conventi | - ^^^ Parameter name begins with `__` but will not be treated as positional-only | | | Prior parameter here was positional-or-keyword - | info: A parameter can only be positional-only if it precedes all positional-or-keyword parameters ``` @@ -120,7 +117,6 @@ warning[invalid-legacy-positional-parameter]: Invalid use of the legacy conventi | - ^^^ Parameter name begins with `__` but will not be treated as positional-only | | | Prior parameter here was positional-or-keyword - | info: A parameter can only be positional-only if it precedes all positional-or-keyword parameters ``` @@ -133,7 +129,6 @@ warning[invalid-legacy-positional-parameter]: Invalid use of the legacy conventi | - ^^^ Parameter name begins with `__` but will not be treated as positional-only | | | Prior parameter here was positional-or-keyword - | info: A parameter can only be positional-only if it precedes all positional-or-keyword parameters ``` @@ -146,7 +141,6 @@ warning[invalid-legacy-positional-parameter]: Invalid use of the legacy conventi | - ^^^ Parameter name begins with `__` but will not be treated as positional-only | | | Prior parameter here was positional-or-keyword - | info: A parameter can only be positional-only if it precedes all positional-or-keyword parameters ``` @@ -159,7 +153,6 @@ warning[invalid-legacy-positional-parameter]: Invalid use of the legacy conventi | - ^^^ Parameter name begins with `__` but will not be treated as positional-only | | | Prior parameter here was positional-or-keyword - | info: A parameter can only be positional-only if it precedes all positional-or-keyword parameters ``` @@ -172,7 +165,6 @@ warning[invalid-legacy-positional-parameter]: Invalid use of the legacy conventi | ---- ^^^ Parameter name begins with `__` but will not be treated as positional-only | | | Prior parameter here was positional-or-keyword - | info: A parameter can only be positional-only if it precedes all positional-or-keyword parameters ``` @@ -183,13 +175,11 @@ error[positional-only-parameter-as-kwarg]: Positional-only parameter 2 (`__x`) p | 63 | C(42).method(__x=1) | ^^^^^ - | info: Method signature here --> src/mdtest_snippet.py:49:9 | 49 | def method(self, __x: int): ... | ^^^^^^^^^^^^^^^^^^^^^^ - | ``` @@ -199,12 +189,10 @@ error[positional-only-parameter-as-kwarg]: Positional-only parameter 2 (`__x`) p | 65 | C.class_method(__x="1") | ^^^^^^^ - | info: Method signature here --> src/mdtest_snippet.py:51:9 | 51 | def class_method(cls, __x: str): ... | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/function.md_-_Call_expression_-_Wrong_argument_type_-_Diagnostics_for_unio\342\200\246_(5396a8f9e7f88f71).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/function.md_-_Call_expression_-_Wrong_argument_type_-_Diagnostics_for_unio\342\200\246_(5396a8f9e7f88f71).snap" index dd637fa1cf302c..3163e5ba0201b7 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/function.md_-_Call_expression_-_Wrong_argument_type_-_Diagnostics_for_unio\342\200\246_(5396a8f9e7f88f71).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/function.md_-_Call_expression_-_Wrong_argument_type_-_Diagnostics_for_unio\342\200\246_(5396a8f9e7f88f71).snap" @@ -40,7 +40,6 @@ error[invalid-argument-type]: Argument to function `f` is incorrect | 14 | f(a) # error: [invalid-argument-type] | ^ Expected `Sized`, found `str | Foo` - | info: element `Foo` of union `str | Foo` is not assignable to `Sized` info: └── type `Foo` is not assignable to protocol `Sized` info: └── protocol member `__len__` is not defined on type `Foo` @@ -49,7 +48,6 @@ info: Function defined here | 7 | def f(x: Sized): ... | ^ -------- Parameter declared here - | ``` @@ -59,7 +57,6 @@ error[invalid-argument-type]: Argument to function `f` is incorrect | 15 | f(b) # error: [invalid-argument-type] | ^ Expected `Sized`, found `list[str] | str | dict[str, str] | ... omitted 5 union elements` - | info: element `Foo` of union `list[str] | str | dict[str, str] | ... omitted 5 union elements` is not assignable to `Sized` info: └── type `Foo` is not assignable to protocol `Sized` info: └── protocol member `__len__` is not defined on type `Foo` @@ -68,7 +65,6 @@ info: Function defined here | 7 | def f(x: Sized): ... | ^ -------- Parameter declared here - | ``` @@ -78,7 +74,6 @@ error[invalid-argument-type]: Argument to function `f` is incorrect | 16 | f(c) # error: [invalid-argument-type] | ^ Expected `Sized`, found `list[str] | str | dict[str, str] | ... omitted 6 union elements` - | info: element `Foo` of union `list[str] | str | dict[str, str] | ... omitted 6 union elements` is not assignable to `Sized` info: └── type `Foo` is not assignable to protocol `Sized` info: └── protocol member `__len__` is not defined on type `Foo` @@ -87,7 +82,6 @@ info: Function defined here | 7 | def f(x: Sized): ... | ^ -------- Parameter declared here - | ``` @@ -97,7 +91,6 @@ error[invalid-argument-type]: Argument to function `f` is incorrect | 17 | f(d) # error: [invalid-argument-type] | ^ Expected `Sized`, found `list[str] | str | dict[str, str] | ... omitted 7 union elements` - | info: element `Foo` of union `list[str] | str | dict[str, str] | ... omitted 7 union elements` is not assignable to `Sized` info: └── type `Foo` is not assignable to protocol `Sized` info: └── protocol member `__len__` is not defined on type `Foo` @@ -106,6 +99,5 @@ info: Function defined here | 7 | def f(x: Sized): ... | ^ -------- Parameter declared here - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/instance_layout_conf\342\200\246_-_Tests_for_ty's_`inst\342\200\246_-_Builtins_with_implic\342\200\246_(4c3d127986a58f11).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/instance_layout_conf\342\200\246_-_Tests_for_ty's_`inst\342\200\246_-_Builtins_with_implic\342\200\246_(4c3d127986a58f11).snap" index 41ab66ec3888bc..6e920e9688c6d0 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/instance_layout_conf\342\200\246_-_Tests_for_ty's_`inst\342\200\246_-_Builtins_with_implic\342\200\246_(4c3d127986a58f11).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/instance_layout_conf\342\200\246_-_Tests_for_ty's_`inst\342\200\246_-_Builtins_with_implic\342\200\246_(4c3d127986a58f11).snap" @@ -70,7 +70,6 @@ error[instance-layout-conflict]: Class will raise `TypeError` at runtime due to 7 | | str 8 | | ): ... | |_^ Bases `int` and `str` cannot be combined in multiple inheritance - | info: Two classes cannot coexist in a class's MRO if their instances have incompatible memory layouts --> src/mdtest_snippet.py:6:5 | @@ -78,7 +77,6 @@ info: Two classes cannot coexist in a class's MRO if their instances have incomp | --- `int` instances have a distinct memory layout because of the way `int` is implemented in a C extension 7 | str | --- `str` instances have a distinct memory layout because of the way `str` is implemented in a C extension - | ``` @@ -92,7 +90,6 @@ error[instance-layout-conflict]: Class will raise `TypeError` at runtime due to 15 | | B, 16 | | ): ... | |_^ Bases `int` and `B` cannot be combined in multiple inheritance - | info: Two classes cannot coexist in a class's MRO if their instances have incompatible memory layouts --> src/mdtest_snippet.py:14:5 | @@ -100,7 +97,6 @@ info: Two classes cannot coexist in a class's MRO if their instances have incomp | --- `int` instances have a distinct memory layout because of the way `int` is implemented in a C extension 15 | B, | - `B` instances have a distinct memory layout because `B` defines non-empty `__slots__` - | ``` @@ -114,7 +110,6 @@ error[instance-layout-conflict]: Class will raise `TypeError` at runtime due to 21 | | str 22 | | ): ... | |_^ Bases `D` and `str` cannot be combined in multiple inheritance - | info: Two classes cannot coexist in a class's MRO if their instances have incompatible memory layouts --> src/mdtest_snippet.py:20:5 | @@ -125,7 +120,6 @@ info: Two classes cannot coexist in a class's MRO if their instances have incomp | `int` instances have a distinct memory layout because of the way `int` is implemented in a C extension 21 | str | --- `str` instances have a distinct memory layout because of the way `str` is implemented in a C extension - | ``` @@ -135,7 +129,6 @@ error[instance-layout-conflict]: Class will raise `TypeError` at runtime due to | 24 | class F(int, bytes, bytearray): ... # error: [instance-layout-conflict] | ^^^^^^^^^^^^^^^^^^^^^^^^ Bases `int`, `bytes` and `bytearray` cannot be combined in multiple inheritance - | info: Two classes cannot coexist in a class's MRO if their instances have incompatible memory layouts --> src/mdtest_snippet.py:24:9 | @@ -144,7 +137,6 @@ info: Two classes cannot coexist in a class's MRO if their instances have incomp | | | | | `bytes` instances have a distinct memory layout because of the way `bytes` is implemented in a C extension | `int` instances have a distinct memory layout because of the way `int` is implemented in a C extension - | ``` @@ -154,7 +146,6 @@ error[invalid-typed-dict-header]: `@disjoint_base` cannot be used with `TypedDic | 31 | @disjoint_base # error: [invalid-typed-dict-header] "`@disjoint_base` cannot be used with `TypedDict` class `Movie`" | ^^^^^^^^^^^^^^ - | ``` @@ -164,7 +155,6 @@ error[invalid-protocol]: `@disjoint_base` cannot be used with protocol class `Su | 34 | @disjoint_base # error: [invalid-protocol] "`@disjoint_base` cannot be used with protocol class `SupportsClose`" | ^^^^^^^^^^^^^^ - | ``` @@ -178,7 +168,6 @@ error[instance-layout-conflict]: Class will raise `TypeError` at runtime due to 39 | | H 40 | | ): ... | |_^ Bases `G` and `H` cannot be combined in multiple inheritance - | info: Two classes cannot coexist in a class's MRO if their instances have incompatible memory layouts --> src/mdtest_snippet.py:38:5 | @@ -186,7 +175,6 @@ info: Two classes cannot coexist in a class's MRO if their instances have incomp | - `G` instances have a distinct memory layout because of the way `G` is implemented in a C extension 39 | H | - `H` instances have a distinct memory layout because of the way `H` is implemented in a C extension - | ``` @@ -199,7 +187,6 @@ error[invalid-generic-class]: Inconsistent type arguments for `Sequence` among c | | | | | Later class base inherits from `Sequence[str]` | Earlier class base inherits from `Sequence[int]` - | ``` @@ -209,6 +196,5 @@ error[subclass-of-final-class]: Class `Foo` cannot inherit from final class `ran | 43 | class Foo(range, str): ... # error: [subclass-of-final-class] | ^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/instance_layout_conf\342\200\246_-_Tests_for_ty's_`inst\342\200\246_-_`__slots__`___incompa\342\200\246_(98b54233987eb654).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/instance_layout_conf\342\200\246_-_Tests_for_ty's_`inst\342\200\246_-_`__slots__`___incompa\342\200\246_(98b54233987eb654).snap" index 16814de0fe8e5b..d1c6853a6c7b70 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/instance_layout_conf\342\200\246_-_Tests_for_ty's_`inst\342\200\246_-_`__slots__`___incompa\342\200\246_(98b54233987eb654).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/instance_layout_conf\342\200\246_-_Tests_for_ty's_`inst\342\200\246_-_`__slots__`___incompa\342\200\246_(98b54233987eb654).snap" @@ -37,7 +37,6 @@ error[instance-layout-conflict]: Class will raise `TypeError` at runtime due to 9 | | B, 10 | | ): ... | |_^ Bases `A` and `B` cannot be combined in multiple inheritance - | info: Two classes cannot coexist in a class's MRO if their instances have incompatible memory layouts --> src/mdtest_snippet.py:8:5 | @@ -45,6 +44,5 @@ info: Two classes cannot coexist in a class's MRO if their instances have incomp | - `A` instances have a distinct memory layout because `A` defines non-empty `__slots__` 9 | B, | - `B` instances have a distinct memory layout because `B` defines non-empty `__slots__` - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_AST_nodes_that_are_o\342\200\246_(58a3839a9bc7026d).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_AST_nodes_that_are_o\342\200\246_(58a3839a9bc7026d).snap" index 10f3407bcfb621..eda29190437849 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_AST_nodes_that_are_o\342\200\246_(58a3839a9bc7026d).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_AST_nodes_that_are_o\342\200\246_(58a3839a9bc7026d).snap" @@ -33,7 +33,6 @@ error[invalid-type-form]: Int literals are not allowed in this context in a para | 3 | a: 42, | ^^ Did you mean `typing.Literal[42]`? - | info: See the following page for a reference on valid type expressions: info: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions @@ -45,7 +44,6 @@ error[invalid-type-form]: Bytes literals are not allowed in this context in a pa | 5 | b: b"42", | ^^^^^ Did you mean `typing.Literal[b"42"]`? - | info: See the following page for a reference on valid type expressions: info: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions @@ -57,7 +55,6 @@ error[invalid-type-form]: Boolean literals are not allowed in this context in a | 7 | c: True, | ^^^^ Did you mean `typing.Literal[True]`? - | info: See the following page for a reference on valid type expressions: info: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions @@ -71,7 +68,6 @@ error[invalid-syntax-in-forward-annotation]: Syntax error in forward annotation | --------^^^^^^ | | | Unexpected token at the end of an expression - | help: Did you mean `typing.Literal["invalid syntax"]`? ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_Dict-literal_or_set-\342\200\246_(15737b0beb194b0e).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_Dict-literal_or_set-\342\200\246_(15737b0beb194b0e).snap" index 1227652f2d7e42..b0bbb1b6f8cdc7 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_Dict-literal_or_set-\342\200\246_(15737b0beb194b0e).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_Dict-literal_or_set-\342\200\246_(15737b0beb194b0e).snap" @@ -27,7 +27,6 @@ error[invalid-type-form]: Dict literals are not allowed in parameter annotations | 2 | x: {int: str}, # error: [invalid-type-form] | ^^^^^^^^^^ Did you mean `dict[int, str]`? - | info: See the following page for a reference on valid type expressions: info: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions @@ -39,7 +38,6 @@ error[invalid-type-form]: Set literals are not allowed in parameter annotations | 3 | y: {str}, # error: [invalid-type-form] | ^^^^^ Did you mean `set[str]`? - | info: See the following page for a reference on valid type expressions: info: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_List-literal_used_wh\342\200\246_(ba5cb09eaa3715d8).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_List-literal_used_wh\342\200\246_(ba5cb09eaa3715d8).snap" index 77eeb581248ea8..db6a0ecbd5cb6a 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_List-literal_used_wh\342\200\246_(ba5cb09eaa3715d8).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_List-literal_used_wh\342\200\246_(ba5cb09eaa3715d8).snap" @@ -33,7 +33,6 @@ error[invalid-type-form]: List literals are not allowed in this context in a par | 2 | x: [int], # error: [invalid-type-form] | ^^^^^ Did you mean `list[int]`? - | info: See the following page for a reference on valid type expressions: info: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions @@ -45,7 +44,6 @@ error[invalid-type-form]: List literals are not allowed in this context in a ret | 3 | ) -> [int]: # error: [invalid-type-form] | ^^^^^ Did you mean `list[int]`? - | info: See the following page for a reference on valid type expressions: info: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions @@ -57,7 +55,6 @@ error[invalid-type-form]: List literals are not allowed in this context in a par | 8 | x: [int, str], # error: [invalid-type-form] | ^^^^^^^^^^ - | info: See the following page for a reference on valid type expressions: info: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions @@ -69,7 +66,6 @@ error[invalid-type-form]: List literals are not allowed in this context in a ret | 9 | ) -> [int, str]: # error: [invalid-type-form] | ^^^^^^^^^^ - | info: See the following page for a reference on valid type expressions: info: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_Module-literal_used_\342\200\246_(652fec4fd4a6c63a).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_Module-literal_used_\342\200\246_(652fec4fd4a6c63a).snap" index 9ecce90a246dd7..da667d81c73fc7 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_Module-literal_used_\342\200\246_(652fec4fd4a6c63a).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_Module-literal_used_\342\200\246_(652fec4fd4a6c63a).snap" @@ -41,7 +41,6 @@ error[invalid-type-form]: Module `datetime` is not valid in a parameter annotati 3 | def f(x: datetime): ... # error: [invalid-type-form] | ^^^^^^^^ Did you mean to use the module's member `datetime.datetime`? | - | 2 | - def f(x: datetime): ... # error: [invalid-type-form] 3 + def f(x: datetime.datetime): ... # error: [invalid-type-form] @@ -57,7 +56,6 @@ error[invalid-type-form]: Module `PIL.Image` is not valid in a parameter annotat 3 | def g(x: Image): ... # error: [invalid-type-form] | ^^^^^ Did you mean to use the module's member `Image.Image`? | - | 2 | - def g(x: Image): ... # error: [invalid-type-form] 3 + def g(x: Image.Image): ... # error: [invalid-type-form] diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_Special-cased_diagno\342\200\246_(a4b698196d337a3f).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_Special-cased_diagno\342\200\246_(a4b698196d337a3f).snap" index d575a1c0f92f13..06b07d47046514 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_Special-cased_diagno\342\200\246_(a4b698196d337a3f).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_Special-cased_diagno\342\200\246_(a4b698196d337a3f).snap" @@ -27,7 +27,6 @@ error[invalid-type-form]: Function `callable` is not valid in a parameter annota | 3 | def decorator(fn: callable) -> callable: | ^^^^^^^^ Did you mean `collections.abc.Callable`? - | ``` @@ -37,6 +36,5 @@ error[invalid-type-form]: Function `callable` is not valid in a return type anno | 3 | def decorator(fn: callable) -> callable: | ^^^^^^^^ Did you mean `collections.abc.Callable`? - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_Tuple-literal_used_w\342\200\246_(f61204fc81905069).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_Tuple-literal_used_w\342\200\246_(f61204fc81905069).snap" index 4a6890c7476f61..68d261cc833f78 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_Tuple-literal_used_w\342\200\246_(f61204fc81905069).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_Tuple-literal_used_w\342\200\246_(f61204fc81905069).snap" @@ -35,7 +35,6 @@ error[invalid-type-form]: Tuple literals are not allowed in this context in a pa | 2 | x: (), # error: [invalid-type-form] | ^^ Did you mean `tuple[()]`? - | info: See the following page for a reference on valid type expressions: info: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions @@ -47,7 +46,6 @@ error[invalid-type-form]: Tuple literals are not allowed in this context in a re | 3 | ) -> (): # error: [invalid-type-form] | ^^ Did you mean `tuple[()]`? - | info: See the following page for a reference on valid type expressions: info: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions @@ -59,7 +57,6 @@ error[invalid-type-form]: Tuple literals are not allowed in this context in a pa | 6 | x: (int,), # error: [invalid-type-form] | ^^^^^^ Did you mean `tuple[int]`? - | info: See the following page for a reference on valid type expressions: info: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions @@ -71,7 +68,6 @@ error[invalid-type-form]: Tuple literals are not allowed in this context in a re | 7 | ) -> (int,): # error: [invalid-type-form] | ^^^^^^ Did you mean `tuple[int]`? - | info: See the following page for a reference on valid type expressions: info: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions @@ -83,7 +79,6 @@ error[invalid-type-form]: Tuple literals are not allowed in this context in a pa | 10 | x: (int, str), # error: [invalid-type-form] | ^^^^^^^^^^ Did you mean `tuple[int, str]`? - | info: See the following page for a reference on valid type expressions: info: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions @@ -95,7 +90,6 @@ error[invalid-type-form]: Tuple literals are not allowed in this context in a re | 11 | ) -> (int, str): # error: [invalid-type-form] | ^^^^^^^^^^ Did you mean `tuple[int, str]`? - | info: See the following page for a reference on valid type expressions: info: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Multiple_starred_exp\342\200\246_(3fbab22ead236138).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Multiple_starred_exp\342\200\246_(3fbab22ead236138).snap" index 374334e3240f27..2ad9d772e70159 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Multiple_starred_exp\342\200\246_(3fbab22ead236138).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Multiple_starred_exp\342\200\246_(3fbab22ead236138).snap" @@ -53,7 +53,6 @@ error[invalid-type-form]: Multiple unpacked variadic tuples are not allowed in a | | | | | Later unpacked variadic tuple | First unpacked variadic tuple - | ``` @@ -66,7 +65,6 @@ error[invalid-type-form]: Multiple unpacked variadic tuples are not allowed in a | | | | | Later unpacked variadic tuple | First unpacked variadic tuple - | ``` @@ -79,7 +77,6 @@ error[invalid-type-form]: Multiple unpacked variadic tuples are not allowed in a | | | | | Later unpacked variadic tuple | First unpacked variadic tuple - | ``` @@ -92,7 +89,6 @@ error[invalid-type-form]: Multiple unpacked variadic tuples are not allowed in a | | | | | Later unpacked variadic tuple | First unpacked variadic tuple - | ``` @@ -105,7 +101,6 @@ error[invalid-type-form]: Multiple unpacked variadic tuples are not allowed in a | | | | | Later unpacked variadic tuple | First unpacked variadic tuple - | ``` @@ -118,6 +113,5 @@ error[invalid-type-form]: Multiple unpacked variadic tuples are not allowed in a | | | | | Later unpacked variadic tuple | First unpacked variadic tuple - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Basic_(f15db7dc447d0795).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Basic_(f15db7dc447d0795).snap" index ac7a7f00dda371..916e38516dbd5d 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Basic_(f15db7dc447d0795).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Basic_(f15db7dc447d0795).snap" @@ -30,7 +30,6 @@ error[invalid-await]: `Literal[1]` is not awaitable | 349 | class int: | --- type defined here - | info: `__await__` is missing ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Custom_type_with_mis\342\200\246_(9ce1ee3cd1c9c8d1).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Custom_type_with_mis\342\200\246_(9ce1ee3cd1c9c8d1).snap" index a806e2605ad172..7e1ab9e6ec5db9 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Custom_type_with_mis\342\200\246_(9ce1ee3cd1c9c8d1).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Custom_type_with_mis\342\200\246_(9ce1ee3cd1c9c8d1).snap" @@ -33,7 +33,6 @@ error[invalid-await]: `MissingAwait` is not awaitable | 1 | class MissingAwait: | ------------ type defined here - | info: `__await__` is missing ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Custom_type_with_pos\342\200\246_(a028edbafe180ca).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Custom_type_with_pos\342\200\246_(a028edbafe180ca).snap" index ade20c220ff08e..dddc76738ffc3d 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Custom_type_with_pos\342\200\246_(a028edbafe180ca).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Custom_type_with_pos\342\200\246_(a028edbafe180ca).snap" @@ -37,7 +37,6 @@ error[invalid-await]: `PossiblyUnbound` is not awaitable | 5 | def __await__(self): | --------------- method defined here - | info: `__await__` may be missing ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Invalid_union_return\342\200\246_(fedf62ffaca0f2d7).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Invalid_union_return\342\200\246_(fedf62ffaca0f2d7).snap" index ea978d87eda724..3bddee84b7cd55 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Invalid_union_return\342\200\246_(fedf62ffaca0f2d7).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Invalid_union_return\342\200\246_(fedf62ffaca0f2d7).snap" @@ -37,7 +37,6 @@ error[invalid-await]: `UnawaitableUnion` is not awaitable | 14 | await UnawaitableUnion() # error: [invalid-await] | ^^^^^^^^^^^^^^^^^^ - | info: `__await__` returns `Generator[Any, None, None] | int`, which is not a valid iterator ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Non-callable_`__awai\342\200\246_(9db6c457a98cde25).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Non-callable_`__awai\342\200\246_(9db6c457a98cde25).snap" index c339d15aa53b27..f9e68e60751ff4 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Non-callable_`__awai\342\200\246_(9db6c457a98cde25).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Non-callable_`__awai\342\200\246_(9db6c457a98cde25).snap" @@ -39,7 +39,6 @@ error[invalid-await]: `HasBadAwait` is not awaitable | 2 | __await__ = 42 | --------- attribute defined here - | info: `__await__` is not callable ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Non-callable_`__awai\342\200\246_(d78580fb6720e4ea).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Non-callable_`__awai\342\200\246_(d78580fb6720e4ea).snap" index d05b77257297e5..e76efae52cfe1d 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Non-callable_`__awai\342\200\246_(d78580fb6720e4ea).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Non-callable_`__awai\342\200\246_(d78580fb6720e4ea).snap" @@ -50,7 +50,6 @@ error[invalid-await]: `NonCallableAwait` is not awaitable 4 | async def main() -> None: 5 | await NonCallableAwait() # error: [invalid-await] | ^^^^^^^^^^^^^^^^^^ - | info: `__await__` is not callable ``` @@ -66,7 +65,6 @@ error[invalid-await]: `DeepInheritedNonCallableAwait` is not awaitable | 7 | __await__ = 42 | --------- attribute defined here - | info: `__await__` is not callable ``` @@ -77,7 +75,6 @@ error[invalid-await]: `A | B` is not awaitable | 23 | await x # error: [invalid-await] | ^ - | info: `__await__` is not callable ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Union_type_where_one\342\200\246_(ef7c2c0c8d9b1f0).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Union_type_where_one\342\200\246_(ef7c2c0c8d9b1f0).snap" index 763a73ac3c6a2e..2b52cc1ef6fa42 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Union_type_where_one\342\200\246_(ef7c2c0c8d9b1f0).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Union_type_where_one\342\200\246_(ef7c2c0c8d9b1f0).snap" @@ -36,7 +36,6 @@ error[invalid-await]: `Awaitable | NotAwaitable` is not awaitable | 2 | def __await__(self): | --------------- method defined here - | info: `__await__` may be missing info: `NotAwaitable` does not implement `__await__` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_`__await__`_definiti\342\200\246_(15b05c126b6ae968).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_`__await__`_definiti\342\200\246_(15b05c126b6ae968).snap" index b59b8371657faa..0a8188f0672274 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_`__await__`_definiti\342\200\246_(15b05c126b6ae968).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_`__await__`_definiti\342\200\246_(15b05c126b6ae968).snap" @@ -34,7 +34,6 @@ error[invalid-await]: `InvalidAwaitArgs` is not awaitable | 2 | def __await__(self, value: int): | ------------------ parameters here - | info: `__await__` requires arguments and cannot be called implicitly ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_`__await__`_definiti\342\200\246_(ccb69f512135dd61).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_`__await__`_definiti\342\200\246_(ccb69f512135dd61).snap" index 69d17b266ab1f4..66008853dd6b62 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_`__await__`_definiti\342\200\246_(ccb69f512135dd61).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_`__await__`_definiti\342\200\246_(ccb69f512135dd61).snap" @@ -34,7 +34,6 @@ error[invalid-await]: `InvalidAwaitReturn` is not awaitable | 2 | def __await__(self) -> int: | ---------------------- method defined here - | info: `__await__` returns `int`, which is not a valid iterator ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_type_paramet\342\200\246_-_Invalid_Order_of_Leg\342\200\246_(eaa359e8d6b3031d).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_type_paramet\342\200\246_-_Invalid_Order_of_Leg\342\200\246_(eaa359e8d6b3031d).snap" index f8e178fed23562..99ad2532ab15dd 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_type_paramet\342\200\246_-_Invalid_Order_of_Leg\342\200\246_(eaa359e8d6b3031d).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_type_paramet\342\200\246_-_Invalid_Order_of_Leg\342\200\246_(eaa359e8d6b3031d).snap" @@ -68,7 +68,6 @@ error[invalid-generic-class]: Type parameters without defaults cannot follow typ 4 | 5 | T2 = TypeVar("T2") | ------------------ `T2` defined here - | ``` @@ -90,7 +89,6 @@ error[invalid-generic-class]: Type parameters without defaults cannot follow typ 5 | T2 = TypeVar("T2") 6 | T3 = TypeVar("T3") | ------------------ `T3` defined here - | ``` @@ -111,7 +109,6 @@ error[invalid-generic-class]: Type parameters without defaults cannot follow typ 4 | 5 | T2 = TypeVar("T2") | ------------------ `T2` defined here - | ``` @@ -132,7 +129,6 @@ error[invalid-generic-class]: Type parameters without defaults cannot follow typ 4 | 5 | T2 = TypeVar("T2") | ------------------ `T2` defined here - | ``` @@ -142,7 +138,6 @@ error[invalid-generic-class]: Cannot both inherit from subscripted `Protocol` an | 32 | Protocol[T1, T2, DefaultStrT, T3], | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove the type parameters from the `Protocol` base | 31 | # error: [invalid-generic-class] @@ -171,6 +166,5 @@ error[invalid-generic-class]: Type parameters without defaults cannot follow typ 4 | 5 | T2 = TypeVar("T2") | ------------------ `T2` defined here - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Boolean_parameters_m\342\200\246_(3edf97b20f58fa11).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Boolean_parameters_m\342\200\246_(3edf97b20f58fa11).snap" index f6d155f7e17bc6..127f64be486d5a 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Boolean_parameters_m\342\200\246_(3edf97b20f58fa11).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Boolean_parameters_m\342\200\246_(3edf97b20f58fa11).snap" @@ -36,7 +36,6 @@ error[invalid-legacy-type-variable]: The `covariant` parameter of `TypeVar` cann | 7 | T = TypeVar("T", covariant=cond()) | ^^^^^^ - | ``` @@ -46,7 +45,6 @@ error[invalid-legacy-type-variable]: The `contravariant` parameter of `TypeVar` | 10 | U = TypeVar("U", contravariant=cond()) | ^^^^^^ - | ``` @@ -56,6 +54,5 @@ error[invalid-legacy-type-variable]: The `infer_variance` parameter of `TypeVar` | 13 | V = TypeVar("V", infer_variance=cond()) | ^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Cannot_be_both_covar\342\200\246_(b7b0976739681470).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Cannot_be_both_covar\342\200\246_(b7b0976739681470).snap" index 95f919e749f282..954a6e2b466f07 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Cannot_be_both_covar\342\200\246_(b7b0976739681470).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Cannot_be_both_covar\342\200\246_(b7b0976739681470).snap" @@ -27,6 +27,5 @@ error[invalid-legacy-type-variable]: A `TypeVar` cannot be both covariant and co | 4 | T = TypeVar("T", covariant=True, contravariant=True) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Cannot_have_both_bou\342\200\246_(4ca5f13621915554).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Cannot_have_both_bou\342\200\246_(4ca5f13621915554).snap" index d225dc5f27e80c..faa09184ffb218 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Cannot_have_both_bou\342\200\246_(4ca5f13621915554).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Cannot_have_both_bou\342\200\246_(4ca5f13621915554).snap" @@ -27,6 +27,5 @@ error[invalid-legacy-type-variable]: A `TypeVar` cannot have both a bound and co | 4 | T = TypeVar("T", int, str, bound=bytes) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Cannot_have_only_one\342\200\246_(8b0258f5188209c6).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Cannot_have_only_one\342\200\246_(8b0258f5188209c6).snap" index 1d57404085b840..177dd3cc20e468 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Cannot_have_only_one\342\200\246_(8b0258f5188209c6).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Cannot_have_only_one\342\200\246_(8b0258f5188209c6).snap" @@ -27,6 +27,5 @@ error[invalid-legacy-type-variable]: A `TypeVar` cannot have exactly one constra | 4 | T = TypeVar("T", int) | ^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Invalid_feature_for_\342\200\246_(72827c64b5c73d05).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Invalid_feature_for_\342\200\246_(72827c64b5c73d05).snap" index c9c31ef57fa070..38310e4d41f822 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Invalid_feature_for_\342\200\246_(72827c64b5c73d05).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Invalid_feature_for_\342\200\246_(72827c64b5c73d05).snap" @@ -27,6 +27,5 @@ error[invalid-legacy-type-variable]: The `default` parameter of `typing.TypeVar` | 4 | T = TypeVar("T", default=int) | ^^^^^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Invalid_keyword_argu\342\200\246_(39164266ada3dc2f).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Invalid_keyword_argu\342\200\246_(39164266ada3dc2f).snap" index fb335e4faeabcd..6cac2b9e9c07e7 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Invalid_keyword_argu\342\200\246_(39164266ada3dc2f).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Invalid_keyword_argu\342\200\246_(39164266ada3dc2f).snap" @@ -27,6 +27,5 @@ error[invalid-legacy-type-variable]: Unknown keyword argument `invalid_keyword` | 4 | T = TypeVar("T", invalid_keyword=True) | ^^^^^^^^^^^^^^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Must_be_directly_ass\342\200\246_(c2e3e46852bb268f).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Must_be_directly_ass\342\200\246_(c2e3e46852bb268f).snap" index 359c8f9eda1fc5..8ce6f006e00b91 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Must_be_directly_ass\342\200\246_(c2e3e46852bb268f).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Must_be_directly_ass\342\200\246_(c2e3e46852bb268f).snap" @@ -31,7 +31,6 @@ error[invalid-legacy-type-variable]: A `TypeVar` definition must be a simple var | 5 | U: TypeVar = TypeVar("U") | ^^^^^^^^^^^^ - | ``` @@ -41,6 +40,5 @@ error[invalid-legacy-type-variable]: A `TypeVar` definition must be a simple var | 8 | tuple_with_typevar = ("foo", TypeVar("W")) | ^^^^^^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Must_have_a_name_(79a4ce09338e666b).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Must_have_a_name_(79a4ce09338e666b).snap" index d24e221540691b..14a0c408e7947c 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Must_have_a_name_(79a4ce09338e666b).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Must_have_a_name_(79a4ce09338e666b).snap" @@ -27,6 +27,5 @@ error[invalid-legacy-type-variable]: The `name` parameter of `TypeVar` is requir | 4 | T = TypeVar() | ^^^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Must_not_be_redefine\342\200\246_(b1be57970f924722).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Must_not_be_redefine\342\200\246_(b1be57970f924722).snap" index 91c84bbc35c3f8..e1ef92d90ffc47 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Must_not_be_redefine\342\200\246_(b1be57970f924722).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Must_not_be_redefine\342\200\246_(b1be57970f924722).snap" @@ -33,6 +33,5 @@ error[invalid-legacy-type-variable]: Cannot redefine `T` as a type variable 5 | # error: [invalid-legacy-type-variable] 6 | T = TypeVar("T") | ^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Name_can't_be_given_\342\200\246_(8f6aed0dba79e995).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Name_can't_be_given_\342\200\246_(8f6aed0dba79e995).snap" index 340c9ce49b3a63..83a517ddae0962 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Name_can't_be_given_\342\200\246_(8f6aed0dba79e995).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Name_can't_be_given_\342\200\246_(8f6aed0dba79e995).snap" @@ -27,6 +27,5 @@ error[invalid-legacy-type-variable]: The `name` parameter of `TypeVar` can only | 4 | T = TypeVar("T", name="T") | ^^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_No_variadic_argument\342\200\246_(9d57505425233fd8).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_No_variadic_argument\342\200\246_(9d57505425233fd8).snap" index e998cbb5e7d61e..a114575df78dd4 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_No_variadic_argument\342\200\246_(9d57505425233fd8).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_No_variadic_argument\342\200\246_(9d57505425233fd8).snap" @@ -32,7 +32,6 @@ error[invalid-legacy-type-variable]: Starred arguments are not supported in `Typ | 6 | T = TypeVar("T", *types) | ^^^^^^ - | ``` @@ -42,6 +41,5 @@ error[invalid-legacy-type-variable]: Starred arguments are not supported in `Typ | 9 | S = TypeVar("S", **{"bound": int}) | ^^^^^^^^^^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_`TypeVar`_parameter_\342\200\246_(8424f2b8bc4351f9).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_`TypeVar`_parameter_\342\200\246_(8424f2b8bc4351f9).snap" index 6e440a5f149d48..e6e4e1d4a9b2de 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_`TypeVar`_parameter_\342\200\246_(8424f2b8bc4351f9).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_`TypeVar`_parameter_\342\200\246_(8424f2b8bc4351f9).snap" @@ -27,6 +27,5 @@ warning[mismatched-type-name]: The name passed to `TypeVar` must match the varia | 4 | T = TypeVar("Q") | ^^^ Expected "T", got "Q" - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/missing_argument_par\342\200\246_-_Missing_argument_for\342\200\246_(b632d61c1d75f9fb).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/missing_argument_par\342\200\246_-_Missing_argument_for\342\200\246_(b632d61c1d75f9fb).snap" index c24f7e5519c4a9..5d14c8d9d8f5d8 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/missing_argument_par\342\200\246_-_Missing_argument_for\342\200\246_(b632d61c1d75f9fb).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/missing_argument_par\342\200\246_-_Missing_argument_for\342\200\246_(b632d61c1d75f9fb).snap" @@ -31,7 +31,6 @@ error[missing-argument]: No arguments provided for required parameters `*args`, | 5 | func() # error: [missing-argument] | ^^^^^^ - | info: These arguments are required because `ParamSpec` `P` could represent any set of parameters at runtime ``` @@ -42,7 +41,6 @@ error[missing-argument]: No argument provided for required parameter `**kwargs` | 6 | func(*args) # error: [missing-argument] | ^^^^^^^^^^^ - | info: These arguments are required because `ParamSpec` `P` could represent any set of parameters at runtime ``` @@ -53,7 +51,6 @@ error[missing-argument]: No argument provided for required parameter `*args` | 7 | func(**kwargs) # error: [missing-argument] | ^^^^^^^^^^^^^^ - | info: These arguments are required because `ParamSpec` `P` could represent any set of parameters at runtime ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Or\342\200\246_-_Inline_tuple-literal\342\200\246_(4ee237f49e7ac736).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Or\342\200\246_-_Inline_tuple-literal\342\200\246_(4ee237f49e7ac736).snap" index dc192bc259c02c..12071a81a85f01 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Or\342\200\246_-_Inline_tuple-literal\342\200\246_(4ee237f49e7ac736).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Or\342\200\246_-_Inline_tuple-literal\342\200\246_(4ee237f49e7ac736).snap" @@ -30,7 +30,6 @@ error[duplicate-base]: Duplicate base class `int` | ^^^^^^^^^^^^^^^^^^^^^^^^^ --- ^^^ Class `int` later repeated here | | | Class `int` first included in bases list here - | info: Definition of class `InlineTupleDuplicateBases` will raise `TypeError` at runtime ``` @@ -41,7 +40,6 @@ error[invalid-base]: Invalid class base with type `Literal[1]` | 5 | class InlineTupleInvalidBases(*(int, 1)): ... | ^ - | info: Definition of class `InlineTupleInvalidBases` will raise `TypeError` at runtime ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Or\342\200\246_-_Unresolvable_MROs_in\342\200\246_(e2b355c09a967862).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Or\342\200\246_-_Unresolvable_MROs_in\342\200\246_(e2b355c09a967862).snap" index c3824309d7c63a..353c2c160afc6e 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Or\342\200\246_-_Unresolvable_MROs_in\342\200\246_(e2b355c09a967862).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Or\342\200\246_-_Unresolvable_MROs_in\342\200\246_(e2b355c09a967862).snap" @@ -30,6 +30,5 @@ error[inconsistent-mro]: Cannot create a consistent method resolution order (MRO | 7 | class Baz(Protocol[T], Foo, Bar[T]): ... # error: [inconsistent-mro] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Or\342\200\246_-_`__bases__`_includes\342\200\246_(d2532518c44112c8).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Or\342\200\246_-_`__bases__`_includes\342\200\246_(d2532518c44112c8).snap" index fae0fef2f03733..3577953f289c9d 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Or\342\200\246_-_`__bases__`_includes\342\200\246_(d2532518c44112c8).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Or\342\200\246_-_`__bases__`_includes\342\200\246_(d2532518c44112c8).snap" @@ -51,7 +51,6 @@ warning[unsupported-base]: Unsupported class base | 17 | class Foo(x): ... | ^ Has type ` | ` - | info: ty cannot resolve a consistent method resolution order (MRO) for class `Foo` due to this base info: Only class objects or `Any` are supported as class bases @@ -63,7 +62,6 @@ warning[unsupported-base]: Unsupported class base | 28 | class D(C): ... # error: [unsupported-base] | ^ Has type `.C @ src/mdtest_snippet.py:23:15'> | .C @ src/mdtest_snippet.py:26:15'>` - | info: ty cannot resolve a consistent method resolution order (MRO) for class `D` due to this base info: Only class objects or `Any` are supported as class bases diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Or\342\200\246_-_`__bases__`_lists_th\342\200\246_(6f8d0bf648c4b305).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Or\342\200\246_-_`__bases__`_lists_th\342\200\246_(6f8d0bf648c4b305).snap" index 2f460e3e2c420b..b9469efc223d4a 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Or\342\200\246_-_`__bases__`_lists_th\342\200\246_(6f8d0bf648c4b305).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Or\342\200\246_-_`__bases__`_lists_th\342\200\246_(6f8d0bf648c4b305).snap" @@ -47,7 +47,6 @@ error[invalid-base]: Invalid class base with type `Literal[2]` | 1 | class Foo(2): ... # error: [invalid-base] | ^ - | info: Definition of class `Foo` will raise `TypeError` at runtime ``` @@ -58,7 +57,6 @@ warning[unsupported-base]: Unsupported class base | 6 | class Bar(Foo()): ... # error: [unsupported-base] | ^^^^^ Has type `Foo` - | info: ty cannot resolve a consistent method resolution order (MRO) for class `Bar` due to this base info: Only class objects or `Any` are supported as class bases @@ -70,7 +68,6 @@ error[invalid-base]: Invalid class base with type `Bad1` | 15 | class BadSub1(Bad1()): ... # error: [invalid-base] | ^^^^^^ - | info: Definition of class `BadSub1` will raise `TypeError` at runtime info: An instance type is only a valid class base if it has a valid `__mro_entries__` method info: Type `Bad1` has an `__mro_entries__` method, but it cannot be called with the expected arguments @@ -84,7 +81,6 @@ error[invalid-base]: Invalid class base with type `Bad2` | 16 | class BadSub2(Bad2()): ... # error: [invalid-base] | ^^^^^^ - | info: Definition of class `BadSub2` will raise `TypeError` at runtime info: An instance type is only a valid class base if it has a valid `__mro_entries__` method info: Type `Bad2` has an `__mro_entries__` method, but it does not return a tuple of types @@ -97,7 +93,6 @@ error[invalid-base]: Invalid class base with type `HasMroEntries | NoMroEntries` | 24 | class Foo(base): ... # error: [invalid-base] | ^^^^ - | info: Definition of class `Foo` will raise `TypeError` at runtime info: An instance type is only a valid class base if it has a valid `__mro_entries__` method info: Type `HasMroEntries | NoMroEntries` may have an `__mro_entries__` attribute, but it may be missing diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Or\342\200\246_-_`__bases__`_lists_wi\342\200\246_(ea7ebc83ec359b54).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Or\342\200\246_-_`__bases__`_lists_wi\342\200\246_(ea7ebc83ec359b54).snap" index 6ed04adbfb1713..4cdfd9adc0a5c8 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Or\342\200\246_-_`__bases__`_lists_wi\342\200\246_(ea7ebc83ec359b54).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/mro.md_-_Method_Resolution_Or\342\200\246_-_`__bases__`_lists_wi\342\200\246_(ea7ebc83ec359b54).snap" @@ -91,7 +91,6 @@ error[duplicate-base]: Duplicate base class `str` | ^^^ --- ^^^ Class `str` later repeated here | | | Class `str` first included in bases list here - | info: Definition of class `Foo` will raise `TypeError` at runtime ``` @@ -110,7 +109,6 @@ error[duplicate-base]: Duplicate base class `Eggs` 21 | Spam, 22 | Eggs, | ^^^^ Class `Eggs` later repeated here - | info: Definition of class `Ham` will raise `TypeError` at runtime ``` @@ -128,7 +126,6 @@ error[duplicate-base]: Duplicate base class `Spam` 20 | Baz, 21 | Spam, | ^^^^ Class `Spam` later repeated here - | info: Definition of class `Ham` will raise `TypeError` at runtime ``` @@ -141,7 +138,6 @@ error[duplicate-base]: Duplicate base class `Mushrooms` | ^^^^^^^^ --------- ^^^^^^^^^ Class `Mushrooms` later repeated here | | | Class `Mushrooms` first included in bases list here - | info: Definition of class `Omelette` will raise `TypeError` at runtime ``` @@ -165,7 +161,6 @@ error[duplicate-base]: Duplicate base class `Eggs` 45 | Baz, 46 | Eggs, | ^^^^ Class `Eggs` later repeated here - | info: Definition of class `VeryEggyOmelette` will raise `TypeError` at runtime ``` @@ -180,7 +175,6 @@ error[duplicate-base]: Duplicate base class `A` | - Class `A` first included in bases list here 61 | A | ^ Class `A` later repeated here - | info: Definition of class `C` will raise `TypeError` at runtime ``` @@ -191,7 +185,6 @@ warning[unused-type-ignore-comment]: Unused `type: ignore` directive | 63 | ): # type: ignore[ty:duplicate-base] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove the unused suppression comment | 62 | # error: [unused-type-ignore-comment] diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_Edge_case___multiple_\342\200\246_(f30babd05c89dce9).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_Edge_case___multiple_\342\200\246_(f30babd05c89dce9).snap" index 1dce9a6fbc2e94..1c4e2074c684d2 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_Edge_case___multiple_\342\200\246_(f30babd05c89dce9).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_Edge_case___multiple_\342\200\246_(f30babd05c89dce9).snap" @@ -37,7 +37,6 @@ error[invalid-named-tuple]: NamedTuple field name cannot start with an underscor | 8 | _asdict: bool # error: [invalid-named-tuple] "NamedTuple field `_asdict` cannot start with an underscore" | ^^^^^^^^^^^^^ Class definition will raise `TypeError` at runtime due to this field - | ``` @@ -47,7 +46,6 @@ error[invalid-named-tuple]: Cannot overwrite NamedTuple attribute `_asdict` | 14 | _asdict = True | ^^^^^^^ - | info: This will cause the class creation to fail at runtime ``` @@ -58,7 +56,6 @@ error[invalid-named-tuple]: Cannot overwrite NamedTuple attribute `_asdict` | 14 | _asdict = True | ^^^^^^^ - | info: This will cause the class creation to fail at runtime ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_NamedTuples_cannot_h\342\200\246_(e2ed186fe2b2fc35).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_NamedTuples_cannot_h\342\200\246_(e2ed186fe2b2fc35).snap" index 00c621984e07a4..84df1683505389 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_NamedTuples_cannot_h\342\200\246_(e2ed186fe2b2fc35).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_NamedTuples_cannot_h\342\200\246_(e2ed186fe2b2fc35).snap" @@ -51,7 +51,6 @@ error[invalid-named-tuple]: NamedTuple field name cannot start with an underscor | 5 | _bar: int | ^^^^^^^^^ Class definition will raise `TypeError` at runtime due to this field - | ``` @@ -61,7 +60,6 @@ error[invalid-named-tuple]: Field name `_x` in `NamedTuple()` cannot start with | 15 | Underscore = NamedTuple("Underscore", [("_x", int), ("y", str)]) | ^^^^^^^^^^^^^^^^^^^^^^^^^ Will raise `ValueError` at runtime - | ``` @@ -71,7 +69,6 @@ error[invalid-named-tuple]: Field name `class` in `NamedTuple()` cannot be a Pyt | 19 | Keyword = NamedTuple("Keyword", [("x", int), ("class", str)]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Will raise `ValueError` at runtime - | ``` @@ -81,7 +78,6 @@ error[invalid-named-tuple]: Duplicate field name `x` in `NamedTuple()` | 23 | Duplicate = NamedTuple("Duplicate", [("x", int), ("y", str), ("x", float)]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Field `x` already defined; will raise `ValueError` at runtime - | ``` @@ -91,6 +87,5 @@ error[invalid-named-tuple]: Field name `not valid` in `NamedTuple()` is not a va | 27 | Invalid = NamedTuple("Invalid", [("not valid", int), ("ok", str)]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Will raise `ValueError` at runtime - | ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_`typing.NamedTuple`_-_Definition_(bbf79630502e65e9).snap b/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_`typing.NamedTuple`_-_Definition_(bbf79630502e65e9).snap index 441d9f1d738557..3e06bc9057a4ee 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_`typing.NamedTuple`_-_Definition_(bbf79630502e65e9).snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_`typing.NamedTuple`_-_Definition_(bbf79630502e65e9).snap @@ -48,7 +48,6 @@ error[invalid-named-tuple]: NamedTuple field without default value cannot follow 5 | # error: [invalid-named-tuple] "NamedTuple field without default value cannot follow field(s) with default value(s): Field `latitud… 6 | latitude: float | ^^^^^^^^^^^^^^^ Field `latitude` defined here without a default value - | ``` @@ -63,7 +62,6 @@ error[invalid-named-tuple]: NamedTuple field without default value cannot follow 7 | # error: [invalid-named-tuple] "NamedTuple field without default value cannot follow field(s) with default value(s): Field `longitu… 8 | longitude: float | ^^^^^^^^^^^^^^^^ Field `longitude` defined here without a default value - | ``` @@ -75,7 +73,6 @@ error[invalid-named-tuple]: NamedTuple field without default value cannot follow | --------------------- Earlier field `altitude` defined here with a default value 15 | latitude: float # error: [invalid-named-tuple] | ^^^^^^^^^^^^^^^ Field `latitude` defined here without a default value - | ``` @@ -88,7 +85,6 @@ error[invalid-named-tuple]: NamedTuple field without default value cannot follow 15 | latitude: float # error: [invalid-named-tuple] 16 | longitude: float # error: [invalid-named-tuple] | ^^^^^^^^^^^^^^^^ Field `longitude` defined here without a default value - | ``` @@ -98,7 +94,6 @@ error[invalid-named-tuple]: NamedTuple field without default value cannot follow | 20 | latitude: float # error: [invalid-named-tuple] | ^^^^^^^^^^^^^^^ Field `latitude` defined here without a default value - | info: Earlier field `altitude` was defined with a default value ``` @@ -109,7 +104,6 @@ error[invalid-named-tuple]: NamedTuple field without default value cannot follow | 21 | longitude: float # error: [invalid-named-tuple] | ^^^^^^^^^^^^^^^^ Field `longitude` defined here without a default value - | info: Earlier field `altitude` was defined with a default value ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_`typing.NamedTuple`_-_Multiple_Inheritance_(82ed33d1b3b433d8).snap b/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_`typing.NamedTuple`_-_Multiple_Inheritance_(82ed33d1b3b433d8).snap index e184e4e373bcec..89fb704a2ad0c4 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_`typing.NamedTuple`_-_Multiple_Inheritance_(82ed33d1b3b433d8).snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_`typing.NamedTuple`_-_Multiple_Inheritance_(82ed33d1b3b433d8).snap @@ -57,7 +57,6 @@ error[invalid-named-tuple]: NamedTuple class `C` cannot use multiple inheritance | 4 | class C(NamedTuple, object): | ^^^^^^ - | ``` @@ -67,7 +66,6 @@ error[invalid-named-tuple]: NamedTuple class `D` cannot use multiple inheritance | 10 | int, # error: [invalid-named-tuple] | ^^^ - | ``` @@ -77,6 +75,5 @@ error[invalid-named-tuple]: NamedTuple class `E` cannot use multiple inheritance | 17 | class E(NamedTuple, Protocol): ... | ^^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_`typing.NamedTuple`_-_Name_mismatch_diagno\342\200\246_(8ca723b970e370d0).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_`typing.NamedTuple`_-_Name_mismatch_diagno\342\200\246_(8ca723b970e370d0).snap" index b40529677c85c9..3912a521a65fcd 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_`typing.NamedTuple`_-_Name_mismatch_diagno\342\200\246_(8ca723b970e370d0).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_`typing.NamedTuple`_-_Name_mismatch_diagno\342\200\246_(8ca723b970e370d0).snap" @@ -30,6 +30,5 @@ warning[mismatched-type-name]: The name passed to `NamedTuple` must match the va | 5 | Mismatch = NamedTuple("WrongName", [("x", int)]) | ^^^^^^^^^^^ Expected "Mismatch", got "WrongName" - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_A_class_constructor_\342\200\246_(dd9f8a8f736a329).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_A_class_constructor_\342\200\246_(dd9f8a8f736a329).snap" index 4657987302a747..914ada6c79a65b 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_A_class_constructor_\342\200\246_(dd9f8a8f736a329).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_A_class_constructor_\342\200\246_(dd9f8a8f736a329).snap" @@ -24,7 +24,6 @@ error[no-matching-overload]: No overload of class `type` matches arguments | 1 | type() # error: [no-matching-overload] | ^^^^^^ - | help: `builtins.type()` can either be called with one or three positional arguments (got 0) ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_A_method_call_with_u\342\200\246_(31cb5f881221158e).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_A_method_call_with_u\342\200\246_(31cb5f881221158e).snap" index d9ec2d4d0a2424..892d856520c0c1 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_A_method_call_with_u\342\200\246_(31cb5f881221158e).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_A_method_call_with_u\342\200\246_(31cb5f881221158e).snap" @@ -35,14 +35,12 @@ error[no-matching-overload]: No overload of bound method `Foo.bar` matches argum | 12 | foo.bar(b"wat") # error: [no-matching-overload] | ^^^^^^^^^^^^^^^ - | info: First overload defined here --> src/mdtest_snippet.py:4:5 | 4 | / @overload 5 | | def bar(self, x: int) -> int: ... | |_____________________________________^ First overload defined here - | info: Possible overloads for bound method `bar`: info: (self, x: int) -> int info: (self, x: str) -> str @@ -51,6 +49,5 @@ info: Overload implementation defined here | 8 | def bar(self, x: int | str) -> int | str: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_An_explicit_`__get__\342\200\246_(9ecd21d0927ee1ff).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_An_explicit_`__get__\342\200\246_(9ecd21d0927ee1ff).snap" index 27e1354f70329f..d7aab53c57fa01 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_An_explicit_`__get__\342\200\246_(9ecd21d0927ee1ff).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_An_explicit_`__get__\342\200\246_(9ecd21d0927ee1ff).snap" @@ -35,14 +35,12 @@ error[no-matching-overload]: No overload of method wrapper `__get__` of function | 12 | f.__get__() # error: [no-matching-overload] | ^^^^^^^^^^^ - | info: First overload defined here --> src/mdtest_snippet.py:3:1 | 3 | / @overload 4 | | def f(x: int) -> int: ... | |_________________________^ First overload defined here - | info: Possible overloads for method wrapper `__get__` of function `f`: info: (x: int) -> int info: (x: str) -> str @@ -52,6 +50,5 @@ info: Overload implementation defined here | 9 | def f(x: int | str | bytes) -> int | str | bytes: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_Call_to_function_wit\342\200\246_(dd80c593d9136f35).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_Call_to_function_wit\342\200\246_(dd80c593d9136f35).snap" index 48bd14faf8fde0..a5452d1ef7a9ae 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_Call_to_function_wit\342\200\246_(dd80c593d9136f35).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_Call_to_function_wit\342\200\246_(dd80c593d9136f35).snap" @@ -72,14 +72,12 @@ error[no-matching-overload]: No overload of function `foo` matches arguments | 49 | foo(Foo(), Foo()) # error: [no-matching-overload] | ^^^^^^^^^^^^^^^^^ - | info: First overload defined here --> src/mdtest_snippet.py:5:1 | 5 | / @overload 6 | | def foo(a: int, b: int, c: int): ... | |____________________________________^ First overload defined here - | info: Possible overloads for function `foo`: info: (a: int, b: int, c: int) -> Unknown info: (a: str, b: int, c: int) -> Unknown @@ -107,6 +105,5 @@ info: Overload implementation defined here | 47 | def foo(a, b, c): ... | ^^^^^^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_Call_to_function_wit\342\200\246_(f66e3a8a3977c472).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_Call_to_function_wit\342\200\246_(f66e3a8a3977c472).snap" index fc4dfeafb6342f..8d1907ec94b17b 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_Call_to_function_wit\342\200\246_(f66e3a8a3977c472).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_Call_to_function_wit\342\200\246_(f66e3a8a3977c472).snap" @@ -152,14 +152,12 @@ error[no-matching-overload]: No overload of function `foo` matches arguments | 129 | foo(Foo(), Foo()) # error: [no-matching-overload] | ^^^^^^^^^^^^^^^^^ - | info: First overload defined here --> src/mdtest_snippet.py:5:1 | 5 | / @overload 6 | | def foo(a: int, b: int, c: int): ... | |____________________________________^ First overload defined here - | info: Possible overloads for function `foo`: info: (a: int, b: int, c: int) -> Unknown info: (a: str, b: int, c: int) -> Unknown @@ -217,6 +215,5 @@ info: Overload implementation defined here | 127 | def foo(a, b, c): ... | ^^^^^^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_Calls_to_overloaded_\342\200\246_(3553d085684e16a0).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_Calls_to_overloaded_\342\200\246_(3553d085684e16a0).snap" index 63d8843741ee58..91fc4c1e35eb4e 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_Calls_to_overloaded_\342\200\246_(3553d085684e16a0).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_Calls_to_overloaded_\342\200\246_(3553d085684e16a0).snap" @@ -33,14 +33,12 @@ error[no-matching-overload]: No overload of function `f` matches arguments | 10 | f(b"foo") # error: [no-matching-overload] | ^^^^^^^^^ - | info: First overload defined here --> src/mdtest_snippet.py:3:1 | 3 | / @overload 4 | | def f(x: int) -> int: ... | |_________________________^ First overload defined here - | info: Possible overloads for function `f`: info: (x: int) -> int info: (x: str) -> str @@ -49,6 +47,5 @@ info: Overload implementation defined here | 7 | def f(x: int | str) -> int | str: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_Calls_to_overloaded_\342\200\246_(36814b28492c01d2).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_Calls_to_overloaded_\342\200\246_(36814b28492c01d2).snap" index e641681188fefb..ac0bde43f0e702 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_Calls_to_overloaded_\342\200\246_(36814b28492c01d2).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/no_matching_overload\342\200\246_-_No_matching_overload\342\200\246_-_Calls_to_overloaded_\342\200\246_(36814b28492c01d2).snap" @@ -84,7 +84,6 @@ error[no-matching-overload]: No overload of function `f` matches arguments | 61 | f(b"foo") # error: [no-matching-overload] | ^^^^^^^^^ - | info: First overload defined here --> src/mdtest_snippet.py:3:1 | @@ -108,7 +107,6 @@ info: First overload defined here 20 | | hyena: int, 21 | | ) -> int: ... | |_____________^ First overload defined here - | info: Possible overloads for function `f`: info: (lion: int, turtle: int, tortoise: int, goat: int, capybara: int, chicken: int, ostrich: int, gorilla: int, giraffe: int, condor: int, kangaroo: int, anaconda: int, tarantula: int, millipede: int, leopard: int, hyena: int) -> int info: (lion: str, turtle: str, tortoise: str, goat: str, capybara: str, chicken: str, ostrich: str, gorilla: str, giraffe: str, condor: str, kangaroo: str, anaconda: str, tarantula: str, millipede: str, leopard: str, hyena: str) -> str @@ -135,6 +133,5 @@ info: Overload implementation defined here 57 | | hyena: int | str, 58 | | ) -> int | str: | |______________^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_At_least_two_overloa\342\200\246_(84dadf8abd8f2f2).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_At_least_two_overloa\342\200\246_(84dadf8abd8f2f2).snap" index f5cac57e3e0100..d023427e92b329 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_At_least_two_overloa\342\200\246_(84dadf8abd8f2f2).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_At_least_two_overloa\342\200\246_(84dadf8abd8f2f2).snap" @@ -43,7 +43,6 @@ error[invalid-overload]: Overloaded function `func` requires at least two overlo 4 | # error: [invalid-overload] 5 | def func(x: int) -> int: ... | ^^^^ Only one overload defined here - | ``` @@ -56,6 +55,5 @@ error[invalid-overload]: Overloaded function `func` requires at least two overlo 4 | # error: [invalid-overload] 5 | def func(x: int) -> int: ... | ^^^^ Only one overload defined here - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@classmethod`_(aaa04d4cfa3adaba).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@classmethod`_(aaa04d4cfa3adaba).snap" index 5d1efa29cd1c6d..6fcb7b1c60455a 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@classmethod`_(aaa04d4cfa3adaba).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@classmethod`_(aaa04d4cfa3adaba).snap" @@ -105,7 +105,6 @@ error[invalid-overload]: Overloaded function `try_from1` does not use the `@clas 15 | # error: [invalid-overload] "Overloaded function `try_from1` does not use the `@classmethod` decorator consistently" 16 | def try_from1(cls, x: int | str) -> CheckClassMethod | None: | ^^^^^^^^^ - | ``` @@ -122,7 +121,6 @@ error[invalid-overload]: Overloaded function `try_from2` does not use the `@clas | --------- 22 | def try_from2(cls, x: int) -> CheckClassMethod: ... | --------- Missing here - | ``` @@ -134,7 +132,6 @@ error[invalid-overload]: Overloaded function `try_from3` does not use the `@clas | --------- | | | Missing here - | ``` @@ -144,7 +141,6 @@ error[call-non-callable]: Object of type `CheckClassMethod` is not callable | 43 | return cls(x) | ^^^^^^ - | ``` @@ -156,7 +152,6 @@ error[invalid-assignment]: Object of type `bound method .from_valu | -------------------- ^^^^^^^^^^^^^^^ Incompatible value of type `bound method .from_value(x: int) -> int` | | | Declared type - | info: incompatible return types: `int` is not assignable to `str` ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@final`_(f8e529ec23a61665).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@final`_(f8e529ec23a61665).snap" index bcade816493f9e..284d5de34f4904 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@final`_(f8e529ec23a61665).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@final`_(f8e529ec23a61665).snap" @@ -89,7 +89,6 @@ error[invalid-overload]: `@final` decorator should be applied only to the overlo 17 | def method2(self, x: str) -> str: ... 18 | def method2(self, x: int | str) -> int | str: | ------- Implementation defined here - | ``` @@ -106,7 +105,6 @@ error[invalid-overload]: `@final` decorator should be applied only to the overlo | ^^^^^^^ 27 | def method3(self, x: int | str) -> int | str: | ------- Implementation defined here - | ``` @@ -123,7 +121,6 @@ error[invalid-overload]: `@final` decorator should be applied only to the first 13 | # error: [invalid-overload] 14 | def method2(self, x: str) -> str: ... | ^^^^^^^ - | ``` @@ -139,7 +136,6 @@ error[invalid-overload]: `@final` decorator should be applied only to the first 18 | @overload 19 | def method3(self, x: str) -> int: ... # error: [invalid-overload] | ^^^^^^^ - | ``` @@ -158,6 +154,5 @@ error[invalid-overload]: `@final` decorator should be applied only to the first | ------ 22 | def method3(self, x: bytes) -> bytes: ... # error: [invalid-overload] | ^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@override`_(2df210735ca532f9).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@override`_(2df210735ca532f9).snap" index a6ac3a452e4895..dd869f372dcda1 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@override`_(2df210735ca532f9).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@override`_(2df210735ca532f9).snap" @@ -95,7 +95,6 @@ error[invalid-overload]: `@override` decorator should be applied only to the ove | ^^^^^^ 27 | def method(self, x: int | str) -> int | str: | ------ Implementation defined here - | ``` @@ -114,7 +113,6 @@ error[invalid-overload]: `@override` decorator should be applied only to the ove 36 | def method(self, x: str) -> str: ... 37 | def method(self, x: int | str) -> int | str: | ------ Implementation defined here - | ``` @@ -131,6 +129,5 @@ error[invalid-overload]: `@override` decorator should be applied only to the fir 21 | # error: [invalid-overload] 22 | def method(self, x: str) -> str: ... | ^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Overload_without_an_\342\200\246_-_Regular_modules_(5c8e81664d1c7470).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Overload_without_an_\342\200\246_-_Regular_modules_(5c8e81664d1c7470).snap" index 7901a7572e2564..693a5564d680a6 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Overload_without_an_\342\200\246_-_Regular_modules_(5c8e81664d1c7470).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Overload_without_an_\342\200\246_-_Regular_modules_(5c8e81664d1c7470).snap" @@ -37,7 +37,6 @@ error[invalid-overload]: Overloads for function `func` must be followed by a non | 5 | def func(x: int) -> int: ... | ^^^^ - | info: Attempting to call `func` will raise `TypeError` at runtime info: Overloaded functions without implementations are only permitted: info: - in stub files @@ -54,7 +53,6 @@ error[invalid-overload]: Overloads for function `method` must be followed by a n | 12 | def method(self, x: int) -> int: ... | ^^^^^^ - | info: Attempting to call `method` will raise `TypeError` at runtime info: Overloaded functions without implementations are only permitted: info: - in stub files diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_`@overload`-decorate\342\200\246_(d17a1580f99a6402).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_`@overload`-decorate\342\200\246_(d17a1580f99a6402).snap" index 36d556d1c22436..53b47f9c38bab4 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_`@overload`-decorate\342\200\246_(d17a1580f99a6402).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_`@overload`-decorate\342\200\246_(d17a1580f99a6402).snap" @@ -55,7 +55,6 @@ warning[useless-overload-body]: Useless body for `@overload`-decorated function | 23 | return x # error: [useless-overload-body] | ^^^^^^^^ This statement will never be executed - | info: `@overload`-decorated functions are solely for type checkers and must be overwritten at runtime by a non-`@overload`-decorated implementation help: Consider replacing this function body with `...` or `pass` @@ -67,7 +66,6 @@ warning[useless-overload-body]: Useless body for `@overload`-decorated function | 29 | print("oh no, a string") # error: [useless-overload-body] | ^^^^^^^^^^^^^^^^^^^^^^^^ This statement will never be executed - | info: `@overload`-decorated functions are solely for type checkers and must be overwritten at runtime by a non-`@overload`-decorated implementation help: Consider replacing this function body with `...` or `pass` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/override.md_-_`typing.override`_-_Basics_(b7c220f8171f11f0).snap b/crates/ty_python_semantic/resources/mdtest/snapshots/override.md_-_`typing.override`_-_Basics_(b7c220f8171f11f0).snap index 2fb6d32fdf2521..48a0a8d2a00463 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/override.md_-_`typing.override`_-_Basics_(b7c220f8171f11f0).snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/override.md_-_`typing.override`_-_Basics_(b7c220f8171f11f0).snap @@ -200,7 +200,6 @@ error[invalid-explicit-override]: Method `___reprrr__` is decorated with `@overr | --------- 99 | def ___reprrr__(self): ... # error: [invalid-explicit-override] | ^^^^^^^^^^^ - | info: No `___reprrr__` definitions were found on any superclasses of `Invalid` ``` @@ -214,7 +213,6 @@ error[invalid-explicit-override]: Method `foo` is decorated with `@override` but 101 | @classmethod 102 | def foo(self): ... # error: [invalid-explicit-override] | ^^^ - | info: No `foo` definitions were found on any superclasses of `Invalid` ``` @@ -227,7 +225,6 @@ error[invalid-explicit-override]: Method `bar` is decorated with `@override` but | --------- 105 | def bar(self): ... # error: [invalid-explicit-override] | ^^^ - | info: No `bar` definitions were found on any superclasses of `Invalid` ``` @@ -240,7 +237,6 @@ error[invalid-explicit-override]: Method `baz` is decorated with `@override` but | --------- 108 | def baz(): ... # error: [invalid-explicit-override] | ^^^ - | info: No `baz` definitions were found on any superclasses of `Invalid` ``` @@ -254,7 +250,6 @@ error[invalid-explicit-override]: Method `eggs` is decorated with `@override` bu 110 | @staticmethod 111 | def eggs(): ... # error: [invalid-explicit-override] | ^^^^ - | info: No `eggs` definitions were found on any superclasses of `Invalid` ``` @@ -267,7 +262,6 @@ error[invalid-explicit-override]: Method `bad_property1` is decorated with `@ove | --------- 114 | def bad_property1(self) -> int: ... # error: [invalid-explicit-override] | ^^^^^^^^^^^^^ - | info: No `bad_property1` definitions were found on any superclasses of `Invalid` ``` @@ -281,7 +275,6 @@ error[invalid-explicit-override]: Method `bad_property2` is decorated with `@ove 116 | @property 117 | def bad_property2(self) -> int: ... # error: [invalid-explicit-override] | ^^^^^^^^^^^^^ - | info: No `bad_property2` definitions were found on any superclasses of `Invalid` ``` @@ -294,7 +287,6 @@ error[invalid-explicit-override]: Method `bad_settable_property` is decorated wi | --------- 120 | def bad_settable_property(self) -> int: ... # error: [invalid-explicit-override] | ^^^^^^^^^^^^^^^^^^^^^ - | info: No `bad_settable_property` definitions were found on any superclasses of `Invalid` ``` @@ -307,7 +299,6 @@ error[invalid-explicit-override]: Method `lossy` is decorated with `@override` b | --------- 125 | def lossy(self): ... # error: [invalid-explicit-override] | ^^^^^ - | info: No `lossy` definitions were found on any superclasses of `Invalid` ``` @@ -321,7 +312,6 @@ error[invalid-explicit-override]: Method `lossy2` is decorated with `@override` 127 | @lossy_decorator 128 | def lossy2(self): ... # error: [invalid-explicit-override] | ^^^^^^ - | info: No `lossy2` definitions were found on any superclasses of `Invalid` ``` @@ -337,7 +327,6 @@ error[invalid-method-override]: Invalid override of method `class_method1` | 20 | def class_method1(cls) -> int: ... | ------------------------- `Parent.class_method1` defined here - | info: `LiskovViolatingButNotOverrideViolating.class_method1` is a staticmethod but `Parent.class_method1` is a classmethod info: This violates the Liskov Substitution Principle @@ -354,7 +343,6 @@ error[invalid-explicit-override]: Method `bar` is decorated with `@override` but | 156 | @override | --------- - | info: No `bar` definitions were found on any superclasses of `Foo` ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/paramspec.md_-_Legacy_`ParamSpec`_-_Validating_`ParamSpe\342\200\246_(648be2a43987ffd8).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/paramspec.md_-_Legacy_`ParamSpec`_-_Validating_`ParamSpe\342\200\246_(648be2a43987ffd8).snap" index 1b284285a50e89..34060323b972ce 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/paramspec.md_-_Legacy_`ParamSpec`_-_Validating_`ParamSpe\342\200\246_(648be2a43987ffd8).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/paramspec.md_-_Legacy_`ParamSpec`_-_Validating_`ParamSpe\342\200\246_(648be2a43987ffd8).snap" @@ -108,7 +108,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a p | 24 | a1: P, | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -124,7 +123,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a p | 26 | a3: Callable[[P], int], | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -140,7 +138,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a p | 28 | a4: Callable[..., P], | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -156,7 +153,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a p | 30 | a5: Callable[Concatenate[P, ...], int], | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -172,7 +168,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a p | 32 | a6: P | int, | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -188,7 +183,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a p | 34 | a7: Union[P, int], | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -204,7 +198,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a p | 36 | a8: Optional[P], | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -220,7 +213,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a p | 38 | a9: Annotated[P, "metadata"], | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -236,7 +228,6 @@ error[invalid-type-form]: The first argument to `Callable` must be either a list | 40 | a10: Callable["[int, str]", str], | ^^^^^^^^^^^^ - | info: See the following page for a reference on valid type expressions: info: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions @@ -248,7 +239,6 @@ error[invalid-type-form]: The first argument to `Callable` must be either a list | 42 | a11: Callable["...", int], | ^^^^^ - | info: See the following page for a reference on valid type expressions: info: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions @@ -260,7 +250,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a r | 46 | def invalid_return() -> P: | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -276,7 +265,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a t | 51 | x: P = y | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -292,7 +280,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a t | 55 | x: Final[P] = y | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -308,7 +295,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a r | 58 | def invalid_stringified_return() -> "P": | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -324,7 +310,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a p | 63 | a: "P", | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -340,7 +325,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a t | 67 | x: "P" = y | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -356,7 +340,6 @@ error[invalid-type-form]: Bare ParamSpec `Q` is not valid in this context in a p | 74 | a: InvalidSpecializationTarget[[Q]], | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -372,7 +355,6 @@ error[invalid-type-form]: Bare ParamSpec `Q` is not valid in this context in a p | 76 | b: InvalidSpecializationTarget[Q,], | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/paramspec.md_-_Legacy_`ParamSpec`_-_`ParamSpec`_cannot_s\342\200\246_(c9dbdc7b13b704a4).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/paramspec.md_-_Legacy_`ParamSpec`_-_`ParamSpec`_cannot_s\342\200\246_(c9dbdc7b13b704a4).snap" index 30d66b02d29ce9..31e331a2c6dcf6 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/paramspec.md_-_Legacy_`ParamSpec`_-_`ParamSpec`_cannot_s\342\200\246_(c9dbdc7b13b704a4).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/paramspec.md_-_Legacy_`ParamSpec`_-_`ParamSpec`_cannot_s\342\200\246_(c9dbdc7b13b704a4).snap" @@ -56,7 +56,6 @@ error[invalid-type-arguments]: ParamSpec `P` cannot be used to specialize type v | - Type variable `T` defined here 4 | P = ParamSpec("P") | - ParamSpec `P` defined here - | ``` @@ -66,6 +65,5 @@ error[invalid-type-arguments]: Type argument for `ParamSpec` must be either a li | 26 | def func3(c: ParamSpecAndTypeVar[T, int], other: T): ... | ^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/paramspec.md_-_PEP_695_`ParamSpec`_-_Validating_`ParamSpe\342\200\246_(327594c6dacd8ad).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/paramspec.md_-_PEP_695_`ParamSpec`_-_Validating_`ParamSpe\342\200\246_(327594c6dacd8ad).snap" index 99303e65797ff2..170d8af1e67bf1 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/paramspec.md_-_PEP_695_`ParamSpec`_-_Validating_`ParamSpe\342\200\246_(327594c6dacd8ad).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/paramspec.md_-_PEP_695_`ParamSpec`_-_Validating_`ParamSpe\342\200\246_(327594c6dacd8ad).snap" @@ -86,7 +86,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a p | 11 | a1: P, | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -102,7 +101,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a p | 13 | a3: Callable[[P], int], | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -118,7 +116,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a p | 15 | a4: Callable[..., P], | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -134,7 +131,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a p | 17 | a5: Callable[Concatenate[P, ...], int], | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -150,7 +146,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a p | 19 | a6: P | int, | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -166,7 +161,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a p | 21 | a7: Union[P, int], | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -182,7 +176,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a p | 23 | a8: Optional[P], | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -198,7 +191,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a p | 25 | a9: Annotated[P, "metadata"], | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -214,7 +206,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a r | 29 | def invalid_return[**P]() -> P: | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -230,7 +221,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a t | 33 | type Alias[**P] = P | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -246,7 +236,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a t | 37 | x: P = y | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -262,7 +251,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a t | 41 | x: Final[P] = y | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -278,7 +266,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a r | 44 | def invalid_stringified_return[**P]() -> "P": | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -294,7 +281,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a p | 49 | a: "P", | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -310,7 +296,6 @@ error[invalid-type-form]: Bare ParamSpec `P` is not valid in this context in a t | 53 | x: "P" = y | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -326,7 +311,6 @@ error[invalid-type-form]: Bare ParamSpec `Q` is not valid in this context in a p | 60 | a: InvalidSpecializationTarget[[Q]], | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` @@ -342,7 +326,6 @@ error[invalid-type-form]: Bare ParamSpec `Q` is not valid in this context in a p | 62 | b: InvalidSpecializationTarget[Q,], | ^ - | info: A bare ParamSpec is only valid: info: - as the first argument to `Callable` info: - as the last argument to `Concatenate` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/paramspec.md_-_PEP_695_`ParamSpec`_-_`ParamSpec`_cannot_s\342\200\246_(8243f67799c93e3c).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/paramspec.md_-_PEP_695_`ParamSpec`_-_`ParamSpec`_cannot_s\342\200\246_(8243f67799c93e3c).snap" index 7c51e0f626b7cb..53c9b8e2e7af5f 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/paramspec.md_-_PEP_695_`ParamSpec`_-_`ParamSpec`_cannot_s\342\200\246_(8243f67799c93e3c).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/paramspec.md_-_PEP_695_`ParamSpec`_-_`ParamSpec`_cannot_s\342\200\246_(8243f67799c93e3c).snap" @@ -60,7 +60,6 @@ error[invalid-type-arguments]: ParamSpec `P` cannot be used to specialize type v | 3 | class OnlyTypeVar[T]: | - Type variable `T` defined here - | ``` @@ -79,7 +78,6 @@ error[invalid-type-arguments]: ParamSpec `P` cannot be used to specialize type v 8 | 9 | def f[**P, T](): | - ParamSpec `P` defined here - | ``` @@ -89,6 +87,5 @@ error[invalid-type-arguments]: Type argument for `ParamSpec` must be either a li | 29 | def func3[T](c: ParamSpecAndTypeVar[T, int], other: T): ... | ^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Calls_to_protocol_cl\342\200\246_(288988036f34ddcf).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Calls_to_protocol_cl\342\200\246_(288988036f34ddcf).snap" index 83895eae630abf..413c1927b86a85 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Calls_to_protocol_cl\342\200\246_(288988036f34ddcf).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Calls_to_protocol_cl\342\200\246_(288988036f34ddcf).snap" @@ -48,7 +48,6 @@ error[call-non-callable]: Object of type `` is n | 4 | reveal_type(Protocol()) # revealed: Unknown | ^^^^^^^^^^ - | ``` @@ -58,13 +57,11 @@ error[call-non-callable]: Cannot instantiate class `MyProtocol` | 10 | reveal_type(MyProtocol()) # revealed: MyProtocol | ^^^^^^^^^^^^ This call will raise `TypeError` at runtime - | info: Protocol classes cannot be instantiated --> src/mdtest_snippet.py:6:7 | 6 | class MyProtocol(Protocol): | ^^^^^^^^^^^^^^^^^^^^ `MyProtocol` declared as a protocol here - | ``` @@ -74,12 +71,10 @@ error[call-non-callable]: Cannot instantiate class `GenericProtocol` | 16 | reveal_type(GenericProtocol[int]()) # revealed: GenericProtocol[int] | ^^^^^^^^^^^^^^^^^^^^^^ This call will raise `TypeError` at runtime - | info: Protocol classes cannot be instantiated --> src/mdtest_snippet.py:12:7 | 12 | class GenericProtocol[T](Protocol): | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `GenericProtocol` declared as a protocol here - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Diagnostics_and_auto\342\200\246_(310665856cfe2424).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Diagnostics_and_auto\342\200\246_(310665856cfe2424).snap" index fb5b8f5be28d9d..b04e1b5ef8dc05 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Diagnostics_and_auto\342\200\246_(310665856cfe2424).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Diagnostics_and_auto\342\200\246_(310665856cfe2424).snap" @@ -55,7 +55,6 @@ error[invalid-generic-class]: Cannot both inherit from subscripted `Protocol` an | 5 | class Foo(Protocol[T], Generic[T]): ... # error: [invalid-generic-class] | ^^^^^^^^^^^ - | help: Remove the type parameters from the `Protocol` base | 4 | @@ -76,7 +75,6 @@ error[invalid-generic-class]: Cannot both inherit from subscripted `Protocol` an 11 | | T, 12 | | ], Generic[T]): ... | |_^ - | help: Remove the type parameters from the `Protocol` base | 9 | # error: [invalid-generic-class] @@ -100,7 +98,6 @@ error[invalid-generic-class]: Cannot both inherit from subscripted `Protocol` an 19 | | # very well documented code 20 | | ], # important comma! | |_^ - | help: Remove the type parameters from the `Protocol` base | 15 | # error: [invalid-generic-class] @@ -122,7 +119,6 @@ error[invalid-generic-class]: Cannot both inherit from subscripted `Protocol` an | 32 | class Foo[T](Protocol[T]): ... # error: [invalid-generic-class] | ^^^^^^^^^^^ - | help: Remove the type parameters from the `Protocol` base | 31 | diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Diagnostics_for_prot\342\200\246_(585a3e9545d41b64).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Diagnostics_for_prot\342\200\246_(585a3e9545d41b64).snap" index c62928847e0204..50abe4a3a545a8 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Diagnostics_for_prot\342\200\246_(585a3e9545d41b64).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Diagnostics_for_prot\342\200\246_(585a3e9545d41b64).snap" @@ -68,13 +68,11 @@ warning[ambiguous-protocol-member]: Cannot assign to undeclared variable in the | 12 | a = None # type: int | ^^^^^^^^ Consider adding an annotation for `a` - | info: Assigning to an undeclared variable in a protocol class leads to an ambiguous interface --> src/a.py:6:7 | 6 | class A(Protocol): | ^^^^^^^^^^^ `A` declared as a protocol here - | info: No declarations found for `a` in the body of `A` or any of its superclasses ``` @@ -85,13 +83,11 @@ warning[ambiguous-protocol-member]: Cannot assign to undeclared variable in the | 14 | b = ... # type: str | ^^^^^^^ Consider adding an annotation for `b` - | info: Assigning to an undeclared variable in a protocol class leads to an ambiguous interface --> src/a.py:6:7 | 6 | class A(Protocol): | ^^^^^^^^^^^ `A` declared as a protocol here - | info: No declarations found for `b` in the body of `A` or any of its superclasses ``` @@ -102,13 +98,11 @@ warning[ambiguous-protocol-member]: Cannot assign to undeclared variable in the | 17 | c = 1 # error: [ambiguous-protocol-member] | ^^^^^ Consider adding an annotation, e.g. `c: int = ...` - | info: Assigning to an undeclared variable in a protocol class leads to an ambiguous interface --> src/a.py:6:7 | 6 | class A(Protocol): | ^^^^^^^^^^^ `A` declared as a protocol here - | info: No declarations found for `c` in the body of `A` or any of its superclasses ``` @@ -119,13 +113,11 @@ warning[ambiguous-protocol-member]: Cannot assign to undeclared variable in the | 22 | for d in range(42): | ^ `d` is not declared as a protocol member - | info: Assigning to an undeclared variable in a protocol class leads to an ambiguous interface --> src/a.py:6:7 | 6 | class A(Protocol): | ^^^^^^^^^^^ `A` declared as a protocol here - | info: No declarations found for `d` in the body of `A` or any of its superclasses ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Invalid_calls_to_`ge\342\200\246_(3d0c4ee818c4d8d5).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Invalid_calls_to_`ge\342\200\246_(3d0c4ee818c4d8d5).snap" index 4b8f21004d4672..cfc81b93436905 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Invalid_calls_to_`ge\342\200\246_(3d0c4ee818c4d8d5).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Invalid_calls_to_`ge\342\200\246_(3d0c4ee818c4d8d5).snap" @@ -35,14 +35,12 @@ error[invalid-argument-type]: Invalid argument to `get_protocol_members` | 5 | get_protocol_members(NotAProtocol) # error: [invalid-argument-type] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This call will raise `TypeError` at runtime - | info: Only protocol classes can be passed to `get_protocol_members` info: `NotAProtocol` is declared here, but it is not a protocol class: --> src/mdtest_snippet.py:3:7 | 3 | class NotAProtocol: ... | ^^^^^^^^^^^^ - | 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# @@ -54,14 +52,12 @@ error[invalid-argument-type]: Invalid argument to `get_protocol_members` | 9 | get_protocol_members(AlsoNotAProtocol) # error: [invalid-argument-type] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This call will raise `TypeError` at runtime - | info: Only protocol classes can be passed to `get_protocol_members` info: `AlsoNotAProtocol` is declared here, but it is not a protocol class: --> src/mdtest_snippet.py:7:7 | 7 | class AlsoNotAProtocol(NotAProtocol, object): ... | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | 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# diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Match_class_patterns\342\200\246_(8ae0e231033b78e).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Match_class_patterns\342\200\246_(8ae0e231033b78e).snap" index 017fdee47756c5..62f4a2a204369a 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Match_class_patterns\342\200\246_(8ae0e231033b78e).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Match_class_patterns\342\200\246_(8ae0e231033b78e).snap" @@ -52,13 +52,11 @@ error[isinstance-against-protocol]: Class `HasX` cannot be used in a class patte | 12 | case HasX(): # error: [isinstance-against-protocol] | ^^^^ This will raise `TypeError` at runtime - | info: `HasX` is declared as a protocol class, but it is not declared as runtime-checkable --> src/mdtest_snippet.py:3:7 | 3 | class HasX(Protocol): | ^^^^^^^^^^^^^^ `HasX` declared here - | info: A protocol class can only be used in a match class pattern 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 @@ -70,13 +68,11 @@ error[isinstance-against-protocol]: Class `HasX` cannot be used in a class patte | 28 | case Wrapper(inner=HasX()): # error: [isinstance-against-protocol] | ^^^^ This will raise `TypeError` at runtime - | info: `HasX` is declared as a protocol class, but it is not declared as runtime-checkable --> src/mdtest_snippet.py:3:7 | 3 | class HasX(Protocol): | ^^^^^^^^^^^^^^ `HasX` declared here - | info: A protocol class can only be used in a match class pattern 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 diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Narrowing_of_protoco\342\200\246_(98257e7c2300373).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Narrowing_of_protoco\342\200\246_(98257e7c2300373).snap" index 13a0b9d177bd75..0c5ec011404e37 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Narrowing_of_protoco\342\200\246_(98257e7c2300373).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Narrowing_of_protoco\342\200\246_(98257e7c2300373).snap" @@ -103,13 +103,11 @@ error[isinstance-against-protocol]: Class `HasX` cannot be used as the second ar | 7 | if isinstance(arg, HasX): # error: [isinstance-against-protocol] | ^^^^^^^^^^^^^^^^^^^^^ This call will raise `TypeError` at runtime - | info: `HasX` is declared as a protocol class, but it is not declared as runtime-checkable --> src/mdtest_snippet.py:3:7 | 3 | class HasX(Protocol): | ^^^^^^^^^^^^^^ `HasX` declared here - | 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 @@ -121,13 +119,11 @@ error[isinstance-against-protocol]: Class `HasX` cannot be used as the second ar | 12 | if issubclass(arg2, HasX): # error: [isinstance-against-protocol] | ^^^^^^^^^^^^^^^^^^^^^^ This call will raise `TypeError` at runtime - | info: `HasX` is declared as a protocol class, but it is not declared as runtime-checkable --> src/mdtest_snippet.py:3:7 | 3 | class HasX(Protocol): | ^^^^^^^^^^^^^^ `HasX` declared here - | 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 @@ -139,13 +135,11 @@ error[isinstance-against-protocol]: Class `RuntimeCheckableHasX` cannot be used | 43 | if issubclass(arg1, RuntimeCheckableHasX): | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This call will raise `TypeError` at runtime - | info: A protocol class cannot be used in `issubclass` checks if it has non-method members --> src/mdtest_snippet.py:20:5 | 20 | x: int | ^ Non-method member `x` declared here - | ``` @@ -155,14 +149,12 @@ error[isinstance-against-protocol]: Class `MultipleNonMethodMembers` cannot be u | 48 | if issubclass(arg1, MultipleNonMethodMembers): # error: [isinstance-against-protocol] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This call will raise `TypeError` at runtime - | info: A protocol class cannot be used in `issubclass` checks if it has non-method members info: `MultipleNonMethodMembers` has non-method members `a` and `b` --> src/mdtest_snippet.py:39:5 | 39 | a: int | ^ Non-method member `a` declared here - | ``` @@ -172,13 +164,11 @@ error[isinstance-against-protocol]: Class `HasX` cannot be used as the second ar | 63 | isinstance(arg, (HasX, RuntimeCheckableHasX)) # error: [isinstance-against-protocol] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This call will raise `TypeError` at runtime - | info: `HasX` is declared as a protocol class, but it is not declared as runtime-checkable --> src/mdtest_snippet.py:3:7 | 3 | class HasX(Protocol): | ^^^^^^^^^^^^^^ `HasX` declared here - | 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 @@ -190,13 +180,11 @@ error[isinstance-against-protocol]: Class `HasX` cannot be used as the second ar | 64 | isinstance(arg, (HasX, int)) # error: [isinstance-against-protocol] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This call will raise `TypeError` at runtime - | info: `HasX` is declared as a protocol class, but it is not declared as runtime-checkable --> src/mdtest_snippet.py:3:7 | 3 | class HasX(Protocol): | ^^^^^^^^^^^^^^ `HasX` declared here - | 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 @@ -208,13 +196,11 @@ error[isinstance-against-protocol]: Class `HasX` cannot be used as the second ar | 68 | issubclass(arg2, (HasX, RuntimeCheckableHasX)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This call will raise `TypeError` at runtime - | info: `HasX` is declared as a protocol class, but it is not declared as runtime-checkable --> src/mdtest_snippet.py:3:7 | 3 | class HasX(Protocol): | ^^^^^^^^^^^^^^ `HasX` declared here - | 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 @@ -226,13 +212,11 @@ error[isinstance-against-protocol]: Class `RuntimeCheckableHasX` cannot be used | 68 | issubclass(arg2, (HasX, RuntimeCheckableHasX)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This call will raise `TypeError` at runtime - | info: A protocol class cannot be used in `issubclass` checks if it has non-method members --> src/mdtest_snippet.py:20:5 | 20 | x: int | ^ Non-method member `x` declared here - | ``` @@ -242,13 +226,11 @@ error[isinstance-against-protocol]: Class `HasX` cannot be used as the second ar | 70 | issubclass(arg2, (HasX, OnlyMethodMembers)) # error: [isinstance-against-protocol] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This call will raise `TypeError` at runtime - | info: `HasX` is declared as a protocol class, but it is not declared as runtime-checkable --> src/mdtest_snippet.py:3:7 | 3 | class HasX(Protocol): | ^^^^^^^^^^^^^^ `HasX` declared here - | 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 @@ -260,13 +242,11 @@ error[isinstance-against-protocol]: Class `HasX` cannot be used as the second ar | 72 | isinstance(arg, (int, (HasX, str))) # error: [isinstance-against-protocol] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This call will raise `TypeError` at runtime - | info: `HasX` is declared as a protocol class, but it is not declared as runtime-checkable --> src/mdtest_snippet.py:3:7 | 3 | class HasX(Protocol): | ^^^^^^^^^^^^^^ `HasX` declared here - | 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 @@ -278,13 +258,11 @@ error[isinstance-against-protocol]: Class `HasX` cannot be used as the second ar | 76 | issubclass(arg2, (int, (HasX, RuntimeCheckableHasX))) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This call will raise `TypeError` at runtime - | info: `HasX` is declared as a protocol class, but it is not declared as runtime-checkable --> src/mdtest_snippet.py:3:7 | 3 | class HasX(Protocol): | ^^^^^^^^^^^^^^ `HasX` declared here - | 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 @@ -296,13 +274,11 @@ error[isinstance-against-protocol]: Class `RuntimeCheckableHasX` cannot be used | 76 | issubclass(arg2, (int, (HasX, RuntimeCheckableHasX))) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This call will raise `TypeError` at runtime - | info: A protocol class cannot be used in `issubclass` checks if it has non-method members --> src/mdtest_snippet.py:20:5 | 20 | x: int | ^ Non-method member `x` declared here - | ``` @@ -312,13 +288,11 @@ error[isinstance-against-protocol]: Class `HasX` cannot be used as the second ar | 80 | isinstance(arg, classes) # error: [isinstance-against-protocol] | ^^^^^^^^^^^^^^^^^^^^^^^^ This call will raise `TypeError` at runtime - | info: `HasX` is declared as a protocol class, but it is not declared as runtime-checkable --> src/mdtest_snippet.py:3:7 | 3 | class HasX(Protocol): | ^^^^^^^^^^^^^^ `HasX` declared here - | 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 diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Protocol_members_in_\342\200\246_(21be5d9bdab1c844).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Protocol_members_in_\342\200\246_(21be5d9bdab1c844).snap" index 7596d930a60936..88ad76c83613bd 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Protocol_members_in_\342\200\246_(21be5d9bdab1c844).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/protocols.md_-_Protocols_-_Protocol_members_in_\342\200\246_(21be5d9bdab1c844).snap" @@ -38,13 +38,11 @@ warning[ambiguous-protocol-member]: Cannot assign to undeclared variable in the | 12 | e = 56 # error: [ambiguous-protocol-member] | ^^^^^^ Consider adding an annotation, e.g. `e: int = ...` - | info: Assigning to an undeclared variable in a protocol class leads to an ambiguous interface --> src/mdtest_snippet.py:4:7 | 4 | class Foo(Protocol): | ^^^^^^^^^^^^^ `Foo` declared as a protocol here - | info: No declarations found for `e` in the body of `Foo` or any of its superclasses ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Diagnostics_for_`emp\342\200\246_(f44e56404a51ca26).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Diagnostics_for_`emp\342\200\246_(f44e56404a51ca26).snap" index 3b2a930a99fb76..064faaad298b3e 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Diagnostics_for_`emp\342\200\246_(f44e56404a51ca26).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Diagnostics_for_`emp\342\200\246_(f44e56404a51ca26).snap" @@ -30,7 +30,6 @@ error[empty-body]: Function always implicitly returns `None`, which is not assig | 7 | def method(self) -> str: ... # error: [empty-body] | ^^^ - | info: Consider changing the return annotation to `-> None` or adding a `return` statement info: Functions with empty bodies and non-`None` return types are only permitted: info: - in stub files @@ -43,7 +42,6 @@ info: Only classes that directly inherit from `typing.Protocol` or `typing_exten | 6 | class Concrete(Abstract): | ^^^^^^^^^^^^^^^^^^ `Protocol` not present in `Concrete`'s immediate bases - | info: See https://typing.python.org/en/latest/spec/protocol.html# ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Generator_functions_-_Asynchronous_(408134055c24a538).snap b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Generator_functions_-_Asynchronous_(408134055c24a538).snap index c930f1b4a3c854..5f4aa0fd813894 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Generator_functions_-_Asynchronous_(408134055c24a538).snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Generator_functions_-_Asynchronous_(408134055c24a538).snap @@ -44,7 +44,6 @@ error[invalid-return-type]: Return type does not match returned value | 16 | async def j() -> str: # error: [invalid-return-type] | ^^^ expected `str`, found `types.AsyncGeneratorType` - | 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 @@ -56,6 +55,5 @@ error[invalid-syntax]: `return` with value in async generator | 21 | return 2 # error: [invalid-syntax] "`return` with value in async generator" | ^^^^^^^^ - | ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Generator_functions_-_Synchronous_(6a32ec69d15117b8).snap b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Generator_functions_-_Synchronous_(6a32ec69d15117b8).snap index d684e31c9de95f..42bded3518998e 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Generator_functions_-_Synchronous_(6a32ec69d15117b8).snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Generator_functions_-_Synchronous_(6a32ec69d15117b8).snap @@ -59,7 +59,6 @@ error[invalid-return-type]: Return type does not match returned value | 19 | def j() -> str: # error: [invalid-return-type] | ^^^ expected `str`, found `types.GeneratorType` - | 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 @@ -74,7 +73,6 @@ error[invalid-return-type]: Return type does not match returned value 23 | yield 24 | return "" # error: [invalid-return-type] | ^^ expected `None`, found `Literal[""]` - | ``` @@ -87,7 +85,6 @@ error[invalid-return-type]: Return type does not match returned value 26 | yield 1 27 | return "" # error: [invalid-return-type] | ^^ expected `int`, found `Literal[""]` - | ``` @@ -97,7 +94,6 @@ error[invalid-return-type]: Function always implicitly returns `None`, which is | 31 | def missing_return() -> typing.Generator[int, int, int]: # error: [invalid-return-type] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | info: Consider changing the return annotation to `-> None` or adding a `return` statement ``` @@ -112,6 +108,5 @@ error[invalid-return-type]: Return type does not match returned value 35 | # error: [invalid-return-type] 36 | return "foo" | ^^^^^ expected `None`, found `Literal["foo"]` - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_conditional_\342\200\246_(94c036c5d3803ab2).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_conditional_\342\200\246_(94c036c5d3803ab2).snap" index 16e9f472100447..aa7a54f5e9115d 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_conditional_\342\200\246_(94c036c5d3803ab2).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_conditional_\342\200\246_(94c036c5d3803ab2).snap" @@ -43,7 +43,6 @@ error[invalid-return-type]: Return type does not match returned value 5 | # error: [invalid-return-type] 6 | return 1 | ^ expected `str`, found `Literal[1]` - | ``` @@ -57,7 +56,6 @@ error[invalid-return-type]: Return type does not match returned value 10 | # error: [invalid-return-type] 11 | return 1 | ^ expected `str`, found `Literal[1]` - | ``` @@ -72,6 +70,5 @@ error[invalid-return-type]: Return type does not match returned value | 8 | def f(cond: bool) -> str: | --- Expected `str` because of return type - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_implicit_ret\342\200\246_(393cb38bf7119649).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_implicit_ret\342\200\246_(393cb38bf7119649).snap" index 98918bef021caa..07945ff967e2a7 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_implicit_ret\342\200\246_(393cb38bf7119649).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_implicit_ret\342\200\246_(393cb38bf7119649).snap" @@ -45,7 +45,6 @@ error[invalid-return-type]: Function can implicitly return `None`, which is not | 6 | def f(cond: bool) -> int: | ^^^ - | ``` @@ -55,7 +54,6 @@ error[invalid-return-type]: Function always implicitly returns `None`, which is | 11 | def f(cond: bool) -> int: | ^^^ - | info: Consider changing the return annotation to `-> None` or adding a `return` statement ``` @@ -66,6 +64,5 @@ error[invalid-return-type]: Function can implicitly return `None`, which is not | 16 | def f(cond: bool) -> int: | ^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_implicit_ret\342\200\246_(3d2d19aa49b28f1c).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_implicit_ret\342\200\246_(3d2d19aa49b28f1c).snap" index 778f3b10d0e556..48783ffacbc25e 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_implicit_ret\342\200\246_(3d2d19aa49b28f1c).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_implicit_ret\342\200\246_(3d2d19aa49b28f1c).snap" @@ -26,7 +26,6 @@ error[invalid-return-type]: Function always implicitly returns `None`, which is | 2 | def f() -> int: | ^^^ - | info: Consider changing the return annotation to `-> None` or adding a `return` statement ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type_(a91e0c67519cd77f).snap b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type_(a91e0c67519cd77f).snap index 2edd69296d3336..5c3a100538a6d9 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type_(a91e0c67519cd77f).snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type_(a91e0c67519cd77f).snap @@ -53,7 +53,6 @@ error[invalid-return-type]: Function always implicitly returns `None`, which is | 2 | def f() -> int: | ^^^ - | info: Consider changing the return annotation to `-> None` or adding a `return` statement ``` @@ -67,7 +66,6 @@ error[invalid-return-type]: Return type does not match returned value 6 | # error: [invalid-return-type] 7 | return 1 | ^ expected `str`, found `Literal[1]` - | ``` @@ -80,7 +78,6 @@ error[invalid-return-type]: Return type does not match returned value 10 | # error: [invalid-return-type] 11 | return | ^^^^^^ expected `int`, found `None` - | ``` @@ -90,7 +87,6 @@ error[empty-body]: Function always implicitly returns `None`, which is not assig | 18 | def m(x: T) -> T: ... | ^ - | info: Consider changing the return annotation to `-> None` or adding a `return` statement info: Functions with empty bodies and non-`None` return types are only permitted: info: - in stub files @@ -109,7 +105,6 @@ error[invalid-return-type]: Return type does not match returned value 23 | class A[T]: ... 24 | return A[int]() # error: [invalid-return-type] | ^^^^^^^^ expected `mdtest_snippet.A[int]`, found `mdtest_snippet..A[int]` - | ``` @@ -122,6 +117,5 @@ error[invalid-return-type]: Return type does not match returned value 29 | class B: ... 30 | return B() # error: [invalid-return-type] | ^^^ expected `mdtest_snippet.B`, found `mdtest_snippet..B` - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type_\342\200\246_(c3a523878447af6b).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type_\342\200\246_(c3a523878447af6b).snap" index 1c43d901aaaa3f..0d29532dfaa22c 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type_\342\200\246_(c3a523878447af6b).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type_\342\200\246_(c3a523878447af6b).snap" @@ -39,7 +39,6 @@ error[invalid-return-type]: Return type does not match returned value 2 | # error: [invalid-return-type] 3 | return ... | ^^^ expected `int`, found `EllipsisType` - | ``` @@ -49,7 +48,6 @@ error[invalid-return-type]: Function always implicitly returns `None`, which is | 6 | def foo() -> int: | ^^^ - | info: Consider changing the return annotation to `-> None` or adding a `return` statement ``` @@ -60,7 +58,6 @@ error[invalid-return-type]: Function always implicitly returns `None`, which is | 11 | def foo() -> int: | ^^^ - | info: Consider changing the return annotation to `-> None` or adding a `return` statement ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_class_within\342\200\246_(3259718bf20b45a2).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_class_within\342\200\246_(3259718bf20b45a2).snap" index 4e584caec43a46..4f386ac1497476 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_class_within\342\200\246_(3259718bf20b45a2).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_class_within\342\200\246_(3259718bf20b45a2).snap" @@ -35,7 +35,6 @@ error[shadowed-type-variable]: Generic class `Bad1` uses type variable `T` alrea 5 | # error: [shadowed-type-variable] 6 | class Bad1[T]: ... | ^^^^ `T` used in class definition here - | ``` @@ -51,6 +50,5 @@ error[shadowed-type-variable]: Generic class `Bad2` uses type variable `T` alrea 7 | # error: [shadowed-type-variable] 8 | class Bad2(Iterable[T]): ... | ^^^^^^^^^^^^^^^^^ `T` used in class definition here - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_class_within\342\200\246_(711fb86287c4d87b).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_class_within\342\200\246_(711fb86287c4d87b).snap" index 55db2ec57894bd..b9d2eaba14af89 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_class_within\342\200\246_(711fb86287c4d87b).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_class_within\342\200\246_(711fb86287c4d87b).snap" @@ -35,7 +35,6 @@ error[shadowed-type-variable]: Generic class `Bad1` uses type variable `T` alrea 5 | # error: [shadowed-type-variable] 6 | class Bad1[T]: ... | ^^^^ `T` used in class definition here - | ``` @@ -51,6 +50,5 @@ error[shadowed-type-variable]: Generic class `Bad2` uses type variable `T` alrea 7 | # error: [shadowed-type-variable] 8 | class Bad2(Iterable[T]): ... | ^^^^^^^^^^^^^^^^^ `T` used in class definition here - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_function_wit\342\200\246_(f58a51442a16371e).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_function_wit\342\200\246_(f58a51442a16371e).snap" index a2a37ae67ae3ba..85cd27623396ee 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_function_wit\342\200\246_(f58a51442a16371e).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_function_wit\342\200\246_(f58a51442a16371e).snap" @@ -33,6 +33,5 @@ error[shadowed-type-variable]: Generic function `bad` uses type variable `T` alr | 1 | def f[T](x: T, y: T) -> None: | ------------------------ Type variable `T` is bound in this enclosing scope - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_method_withi\342\200\246_(c19e9277cf9fafb5).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_method_withi\342\200\246_(c19e9277cf9fafb5).snap" index 29725bea77fb09..1b5754cbb522e1 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_method_withi\342\200\246_(c19e9277cf9fafb5).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_method_withi\342\200\246_(c19e9277cf9fafb5).snap" @@ -33,6 +33,5 @@ error[shadowed-type-variable]: Generic function `bad` uses type variable `T` alr | 1 | class C[T]: | - Type variable `T` is bound in this enclosing scope - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Function_nested_in_c\342\200\246_(1a50b4ccb10b95dd).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Function_nested_in_c\342\200\246_(1a50b4ccb10b95dd).snap" index 9f7d87d5b2e883..02256a188b160a 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Function_nested_in_c\342\200\246_(1a50b4ccb10b95dd).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Function_nested_in_c\342\200\246_(1a50b4ccb10b95dd).snap" @@ -30,7 +30,6 @@ error[invalid-type-variable-default]: Invalid default for type parameter `U` 2 | # error: [invalid-type-variable-default] 3 | def f[U = T](self): ... | ^ `T` is a type parameter bound in an outer scope - | info: See https://typing.python.org/en/latest/spec/generics.html#scoping-rules ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_in_me\342\200\246_(2ed4c18a38ed9090).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_in_me\342\200\246_(2ed4c18a38ed9090).snap" index 82324be6582c9e..9b7642bd65e528 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_in_me\342\200\246_(2ed4c18a38ed9090).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_in_me\342\200\246_(2ed4c18a38ed9090).snap" @@ -37,7 +37,6 @@ error[invalid-type-variable-default]: Invalid use of type variable `T2` 7 | # error: [invalid-type-variable-default] "Invalid use of type variable `T2`: default of `T2` refers to out-of-scope type variable `… 8 | def method(self, x: T2) -> T2: | ^^ Default of `T2` references out-of-scope type variable `T1` - | info: See https://typing.python.org/en/latest/spec/generics.html#scoping-rules ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_in_ne\342\200\246_(a1aca17ea750ffdd).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_in_ne\342\200\246_(a1aca17ea750ffdd).snap" index 37b3cf576eaf3b..31fc5220dcbe28 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_in_ne\342\200\246_(a1aca17ea750ffdd).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_in_ne\342\200\246_(a1aca17ea750ffdd).snap" @@ -38,7 +38,6 @@ error[invalid-type-variable-default]: Invalid use of type variable `U` 7 | # error: [invalid-type-variable-default] 8 | def inner(y: U) -> U: | ^ Default of `U` references out-of-scope type variable `T` - | info: See https://typing.python.org/en/latest/spec/generics.html#scoping-rules ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_order\342\200\246_(d075a45828c9dbc5).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_order\342\200\246_(d075a45828c9dbc5).snap" index 946a5aee3d08ba..b0d02b14ef75c3 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_order\342\200\246_(d075a45828c9dbc5).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_order\342\200\246_(d075a45828c9dbc5).snap" @@ -56,7 +56,6 @@ error[invalid-type-variable-default]: Type parameters without defaults cannot fo | ------------------------------- `T1` defined here 4 | T2 = TypeVar("T2") | ------------------ `T2` defined here - | ``` @@ -76,7 +75,6 @@ error[invalid-type-variable-default]: Type parameters without defaults cannot fo 4 | T2 = TypeVar("T2") 5 | T3 = TypeVar("T3") | ------------------ `T3` defined here - | ``` @@ -95,6 +93,5 @@ error[invalid-type-variable-default]: Type parameters without defaults cannot fo | ------------------------------- `T1` defined here 4 | T2 = TypeVar("T2") | ------------------ `T2` defined here - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_with_\342\200\246_(ce8defbeaf54e06c).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_with_\342\200\246_(ce8defbeaf54e06c).snap" index 98aa8d2eef1410..2abad477e49eee 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_with_\342\200\246_(ce8defbeaf54e06c).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_with_\342\200\246_(ce8defbeaf54e06c).snap" @@ -39,7 +39,6 @@ error[invalid-type-variable-default]: Invalid use of type variable `U` 6 | # error: [invalid-type-variable-default] 7 | def bad(y: U, z: T) -> tuple[U, T]: | ^ Default of `U` references later type parameter `T` - | info: See https://typing.python.org/en/latest/spec/generics.html#scoping-rules ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Nested_functions_(3f2ee9fa81da0177).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Nested_functions_(3f2ee9fa81da0177).snap" index 62bd9c1a5cf540..34f1b560ac019f 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Nested_functions_(3f2ee9fa81da0177).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Nested_functions_(3f2ee9fa81da0177).snap" @@ -30,7 +30,6 @@ error[invalid-type-variable-default]: Invalid default for type parameter `U` 2 | # error: [invalid-type-variable-default] "Type parameter `U` cannot use outer-scope type parameter `T` as its default" 3 | def inner[U = T](): ... | ^ `T` is a type parameter bound in an outer scope - | info: See https://typing.python.org/en/latest/spec/generics.html#scoping-rules ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Type_alias_nested_in\342\200\246_(de027dcc5360f252).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Type_alias_nested_in\342\200\246_(de027dcc5360f252).snap" index 55e25a76049f8a..12740107dd8578 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Type_alias_nested_in\342\200\246_(de027dcc5360f252).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Type_alias_nested_in\342\200\246_(de027dcc5360f252).snap" @@ -31,7 +31,6 @@ error[invalid-type-variable-default]: Invalid default for type parameter `U` 2 | # error: [invalid-type-variable-default] 3 | type Alias[U = T] = list[U] | ^ `T` is a type parameter bound in an outer scope - | info: See https://typing.python.org/en/latest/spec/generics.html#scoping-rules ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/single_matching_over\342\200\246_-_Single_matching_over\342\200\246_-_Bound_method_overloa\342\200\246_(39e892ccb644ee63).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/single_matching_over\342\200\246_-_Single_matching_over\342\200\246_-_Bound_method_overloa\342\200\246_(39e892ccb644ee63).snap" index 6af0555664d54e..3c7bc0e0684c97 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/single_matching_over\342\200\246_-_Single_matching_over\342\200\246_-_Bound_method_overloa\342\200\246_(39e892ccb644ee63).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/single_matching_over\342\200\246_-_Single_matching_over\342\200\246_-_Bound_method_overloa\342\200\246_(39e892ccb644ee63).snap" @@ -49,7 +49,6 @@ error[invalid-overload]: Implementation does not accept all arguments of this ov 12 | def f(self, x: str, y: int) -> str: ... 13 | def f( | - Implementation defined here - | info: Implementation signature `(self, x: bytes | int | str, y: int = 0) -> bytes | int | str` is not assignable to overload signature `(self: Other, x: bytes) -> bytes` info: parameter `self` has an incompatible type: `Other` is not assignable to `Base` @@ -61,13 +60,11 @@ error[invalid-argument-type]: Argument to bound method `Base.f` is incorrect | 20 | Base().f("ok", "bad") # error: [invalid-argument-type] | ^^^^^ Expected `int`, found `Literal["bad"]` - | info: Matching overload defined here --> src/mdtest_snippet.py:12:9 | 12 | def f(self, x: str, y: int) -> str: ... | ^ ------ Parameter declared here - | info: Non-matching overloads for bound method `f`: info: (self: Other, x: bytes) -> bytes info: (self, x: int) -> int diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/single_matching_over\342\200\246_-_Single_matching_over\342\200\246_-_Call_to_function_wit\342\200\246_(8fdf5a06afc7d4fe).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/single_matching_over\342\200\246_-_Single_matching_over\342\200\246_-_Call_to_function_wit\342\200\246_(8fdf5a06afc7d4fe).snap" index 3ada6ceb144357..930e95da098079 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/single_matching_over\342\200\246_-_Single_matching_over\342\200\246_-_Call_to_function_wit\342\200\246_(8fdf5a06afc7d4fe).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/single_matching_over\342\200\246_-_Single_matching_over\342\200\246_-_Call_to_function_wit\342\200\246_(8fdf5a06afc7d4fe).snap" @@ -159,13 +159,11 @@ error[invalid-argument-type]: Argument to function `foo` is incorrect | 5 | foo("foo") # error: [invalid-argument-type] | ^^^^^ Expected `int`, found `Literal["foo"]` - | info: Matching overload defined here --> src/overloaded.pyi:4:5 | 4 | def foo(a: int): ... | ^^^ ------ Parameter declared here - | info: Non-matching overloads for function `foo`: info: (a: int, b: int, c: int) -> Unknown info: (a: str, b: int, c: int) -> Unknown diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/single_matching_over\342\200\246_-_Single_matching_over\342\200\246_-_Limited_number_of_ov\342\200\246_(93e9a157fdca3ab2).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/single_matching_over\342\200\246_-_Single_matching_over\342\200\246_-_Limited_number_of_ov\342\200\246_(93e9a157fdca3ab2).snap" index c2f43cfdf09f64..2b6bf4efe4a56e 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/single_matching_over\342\200\246_-_Single_matching_over\342\200\246_-_Limited_number_of_ov\342\200\246_(93e9a157fdca3ab2).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/single_matching_over\342\200\246_-_Single_matching_over\342\200\246_-_Limited_number_of_ov\342\200\246_(93e9a157fdca3ab2).snap" @@ -39,13 +39,11 @@ error[invalid-argument-type]: Argument to function `f` is incorrect | 3 | f("a") # error: [invalid-argument-type] | ^^^ Expected `int`, found `Literal["a"]` - | info: Matching overload defined here --> src/overloaded.pyi:6:5 | 6 | def f(x: int) -> int: ... | ^ ------ Parameter declared here - | info: Non-matching overloads for function `f`: info: () -> None info: (x: int, y: int) -> int diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/special_form_attribu\342\200\246_-_Diagnostics_for_inva\342\200\246_(249d635e74a41c9e).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/special_form_attribu\342\200\246_-_Diagnostics_for_inva\342\200\246_(249d635e74a41c9e).snap" index 653c37cc173106..bc70f34a72025c 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/special_form_attribu\342\200\246_-_Diagnostics_for_inva\342\200\246_(249d635e74a41c9e).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/special_form_attribu\342\200\246_-_Diagnostics_for_inva\342\200\246_(249d635e74a41c9e).snap" @@ -43,7 +43,6 @@ error[unresolved-attribute]: Special form `typing.Any` has no attribute `foo` | 14 | X.foo # error: [unresolved-attribute] | ^^^^^ - | help: Objects with type `Any` have a `foo` attribute, but the symbol `typing.Any` does not itself inhabit the type `Any` help: This error may indicate that `X` was defined as `X = typing.Any` when `X: typing.Any` was intended @@ -55,7 +54,6 @@ error[unresolved-attribute]: Special form `typing.Any` has no attribute `aaaaooo | 15 | X.aaaaooooooo # error: [unresolved-attribute] | ^^^^^^^^^^^^^ - | help: Objects with type `Any` have an `aaaaooooooo` attribute, but the symbol `typing.Any` does not itself inhabit the type `Any` help: This error may indicate that `X` was defined as `X = typing.Any` when `X: typing.Any` was intended @@ -67,7 +65,6 @@ error[unresolved-attribute]: Special form `typing.LiteralString` has no attribut | 16 | Foo.X.startswith # error: [unresolved-attribute] | ^^^^^^^^^^^^^^^^ - | help: Objects with type `LiteralString` have a `startswith` attribute, but the symbol `typing.LiteralString` does not itself inhabit the type `LiteralString` help: This error may indicate that `Foo.X` was defined as `Foo.X = typing.LiteralString` when `Foo.X: typing.LiteralString` was intended @@ -79,7 +76,6 @@ error[unresolved-attribute]: Special form `typing.LiteralString` has no attribut | 17 | Foo.Bar().y.startswith # error: [unresolved-attribute] | ^^^^^^^^^^^^^^^^^^^^^^ - | help: Objects with type `LiteralString` have a `startswith` attribute, but the symbol `typing.LiteralString` does not itself inhabit the type `LiteralString` ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/string.md_-_String_annotations_-_Partially_deferred_a\342\200\246_-_Python_less_than_3.1\342\200\246_(5e6477d05ddea33f).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/string.md_-_String_annotations_-_Partially_deferred_a\342\200\246_-_Python_less_than_3.1\342\200\246_(5e6477d05ddea33f).snap" index f784c93ac8e554..ad9488ac5f6f85 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/string.md_-_String_annotations_-_Partially_deferred_a\342\200\246_-_Python_less_than_3.1\342\200\246_(5e6477d05ddea33f).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/string.md_-_String_annotations_-_Partially_deferred_a\342\200\246_-_Python_less_than_3.1\342\200\246_(5e6477d05ddea33f).snap" @@ -91,7 +91,6 @@ error[unsupported-operator]: Unsupported `|` operation | | | | | Has type `Literal["Foo"]` | Has type `` - | info: All parameter annotations are evaluated at runtime by default on Python <3.14 info: Python 3.13 was assumed when inferring types because it was specified on the command line help: Put quotes around the whole union rather than just certain elements @@ -107,7 +106,6 @@ error[unsupported-operator]: Unsupported `|` operation | | | | | Has type `Literal["memoryview"]` | Has type `` - | info: All parameter annotations are evaluated at runtime by default on Python <3.14 info: Python 3.13 was assumed when inferring types because it was specified on the command line help: Put quotes around the whole union rather than just certain elements @@ -123,7 +121,6 @@ error[unsupported-operator]: Unsupported `|` operation | | | | | Has type `None` | Has type `Literal["TD"]` - | info: All parameter annotations are evaluated at runtime by default on Python <3.14 info: Python 3.13 was assumed when inferring types because it was specified on the command line help: Put quotes around the whole union rather than just certain elements @@ -139,7 +136,6 @@ error[unsupported-operator]: Unsupported `|` operation | | | | | Has type `None` | Has type `Literal["P"]` - | info: All parameter annotations are evaluated at runtime by default on Python <3.14 info: Python 3.13 was assumed when inferring types because it was specified on the command line help: Put quotes around the whole union rather than just certain elements @@ -152,7 +148,6 @@ error[unsupported-operator]: Unsupported `|` operation | 33 | h: None | None, | ^^^^^^^^^^^ Both operands have type `None` - | info: All parameter annotations are evaluated at runtime by default on Python <3.14 info: Python 3.13 was assumed when inferring types because it was specified on the command line @@ -164,7 +159,6 @@ error[unresolved-reference]: Name `SomethingUndefined` used when not defined | 36 | i: SomethingUndefined | SomethingAlsoUndefined, | ^^^^^^^^^^^^^^^^^^ - | ``` @@ -174,7 +168,6 @@ error[unresolved-reference]: Name `SomethingAlsoUndefined` used when not defined | 36 | i: SomethingUndefined | SomethingAlsoUndefined, | ^^^^^^^^^^^^^^^^^^^^^^ - | ``` @@ -187,7 +180,6 @@ error[unsupported-operator]: Unsupported `|` operation | | | | | Has type `Literal["bytes"]` | Has type `` - | info: All parameter annotations are evaluated at runtime by default on Python <3.14 info: Python 3.13 was assumed when inferring types because it was specified on the command line help: Put quotes around the whole union rather than just certain elements @@ -203,7 +195,6 @@ error[unsupported-operator]: Unsupported `|` operation | | | | | Has type `None` | Has type `Literal["int"]` - | info: All parameter annotations are evaluated at runtime by default on Python <3.14 info: Python 3.13 was assumed when inferring types because it was specified on the command line help: Put quotes around the whole union rather than just certain elements @@ -219,7 +210,6 @@ error[unsupported-operator]: Unsupported `|` operation | | | | | Has type `None` | Has type `Literal["int"]` - | info: All type expressions are evaluated at runtime by default on Python <3.14 info: Python 3.13 was assumed when inferring types because it was specified on the command line help: Put quotes around the whole union rather than just certain elements diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/super.md_-_Super_-_Basic_Usage_-_Explicit_Super_Objec\342\200\246_(b753048091f275c0).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/super.md_-_Super_-_Basic_Usage_-_Explicit_Super_Objec\342\200\246_(b753048091f275c0).snap" index 9d59d177b631a4..6415a40aa3fb80 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/super.md_-_Super_-_Basic_Usage_-_Explicit_Super_Objec\342\200\246_(b753048091f275c0).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/super.md_-_Super_-_Basic_Usage_-_Explicit_Super_Objec\342\200\246_(b753048091f275c0).snap" @@ -129,7 +129,6 @@ error[unresolved-attribute]: Object of type `, C>` has no att | 20 | super(C, C()).c # error: [unresolved-attribute] | ^^^^^^^^^^^^^^^ - | ``` @@ -139,7 +138,6 @@ error[unresolved-attribute]: Object of type `, C>` has no att | 23 | super(B, C()).b # error: [unresolved-attribute] | ^^^^^^^^^^^^^^^ - | ``` @@ -149,7 +147,6 @@ error[unresolved-attribute]: Object of type `, C>` has no att | 24 | super(B, C()).c # error: [unresolved-attribute] | ^^^^^^^^^^^^^^^ - | ``` @@ -159,7 +156,6 @@ error[unresolved-attribute]: Object of type `, C>` has no att | 26 | super(A, C()).a # error: [unresolved-attribute] | ^^^^^^^^^^^^^^^ - | ``` @@ -169,7 +165,6 @@ error[unresolved-attribute]: Object of type `, C>` has no att | 27 | super(A, C()).b # error: [unresolved-attribute] | ^^^^^^^^^^^^^^^ - | ``` @@ -179,7 +174,6 @@ error[unresolved-attribute]: Object of type `, C>` has no att | 28 | super(A, C()).c # error: [unresolved-attribute] | ^^^^^^^^^^^^^^^ - | ``` @@ -189,7 +183,6 @@ error[invalid-super-argument]: `` is an abstract/st | 78 | reveal_type(super(object, x)) | ^^^^^^^^^^^^^^^^ - | ``` @@ -199,7 +192,6 @@ error[invalid-super-argument]: `(int, str, /) -> bool` is an abstract/structural | 82 | reveal_type(super(object, z)) | ^^^^^^^^^^^^^^^^ - | ``` @@ -209,6 +201,5 @@ error[invalid-super-argument]: `types.GenericAlias` instance `list[int]` is not | 98 | reveal_type(super(list[int], [])) | ^^^^^^^^^^^^^^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/super.md_-_Super_-_Basic_Usage_-_Implicit_Super_Objec\342\200\246_(f9e5e48e3a4a4c12).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/super.md_-_Super_-_Basic_Usage_-_Implicit_Super_Objec\342\200\246_(f9e5e48e3a4a4c12).snap" index 675b898a76d78b..b4eb19178bfcfa 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/super.md_-_Super_-_Basic_Usage_-_Implicit_Super_Objec\342\200\246_(f9e5e48e3a4a4c12).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/super.md_-_Super_-_Basic_Usage_-_Implicit_Super_Objec\342\200\246_(f9e5e48e3a4a4c12).snap" @@ -166,7 +166,6 @@ info[missing-type-argument]: Missing type argument for generic class `Foo` (expe | 61 | def method3(self: Foo): # error: [missing-type-argument] | ^^^ - | ``` @@ -176,7 +175,6 @@ error[invalid-super-argument]: `S@method7` is not an instance or subclass of `` help: Consider adding an upper bound to type variable `S` @@ -189,7 +187,6 @@ error[invalid-super-argument]: `S@method8` is not an instance or subclass of `` @@ -201,7 +198,6 @@ error[invalid-super-argument]: `S@method9` is not an instance or subclass of `` @@ -213,7 +209,6 @@ error[invalid-super-argument]: `S@method10` is a type variable with an abstract/ | 100 | reveal_type(super()) | ^^^^^^^ - | info: Type variable `S` has upper bound `(...) -> str` ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/super.md_-_Super_-_Basic_Usage_-_Metaclasses_(faeb52a8cd1533b3).snap b/crates/ty_python_semantic/resources/mdtest/snapshots/super.md_-_Super_-_Basic_Usage_-_Metaclasses_(faeb52a8cd1533b3).snap index d4c42f028e8593..7b1b9425eb36df 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/super.md_-_Super_-_Basic_Usage_-_Metaclasses_(faeb52a8cd1533b3).snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/super.md_-_Super_-_Basic_Usage_-_Metaclasses_(faeb52a8cd1533b3).snap @@ -63,7 +63,6 @@ error[invalid-super-argument]: `` is not an instance or subcl | 34 | super(Meta, OtherBase) # error: [invalid-super-argument] | ^^^^^^^^^^^^^^^^^^^^^^ - | ``` @@ -73,7 +72,6 @@ error[invalid-super-argument]: `type[T@__call__]` is not an instance or subclass | 40 | return super(BoundIntMeta, cls).__call__() # error: [invalid-super-argument] | ^^^^^^^^^^^^^^^^^^^^^^^^ - | info: Type variable `T` has upper bound `int` info: `type[int]` is not an instance or subclass of `` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/super.md_-_Super_-_Invalid_Usages_-_Diagnostic_when_the_\342\200\246_(93e8ab913ead83b2).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/super.md_-_Super_-_Invalid_Usages_-_Diagnostic_when_the_\342\200\246_(93e8ab913ead83b2).snap" index 456d3f18be4b07..094e39d4ef4c03 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/super.md_-_Super_-_Invalid_Usages_-_Diagnostic_when_the_\342\200\246_(93e8ab913ead83b2).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/super.md_-_Super_-_Invalid_Usages_-_Diagnostic_when_the_\342\200\246_(93e8ab913ead83b2).snap" @@ -34,6 +34,5 @@ error[invalid-super-argument]: Argument is not a valid class | 11 | super(A, A()) # error: [invalid-super-argument] | ^^^^^^^^^^^^^ Argument has type `.A @ src/mdtest_snippet.py:6:15'> | .A @ src/mdtest_snippet.py:9:15'>` - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/sync.md_-_With_statements_-_Context_expression_w\342\200\246_(3d4f2229d00f8d86).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/sync.md_-_With_statements_-_Context_expression_w\342\200\246_(3d4f2229d00f8d86).snap" index 036133bd8396bb..1a5b7bf330fe0d 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/sync.md_-_With_statements_-_Context_expression_w\342\200\246_(3d4f2229d00f8d86).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/sync.md_-_With_statements_-_Context_expression_w\342\200\246_(3d4f2229d00f8d86).snap" @@ -40,6 +40,5 @@ error[invalid-context-manager]: Object of type `GoodManager | BadManager` cannot | 16 | with context_expr as f: | ^^^^^^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/sync.md_-_With_statements_-_Context_expression_w\342\200\246_(718dcfd7e6ed9829).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/sync.md_-_With_statements_-_Context_expression_w\342\200\246_(718dcfd7e6ed9829).snap" index f845368fbe413f..1e75bdf2b2ee18 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/sync.md_-_With_statements_-_Context_expression_w\342\200\246_(718dcfd7e6ed9829).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/sync.md_-_With_statements_-_Context_expression_w\342\200\246_(718dcfd7e6ed9829).snap" @@ -39,7 +39,6 @@ error[invalid-context-manager]: Object of type `GoodManager | MissingExitManager | 15 | with context_expr as f: | ^^^^^^^^^^^^ - | info: `NotAContextManager` does not implement `__enter__` or `__exit__` info: `MissingExitManager` does not implement `__exit__` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/sync.md_-_With_statements_-_Context_expression_w\342\200\246_(8686e7748a7c975).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/sync.md_-_With_statements_-_Context_expression_w\342\200\246_(8686e7748a7c975).snap" index 02cebd2c08aabf..c53e9081f63f5b 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/sync.md_-_With_statements_-_Context_expression_w\342\200\246_(8686e7748a7c975).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/sync.md_-_With_statements_-_Context_expression_w\342\200\246_(8686e7748a7c975).snap" @@ -35,7 +35,6 @@ error[invalid-context-manager]: Object of type `Manager1 | NotAContextManager` c | 11 | with context_expr as f: | ^^^^^^^^^^^^ - | info: `NotAContextManager` does not implement `__enter__` or `__exit__` ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Chained_comparisons_\342\200\246_(f45f1da2f8ca693d).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Chained_comparisons_\342\200\246_(f45f1da2f8ca693d).snap" index 4929923292b09d..8fff86797c3641 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Chained_comparisons_\342\200\246_(f45f1da2f8ca693d).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Chained_comparisons_\342\200\246_(f45f1da2f8ca693d).snap" @@ -40,7 +40,6 @@ error[unsupported-bool-conversion]: Boolean conversion is not supported for type | 15 | a < b < b | ^^^^^ - | info: `__bool__` on `NotBoolable | Literal[False]` must be callable ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Equality_with_elemen\342\200\246_(39b614d4707c0661).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Equality_with_elemen\342\200\246_(39b614d4707c0661).snap" index 5704deda5d4a40..9584e58b4e628a 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Equality_with_elemen\342\200\246_(39b614d4707c0661).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Equality_with_elemen\342\200\246_(39b614d4707c0661).snap" @@ -45,7 +45,6 @@ error[invalid-method-override]: Invalid override of method `__eq__` | 136 | def __eq__(self, value: object, /) -> bool: ... | -------------------------------------- `object.__eq__` defined here - | info: incompatible return types: `NotBoolable` is not assignable to `bool` info: This violates the Liskov Substitution Principle help: It is recommended for `__eq__` to work with arbitrary objects, for example: @@ -64,7 +63,6 @@ error[unsupported-bool-conversion]: Boolean conversion is not supported for type | 10 | reveal_type((A(),) == (A(),)) # revealed: bool | ^^^^^^^^^^^^^^^^ - | info: `__bool__` on `NotBoolable` must be callable ``` @@ -75,7 +73,6 @@ error[unsupported-bool-conversion]: Boolean conversion is not supported for type | 12 | reveal_type((A(), "x") == (A(), "y")) # revealed: Literal[False] | ^^^^^^^^^^^^^^^^^^^^^^^^ - | info: `__bool__` on `NotBoolable` must be callable ``` @@ -86,7 +83,6 @@ error[unsupported-bool-conversion]: Boolean conversion is not supported for type | 14 | reveal_type((A(),) != (A(), 0)) # revealed: Literal[True] | ^^^^^^^^^^^^^^^^^^ - | info: `__bool__` on `NotBoolable` must be callable ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Heterogeneous_-_Value_Comparisons_-_Comparison_Unsupport\342\200\246_(966dd82bd3668d0e).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Heterogeneous_-_Value_Comparisons_-_Comparison_Unsupport\342\200\246_(966dd82bd3668d0e).snap" index 4c94dacd0820da..379e13c47cce54 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Heterogeneous_-_Value_Comparisons_-_Comparison_Unsupport\342\200\246_(966dd82bd3668d0e).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Heterogeneous_-_Value_Comparisons_-_Comparison_Unsupport\342\200\246_(966dd82bd3668d0e).snap" @@ -53,7 +53,6 @@ error[unsupported-operator]: Unsupported `<` operation | | | | | Has type `tuple[Literal[1], Literal["hello"]]` | Has type `tuple[Literal[1], Literal[2]]` - | info: Operation fails because operator `<` is not supported between the tuple elements at index 2 (of type `Literal[2]` and `Literal["hello"]`) ``` @@ -67,7 +66,6 @@ error[unsupported-operator]: Unsupported `<=` operation | | | | | Has type `tuple[Literal[1], Literal["hello"]]` | Has type `tuple[Literal[1], Literal[2]]` - | info: Operation fails because operator `<=` is not supported between the tuple elements at index 2 (of type `Literal[2]` and `Literal["hello"]`) ``` @@ -81,7 +79,6 @@ error[unsupported-operator]: Unsupported `>` operation | | | | | Has type `tuple[Literal[1], Literal["hello"]]` | Has type `tuple[Literal[1], Literal[2]]` - | info: Operation fails because operator `>` is not supported between the tuple elements at index 2 (of type `Literal[2]` and `Literal["hello"]`) ``` @@ -95,7 +92,6 @@ error[unsupported-operator]: Unsupported `>=` operation | | | | | Has type `tuple[Literal[1], Literal["hello"]]` | Has type `tuple[Literal[1], Literal[2]]` - | info: Operation fails because operator `>=` is not supported between the tuple elements at index 2 (of type `Literal[2]` and `Literal["hello"]`) ``` @@ -108,7 +104,6 @@ error[unsupported-operator]: Unsupported `<` operation | -----------^^^----------- | | | Both operands have type `tuple[object]` - | info: Operation fails because operator `<` is not supported between the tuple elements at index 1 (both of type `object`) ``` @@ -121,7 +116,6 @@ error[unsupported-operator]: Unsupported `<` operation | -----------^^^----------- | | | Both operands have type `tuple[object]` - | info: Operation fails because operator `<` is not supported between the tuple elements at index 1 (both of type `object`) ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Homogeneous_-_Tuples_with_Prefixes\342\200\246_(c25079c01f6d8eb3).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Homogeneous_-_Tuples_with_Prefixes\342\200\246_(c25079c01f6d8eb3).snap" index 254cb309ea7d4e..0eae1e0107d82c 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Homogeneous_-_Tuples_with_Prefixes\342\200\246_(c25079c01f6d8eb3).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Homogeneous_-_Tuples_with_Prefixes\342\200\246_(c25079c01f6d8eb3).snap" @@ -39,7 +39,6 @@ error[unsupported-operator]: Unsupported `<` operation | | | | | Has type `tuple[str, *tuple[int, ...]]` | Has type `tuple[int, *tuple[str, ...]]` - | info: Operation fails because operator `<` is not supported between objects of type `int` and `str` ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Homogeneous_-_Unsupported_Comparis\342\200\246_(400a427b33d53e00).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Homogeneous_-_Unsupported_Comparis\342\200\246_(400a427b33d53e00).snap" index 6d81e32027bdf8..144450cf1ead8a 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Homogeneous_-_Unsupported_Comparis\342\200\246_(400a427b33d53e00).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Homogeneous_-_Unsupported_Comparis\342\200\246_(400a427b33d53e00).snap" @@ -65,7 +65,6 @@ error[unsupported-operator]: Unsupported `<` operation | | | | | Has type `tuple[str, ...]` | Has type `tuple[int, ...]` - | info: Operation fails because operator `<` is not supported between objects of type `int` and `str` ``` @@ -79,7 +78,6 @@ error[unsupported-operator]: Unsupported `<` operation | | | | | Has type `tuple[int, ...]` | Has type `tuple[str, ...]` - | info: Operation fails because operator `<` is not supported between objects of type `str` and `int` ``` @@ -93,7 +91,6 @@ error[unsupported-operator]: Unsupported `<` operation | | | | | Has type `tuple[str]` | Has type `tuple[int, ...]` - | info: Operation fails because operator `<` is not supported between objects of type `int` and `str` ``` @@ -107,7 +104,6 @@ error[unsupported-operator]: Unsupported `<` operation | | | | | Has type `tuple[int, ...]` | Has type `tuple[str]` - | info: Operation fails because operator `<` is not supported between objects of type `str` and `int` ``` @@ -121,7 +117,6 @@ error[unsupported-operator]: Unsupported `<` operation | | | | | Has type `tuple[int, ...]` | Has type `tuple[int, str]` - | info: Operation fails because operator `<` is not supported between objects of type `str` and `int` ``` @@ -135,7 +130,6 @@ error[unsupported-operator]: Unsupported `<` operation | | | | | Has type `tuple[int, str]` | Has type `tuple[int, ...]` - | info: Operation fails because operator `<` is not supported between objects of type `int` and `str` ``` @@ -149,7 +143,6 @@ error[unsupported-operator]: Unsupported `<` operation | | | | | Has type `tuple[int, str]` | Has type `tuple[str, ...]` - | info: Operation fails because operator `<` is not supported between objects of type `str` and `int` ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Class_header_validat\342\200\246_(25381f371caa1401).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Class_header_validat\342\200\246_(25381f371caa1401).snap" index 954fafa461b09d..0c16ade179dff8 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Class_header_validat\342\200\246_(25381f371caa1401).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Class_header_validat\342\200\246_(25381f371caa1401).snap" @@ -50,7 +50,6 @@ error[invalid-typed-dict-header]: TypedDict class `Foo` can only inherit from Ty | 349 | class int: | --- `int` defined here - | ``` @@ -65,7 +64,6 @@ error[invalid-typed-dict-header]: TypedDict class `Foo2` can only inherit from T | 113 | class object: | ------ `object` defined here - | ``` @@ -75,7 +73,6 @@ error[invalid-argument-type]: Invalid argument to parameter `total` in `TypedDic | 7 | class Bar(TypedDict, total=42): ... # error: [invalid-argument-type] | ^^^^^^^^ Expected either `True` or `False`, got object of type `Literal[42]` - | ``` @@ -85,7 +82,6 @@ error[invalid-argument-type]: Invalid argument to parameter `closed` in `TypedDi | 8 | class Baz(TypedDict, closed=None): ... # error: [invalid-argument-type] | ^^^^^^^^^^^ Expected either `True` or `False`, got object of type `None` - | ``` @@ -95,7 +91,6 @@ error[invalid-argument-type]: Invalid argument to parameter `total` in `TypedDic | 10 | class VeryDynamic(TypedDict, total=is_total): ... # error: [invalid-argument-type] | ^^^^^^^^^^^^^^ Expected either `True` or `False`, got object of type `bool` - | ``` @@ -105,7 +100,6 @@ error[unknown-argument]: Unknown keyword argument `weird` in `TypedDict` definit | 11 | class Bazzzz(TypedDict, weird=56): ... # error: [unknown-argument] | ^^^^^^^^ - | ``` @@ -115,7 +109,6 @@ error[invalid-typed-dict-header]: Custom metaclasses are not supported in `Typed | 14 | class Spam(TypedDict, metaclass=ABCMeta): ... # error: [invalid-typed-dict-header] | ^^^^^^^^^^^^^^^^^ - | ``` @@ -125,7 +118,6 @@ error[invalid-typed-dict-header]: Custom metaclasses are not supported in `Typed | 18 | class Ham(TypedDict, metaclass=type): ... # error: [invalid-typed-dict-header] | ^^^^^^^^^^^^^^ - | ``` @@ -135,7 +127,6 @@ error[invalid-typed-dict-header]: Keyword-variadic arguments are not supported i | 20 | class Eggs(TypedDict, **kwargs): ... # error: [invalid-typed-dict-header] | ^^^^^^^^ - | ``` @@ -145,7 +136,6 @@ error[invalid-argument-type]: Invalid argument to parameter `total` in `TypedDic | 21 | class Qux(TypedDict, total=1 == 1): ... # error: [invalid-argument-type] | ^^^^^^^^^^^^ Expected either `True` or `False`, got object of type `Literal[True]` - | ``` @@ -155,6 +145,5 @@ error[invalid-argument-type]: Invalid argument to parameter `closed` in `TypedDi | 22 | class Quux(TypedDict, closed=1 == 1): ... # error: [invalid-argument-type] | ^^^^^^^^^^^^^ Expected either `True` or `False`, got object of type `Literal[True]` - | ``` diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Diagnostics_(e5289abf5c570c29).snap b/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Diagnostics_(e5289abf5c570c29).snap index 33c4c3732bb377..da81f71a2886c3 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Diagnostics_(e5289abf5c570c29).snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Diagnostics_(e5289abf5c570c29).snap @@ -83,7 +83,6 @@ error[invalid-key]: Unknown key "nane" for TypedDict `Person` | | | TypedDict `Person` | - | 7 | def access_invalid_literal_string_key(person: Person): - person["nane"] # error: [invalid-key] 8 + person["name"] # error: [invalid-key] @@ -101,7 +100,6 @@ error[invalid-key]: Unknown key "nane" for TypedDict `Person` | ------ ^^^^^^^^ Unknown key "nane" - did you mean "name"? | | | TypedDict `Person` - | ``` @@ -111,7 +109,6 @@ error[invalid-key]: TypedDict `Person` can only be subscripted with a string lit | 16 | person[str_key] # error: [invalid-key] | ^^^^^^^ - | ``` @@ -124,13 +121,11 @@ error[invalid-assignment]: Invalid assignment to key "age" with declared type `i | | | | | key has declared type `int | None` | TypedDict `Person` - | info: Item declaration --> src/mdtest_snippet.py:5:5 | 5 | age: int | None | --------------- Item declared here - | ``` @@ -143,7 +138,6 @@ error[invalid-key]: Unknown key "nane" for TypedDict `Person` | | | TypedDict `Person` | - | 21 | def write_to_non_existing_key(person: Person): - person["nane"] = "Alice" # error: [invalid-key] 22 + person["name"] = "Alice" # error: [invalid-key] @@ -159,7 +153,6 @@ error[invalid-key]: TypedDict `Person` can only be subscripted with a string lit | 25 | person[str_key] = "Alice" # error: [invalid-key] | ^^^^^^^ - | ``` @@ -172,7 +165,6 @@ error[invalid-key]: Unknown key "unknown" for TypedDict `Person` | | | | | Unknown key "unknown" | TypedDict `Person` - | ``` @@ -182,7 +174,6 @@ error[invalid-key]: Unknown key "unknown" for TypedDict `Person` | 32 | bob = Person(name="Bob", age=25, unknown="Bar") | ------ TypedDict `Person` ^^^^^^^^^^^^^ Unknown key "unknown" - | ``` @@ -194,13 +185,11 @@ error[invalid-assignment]: Cannot assign to key "id" on TypedDict `Employee` | -------- ^^^^ key is marked read-only | | | TypedDict `Employee` - | info: Item declaration --> src/mdtest_snippet.py:36:5 | 36 | id: ReadOnly[int] | ----------------- Read-only item declared here - | ``` @@ -213,7 +202,6 @@ error[invalid-key]: Unknown key "nane" for TypedDict `Person` | | | TypedDict `Person` | - | 42 | # error: [invalid-key] - person['nane'] = "Alice" # fmt: skip 43 + person['name'] = "Alice" # fmt: skip @@ -229,13 +217,11 @@ error[invalid-typed-dict-field]: Cannot overwrite TypedDict field `name` | 48 | name: int # error: [invalid-typed-dict-field] | ^^^^^^^^^ Inherited mutable field type `str` is incompatible with `int` - | info: Field declaration --> src/mdtest_snippet.py:45:5 | 45 | name: str | --------- Inherited field `name` declared here on base `MovieBase` - | ``` @@ -245,18 +231,15 @@ error[invalid-typed-dict-field]: Cannot overwrite TypedDict field `value` while | 56 | class BadMerge(LeftBase, RightBase): # error: [invalid-typed-dict-field] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Inherited mutable field type `str` is incompatible with `int` - | info: Field declaration --> src/mdtest_snippet.py:51:5 | 51 | value: int | ---------- Field `value` already inherited from another base here - | info: Field declaration --> src/mdtest_snippet.py:54:5 | 54 | value: str | ---------- Inherited field `value` declared here on base `RightBase` - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Error_cases_-_`typing.TypedDict`_i\342\200\246_(9df67eb93e3df341).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Error_cases_-_`typing.TypedDict`_i\342\200\246_(9df67eb93e3df341).snap" index 75b6c4ca3f8c29..647fabb7291423 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Error_cases_-_`typing.TypedDict`_i\342\200\246_(9df67eb93e3df341).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Error_cases_-_`typing.TypedDict`_i\342\200\246_(9df67eb93e3df341).snap" @@ -27,7 +27,6 @@ error[invalid-type-form]: The special form `typing.TypedDict` is not allowed in | 4 | x: TypedDict = {"name": "Alice"} | ^^^^^^^^^ - | help: You might have meant to use a concrete TypedDict or `collections.abc.Mapping[str, object]` ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Function_syntax_with\342\200\246_(4b18755412dfaff1).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Function_syntax_with\342\200\246_(4b18755412dfaff1).snap" index 11ff93b1a4f114..35fa56551c1956 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Function_syntax_with\342\200\246_(4b18755412dfaff1).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Function_syntax_with\342\200\246_(4b18755412dfaff1).snap" @@ -119,7 +119,6 @@ error[too-many-positional-arguments]: Too many positional arguments to function | 4 | TypedDict("Foo", {}, {}) | ^^ - | ``` @@ -129,7 +128,6 @@ error[missing-argument]: No arguments provided for required parameters `typename | 6 | TypedDict() | ^^^^^^^^^^^ - | ``` @@ -139,7 +137,6 @@ error[missing-argument]: No argument provided for required parameter `fields` of | 8 | TypedDict("Foo") | ^^^^^^^^^^^^^^^^ - | ``` @@ -149,7 +146,6 @@ error[invalid-argument-type]: Invalid argument to parameter `typename` of `Typed | 11 | Bad1 = TypedDict(123, {"name": str}) | ^^^ Expected `str`, found `Literal[123]` - | ``` @@ -159,7 +155,6 @@ warning[mismatched-type-name]: The name passed to `TypedDict` must match the var | 14 | BadTypedDict3 = TypedDict("WrongName", {"name": str}) | ^^^^^^^^^^^ Expected "BadTypedDict3", got "WrongName" - | ``` @@ -169,7 +164,6 @@ warning[mismatched-type-name]: The name passed to `TypedDict` must match the var | 19 | Y = TypedDict(x, {}) | ^ Expected "Y", got variable of type `str` - | ``` @@ -179,7 +173,6 @@ error[invalid-argument-type]: Expected a dict literal for parameter `fields` of | 28 | Bad2 = TypedDict("Bad2", "not a dict") | ^^^^^^^^^^^^ - | ``` @@ -189,7 +182,6 @@ error[invalid-argument-type]: Expected a dict literal for parameter `fields` of | 30 | TypedDict("Bad2", "not a dict") | ^^^^^^^^^^^^ - | ``` @@ -199,7 +191,6 @@ error[invalid-argument-type]: Expected a dict literal for parameter `fields` of | 36 | Bad2b = TypedDict("Bad2b", get_fields()) | ^^^^^^^^^^^^ - | ``` @@ -209,7 +200,6 @@ error[invalid-argument-type]: Invalid argument to parameter `total` of `TypedDic | 39 | Bad3 = TypedDict("Bad3", {"name": str}, total="not a bool") | ^^^^^^^^^^^^ Expected either `True` or `False`, got object of type `Literal["not a bool"]` - | ``` @@ -219,7 +209,6 @@ error[invalid-argument-type]: Invalid argument to parameter `closed` of `TypedDi | 42 | Bad4 = TypedDict("Bad4", {"name": str}, closed=123) | ^^^ Expected either `True` or `False`, got object of type `Literal[123]` - | ``` @@ -229,7 +218,6 @@ error[invalid-argument-type]: Variadic positional arguments are not supported in | 48 | Bad5 = TypedDict(*tup) | ^^^^ - | ``` @@ -239,7 +227,6 @@ error[invalid-argument-type]: Variadic keyword arguments are not supported in `T | 51 | Bad6 = TypedDict("Bad6", {"name": str}, **kw) | ^^^^ - | ``` @@ -249,7 +236,6 @@ error[invalid-argument-type]: Variadic positional and keyword arguments are not | 54 | Bad7 = TypedDict(*tup, "foo", "bar", **kw) | ^^^^ ---- - | ``` @@ -259,7 +245,6 @@ error[invalid-argument-type]: Variadic keyword arguments are not supported in `T | 58 | Bad7b = TypedDict("Bad7b", **kw, random_other_arg=56) | ^^^^ - | ``` @@ -269,7 +254,6 @@ error[unknown-argument]: Argument `random_other_arg` does not match any known pa | 58 | Bad7b = TypedDict("Bad7b", **kw, random_other_arg=56) | ^^^^^^^^^^^^^^^^^^^ - | ``` @@ -279,7 +263,6 @@ error[invalid-argument-type]: Keyword splats are not allowed in the `fields` par | 63 | Bad8 = TypedDict("Bad8", {**kwargs}) | ^^^^^^ - | ``` @@ -289,7 +272,6 @@ error[invalid-argument-type]: Keyword splats are not allowed in the `fields` par | 65 | TypedDict("Bad8", {**kwargs}) | ^^^^^^ - | ``` @@ -299,7 +281,6 @@ error[invalid-argument-type]: Keyword splats are not allowed in the `fields` par | 68 | Bad81 = TypedDict("Bad81", {**kwargs, **kwargs}) | ^^^^^^ - | ``` @@ -309,7 +290,6 @@ error[invalid-argument-type]: Keyword splats are not allowed in the `fields` par | 68 | Bad81 = TypedDict("Bad81", {**kwargs, **kwargs}) | ^^^^^^ - | ``` @@ -319,7 +299,6 @@ error[invalid-argument-type]: Keyword splats are not allowed in the `fields` par | 71 | TypedDict("Bad81", {**kwargs, **kwargs}) | ^^^^^^ - | ``` @@ -329,7 +308,6 @@ error[invalid-argument-type]: Keyword splats are not allowed in the `fields` par | 71 | TypedDict("Bad81", {**kwargs, **kwargs}) | ^^^^^^ - | ``` @@ -339,7 +317,6 @@ error[invalid-argument-type]: Keyword splats are not allowed in the `fields` par | 74 | Bad82 = TypedDict("Bad82", {**kwargs, "foo": []}) | ^^^^^^ - | ``` @@ -349,7 +326,6 @@ error[invalid-type-form]: List literals are not allowed in this context in a typ | 74 | Bad82 = TypedDict("Bad82", {**kwargs, "foo": []}) | ^^ - | info: See the following page for a reference on valid type expressions: info: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions @@ -361,7 +337,6 @@ error[invalid-argument-type]: Keyword splats are not allowed in the `fields` par | 77 | TypedDict("Bad82", {**kwargs, "foo": []}) | ^^^^^^ - | ``` @@ -371,7 +346,6 @@ error[invalid-type-form]: List literals are not allowed in this context in a typ | 77 | TypedDict("Bad82", {**kwargs, "foo": []}) | ^^ - | info: See the following page for a reference on valid type expressions: info: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions @@ -383,7 +357,6 @@ error[invalid-argument-type]: Expected a string-literal key in the `fields` dict | 85 | Bad9 = TypedDict("Bad9", {name: int}) | ^^^^ Found `str` - | ``` @@ -393,7 +366,6 @@ error[invalid-argument-type]: Expected a string-literal key in the `fields` dict | 89 | Bad10 = TypedDict("Bad10", {name: 42}) | ^^^^ Found `str` - | ``` @@ -403,7 +375,6 @@ error[invalid-type-form]: Int literals are not allowed in this context in a type | 89 | Bad10 = TypedDict("Bad10", {name: 42}) | ^^ Did you mean `typing.Literal[42]`? - | info: See the following page for a reference on valid type expressions: info: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions @@ -415,7 +386,6 @@ error[invalid-argument-type]: Expected a string-literal key in the `fields` dict | 93 | class Bad11(TypedDict("Bad11", {name: 42})): ... | ^^^^ Found `str` - | ``` @@ -425,7 +395,6 @@ error[invalid-type-form]: Int literals are not allowed in this context in a type | 93 | class Bad11(TypedDict("Bad11", {name: 42})): ... | ^^ Did you mean `typing.Literal[42]`? - | info: See the following page for a reference on valid type expressions: info: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions @@ -437,6 +406,5 @@ error[invalid-argument-type]: Invalid argument to parameter `typename` of `Typed | 96 | class Bad12(TypedDict(123, {"field": int})): ... | ^^^ Expected `str`, found `Literal[123]` - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Only_annotated_decla\342\200\246_(bef70731cae5b8af).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Only_annotated_decla\342\200\246_(bef70731cae5b8af).snap" index 664164e87698e9..73aa2e55127dbc 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Only_annotated_decla\342\200\246_(bef70731cae5b8af).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Only_annotated_decla\342\200\246_(bef70731cae5b8af).snap" @@ -48,7 +48,6 @@ error[invalid-typed-dict-statement]: invalid statement in TypedDict class body | 17 | 42 | ^^ - | info: Only annotated declarations (`: `) are allowed. ``` @@ -59,7 +58,6 @@ error[invalid-typed-dict-statement]: TypedDict item cannot have a value | 19 | b: str = "hello" | ^^^^^^^ - | ``` @@ -69,7 +67,6 @@ error[invalid-typed-dict-statement]: TypedDict class cannot have methods | 21 | def bar(self): ... | ^^^^^^^^^^^^^^^^^^ - | ``` @@ -80,6 +77,5 @@ error[invalid-typed-dict-statement]: TypedDict class cannot have methods 24 | / def baz(self): 25 | | pass | |____________^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Redundant_cast_warni\342\200\246_(75ac240a2d1f7108).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Redundant_cast_warni\342\200\246_(75ac240a2d1f7108).snap" index 4dee562cbcfd63..11b404c26efadf 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Redundant_cast_warni\342\200\246_(75ac240a2d1f7108).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Redundant_cast_warni\342\200\246_(75ac240a2d1f7108).snap" @@ -34,7 +34,6 @@ warning[redundant-cast]: Value is already of type `Foo2` | 10 | _ = cast(Foo2, foo) # error: [redundant-cast] | ^^^^^^^^^^^^^^^ - | help: Remove the redundant `cast` | 9 | foo: Foo2 = {"x": 1} @@ -51,7 +50,6 @@ warning[redundant-cast]: Value is already of type `Bar2` | 11 | _ = cast(Bar2, foo) # error: [redundant-cast] | ^^^^^^^^^^^^^^^ - | info: `Bar2` is equivalent to `Foo2` help: Remove the redundant `cast` | diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_A_smaller_scale_exam\342\200\246_(c24ecd8582e5eb2f).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_A_smaller_scale_exam\342\200\246_(c24ecd8582e5eb2f).snap" index d3cd4f9d362473..3c6c138089e29a 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_A_smaller_scale_exam\342\200\246_(c24ecd8582e5eb2f).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_A_smaller_scale_exam\342\200\246_(c24ecd8582e5eb2f).snap" @@ -37,13 +37,11 @@ error[invalid-argument-type]: Argument to function `f2` is incorrect | 14 | x = f(3) | ^ Expected `str`, found `Literal[3]` - | info: Function defined here --> src/mdtest_snippet.py:4:5 | 4 | def f2(name: str) -> int: | ^^ --------- Parameter declared here - | info: Union variant `def f2(name: str) -> int` is incompatible with this call site info: Attempted to call union type `(def f1() -> int) | (def f2(name: str) -> int)` @@ -55,7 +53,6 @@ error[too-many-positional-arguments]: Too many positional arguments to function | 14 | x = f(3) | ^ - | info: Union variant `def f1() -> int` is incompatible with this call site info: Attempted to call union type `(def f1() -> int) | (def f2(name: str) -> int)` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Multiple_variants_bu\342\200\246_(d840ac443ca8ec7f).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Multiple_variants_bu\342\200\246_(d840ac443ca8ec7f).snap" index afc0cac0273794..ab68afe402f02d 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Multiple_variants_bu\342\200\246_(d840ac443ca8ec7f).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Multiple_variants_bu\342\200\246_(d840ac443ca8ec7f).snap" @@ -36,13 +36,11 @@ error[invalid-argument-type]: Argument to function `f2` is incorrect | 13 | x = f(3) | ^ Expected `str`, found `Literal[3]` - | info: Function defined here --> src/mdtest_snippet.py:4:5 | 4 | def f2(name: str) -> int: | ^^ --------- Parameter declared here - | info: Union variant `def f2(name: str) -> int` is incompatible with this call site info: Attempted to call union type `(def f1(a: int) -> int) | (def f2(name: str) -> int)` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Try_to_cover_all_pos\342\200\246_-_Attribute_access_on_\342\200\246_(7bdb97302c27c412).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Try_to_cover_all_pos\342\200\246_-_Attribute_access_on_\342\200\246_(7bdb97302c27c412).snap" index c42fc43dc8cd70..7d4a0a1fe8ae8a 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Try_to_cover_all_pos\342\200\246_-_Attribute_access_on_\342\200\246_(7bdb97302c27c412).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Try_to_cover_all_pos\342\200\246_-_Attribute_access_on_\342\200\246_(7bdb97302c27c412).snap" @@ -40,7 +40,6 @@ error[invalid-argument-type]: Argument to bound method `A.foo` is incorrect | 17 | return x.foo(y) | ^^^^^^^^ Argument type `T@_` does not satisfy upper bound `A` of type variable `Self` - | info: Union variant `bound method T@_.foo(x: int) -> T@_` is incompatible with this call site info: Attempted to call union type `(bound method T@_.foo(x: int) -> T@_) | (bound method T@_.foo(x: str) -> T@_)` @@ -52,7 +51,6 @@ error[invalid-argument-type]: Argument to bound method `B.foo` is incorrect | 17 | return x.foo(y) | ^^^^^^^^ Argument type `T@_` does not satisfy upper bound `B` of type variable `Self` - | info: Union variant `bound method T@_.foo(x: str) -> T@_` is incompatible with this call site info: Attempted to call union type `(bound method T@_.foo(x: int) -> T@_) | (bound method T@_.foo(x: str) -> T@_)` @@ -64,13 +62,11 @@ error[invalid-argument-type]: Argument to bound method `B.foo` is incorrect | 17 | return x.foo(y) | ^ Expected `str`, found `int` - | info: Method defined here --> src/mdtest_snippet.py:8:9 | 8 | def foo(self, x: str) -> Self: | ^^^ ------ Parameter declared here - | info: Union variant `bound method T@_.foo(x: str) -> T@_` is incompatible with this call site info: Attempted to call union type `(bound method T@_.foo(x: int) -> T@_) | (bound method T@_.foo(x: str) -> T@_)` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Try_to_cover_all_pos\342\200\246_-_Cover_keyword_argume\342\200\246_(ad1d489710ee2a34).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Try_to_cover_all_pos\342\200\246_-_Cover_keyword_argume\342\200\246_(ad1d489710ee2a34).snap" index 43cc83213d3f05..f5fd2564339f4f 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Try_to_cover_all_pos\342\200\246_-_Cover_keyword_argume\342\200\246_(ad1d489710ee2a34).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Try_to_cover_all_pos\342\200\246_-_Cover_keyword_argume\342\200\246_(ad1d489710ee2a34).snap" @@ -37,7 +37,6 @@ error[parameter-already-assigned]: Multiple values provided for parameter `name` | 14 | y = f("foo", name="bar", unknown="quux") | ^^^^^^^^^^ - | info: Union variant `def f1(name: str) -> int` is incompatible with this call site info: Attempted to call union type `(def f1(name: str) -> int) | (def any(...) -> int)` @@ -49,7 +48,6 @@ error[unknown-argument]: Argument `unknown` does not match any known parameter o | 14 | y = f("foo", name="bar", unknown="quux") | ^^^^^^^^^^^^^^ - | info: Union variant `def f1(name: str) -> int` is incompatible with this call site info: Attempted to call union type `(def f1(name: str) -> int) | (def any(...) -> int)` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Try_to_cover_all_pos\342\200\246_-_Cover_non-keyword_re\342\200\246_(707b284610419a54).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Try_to_cover_all_pos\342\200\246_-_Cover_non-keyword_re\342\200\246_(707b284610419a54).snap" index fc22cf876db61b..10819756184b7f 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Try_to_cover_all_pos\342\200\246_-_Cover_non-keyword_re\342\200\246_(707b284610419a54).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Try_to_cover_all_pos\342\200\246_-_Cover_non-keyword_re\342\200\246_(707b284610419a54).snap" @@ -83,7 +83,6 @@ error[call-non-callable]: Object of type `Literal[5]` is not callable | 60 | x = f(3) | ^^^^ - | info: Union variant `Literal[5]` is incompatible with this call site info: Attempted to call union type `(def f1() -> int) | (def f2(name: str) -> int) | (def f3(a: int, b: int) -> int) | ... omitted 5 union elements` @@ -95,7 +94,6 @@ error[call-non-callable]: Object of type `PossiblyNotCallable` is not callable ( | 60 | x = f(3) | ^^^^ - | info: Union variant `PossiblyNotCallable` is incompatible with this call site info: Attempted to call union type `(def f1() -> int) | (def f2(name: str) -> int) | (def f3(a: int, b: int) -> int) | ... omitted 5 union elements` @@ -107,7 +105,6 @@ error[missing-argument]: No argument provided for required parameter `b` of func | 60 | x = f(3) | ^^^^ - | info: Union variant `def f3(a: int, b: int) -> int` is incompatible with this call site info: Attempted to call union type `(def f1() -> int) | (def f2(name: str) -> int) | (def f3(a: int, b: int) -> int) | ... omitted 5 union elements` @@ -119,14 +116,12 @@ error[no-matching-overload]: No overload of function `f6` matches arguments | 60 | x = f(3) | ^^^^ - | info: First overload defined here --> src/mdtest_snippet.py:23:1 | 23 | / @overload 24 | | def f6() -> None: ... | |_____________________^ First overload defined here - | info: Possible overloads for function `f6`: info: () -> None info: (x: str, y: str) -> str @@ -135,7 +130,6 @@ info: Overload implementation defined here | 27 | def f6(x: str | None = None, y: str | None = None) -> str | None: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | info: Union variant `Overload[() -> None, (x: str, y: str) -> str]` is incompatible with this call site info: Attempted to call union type `(def f1() -> int) | (def f2(name: str) -> int) | (def f3(a: int, b: int) -> int) | ... omitted 5 union elements` @@ -147,13 +141,11 @@ error[invalid-argument-type]: Argument to function `f2` is incorrect | 60 | x = f(3) | ^ Expected `str`, found `Literal[3]` - | info: Function defined here --> src/mdtest_snippet.py:7:5 | 7 | def f2(name: str) -> int: | ^^ --------- Parameter declared here - | info: Union variant `def f2(name: str) -> int` is incompatible with this call site info: Attempted to call union type `(def f1() -> int) | (def f2(name: str) -> int) | (def f3(a: int, b: int) -> int) | ... omitted 5 union elements` @@ -165,13 +157,11 @@ error[invalid-argument-type]: Argument to function `f4` is incorrect | 60 | x = f(3) | ^ Argument type `Literal[3]` does not satisfy upper bound `str` of type variable `T` - | info: Type variable defined here --> src/mdtest_snippet.py:13:8 | 13 | def f4[T: str](x: T) -> int: | ^^^^^^ - | info: Union variant `def f4[T](x: T) -> int` is incompatible with this call site info: Attempted to call union type `(def f1() -> int) | (def f2(name: str) -> int) | (def f3(a: int, b: int) -> int) | ... omitted 5 union elements` @@ -183,13 +173,11 @@ error[invalid-argument-type]: Argument to function `f5` is incorrect | 60 | x = f(3) | ^ Expected `str`, found `Literal[3]` - | info: Matching overload defined here --> src/mdtest_snippet.py:19:5 | 19 | def f5(x: str) -> str: ... | ^^ ------ Parameter declared here - | info: Non-matching overloads for function `f5`: info: () -> None info: Union variant `Overload[() -> None, (x: str) -> str]` is incompatible with this call site @@ -203,7 +191,6 @@ error[too-many-positional-arguments]: Too many positional arguments to function | 60 | x = f(3) | ^ - | info: Union variant `def f1() -> int` is incompatible with this call site info: Attempted to call union type `(def f1() -> int) | (def f2(name: str) -> int) | (def f3(a: int, b: int) -> int) | ... omitted 5 union elements` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Try_to_cover_all_pos\342\200\246_-_Truncation_for_long_\342\200\246_(ec94b5e857284ef3).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Try_to_cover_all_pos\342\200\246_-_Truncation_for_long_\342\200\246_(ec94b5e857284ef3).snap" index 1f809315b5918c..50eecabcce2850 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Try_to_cover_all_pos\342\200\246_-_Truncation_for_long_\342\200\246_(ec94b5e857284ef3).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Try_to_cover_all_pos\342\200\246_-_Truncation_for_long_\342\200\246_(ec94b5e857284ef3).snap" @@ -39,12 +39,10 @@ error[invalid-argument-type]: Argument to function `f1` is incorrect | 16 | f1(x) | ^ Expected `Literal[1, 2, 3, 4, 5, ... omitted 3 literals] | A | B | ... omitted 4 union elements`, found `int` - | info: Function defined here --> src/mdtest_snippet.py:10:5 | 10 | def f1(x: Union[Literal[1, 2, 3, 4, 5, 6, 7, 8], A, B, C, D, E, F]) -> int: | ^^ ----------------------------------------------------------- Parameter declared here - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Union_with_overloade\342\200\246_(4408ade1316b97c0).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Union_with_overloade\342\200\246_(4408ade1316b97c0).snap" index cdec5731493fa1..cbaf244dbc6f42 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Union_with_overloade\342\200\246_(4408ade1316b97c0).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f\342\200\246_-_Union_with_overloade\342\200\246_(4408ade1316b97c0).snap" @@ -27,7 +27,6 @@ error[unresolved-attribute]: Attribute `split` is not defined on `int` in union | 4 | x.split(" ") | ^^^^^^^ - | ``` @@ -37,7 +36,6 @@ error[invalid-argument-type]: Argument to bound method `bytes.split` is incorrec | 4 | x.split(" ") | ^^^ Expected `Buffer | None`, found `Literal[" "]` - | info: type `Literal[" "]` is not assignable to any element of the union `Buffer | None` info: ├── type `Literal[" "]` is not assignable to protocol `Buffer` info: │ └── protocol member `__buffer__` is not defined on type `Literal[" "]` @@ -47,7 +45,6 @@ info: Method defined here | 1843 | def split(self, sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[bytes]: | ^^^^^ --------------------------------- Parameter declared here - | info: Union variant `bound method bytes.split(sep: Buffer | None = None, maxsplit: SupportsIndex = -1) -> list[bytes]` is incompatible with this call site info: Attempted to call union type `(bound method bytes.split(sep: Buffer | None = None, maxsplit: SupportsIndex = -1) -> list[bytes]) | (bound method str.split(sep: str | None = None, maxsplit: SupportsIndex = -1) -> list[str])` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/unknown_argument.md_-_Unknown_argument_dia\342\200\246_(f419c2a8e2ce2412).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/unknown_argument.md_-_Unknown_argument_dia\342\200\246_(f419c2a8e2ce2412).snap" index 30e8f26de44a96..9ce0cfb6fee88e 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/unknown_argument.md_-_Unknown_argument_dia\342\200\246_(f419c2a8e2ce2412).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/unknown_argument.md_-_Unknown_argument_dia\342\200\246_(f419c2a8e2ce2412).snap" @@ -47,13 +47,11 @@ error[unknown-argument]: Argument `d` does not match any known parameter of func | 3 | f(a=1, b=2, c=3, d=42) # error: [unknown-argument] | ^^^^ - | info: Function signature here --> src/module.py:1:5 | 1 | def f(a, b, c=42): ... | ^^^^^^^^^^^^^ - | ``` @@ -63,7 +61,6 @@ error[unknown-argument]: Argument `d` does not match any known parameter of func | 12 | h(a=1, b=2, d=42) | ^^^^ - | info: Union variant `def f(a, b, c=42) -> Unknown` is incompatible with this call site info: Attempted to call union type `(def f(a, b, c=42) -> Unknown) | (def g(a, b) -> Unknown)` @@ -75,7 +72,6 @@ error[unknown-argument]: Argument `d` does not match any known parameter of func | 12 | h(a=1, b=2, d=42) | ^^^^ - | info: Union variant `def g(a, b) -> Unknown` is incompatible with this call site info: Attempted to call union type `(def f(a, b, c=42) -> Unknown) | (def g(a, b) -> Unknown)` @@ -87,12 +83,10 @@ error[unknown-argument]: Argument `c` does not match any known parameter of boun | 14 | Foo().method(a=1, b=2, c=3) # error: [unknown-argument] | ^^^ - | info: Method signature here --> src/module.py:5:9 | 5 | def method(self, a, b): ... | ^^^^^^^^^^^^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_An_unresolvable_impo\342\200\246_(72d090df51ea97b8).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_An_unresolvable_impo\342\200\246_(72d090df51ea97b8).snap" index 561207fe582fb7..51d6e37be94b89 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_An_unresolvable_impo\342\200\246_(72d090df51ea97b8).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_An_unresolvable_impo\342\200\246_(72d090df51ea97b8).snap" @@ -26,7 +26,6 @@ error[unresolved-import]: Cannot resolve imported module `does_not_exist` | 1 | import does_not_exist # error: [unresolved-import] | ^^^^^^^^^^^^^^ - | info: Searched in the following paths during module resolution: info: 1. /src (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_Using_`from`_with_a_\342\200\246_(12d4a70b7fc67cc6).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_Using_`from`_with_a_\342\200\246_(12d4a70b7fc67cc6).snap" index 8aa1e73adcc988..1d2b3fe720c419 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_Using_`from`_with_a_\342\200\246_(12d4a70b7fc67cc6).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_Using_`from`_with_a_\342\200\246_(12d4a70b7fc67cc6).snap" @@ -31,6 +31,5 @@ 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] | ^^^^^^^^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_Using_`from`_with_an\342\200\246_(6cff507dc64a1bff).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_Using_`from`_with_an\342\200\246_(6cff507dc64a1bff).snap" index 7ff5d67069f142..3675b71844ec22 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_Using_`from`_with_an\342\200\246_(6cff507dc64a1bff).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_Using_`from`_with_an\342\200\246_(6cff507dc64a1bff).snap" @@ -26,7 +26,6 @@ error[unresolved-import]: Cannot resolve imported module `.does_not_exist.foo.ba | 1 | from .does_not_exist.foo.bar import add # error: [unresolved-import] | ^^^^^^^^^^^^^^^^^^^^^^ - | info: Searched in the following paths during module resolution: info: 1. /src (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_Using_`from`_with_an\342\200\246_(9da56616d6332a83).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_Using_`from`_with_an\342\200\246_(9da56616d6332a83).snap" index 308a61eedcfdc1..8ac259aae2ac76 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_Using_`from`_with_an\342\200\246_(9da56616d6332a83).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_Using_`from`_with_an\342\200\246_(9da56616d6332a83).snap" @@ -26,7 +26,6 @@ error[unresolved-import]: Cannot resolve imported module `.does_not_exist` | 1 | from .does_not_exist import add # error: [unresolved-import] | ^^^^^^^^^^^^^^ - | info: Searched in the following paths during module resolution: info: 1. /src (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_Using_`from`_with_an\342\200\246_(9fa713dfa17cc404).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_Using_`from`_with_an\342\200\246_(9fa713dfa17cc404).snap" index d8cc9b5c312e4f..5a7816e5218ae5 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_Using_`from`_with_an\342\200\246_(9fa713dfa17cc404).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_Using_`from`_with_an\342\200\246_(9fa713dfa17cc404).snap" @@ -26,7 +26,6 @@ error[unresolved-import]: Cannot resolve imported module `does_not_exist` | 1 | from does_not_exist import add # error: [unresolved-import] | ^^^^^^^^^^^^^^ - | info: Searched in the following paths during module resolution: info: 1. /src (first-party code) info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_Using_`from`_with_to\342\200\246_(4b8ba6ee48180cdd).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_Using_`from`_with_to\342\200\246_(4b8ba6ee48180cdd).snap" index b6eb52cd638263..31c9ed5c0c972f 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_Using_`from`_with_to\342\200\246_(4b8ba6ee48180cdd).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_import.md_-_Unresolved_import_di\342\200\246_-_Using_`from`_with_to\342\200\246_(4b8ba6ee48180cdd).snap" @@ -38,7 +38,6 @@ error[unresolved-import]: Cannot resolve imported module `....foo` | 1 | from ....foo import add # error: [unresolved-import] | ^^^ - | help: The module can be resolved if the number of leading dots is reduced help: Did you mean `...foo`? info: Searched in the following paths during module resolution: diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_reference\342\200\246_-_Diagnostics_for_unre\342\200\246_-_New_builtin_used_on_\342\200\246_(51edda0b1aebc2bf).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_reference\342\200\246_-_Diagnostics_for_unre\342\200\246_-_New_builtin_used_on_\342\200\246_(51edda0b1aebc2bf).snap" index 703f7b3257f489..d6e34c335ce3af 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_reference\342\200\246_-_Diagnostics_for_unre\342\200\246_-_New_builtin_used_on_\342\200\246_(51edda0b1aebc2bf).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_reference\342\200\246_-_Diagnostics_for_unre\342\200\246_-_New_builtin_used_on_\342\200\246_(51edda0b1aebc2bf).snap" @@ -24,7 +24,6 @@ error[unresolved-reference]: Name `PythonFinalizationError` used when not define | 1 | PythonFinalizationError # error: [unresolved-reference] | ^^^^^^^^^^^^^^^^^^^^^^^ - | info: `PythonFinalizationError` was added as a builtin in Python 3.13 info: Python 3.12 was assumed when resolving types because it was specified on the command line diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_reference\342\200\246_-_Diagnostics_for_unre\342\200\246_-_Typing_builtin_has_I\342\200\246_-_Info_not_present_bef\342\200\246_(41702a6f6d20b082).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_reference\342\200\246_-_Diagnostics_for_unre\342\200\246_-_Typing_builtin_has_I\342\200\246_-_Info_not_present_bef\342\200\246_(41702a6f6d20b082).snap" index a1d39ac44b2ca4..0fcc75f48ad066 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_reference\342\200\246_-_Diagnostics_for_unre\342\200\246_-_Typing_builtin_has_I\342\200\246_-_Info_not_present_bef\342\200\246_(41702a6f6d20b082).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_reference\342\200\246_-_Diagnostics_for_unre\342\200\246_-_Typing_builtin_has_I\342\200\246_-_Info_not_present_bef\342\200\246_(41702a6f6d20b082).snap" @@ -25,7 +25,6 @@ error[unresolved-reference]: Name `List` used when not defined | 1 | foo: List[int] # error: [unresolved-reference] | ^^^^ - | ``` @@ -35,6 +34,5 @@ error[unresolved-reference]: Name `Type` used when not defined | 2 | bar: Type # error: [unresolved-reference] | ^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_reference\342\200\246_-_Diagnostics_for_unre\342\200\246_-_Typing_builtin_has_I\342\200\246_-_Info_present_in_Pyth\342\200\246_(1028a80959504fc9).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_reference\342\200\246_-_Diagnostics_for_unre\342\200\246_-_Typing_builtin_has_I\342\200\246_-_Info_present_in_Pyth\342\200\246_(1028a80959504fc9).snap" index ff80a771060c80..cc2b3758fd563c 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_reference\342\200\246_-_Diagnostics_for_unre\342\200\246_-_Typing_builtin_has_I\342\200\246_-_Info_present_in_Pyth\342\200\246_(1028a80959504fc9).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/unresolved_reference\342\200\246_-_Diagnostics_for_unre\342\200\246_-_Typing_builtin_has_I\342\200\246_-_Info_present_in_Pyth\342\200\246_(1028a80959504fc9).snap" @@ -25,7 +25,6 @@ error[unresolved-reference]: Name `List` used when not defined | 1 | foo: List[int] # error: [unresolved-reference] | ^^^^ Did you mean `list`? - | ``` @@ -35,6 +34,5 @@ error[unresolved-reference]: Name `Type` used when not defined | 2 | bar: Type # error: [unresolved-reference] | ^^^^ Did you mean `type`? - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_Enum_base_(4873196c8b48364).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_Enum_base_(4873196c8b48364).snap" index 16ebf6b6afe095..31ef1a61df33c1 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_Enum_base_(4873196c8b48364).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_Enum_base_(4873196c8b48364).snap" @@ -29,7 +29,6 @@ error[invalid-base]: Invalid base for class created via `type()` | 6 | X = type("X", (MyEnum,), {}) # error: [invalid-base] | ^^^^^^ Has type `` - | info: Creating an enum class via `type()` is not supported info: Consider using `Enum("X", [])` instead diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_Enum_with_members_(81bef9a8e1230854).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_Enum_with_members_(81bef9a8e1230854).snap" index f971b932d3a260..8485e0f5bad972 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_Enum_with_members_(81bef9a8e1230854).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_Enum_with_members_(81bef9a8e1230854).snap" @@ -30,6 +30,5 @@ error[subclass-of-final-class]: Class `X` cannot inherit from final class `Color | 7 | X = type("X", (Color,), {}) # error: [subclass-of-final-class] | ^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_`@final`_class_(ea69d237256b3762).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_`@final`_class_(ea69d237256b3762).snap" index 9ab5159345ade4..e87d71ccbb8043 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_`@final`_class_(ea69d237256b3762).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_`@final`_class_(ea69d237256b3762).snap" @@ -30,6 +30,5 @@ error[subclass-of-final-class]: Class `X` cannot inherit from final class `Final | 7 | X = type("X", (FinalClass,), {}) # error: [subclass-of-final-class] | ^^^^^^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_`Generic`_base_(d455f46a27cec685).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_`Generic`_base_(d455f46a27cec685).snap" index 2ad2cc404490f2..c6ef194401c703 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_`Generic`_base_(d455f46a27cec685).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_`Generic`_base_(d455f46a27cec685).snap" @@ -28,7 +28,6 @@ error[invalid-base]: Invalid base for class created via `type()` | 5 | X = type("X", (Generic[T],), {}) # error: [invalid-base] | ^^^^^^^^^^ Has type `` - | info: Classes created via `type()` cannot be generic info: Consider using `class X(Generic[...]): ...` instead diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_`Protocol`_base_(99c9bde73664dd51).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_`Protocol`_base_(99c9bde73664dd51).snap" index a10d89d6a87aa1..395f228b5fed1f 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_`Protocol`_base_(99c9bde73664dd51).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_`Protocol`_base_(99c9bde73664dd51).snap" @@ -26,7 +26,6 @@ info[unsupported-dynamic-base]: Unsupported base for class created via `type()` | 3 | X = type("X", (Protocol,), {}) # error: [unsupported-dynamic-base] | ^^^^^^^^ Has type `` - | info: Classes created via `type()` cannot be protocols info: Consider using `class X(Protocol): ...` instead diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_`TypedDict`_base_(6f76171c88fc8760).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_`TypedDict`_base_(6f76171c88fc8760).snap" index 67179b87da4a23..03d01d06041900 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_`TypedDict`_base_(6f76171c88fc8760).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_base_dyn\342\200\246_-_Unsupported_base_for\342\200\246_-_`TypedDict`_base_(6f76171c88fc8760).snap" @@ -26,7 +26,6 @@ error[invalid-base]: Invalid base for class created via `type()` | 3 | X = type("X", (TypedDict,), {}) # error: [invalid-base] | ^^^^^^^^^ Has type `` - | info: Classes created via `type()` cannot be TypedDicts info: Consider using `TypedDict("X", {})` instead diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Has_a_`__bool__`_att\342\200\246_(2721d40bf12fe8b7).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Has_a_`__bool__`_att\342\200\246_(2721d40bf12fe8b7).snap" index b26e7068349282..97865ae1a4e5c5 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Has_a_`__bool__`_att\342\200\246_(2721d40bf12fe8b7).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Has_a_`__bool__`_att\342\200\246_(2721d40bf12fe8b7).snap" @@ -30,7 +30,6 @@ error[unsupported-bool-conversion]: Boolean conversion is not supported for type | 7 | 10 and a and True | ^ - | info: `__bool__` on `NotBoolable` must be callable ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Has_a_`__bool__`_met\342\200\246_(15636dc4074e5335).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Has_a_`__bool__`_met\342\200\246_(15636dc4074e5335).snap" index 2f05042fde9512..c8384e3d688765 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Has_a_`__bool__`_met\342\200\246_(15636dc4074e5335).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Has_a_`__bool__`_met\342\200\246_(15636dc4074e5335).snap" @@ -31,7 +31,6 @@ error[unsupported-bool-conversion]: Boolean conversion is not supported for type | 8 | 10 and a and True | ^ - | info: `str` is not assignable to `bool` --> src/mdtest_snippet.py:2:9 | @@ -39,6 +38,5 @@ info: `str` is not assignable to `bool` | -------- ^^^ Incorrect return type | | | Method defined here - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Has_a_`__bool__`_met\342\200\246_(ce8b8da49eaf4cda).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Has_a_`__bool__`_met\342\200\246_(ce8b8da49eaf4cda).snap" index 44e0c7eb04fb15..159bf8b5271b79 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Has_a_`__bool__`_met\342\200\246_(ce8b8da49eaf4cda).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Has_a_`__bool__`_met\342\200\246_(ce8b8da49eaf4cda).snap" @@ -31,7 +31,6 @@ error[unsupported-bool-conversion]: Boolean conversion is not supported for type | 8 | 10 and a and True | ^ - | info: `__bool__` methods must only have a `self` parameter --> src/mdtest_snippet.py:2:9 | @@ -39,6 +38,5 @@ info: `__bool__` methods must only have a `self` parameter | --------^^^^^^^^^^^ Incorrect parameters | | | Method defined here - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Part_of_a_union_wher\342\200\246_(7cca8063ea43c1a).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Part_of_a_union_wher\342\200\246_(7cca8063ea43c1a).snap" index 90026b8d2ef637..991e95d41b5a1e 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Part_of_a_union_wher\342\200\246_(7cca8063ea43c1a).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Part_of_a_union_wher\342\200\246_(7cca8063ea43c1a).snap" @@ -38,6 +38,5 @@ error[unsupported-bool-conversion]: Boolean conversion is not supported for unio | 15 | 10 and get() and True | ^^^^^ - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_A_constrained_defaul\342\200\246_(b62ed1f409042cc).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_A_constrained_defaul\342\200\246_(b62ed1f409042cc).snap" index f40a34c7b418ab..acf1062b8fd864 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_A_constrained_defaul\342\200\246_(b62ed1f409042cc).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_A_constrained_defaul\342\200\246_(b62ed1f409042cc).snap" @@ -41,6 +41,5 @@ error[invalid-type-variable-default]: TypeVar default is inconsistent with the T | 3 | T1 = TypeVar("T1", int, str) | ---------------------------- `T1` defined here - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_A_constrained_defaul\342\200\246_(d9ffda7fd9cdf840).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_A_constrained_defaul\342\200\246_(d9ffda7fd9cdf840).snap" index b4ed239ad5c786..6d6f1e60b51ebd 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_A_constrained_defaul\342\200\246_(d9ffda7fd9cdf840).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_A_constrained_defaul\342\200\246_(d9ffda7fd9cdf840).snap" @@ -45,6 +45,5 @@ error[invalid-type-variable-default]: TypeVar default is not assignable to the T | 3 | T1 = TypeVar("T1", int, str) | ---------------------------- `T1` defined here - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_A_non-constrained_de\342\200\246_(ff24930259abfb3).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_A_non-constrained_de\342\200\246_(ff24930259abfb3).snap" index 82a9b1532d4b7f..f09d6694cc708e 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_A_non-constrained_de\342\200\246_(ff24930259abfb3).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_A_non-constrained_de\342\200\246_(ff24930259abfb3).snap" @@ -40,7 +40,6 @@ error[invalid-type-variable-default]: TypeVar default is inconsistent with the T | 3 | T1 = TypeVar("T1", bound=int) | ----------------------------- `T1` defined here - | info: `T1` has bound `int` but is not constrained ``` @@ -58,7 +57,6 @@ error[invalid-type-variable-default]: TypeVar default is inconsistent with the T | 4 | T2 = TypeVar("T2") | ------------------ `T2` defined here - | info: `T2` has no bound or constraints ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_An_unbounded_default\342\200\246_(a2759fd9d2731a7d).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_An_unbounded_default\342\200\246_(a2759fd9d2731a7d).snap" index 6543b7f86af90f..a1ab433f0d4abd 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_An_unbounded_default\342\200\246_(a2759fd9d2731a7d).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_An_unbounded_default\342\200\246_(a2759fd9d2731a7d).snap" @@ -35,6 +35,5 @@ error[invalid-type-variable-default]: TypeVar default is not assignable to the T | ^^ --- Upper bound of `S` | | | Upper bound `object` of default `T1` is not assignable to upper bound of `S` - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_Concrete_default_wit\342\200\246_(30284a6490652e58).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_Concrete_default_wit\342\200\246_(30284a6490652e58).snap" index 71aaa269d4d0f4..0f5ce1e3bdd1cd 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_Concrete_default_wit\342\200\246_(30284a6490652e58).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_Concrete_default_wit\342\200\246_(30284a6490652e58).snap" @@ -38,7 +38,6 @@ error[invalid-type-variable-default]: TypeVar default is inconsistent with the T | -------- ^^^^^ `bytes` is not one of the constraints of `T` | | | Constraints of `T` - | ``` @@ -50,6 +49,5 @@ error[invalid-type-variable-default]: TypeVar default is inconsistent with the T | -------- ^^^^ `bool` is not one of the constraints of `U` | | | Constraints of `U` - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_Concrete_default_wit\342\200\246_(37f9b6583c0633f5).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_Concrete_default_wit\342\200\246_(37f9b6583c0633f5).snap" index 4e7343b87d8f7d..0f06aa5ebe6858 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_Concrete_default_wit\342\200\246_(37f9b6583c0633f5).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_Concrete_default_wit\342\200\246_(37f9b6583c0633f5).snap" @@ -31,6 +31,5 @@ error[invalid-type-variable-default]: TypeVar default is not assignable to the T | --- ^^^ Default of `T` | | | Upper bound of `T` - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_Default_TypeVar's_bo\342\200\246_(fcd7ad5416c91629).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_Default_TypeVar's_bo\342\200\246_(fcd7ad5416c91629).snap" index 909fb658f0f81f..4e0073ed4997bc 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_Default_TypeVar's_bo\342\200\246_(fcd7ad5416c91629).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_Default_TypeVar's_bo\342\200\246_(fcd7ad5416c91629).snap" @@ -42,6 +42,5 @@ error[invalid-type-variable-default]: TypeVar default is not assignable to the T | 5 | T3 = TypeVar("T3", bound=str) | ----------------------------- `T3` defined here - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Shadowing_checks_use\342\200\246_(7e6bb178099059fe).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Shadowing_checks_use\342\200\246_(7e6bb178099059fe).snap" index 26499c34cdc22d..24f1fd1a745411 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Shadowing_checks_use\342\200\246_(7e6bb178099059fe).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Shadowing_checks_use\342\200\246_(7e6bb178099059fe).snap" @@ -37,7 +37,6 @@ warning[mismatched-type-name]: The name passed to `TypeVar` must match the varia | 8 | Q = TypeVar("T") | ^^^ Expected "Q", got "T" - | ``` @@ -52,7 +51,6 @@ error[shadowed-type-variable]: Generic class `Bad` uses type variable `Q` alread 13 | # error: [shadowed-type-variable] 14 | class Bad(Generic[Q]): ... | ^^^^^^^^^^^^^^^ `Q` used in class definition here - | ``` @@ -67,6 +65,5 @@ error[shadowed-type-variable]: Generic class `Bad` uses type variable `Q` alread 13 | # error: [shadowed-type-variable] 14 | class Bad(Generic[Q]): ... | ^^^^^^^^^^^^^^^ `Q` used in class definition here - | ``` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/version_related_synt\342\200\246_-_Version-related_synt\342\200\246_-_`match`_statement_-_Before_3.10_(2545eaa83b635b8b).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/version_related_synt\342\200\246_-_Version-related_synt\342\200\246_-_`match`_statement_-_Before_3.10_(2545eaa83b635b8b).snap" index dc72f19035fab7..36b35780ec79a1 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/version_related_synt\342\200\246_-_Version-related_synt\342\200\246_-_`match`_statement_-_Before_3.10_(2545eaa83b635b8b).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/version_related_synt\342\200\246_-_Version-related_synt\342\200\246_-_`match`_statement_-_Before_3.10_(2545eaa83b635b8b).snap" @@ -26,7 +26,6 @@ error[invalid-syntax]: Cannot use `match` statement on Python 3.9 (syntax was ad | 1 | match 2: # error: 1 [invalid-syntax] "Cannot use `match` statement on Python 3.9 (syntax was added in Python 3.10)" | ^^^^^ - | info: Python 3.9 was assumed when parsing syntax because it was specified on the command line ``` diff --git a/crates/ty_python_semantic/resources/mdtest/subscript/instance.md b/crates/ty_python_semantic/resources/mdtest/subscript/instance.md index f0490f831ea260..abe0367ade7ef7 100644 --- a/crates/ty_python_semantic/resources/mdtest/subscript/instance.md +++ b/crates/ty_python_semantic/resources/mdtest/subscript/instance.md @@ -15,7 +15,6 @@ error[not-subscriptable]: Cannot subscript object of type `NotSubscriptable` wit | 4 | a = NotSubscriptable()[0] | ^^^^^^^^^^^^^^^^^^^^^ - | ``` ## `__getitem__` not callable diff --git a/crates/ty_python_semantic/resources/mdtest/suppressions/ty_ignore.md b/crates/ty_python_semantic/resources/mdtest/suppressions/ty_ignore.md index 7faafc6698fe50..29b8829eaa4c71 100644 --- a/crates/ty_python_semantic/resources/mdtest/suppressions/ty_ignore.md +++ b/crates/ty_python_semantic/resources/mdtest/suppressions/ty_ignore.md @@ -126,7 +126,6 @@ warning[unused-ignore-comment]: Unused `ty: ignore` directive | 3 | a = test + 3 # ty: ignore[possibly-unresolved-reference] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove the unused suppression comment | 2 | # snapshot @@ -150,7 +149,6 @@ warning[unused-ignore-comment]: Unused `ty: ignore` directive | 3 | a = test + 3 # ty: ignore[possibly-unresolved-reference] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove the unused suppression comment | 2 | # error: [unresolved-reference] @@ -184,7 +182,6 @@ warning[unused-ignore-comment]: Unused `ty: ignore` directive: 'unused-ignore-co | 2 | a = 10 / 0 # ty: ignore[division-by-zero, unused-ignore-comment] | ^^^^^^^^^^^^^^^^^^^^^ - | help: Remove the unused suppression code | 1 | # snapshot @@ -208,7 +205,6 @@ warning[unused-ignore-comment]: Unused `ty: ignore` directive | 2 | a = 10 / 2 # ty: ignore[division-by-zero, unresolved-reference] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove the unused suppression comment | 1 | # snapshot @@ -230,7 +226,6 @@ warning[unused-ignore-comment]: Unused `ty: ignore` directive: 'invalid-assignme | 5 | a = 10 / 0 # ty: ignore[invalid-assignment, division-by-zero, unresolved-reference] | ^^^^^^^^^^^^^^^^^^ - | help: Remove the unused suppression code | 4 | # snapshot @@ -245,7 +240,6 @@ warning[unused-ignore-comment]: Unused `ty: ignore` directive: 'unresolved-refer | 5 | a = 10 / 0 # ty: ignore[invalid-assignment, division-by-zero, unresolved-reference] | ^^^^^^^^^^^^^^^^^^^^ - | help: Remove the unused suppression code | 4 | # snapshot @@ -266,7 +260,6 @@ warning[unused-ignore-comment]: Unused `ty: ignore` directive: 'invalid-assignme | 7 | a = 10 / 0 # ty: ignore[invalid-assignment, unresolved-reference, division-by-zero] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove the unused suppression codes | 6 | # snapshot @@ -312,7 +305,6 @@ warning[unused-ignore-comment]: Unused `ty: ignore` directive | 9 | # fmt: off # ty: ignore[division-by-zero] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove the unused suppression comment | 8 | # snapshot @@ -337,7 +329,6 @@ warning[unused-ignore-comment]: Unused `ty: ignore` directive | 15 | # ty: ignore[division-by-zero] # fmt: off | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove the unused suppression comment | 14 | # snapshot @@ -475,7 +466,6 @@ warning[ignore-comment-unknown-rule]: Unknown rule `division-by-zer`. Did you me | 2 | a = 10 + 4 # ty: ignore[division-by-zer] | ^^^^^^^^^^^^^^^ - | ``` ## Code with `lint:` prefix diff --git a/crates/ty_python_semantic/resources/mdtest/suppressions/type_ignore.md b/crates/ty_python_semantic/resources/mdtest/suppressions/type_ignore.md index fdf33f588a5a95..6ba5bdbc6f711d 100644 --- a/crates/ty_python_semantic/resources/mdtest/suppressions/type_ignore.md +++ b/crates/ty_python_semantic/resources/mdtest/suppressions/type_ignore.md @@ -170,7 +170,6 @@ warning[unused-ignore-comment]: Unused `ty: ignore` directive | 9 | + 2) # ty:ignore[division-by-zero] # fmt: skip | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove the unused suppression comment | 8 | # snapshot @@ -192,7 +191,6 @@ warning[unused-ignore-comment]: Unused `ty: ignore` directive | 12 | + 2) # fmt: skip # ty:ignore[division-by-zero] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove the unused suppression comment | 11 | # snapshot @@ -319,7 +317,6 @@ warning[unused-type-ignore-comment]: Unused `type: ignore` directive: 'division- | 2 | a = 10 / 2 # type: ignore[mypy-code, ty:division-by-zero] | ^^^^^^^^^^^^^^^^^^^ - | help: Remove the unused suppression code | 1 | # snapshot @@ -341,7 +338,6 @@ warning[unused-type-ignore-comment]: Unused `type: ignore` directive | 2 | a = 10 / 2 # type: ignore[ty:division-by-zero] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove the unused suppression comment | 1 | # snapshot @@ -363,5 +359,4 @@ warning[ignore-comment-unknown-rule]: Unknown rule `division-by`. Did you mean ` | 2 | a = 10 / 2 # type: ignore[ty:division-by] | ^^^^^^^^^^^^^^ - | ``` diff --git a/crates/ty_python_semantic/resources/mdtest/ty_extensions.md b/crates/ty_python_semantic/resources/mdtest/ty_extensions.md index bc5a1b42120216..64436541b83aec 100644 --- a/crates/ty_python_semantic/resources/mdtest/ty_extensions.md +++ b/crates/ty_python_semantic/resources/mdtest/ty_extensions.md @@ -293,7 +293,6 @@ error[static-assert-error]: Static assertion error: argument evaluates to `False | ^^^^^^^^^^^^^^-----^ | | | Inferred type of argument is `Literal[False]` - | ``` With a custom message: @@ -311,7 +310,6 @@ error[static-assert-error]: Static assertion error: with a message | ^^^^^^^^^^^^^^-----^^^^^^^^^^^^^^^^^^^ | | | Inferred type of argument is `Literal[False]` - | ``` When it evaluates to something falsy: @@ -329,7 +327,6 @@ error[static-assert-error]: Static assertion error: argument of type `Literal["" | ^^^^^^^^^^^^^^--^ | | | Inferred type of argument is `Literal[""]` - | ``` When it evaluates to something that is not statically known to be truthy or falsy: @@ -347,7 +344,6 @@ error[static-assert-error]: Static assertion error: argument of type `int` has a | ^^^^^^^^^^^^^^--------------------^ | | | Inferred type of argument is `int` - | ``` ## Type predicates diff --git a/crates/ty_python_semantic/resources/mdtest/type_qualifiers/final.md b/crates/ty_python_semantic/resources/mdtest/type_qualifiers/final.md index dc86e1d631a44d..6c004c6660276a 100644 --- a/crates/ty_python_semantic/resources/mdtest/type_qualifiers/final.md +++ b/crates/ty_python_semantic/resources/mdtest/type_qualifiers/final.md @@ -627,13 +627,11 @@ error[override-of-final-variable]: Cannot override `module_a.Foo.X` | 5 | X = 2 | ^ Overrides a final variable from superclass `module_a.Foo` - | info: `module_a.Foo.X` is declared as `Final`, forbidding overrides --> src/module_a.py:4:5 | 4 | X: Final[int] = 1 | - `module_a.Foo.X` defined here - | ``` ### `Final` declaration without a value @@ -1312,7 +1310,6 @@ error[invalid-assignment]: Reassignment of `Final` symbol `MY_CONSTANT` is not a | 3 | MY_CONSTANT: Final[int] = 1 | ---------- Symbol declared as `Final` here - | ``` Imported `Final` symbol: diff --git a/crates/ty_python_semantic/resources/mdtest/unary/custom.md b/crates/ty_python_semantic/resources/mdtest/unary/custom.md index 1db66e8607fd59..eefeea224434b8 100644 --- a/crates/ty_python_semantic/resources/mdtest/unary/custom.md +++ b/crates/ty_python_semantic/resources/mdtest/unary/custom.md @@ -167,7 +167,6 @@ error[unsupported-operator]: Unary operator `+` is not supported for object of t | 15 | reveal_type(+x) # revealed: bool | ^^ - | info: `No` does not implement `__pos__` @@ -176,7 +175,6 @@ error[unsupported-operator]: Unary operator `-` is not supported for object of t | 18 | reveal_type(-x) # revealed: str | ^^ - | info: `No` does not implement `__neg__` @@ -185,7 +183,6 @@ error[unsupported-operator]: Unary operator `~` is not supported for object of t | 21 | reveal_type(~x) # revealed: int | ^^ - | info: `No` does not implement `__invert__` ``` diff --git a/crates/ty_python_semantic/resources/mdtest/unary/not.md b/crates/ty_python_semantic/resources/mdtest/unary/not.md index 10ee1fccc85277..98f80569316fef 100644 --- a/crates/ty_python_semantic/resources/mdtest/unary/not.md +++ b/crates/ty_python_semantic/resources/mdtest/unary/not.md @@ -231,6 +231,5 @@ error[unsupported-bool-conversion]: Boolean conversion is not supported for type | 5 | not NotBoolable() | ^^^^^^^^^^^^^^^^^ - | info: `__bool__` on `NotBoolable` must be callable ``` diff --git a/crates/ty_python_semantic/resources/mdtest/unreachable.md b/crates/ty_python_semantic/resources/mdtest/unreachable.md index 7576ca63b5ff2f..e73fbb98bcb69a 100644 --- a/crates/ty_python_semantic/resources/mdtest/unreachable.md +++ b/crates/ty_python_semantic/resources/mdtest/unreachable.md @@ -642,6 +642,5 @@ error[invalid-type-form]: Variable of type `Never` is not allowed in a parameter | 4 | def f(x: module.AwesomeAPI): ... | ^^^^^^^^^^^^^^^^^ - | help: The variable may have been inferred as `Never` because its definition was inferred as being unreachable ``` diff --git a/crates/ty_python_semantic/resources/mdtest/with/async.md b/crates/ty_python_semantic/resources/mdtest/with/async.md index a99cdafecf345d..01ff9630768d41 100644 --- a/crates/ty_python_semantic/resources/mdtest/with/async.md +++ b/crates/ty_python_semantic/resources/mdtest/with/async.md @@ -174,7 +174,6 @@ error[invalid-context-manager]: Object of type `Manager` cannot be used with `as | 7 | async with Manager(): | ^^^^^^^^^ - | info: Objects of type `Manager` can be used as sync context managers info: Consider using `with` here ``` diff --git a/crates/ty_python_semantic/resources/mdtest/with/sync.md b/crates/ty_python_semantic/resources/mdtest/with/sync.md index 733c7db405053c..0669d941dd0bd4 100644 --- a/crates/ty_python_semantic/resources/mdtest/with/sync.md +++ b/crates/ty_python_semantic/resources/mdtest/with/sync.md @@ -261,7 +261,6 @@ error[invalid-context-manager]: Object of type `Manager` cannot be used with `wi | 6 | with Manager(): | ^^^^^^^^^ - | info: Objects of type `Manager` can be used as async context managers info: Consider using `async with` here ``` diff --git a/crates/ty_python_semantic/src/fixes.rs b/crates/ty_python_semantic/src/fixes.rs index f4ce815376df9b..6616b9cde9409d 100644 --- a/crates/ty_python_semantic/src/fixes.rs +++ b/crates/ty_python_semantic/src/fixes.rs @@ -898,7 +898,6 @@ mod tests { 1 | import sys 2 | a = 5 + 10 # ty: ignore[unresolved-reference] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove the unused suppression comment | 1 | import sys @@ -934,7 +933,6 @@ mod tests { 1 | import sys 2 | a = x + | ^ - | error[invalid-syntax]: Expected an expression --> test.py:2:8 @@ -942,7 +940,6 @@ mod tests { 1 | import sys 2 | a = x + | ^ - | "); } @@ -1200,7 +1197,6 @@ class B(A): | 1 | value = missing # ty: ignore[] tracked by [123] # ty: ignore[unresolved-reference] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | help: Remove the unused suppression comment | - value = missing # ty: ignore[] tracked by [123] # ty: ignore[unresolved-reference] @@ -1347,7 +1343,6 @@ class B(A): 2 | 3 | result: int = f(missing) # ty: ignore[division-by-zero, invalid-assignment, too-many-positional-arguments, unresolved-reference] | ^^^^^^^^^^^^^^^^ - | help: Remove the unused suppression code | 2 | diff --git a/crates/ty_python_semantic/src/types/ide_support/unreachable_code.rs b/crates/ty_python_semantic/src/types/ide_support/unreachable_code.rs index ac5b0d15a153f7..9ca9ce38108fdc 100644 --- a/crates/ty_python_semantic/src/types/ide_support/unreachable_code.rs +++ b/crates/ty_python_semantic/src/types/ide_support/unreachable_code.rs @@ -188,7 +188,6 @@ mod tests { | 4 | print("dead") | ^^^^^^^^^^^^^ - | "#); Ok(()) } @@ -208,7 +207,6 @@ mod tests { | 5 | print("dead") | ^^^^^^^^^^^^^ - | "#); Ok(()) } @@ -233,7 +231,6 @@ mod tests { | 7 | print("dead") | ^^^^^^^^^^^^^ - | "#); Ok(()) } @@ -254,7 +251,6 @@ mod tests { 4 | / print("dead") 5 | | print("still dead") | |_______________________^ - | "#); Ok(()) } @@ -273,7 +269,6 @@ mod tests { | 4 | print("dead") | ^^^^^^^^^^^^^ - | "#); Ok(()) } @@ -295,7 +290,6 @@ mod tests { | 5 | print("dead") | ^^^^^^^^^^^^^ - | "#); Ok(()) } @@ -314,7 +308,6 @@ mod tests { | 4 | print("dead") | ^^^^^^^^^^^^^ - | "#); Ok(()) } @@ -334,7 +327,6 @@ mod tests { | 5 | print("dead") | ^^^^^^^^^^^^^ - | "#); Ok(()) } @@ -354,7 +346,6 @@ mod tests { | 5 | print("dead") | ^^^^^^^^^^^^^ - | "#); Ok(()) } @@ -374,7 +365,6 @@ mod tests { | 5 | print("dead") | ^^^^^^^^^^^^^ - | "#); Ok(()) } @@ -392,7 +382,6 @@ mod tests { | 3 | print("dead") | ^^^^^^^^^^^^^ - | "#); Ok(()) } @@ -413,14 +402,12 @@ mod tests { | 3 | print("dead") | ^^^^^^^^^^^^^ - | info[unreachable-code]: Code is always unreachable --> src/main.py:6:5 | 6 | print("also dead") | ^^^^^^^^^^^^^^^^^^ - | "#); Ok(()) } @@ -438,7 +425,6 @@ mod tests { | 3 | print("dead") | ^^^^^^^^^^^^^ - | "#); Ok(()) } @@ -458,7 +444,6 @@ mod tests { | 5 | print("dead") | ^^^^^^^^^^^^^ - | "#); Ok(()) } @@ -478,7 +463,6 @@ mod tests { | 5 | print("dead") | ^^^^^^^^^^^^^ - | "#); Ok(()) } @@ -502,7 +486,6 @@ mod tests { | 4 | return | ^^^^^^ - | info[unreachable-code]: Code is always unreachable --> src/main.py:8:9 @@ -510,7 +493,6 @@ mod tests { 8 | / pass 9 | | print("dead") | |_________________^ - | "#); Ok(()) } @@ -530,7 +512,6 @@ mod tests { | 5 | print("dead") | ^^^^^^^^^^^^^ - | "#); Ok(()) } @@ -547,7 +528,6 @@ mod tests { | 2 | x = "yes" if True else "no" | ^^^^ - | "#); Ok(()) } @@ -568,14 +548,12 @@ mod tests { | 3 | x = 1 | ^^^^^ - | info[unreachable-code]: Code is always unreachable --> src/main.py:6:5 | 6 | y = 2 | ^^^^^ - | "); Ok(()) } @@ -593,7 +571,6 @@ mod tests { | 3 | x = lambda: 1 | ^^^^^^^^^^^^^ - | "); Ok(()) } @@ -613,7 +590,6 @@ mod tests { 3 | / def f(): 4 | | pass | |____________^ - | "); Ok(()) } @@ -633,7 +609,6 @@ mod tests { 3 | / class Foo: 4 | | pass | |____________^ - | "); Ok(()) } @@ -651,7 +626,6 @@ mod tests { | 3 | x = [i for i in range(10)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | "); Ok(()) } @@ -675,21 +649,18 @@ mod tests { | 3 | x = {k: v for k, v in {}.items()} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | info[unreachable-code]: Code is always unreachable --> src/main.py:6:5 | 6 | y = {i for i in range(10)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | info[unreachable-code]: Code is always unreachable --> src/main.py:9:5 | 9 | z = (i for i in range(10)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | "); Ok(()) } @@ -710,7 +681,6 @@ mod tests { | 3 | type Alias[T] = list[T] | ^^^^^^^^^^^^^^^^^^^^^^^ - | "); Ok(()) } @@ -733,7 +703,6 @@ mod tests { | 5 | from typing import Self | ^^^^^^^^^^^^^^^^^^^^^^^ - | "); Ok(()) } @@ -756,7 +725,6 @@ mod tests { | 5 | import winreg | ^^^^^^^^^^^^^ - | "); Ok(()) } @@ -780,7 +748,6 @@ mod tests { | 9 | print("dead") | ^^^^^^^^^^^^^ - | "#); Ok(()) } @@ -826,7 +793,6 @@ mod tests { 5 | / if False: 6 | | x = lambda: 1 | |_____________________^ - | "); Ok(()) } From dc06cb1666dad3b35f07a794cc8fcd5642fabc02 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 15 Jul 2026 15:22:59 -0500 Subject: [PATCH 26/34] Bless origin location changes The origin line and column is now determined by the primary annotation. --- crates/ruff/tests/cli/format.rs | 18 +-- crates/ruff_db/src/diagnostic/render/full.rs | 2 +- ...__flake8_bugbear__tests__B033_B033.py.snap | 20 +-- ...at__tests__ISC001_ISC_syntax_error.py.snap | 2 +- ...at__tests__ISC002_ISC_syntax_error.py.snap | 2 +- ...ules__pyflakes__tests__F811_F811_1.py.snap | 2 +- ...les__pyflakes__tests__F811_F811_12.py.snap | 2 +- ...les__pyflakes__tests__F811_F811_17.py.snap | 2 +- ...ules__pyflakes__tests__F811_F811_2.py.snap | 2 +- ...les__pyflakes__tests__F811_F811_23.py.snap | 2 +- ...les__pyflakes__tests__F811_F811_26.py.snap | 2 +- ...les__pyflakes__tests__F811_F811_28.py.snap | 2 +- ...es__pyflakes__tests__F811_F811_29.pyi.snap | 2 +- ...ules__pyflakes__tests__F811_F811_3.py.snap | 2 +- ...les__pyflakes__tests__F811_F811_30.py.snap | 6 +- ...les__pyflakes__tests__F811_F811_31.py.snap | 2 +- ...les__pyflakes__tests__F811_F811_32.py.snap | 2 +- ...les__pyflakes__tests__F811_F811_35.py.snap | 2 +- ...ules__pyflakes__tests__F811_F811_4.py.snap | 2 +- ...ules__pyflakes__tests__F811_F811_5.py.snap | 2 +- ...ules__pyflakes__tests__F811_F811_6.py.snap | 2 +- ...ules__pyflakes__tests__F811_F811_8.py.snap | 2 +- ...shadowed_global_import_in_local_scope.snap | 2 +- ...shadowed_import_shadow_in_local_scope.snap | 2 +- ..._shadowed_local_import_in_local_scope.snap | 2 +- ...811_annotated_assignment_redefinition.snap | 4 +- ...akes__tests__preview__F811_F811_36.py.snap | 2 +- ..._rules__ruff__tests__RUF068_RUF068.py.snap | 24 ++-- crates/ty/tests/cli/main.rs | 2 +- crates/ty/tests/cli/rule_selection.rs | 4 +- crates/ty/tests/cli/scripts.rs | 2 +- crates/ty_ide/src/rename.rs | 2 +- .../resources/mdtest/annotations/any.md | 2 +- .../resources/mdtest/annotations/string.md | 10 +- .../mdtest/assignment/annotations.md | 2 +- .../resources/mdtest/call/abstract_method.md | 2 +- .../resources/mdtest/call/methods.md | 2 +- .../mdtest/dataclasses/dataclasses.md | 4 +- .../resources/mdtest/descriptor_protocol.md | 2 +- .../diagnostics/attribute_assignment.md | 4 +- .../mdtest/diagnostics/error_context.md | 124 +++++++++--------- .../invalid_assignment_syntactic_variants.md | 12 +- .../resources/mdtest/diagnostics/shadowing.md | 4 +- .../mdtest/expression/yield_and_yield_from.md | 6 +- .../mdtest/generics/legacy/classes.md | 2 +- .../mdtest/generics/pep695/aliases.md | 8 +- .../resources/mdtest/liskov.md | 24 ++-- .../resources/mdtest/override.md | 4 +- .../resources/mdtest/protocols.md | 2 +- ...ype_f\342\200\246_(155d53762388f9ad).snap" | 2 +- ...for_`\342\200\246_(7cf0fa634e2a2d59).snap" | 2 +- ..._all_\342\200\246_(8a0f0e8ceccc51b2).snap" | 4 +- ..._one_\342\200\246_(b515711c0a451a86).snap" | 2 +- ...aramet\342\200\246_(6bb09b09c131074).snap" | 16 +-- ..._in_g\342\200\246_(6d8b024dda7ced11).snap" | 2 +- ...sic_case_with_ABC_(21e412599c45972a).snap" | 2 +- ..._ther\342\200\246_(ecae0f4510696c95).snap" | 2 +- ..._ther\342\200\246_(f807ff3716d8ab0d).snap" | 2 +- ...ct_me\342\200\246_(feafee9a4abbe8d1).snap" | 4 +- ...mplic\342\200\246_(e373f31c7a7d88e7).snap" | 32 ++--- ...ods_d\342\200\246_(861757f48340ed92).snap" | 12 +- ...ion_f\342\200\246_(ee99fadd6476677e).snap" | 12 +- ...are_o\342\200\246_(58a3839a9bc7026d).snap" | 2 +- ..._awai\342\200\246_(d78580fb6720e4ea).snap" | 2 +- ...efine\342\200\246_(b1be57970f924722).snap" | 2 +- ...uple`_-_Definition_(bbf79630502e65e9).snap | 8 +- ...verloa\342\200\246_(84dadf8abd8f2f2).snap" | 4 +- ..._-_`@classmethod`_(aaa04d4cfa3adaba).snap" | 4 +- ...00\246_-_`@final`_(f8e529ec23a61665).snap" | 10 +- ...246_-_`@override`_(2df210735ca532f9).snap" | 6 +- ...override`_-_Basics_(b7c220f8171f11f0).snap | 20 +-- ...not_s\342\200\246_(8243f67799c93e3c).snap" | 2 +- ...ions_-_Synchronous_(6a32ec69d15117b8).snap | 6 +- ...onal_\342\200\246_(94c036c5d3803ab2).snap" | 4 +- ...nvalid_return_type_(a91e0c67519cd77f).snap | 8 +- ...type_\342\200\246_(c3a523878447af6b).snap" | 2 +- ...ithin\342\200\246_(3259718bf20b45a2).snap" | 4 +- ...ithin\342\200\246_(711fb86287c4d87b).snap" | 4 +- ..._in_c\342\200\246_(1a50b4ccb10b95dd).snap" | 2 +- ...in_me\342\200\246_(2ed4c18a38ed9090).snap" | 2 +- ...in_ne\342\200\246_(a1aca17ea750ffdd).snap" | 2 +- ...order\342\200\246_(d075a45828c9dbc5).snap" | 6 +- ...with_\342\200\246_(ce8defbeaf54e06c).snap" | 2 +- ..._Nested_functions_(3f2ee9fa81da0177).snap" | 2 +- ...ed_in\342\200\246_(de027dcc5360f252).snap" | 2 +- ...ict`_-_Diagnostics_(e5289abf5c570c29).snap | 16 +-- ...`_met\342\200\246_(15636dc4074e5335).snap" | 2 +- ...`_met\342\200\246_(ce8b8da49eaf4cda).snap" | 2 +- ...defaul\342\200\246_(b62ed1f409042cc).snap" | 2 +- ...ned_de\342\200\246_(ff24930259abfb3).snap" | 4 +- ...fault\342\200\246_(a2759fd9d2731a7d).snap" | 2 +- ...t_wit\342\200\246_(30284a6490652e58).snap" | 4 +- ...t_wit\342\200\246_(37f9b6583c0633f5).snap" | 2 +- ...s_use\342\200\246_(7e6bb178099059fe).snap" | 4 +- 94 files changed, 290 insertions(+), 290 deletions(-) diff --git a/crates/ruff/tests/cli/format.rs b/crates/ruff/tests/cli/format.rs index 6d0c3ad0b1cac6..08549a9fa1e9eb 100644 --- a/crates/ruff/tests/cli/format.rs +++ b/crates/ruff/tests/cli/format.rs @@ -56,14 +56,14 @@ fn default_files() -> Result<()> { exit_code: 1 ----- stdout ----- unformatted: File would be reformatted - --> bar.py:1:1 + --> bar.py:1:7 | - bar = "needs formatting" 1 + bar = "needs formatting" | unformatted: File would be reformatted - --> foo.py:1:1 + --> foo.py:1:7 | - foo = "needs formatting" 1 + foo = "needs formatting" @@ -520,7 +520,7 @@ exclude = ["format_excluded.py"] exit_code: 1 ----- stdout ----- unformatted: File would be reformatted - --> main.py:1:1 + --> main.py:1:3 | - x = 1 1 + x = 1 @@ -548,7 +548,7 @@ fn deduplicate_directory_and_explicit_file() -> Result<()> { exit_code: 1 ----- stdout ----- unformatted: File would be reformatted - --> main.py:1:1 + --> main.py:1:3 | - x = 1 1 + x = 1 @@ -699,7 +699,7 @@ fn output_format_notebook() -> Result<()> { exit_code: 1 ----- stdout ----- unformatted: File would be reformatted - --> CRATE_ROOT/resources/test/fixtures/unformatted.ipynb:cell 1:1:1 + --> CRATE_ROOT/resources/test/fixtures/unformatted.ipynb:cell 1:2:1 ::: cell 1 | 1 | import numpy @@ -834,7 +834,7 @@ fn check_quiet_mode_shows_diagnostics_only() -> Result<()> { exit_code: 1 ----- stdout ----- unformatted: File would be reformatted - --> main.py:1:1 + --> main.py:1:5 | - def foo(): - pass @@ -858,7 +858,7 @@ fn check_default_mode_shows_diagnostics_and_summary() -> Result<()> { exit_code: 1 ----- stdout ----- unformatted: File would be reformatted - --> main.py:1:1 + --> main.py:1:5 | - def foo(): - pass @@ -2555,7 +2555,7 @@ fn markdown_formatting() -> Result<()> { exit_code: 1 ----- stdout ----- unformatted: File would be reformatted - --> CRATE_ROOT/resources/test/fixtures/unformatted.md:1:1 + --> CRATE_ROOT/resources/test/fixtures/unformatted.md:4:7 | 3 | ```py - print( "hello" ) @@ -2692,7 +2692,7 @@ print( 'hello' ) exit_code: 1 ----- stdout ----- unformatted: File would be reformatted - --> test.bar:1:1 + --> test.bar:5:7 | 4 | ```py - print( 'hello' ) diff --git a/crates/ruff_db/src/diagnostic/render/full.rs b/crates/ruff_db/src/diagnostic/render/full.rs index f101972d4e1489..2f92c512932c77 100644 --- a/crates/ruff_db/src/diagnostic/render/full.rs +++ b/crates/ruff_db/src/diagnostic/render/full.rs @@ -947,7 +947,7 @@ print() insta::assert_snapshot!(env.render(&diagnostic), @r" error[test-diagnostic]: main diagnostic message - --> example.py:2:1 + --> example.py:1:16 | 1 | unexpected eof | ^ diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B033_B033.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B033_B033.py.snap index d3a538bc42644b..e0c5f128b31897 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B033_B033.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B033_B033.py.snap @@ -2,7 +2,7 @@ source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs --- B033 [*] Sets should not contain duplicate item `"value1"` - --> B033.py:4:18 + --> B033.py:4:35 | 2 | # Errors. 3 | ### @@ -22,7 +22,7 @@ help: Remove duplicate item | B033 [*] Sets should not contain duplicate item `1` - --> B033.py:5:18 + --> B033.py:5:21 | 3 | ### 4 | incorrect_set = {"value1", 23, 5, "value1"} @@ -42,7 +42,7 @@ help: Remove duplicate item | B033 [*] Sets should not contain duplicate item `"value1"` - --> B033.py:7:5 + --> B033.py:10:5 | 5 | incorrect_set = {1, 1, 2} 6 | incorrect_set_multiline = { @@ -63,7 +63,7 @@ help: Remove duplicate item | B033 [*] Sets should not contain duplicate item `1` - --> B033.py:13:18 + --> B033.py:13:21 | 11 | # B033 12 | } @@ -83,7 +83,7 @@ help: Remove duplicate item | B033 [*] Sets should not contain duplicate item `1` - --> B033.py:14:18 + --> B033.py:14:21 | 12 | } 13 | incorrect_set = {1, 1} @@ -103,7 +103,7 @@ help: Remove duplicate item | B033 [*] Sets should not contain duplicate item `1` - --> B033.py:15:21 + --> B033.py:15:24 | 13 | incorrect_set = {1, 1} 14 | incorrect_set = {1, 1,} @@ -123,7 +123,7 @@ help: Remove duplicate item | B033 [*] Sets should not contain duplicate item `1` - --> B033.py:16:21 + --> B033.py:16:24 | 14 | incorrect_set = {1, 1,} 15 | incorrect_set = {0, 1, 1,} @@ -143,7 +143,7 @@ help: Remove duplicate item | B033 [*] Sets should not contain duplicate item `1` - --> B033.py:19:5 + --> B033.py:20:5 | 17 | incorrect_set = { 18 | 0, @@ -162,7 +162,7 @@ help: Remove duplicate item | B033 [*] Sets should not contain duplicate items, but `False` and `0` has the same value - --> B033.py:22:18 + --> B033.py:22:28 | 20 | 1, 21 | } @@ -182,7 +182,7 @@ help: Remove duplicate item | B033 [*] Sets should not contain duplicate item `"value1"` - --> B033.py:24:5 + --> B033.py:27:5 | 22 | incorrect_set = {False, 1, 0} 23 | incorrect_set_multiline_with_comment = { diff --git a/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC001_ISC_syntax_error.py.snap b/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC001_ISC_syntax_error.py.snap index 236b856612e67e..e4f0da91a02399 100644 --- a/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC001_ISC_syntax_error.py.snap +++ b/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC001_ISC_syntax_error.py.snap @@ -188,7 +188,7 @@ invalid-syntax: f-string: unterminated triple-quoted string | |__^ invalid-syntax: f-string: unterminated string - --> ISC_syntax_error.py:30:1 + --> ISC_syntax_error.py:29:3 | 28 | "i" "j" 29 | ) diff --git a/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC002_ISC_syntax_error.py.snap b/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC002_ISC_syntax_error.py.snap index 100d5e9587794c..171fb45abea802 100644 --- a/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC002_ISC_syntax_error.py.snap +++ b/crates/ruff_linter/src/rules/flake8_implicit_str_concat/snapshots/ruff_linter__rules__flake8_implicit_str_concat__tests__ISC002_ISC_syntax_error.py.snap @@ -101,7 +101,7 @@ invalid-syntax: f-string: unterminated triple-quoted string | |__^ invalid-syntax: f-string: unterminated string - --> ISC_syntax_error.py:30:1 + --> ISC_syntax_error.py:29:3 | 28 | "i" "j" 29 | ) diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_1.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_1.py.snap index 212ac462492312..9b9dac525cb463 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_1.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_1.py.snap @@ -2,7 +2,7 @@ source: crates/ruff_linter/src/rules/pyflakes/mod.rs --- F811 Redefinition of unused `FU` from line 1 - --> F811_1.py:1:14 + --> F811_1.py:1:25 | 1 | import fu as FU, bar as FU | -- ^^ `FU` redefined here diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_12.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_12.py.snap index 8be7749183963c..c80929bfe7a90a 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_12.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_12.py.snap @@ -2,7 +2,7 @@ source: crates/ruff_linter/src/rules/pyflakes/mod.rs --- F811 Redefinition of unused `mixer` from line 2 - --> F811_12.py:2:20 + --> F811_12.py:6:20 | 1 | try: 2 | from aa import mixer diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_17.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_17.py.snap index 14f6d26008f5e1..05b281f2b11853 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_17.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_17.py.snap @@ -23,7 +23,7 @@ help: Remove definition: `fu` | F811 Redefinition of unused `fu` from line 6 - --> F811_17.py:6:12 + --> F811_17.py:9:13 | 5 | def bar(): 6 | import fu diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_2.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_2.py.snap index e6309bb0ba9f6c..9f31e1e5379672 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_2.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_2.py.snap @@ -2,7 +2,7 @@ source: crates/ruff_linter/src/rules/pyflakes/mod.rs --- F811 Redefinition of unused `FU` from line 1 - --> F811_2.py:1:23 + --> F811_2.py:1:34 | 1 | from moo import fu as FU, bar as FU | -- ^^ `FU` redefined here diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_23.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_23.py.snap index aa058c6d541cef..075c3bcec3b4b3 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_23.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_23.py.snap @@ -2,7 +2,7 @@ source: crates/ruff_linter/src/rules/pyflakes/mod.rs --- F811 Redefinition of unused `foo` from line 3 - --> F811_23.py:3:15 + --> F811_23.py:4:15 | 1 | """Test that shadowing an explicit re-export produces a warning.""" 2 | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_26.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_26.py.snap index 1025efb9fdebfd..54464875486b5a 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_26.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_26.py.snap @@ -2,7 +2,7 @@ source: crates/ruff_linter/src/rules/pyflakes/mod.rs --- F811 Redefinition of unused `func` from line 2 - --> F811_26.py:2:9 + --> F811_26.py:5:9 | 1 | class Class: 2 | def func(self): diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_28.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_28.py.snap index cf120b2cd7ea07..b7c57897d81d97 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_28.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_28.py.snap @@ -2,7 +2,7 @@ source: crates/ruff_linter/src/rules/pyflakes/mod.rs --- F811 Redefinition of unused `datetime` from line 3 - --> F811_28.py:3:8 + --> F811_28.py:4:22 | 1 | """Regression test for: https://github.com/astral-sh/ruff/issues/10384""" 2 | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_29.pyi.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_29.pyi.snap index eb5061deba8162..82d384b9965ae3 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_29.pyi.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_29.pyi.snap @@ -2,7 +2,7 @@ source: crates/ruff_linter/src/rules/pyflakes/mod.rs --- F811 Redefinition of unused `Bar` from line 3 - --> F811_29.pyi:3:24 + --> F811_29.pyi:8:1 | 1 | """Regression test for: https://github.com/astral-sh/ruff/issues/10509""" 2 | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_3.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_3.py.snap index ee44272684f1c9..1509fbde81219b 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_3.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_3.py.snap @@ -2,7 +2,7 @@ source: crates/ruff_linter/src/rules/pyflakes/mod.rs --- F811 Redefinition of unused `fu` from line 1 - --> F811_3.py:1:8 + --> F811_3.py:1:12 | 1 | import fu; fu = 3 | -- ^^ `fu` redefined here diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_30.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_30.py.snap index 0a74a323afc292..6e19457c8999f2 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_30.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_30.py.snap @@ -2,7 +2,7 @@ source: crates/ruff_linter/src/rules/pyflakes/mod.rs --- F811 Redefinition of unused `bar` from line 10 - --> F811_30.py:10:5 + --> F811_30.py:12:9 | 8 | """Foo.""" 9 | @@ -16,7 +16,7 @@ F811 Redefinition of unused `bar` from line 10 help: Remove definition: `bar` F811 Redefinition of unused `baz` from line 18 - --> F811_30.py:18:9 + --> F811_30.py:21:5 | 16 | class B: 17 | """B.""" @@ -29,7 +29,7 @@ F811 Redefinition of unused `baz` from line 18 help: Remove definition: `baz` F811 Redefinition of unused `foo` from line 26 - --> F811_30.py:26:9 + --> F811_30.py:29:12 | 24 | class C: 25 | """C.""" diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_31.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_31.py.snap index 1e8be05daaaadf..06efe5ea8baac6 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_31.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_31.py.snap @@ -2,7 +2,7 @@ source: crates/ruff_linter/src/rules/pyflakes/mod.rs --- F811 Redefinition of unused `baz` from line 17 - --> F811_31.py:17:5 + --> F811_31.py:19:29 | 16 | try: 17 | baz = None diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_32.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_32.py.snap index 7b6d5a1e70ca72..9d765221ab0782 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_32.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_32.py.snap @@ -2,7 +2,7 @@ source: crates/ruff_linter/src/rules/pyflakes/mod.rs --- F811 [*] Redefinition of unused `List` from line 4 - --> F811_32.py:4:5 + --> F811_32.py:5:5 | 3 | from typing import ( 4 | List, diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_35.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_35.py.snap index 66cabac4c137ab..d71938d88e9142 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_35.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_35.py.snap @@ -2,7 +2,7 @@ source: crates/ruff_linter/src/rules/pyflakes/mod.rs --- F811 Redefinition of unused `bar` from line 7 - --> F811_35.py:7:9 + --> F811_35.py:9:9 | 6 | class Foo: 7 | def bar(self): ... diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_4.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_4.py.snap index 40ee8788a6e764..de3ad8e353279a 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_4.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_4.py.snap @@ -2,7 +2,7 @@ source: crates/ruff_linter/src/rules/pyflakes/mod.rs --- F811 Redefinition of unused `fu` from line 1 - --> F811_4.py:1:8 + --> F811_4.py:1:12 | 1 | import fu; fu, bar = 3 | -- ^^ `fu` redefined here diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_5.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_5.py.snap index 1b2aa78997ef76..ce327c3c68965a 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_5.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_5.py.snap @@ -2,7 +2,7 @@ source: crates/ruff_linter/src/rules/pyflakes/mod.rs --- F811 Redefinition of unused `fu` from line 1 - --> F811_5.py:1:8 + --> F811_5.py:1:13 | 1 | import fu; [fu, bar] = 3 | -- ^^ `fu` redefined here diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_6.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_6.py.snap index ab9ee4bf1c93d9..661e301b481c6b 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_6.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_6.py.snap @@ -2,7 +2,7 @@ source: crates/ruff_linter/src/rules/pyflakes/mod.rs --- F811 [*] Redefinition of unused `os` from line 5 - --> F811_6.py:5:12 + --> F811_6.py:6:12 | 3 | i = 2 4 | if i == 1: diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_8.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_8.py.snap index 3ffa550828cd5b..f66e56508ee799 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_8.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__F811_F811_8.py.snap @@ -2,7 +2,7 @@ source: crates/ruff_linter/src/rules/pyflakes/mod.rs --- F811 [*] Redefinition of unused `os` from line 4 - --> F811_8.py:4:12 + --> F811_8.py:5:12 | 3 | try: 4 | import os diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_global_import_in_local_scope.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_global_import_in_local_scope.snap index a383786a302a5d..7ee75ac2a27cd0 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_global_import_in_local_scope.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_global_import_in_local_scope.snap @@ -17,7 +17,7 @@ help: Remove unused import: `os` | F811 [*] Redefinition of unused `os` from line 2 - --> :2:8 + --> :5:12 | 2 | import os | -- previous definition of `os` here diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_import_shadow_in_local_scope.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_import_shadow_in_local_scope.snap index b8432d92ebbdb4..c4c0211abdfcf5 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_import_shadow_in_local_scope.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_import_shadow_in_local_scope.snap @@ -17,7 +17,7 @@ help: Remove unused import: `os` | F811 Redefinition of unused `os` from line 2 - --> :2:8 + --> :5:5 | 2 | import os | -- previous definition of `os` here diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_local_import_in_local_scope.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_local_import_in_local_scope.snap index b9163667235d17..3f3e2d46a8ceb1 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_local_import_in_local_scope.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__del_shadowed_local_import_in_local_scope.snap @@ -2,7 +2,7 @@ source: crates/ruff_linter/src/rules/pyflakes/mod.rs --- F811 [*] Redefinition of unused `os` from line 3 - --> :3:12 + --> :4:12 | 2 | def f(): 3 | import os diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f811_annotated_assignment_redefinition.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f811_annotated_assignment_redefinition.snap index 4f60b19931cf28..7d42fbd7c65110 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f811_annotated_assignment_redefinition.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__f811_annotated_assignment_redefinition.snap @@ -2,7 +2,7 @@ source: crates/ruff_linter/src/rules/pyflakes/mod.rs --- F811 Redefinition of unused `bar` from line 4 - --> F811_34.py:4:1 + --> F811_34.py:5:1 | 3 | # F811: both annotated assignments, first unused 4 | bar: int = 1 @@ -15,7 +15,7 @@ F811 Redefinition of unused `bar` from line 4 help: Remove definition: `bar` F811 Redefinition of unused `x` from line 7 - --> F811_34.py:7:1 + --> F811_34.py:8:1 | 5 | bar: int = 2 # F811 6 | diff --git a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F811_F811_36.py.snap b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F811_F811_36.py.snap index a429f37d2a7bd0..c9d5172c651933 100644 --- a/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F811_F811_36.py.snap +++ b/crates/ruff_linter/src/rules/pyflakes/snapshots/ruff_linter__rules__pyflakes__tests__preview__F811_F811_36.py.snap @@ -2,7 +2,7 @@ source: crates/ruff_linter/src/rules/pyflakes/mod.rs --- F811 [*] Redefinition of unused `BrokerUsecase` from line 2 - --> F811_36.py:2:41 + --> F811_36.py:7:45 | 1 | from typing import TYPE_CHECKING 2 | from faststream._internal.broker import BrokerUsecase diff --git a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF068_RUF068.py.snap b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF068_RUF068.py.snap index 8858058a327d64..a93caed1c4ec95 100644 --- a/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF068_RUF068.py.snap +++ b/crates/ruff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF068_RUF068.py.snap @@ -2,7 +2,7 @@ source: crates/ruff_linter/src/rules/ruff/mod.rs --- RUF068 [*] `__all__` contains duplicate entries - --> RUF068.py:15:15 + --> RUF068.py:15:20 | 13 | __all__: typing.Any = ("A", "B") 14 | __all__ = ["A", "B"] @@ -22,7 +22,7 @@ help: Remove duplicate entries from `__all__` | RUF068 [*] `__all__` contains duplicate entries - --> RUF068.py:20:23 + --> RUF068.py:20:33 | 19 | # Bad 20 | __all__: list[str] = ["A", "B", "A"] @@ -41,7 +41,7 @@ help: Remove duplicate entries from `__all__` | RUF068 [*] `__all__` contains duplicate entries - --> RUF068.py:21:29 + --> RUF068.py:21:34 | 19 | # Bad 20 | __all__: list[str] = ["A", "B", "A"] @@ -61,7 +61,7 @@ help: Remove duplicate entries from `__all__` | RUF068 [*] `__all__` contains duplicate entries - --> RUF068.py:22:12 + --> RUF068.py:22:22 | 20 | __all__: list[str] = ["A", "B", "A"] 21 | __all__: typing.Any = ("A", "B", "B") @@ -81,7 +81,7 @@ help: Remove duplicate entries from `__all__` | RUF068 [*] `__all__` contains duplicate entries - --> RUF068.py:23:12 + --> RUF068.py:23:17 | 21 | __all__: typing.Any = ("A", "B", "B") 22 | __all__ = ["A", "B", "A"] @@ -101,7 +101,7 @@ help: Remove duplicate entries from `__all__` | RUF068 [*] `__all__` contains duplicate entries - --> RUF068.py:23:22 + --> RUF068.py:23:27 | 21 | __all__: typing.Any = ("A", "B", "B") 22 | __all__ = ["A", "B", "A"] @@ -121,7 +121,7 @@ help: Remove duplicate entries from `__all__` | RUF068 [*] `__all__` contains duplicate entries - --> RUF068.py:25:5 + --> RUF068.py:26:5 | 23 | __all__ = ["A", "A", "B", "B"] 24 | __all__ = [ @@ -140,7 +140,7 @@ help: Remove duplicate entries from `__all__` | RUF068 [*] `__all__` contains duplicate entries - --> RUF068.py:27:5 + --> RUF068.py:28:5 | 25 | "A", 26 | "A", @@ -159,7 +159,7 @@ help: Remove duplicate entries from `__all__` | RUF068 [*] `__all__` contains duplicate entries - --> RUF068.py:30:13 + --> RUF068.py:30:18 | 28 | "B" 29 | ] @@ -178,7 +178,7 @@ help: Remove duplicate entries from `__all__` | RUF068 [*] `__all__` contains duplicate entries - --> RUF068.py:31:17 + --> RUF068.py:31:22 | 29 | ] 30 | __all__ += ["B", "B"] @@ -198,7 +198,7 @@ help: Remove duplicate entries from `__all__` | RUF068 [*] `__all__` contains duplicate entries - --> RUF068.py:35:5 + --> RUF068.py:36:5 | 33 | # Bad, unsafe 34 | __all__ = [ @@ -217,7 +217,7 @@ help: Remove duplicate entries from `__all__` | RUF068 [*] `__all__` contains duplicate entries - --> RUF068.py:37:5 + --> RUF068.py:39:5 | 35 | "A", 36 | "A", diff --git a/crates/ty/tests/cli/main.rs b/crates/ty/tests/cli/main.rs index fa536f10f8a621..b05ada1fbb1de6 100644 --- a/crates/ty/tests/cli/main.rs +++ b/crates/ty/tests/cli/main.rs @@ -51,7 +51,7 @@ fn test_quiet_output() -> anyhow::Result<()> { exit_code: 1 ----- stdout ----- error[invalid-assignment]: Object of type `Literal["foo"]` is not assignable to `int` - --> test.py:1:4 + --> test.py:1:10 | 1 | x: int = 'foo' | --- ^^^^^ Incompatible value of type `Literal["foo"]` diff --git a/crates/ty/tests/cli/rule_selection.rs b/crates/ty/tests/cli/rule_selection.rs index b04e6a542ced78..19357d71c65e09 100644 --- a/crates/ty/tests/cli/rule_selection.rs +++ b/crates/ty/tests/cli/rule_selection.rs @@ -1122,7 +1122,7 @@ fn configuration_all_rules_with_rule_sorting_before_all() -> anyhow::Result<()> exit_code: 1 ----- stdout ----- error[abstract-method-in-final-class]: Final class `Derived` has unimplemented abstract methods - --> test.py:6:5 + --> test.py:11:7 | 6 | / @abstractmethod 7 | | def foo(self) -> int: @@ -1184,7 +1184,7 @@ fn overrides_all_rules_with_rule_sorting_before_all() -> anyhow::Result<()> { exit_code: 1 ----- stdout ----- error[abstract-method-in-final-class]: Final class `Derived` has unimplemented abstract methods - --> src/test.py:6:5 + --> src/test.py:11:7 | 6 | / @abstractmethod 7 | | def foo(self) -> int: diff --git a/crates/ty/tests/cli/scripts.rs b/crates/ty/tests/cli/scripts.rs index e52dfa59a5774b..dc44976430817d 100644 --- a/crates/ty/tests/cli/scripts.rs +++ b/crates/ty/tests/cli/scripts.rs @@ -80,7 +80,7 @@ fn metadata_without_tool_ty_uses_default_settings() -> anyhow::Result<()> { exit_code: 1 ----- stdout ----- error[invalid-assignment]: Object of type `Literal["not an int"]` is not assignable to `int` - --> script.py:6:8 + --> script.py:6:14 | 6 | value: int = "not an int" | --- ^^^^^^^^^^^^ Incompatible value of type `Literal["not an int"]` diff --git a/crates/ty_ide/src/rename.rs b/crates/ty_ide/src/rename.rs index c3b9c155f4e8e0..183125a5ea67ec 100644 --- a/crates/ty_ide/src/rename.rs +++ b/crates/ty_ide/src/rename.rs @@ -2296,7 +2296,7 @@ DC(f=1) // position-aware binding resolution in `definitions_for_name`. assert_snapshot!(test.rename("better_name"), @" info[rename]: Rename symbol (found 2 locations) - --> lib.py:11:2 + --> lib.py:12:5 | 11 | @my_func.setter | ------- diff --git a/crates/ty_python_semantic/resources/mdtest/annotations/any.md b/crates/ty_python_semantic/resources/mdtest/annotations/any.md index 738ea4dbee3c24..b4b9a3576e2fc9 100644 --- a/crates/ty_python_semantic/resources/mdtest/annotations/any.md +++ b/crates/ty_python_semantic/resources/mdtest/annotations/any.md @@ -244,7 +244,7 @@ def check_callable_union(value1: CallableSubclassOfAny | IncompatibleCallable): ```snapshot error[invalid-assignment]: Object of type `CallableSubclassOfAny | IncompatibleCallable` is not assignable to `(int, /) -> int` - --> src/mdtest_snippet.py:141:14 + --> src/mdtest_snippet.py:141:37 | 141 | target1: Callable[[int], int] = value1 # snapshot | -------------------- ^^^^^^ Incompatible value of type `CallableSubclassOfAny | IncompatibleCallable` diff --git a/crates/ty_python_semantic/resources/mdtest/annotations/string.md b/crates/ty_python_semantic/resources/mdtest/annotations/string.md index 491915d84fc144..6fed825953303c 100644 --- a/crates/ty_python_semantic/resources/mdtest/annotations/string.md +++ b/crates/ty_python_semantic/resources/mdtest/annotations/string.md @@ -403,7 +403,7 @@ help: Did you mean `typing.Literal["yield from 1"]`? error[invalid-syntax-in-forward-annotation]: Syntax error in forward annotation - --> src/mdtest_snippet.py:55:5 + --> src/mdtest_snippet.py:55:10 | 55 | t: "list[yield from 1]" | -----^^^^^^^^^^^^- @@ -413,7 +413,7 @@ help: Did you mean `typing.Literal["list[yield from 1]"]`? error[invalid-syntax-in-forward-annotation]: Syntax error in forward annotation - --> src/mdtest_snippet.py:57:5 + --> src/mdtest_snippet.py:57:9 | 57 | u: "type]" | ----^ @@ -461,7 +461,7 @@ str ```snapshot error[invalid-syntax-in-forward-annotation]: Syntax error in forward annotation - --> src/mdtest_snippet.py:17:12 + --> src/mdtest_snippet.py:19:4 | 17 | a1: """ | ____________- @@ -473,7 +473,7 @@ error[invalid-syntax-in-forward-annotation]: Syntax error in forward annotation error[invalid-syntax-in-forward-annotation]: Syntax error in forward annotation - --> src/mdtest_snippet.py:22:12 + --> src/mdtest_snippet.py:23:6 | 22 | a2: """ | ____________- @@ -484,7 +484,7 @@ error[invalid-syntax-in-forward-annotation]: Syntax error in forward annotation error[invalid-syntax-in-forward-annotation]: Syntax error in forward annotation - --> src/mdtest_snippet.py:27:12 + --> src/mdtest_snippet.py:28:12 | 27 | a3: """ | ____________- diff --git a/crates/ty_python_semantic/resources/mdtest/assignment/annotations.md b/crates/ty_python_semantic/resources/mdtest/assignment/annotations.md index 49c28f9abb4ef0..3687f181ee0606 100644 --- a/crates/ty_python_semantic/resources/mdtest/assignment/annotations.md +++ b/crates/ty_python_semantic/resources/mdtest/assignment/annotations.md @@ -27,7 +27,7 @@ a: Number = 1 ```snapshot error[invalid-assignment]: Object of type `Literal[1]` is not assignable to `Number` - --> src/mdtest_snippet.py:4:4 + --> src/mdtest_snippet.py:4:13 | 4 | a: Number = 1 | ------ ^ Incompatible value of type `Literal[1]` diff --git a/crates/ty_python_semantic/resources/mdtest/call/abstract_method.md b/crates/ty_python_semantic/resources/mdtest/call/abstract_method.md index 786eb0b9ba9dd9..e0552d43b45984 100644 --- a/crates/ty_python_semantic/resources/mdtest/call/abstract_method.md +++ b/crates/ty_python_semantic/resources/mdtest/call/abstract_method.md @@ -18,7 +18,7 @@ Foo.method() ```snapshot error[call-abstract-method]: Cannot call `method` on class object - --> src/mdtest_snippet.py:4:5 + --> src/mdtest_snippet.py:9:1 | 4 | / @classmethod 5 | | @abstractmethod diff --git a/crates/ty_python_semantic/resources/mdtest/call/methods.md b/crates/ty_python_semantic/resources/mdtest/call/methods.md index bfb257f9305c3a..9f413f60190dee 100644 --- a/crates/ty_python_semantic/resources/mdtest/call/methods.md +++ b/crates/ty_python_semantic/resources/mdtest/call/methods.md @@ -696,7 +696,7 @@ class Bad(NotCallableInitSubclass): ```snapshot error[non-callable-init-subclass]: Invalid definition of class `Bad` - --> src/mdtest_snippet.py:36:5 + --> src/mdtest_snippet.py:39:7 | 36 | __init_subclass__ = None | ----------------- `NotCallableInitSubclass.__init_subclass__` has type `None | Unknown`, which may not be callable diff --git a/crates/ty_python_semantic/resources/mdtest/dataclasses/dataclasses.md b/crates/ty_python_semantic/resources/mdtest/dataclasses/dataclasses.md index 0f450075b43600..9e31b727860cf9 100644 --- a/crates/ty_python_semantic/resources/mdtest/dataclasses/dataclasses.md +++ b/crates/ty_python_semantic/resources/mdtest/dataclasses/dataclasses.md @@ -1275,7 +1275,7 @@ class Child(FrozenBase): ```snapshot error[invalid-frozen-dataclass-subclass]: Non-frozen dataclass cannot inherit from frozen dataclass - --> src/foo.py:7:1 + --> src/foo.py:9:7 | 7 | @dataclass | ---------- `Child` dataclass parameters @@ -1284,7 +1284,7 @@ error[invalid-frozen-dataclass-subclass]: Non-frozen dataclass cannot inherit fr | ^^^^^^----------^ Subclass `Child` is not frozen but base class `FrozenBase` is info: This causes the class creation to fail info: Base class definition - --> src/foo.py:3:1 + --> src/foo.py:4:7 | 3 | @dataclass(frozen=True) | ----------------------- `FrozenBase` dataclass parameters diff --git a/crates/ty_python_semantic/resources/mdtest/descriptor_protocol.md b/crates/ty_python_semantic/resources/mdtest/descriptor_protocol.md index 566f58f1757635..351da6f0687643 100644 --- a/crates/ty_python_semantic/resources/mdtest/descriptor_protocol.md +++ b/crates/ty_python_semantic/resources/mdtest/descriptor_protocol.md @@ -791,7 +791,7 @@ DontAssignToMe().immutable = "the properties, they are a-changing" ```snapshot error[invalid-assignment]: Cannot assign to read-only property `immutable` on object of type `DontAssignToMe` - --> src/mdtest_snippet.py:3:9 + --> src/mdtest_snippet.py:6:1 | 3 | def immutable(self): ... | --------- Property `DontAssignToMe.immutable` defined here with no setter diff --git a/crates/ty_python_semantic/resources/mdtest/diagnostics/attribute_assignment.md b/crates/ty_python_semantic/resources/mdtest/diagnostics/attribute_assignment.md index bf7855eeba3b22..e94d43dab8fb8d 100644 --- a/crates/ty_python_semantic/resources/mdtest/diagnostics/attribute_assignment.md +++ b/crates/ty_python_semantic/resources/mdtest/diagnostics/attribute_assignment.md @@ -93,7 +93,7 @@ class C: ```snapshot error[invalid-assignment]: Object of type `None` is not assignable to `str` - --> src/mdtest_snippet.py:3:20 + --> src/mdtest_snippet.py:3:26 | 3 | self.attr: str = None # snapshot: invalid-assignment | --- ^^^^ Incompatible value of type `None` @@ -102,7 +102,7 @@ error[invalid-assignment]: Object of type `None` is not assignable to `str` error[invalid-assignment]: Object of type `None` is not assignable to `str` - --> src/mdtest_snippet.py:8:26 + --> src/mdtest_snippet.py:8:32 | 8 | cls.class_attr1: str = None # snapshot: invalid-assignment | --- ^^^^ Incompatible value of type `None` diff --git a/crates/ty_python_semantic/resources/mdtest/diagnostics/error_context.md b/crates/ty_python_semantic/resources/mdtest/diagnostics/error_context.md index 42527351392656..bc5c02d0fb0165 100644 --- a/crates/ty_python_semantic/resources/mdtest/diagnostics/error_context.md +++ b/crates/ty_python_semantic/resources/mdtest/diagnostics/error_context.md @@ -21,7 +21,7 @@ def _(source: str): ```snapshot error[invalid-assignment]: Object of type `str` is not assignable to `bytes` - --> src/mdtest_snippet.py:2:13 + --> src/mdtest_snippet.py:2:21 | 2 | target: bytes = source # snapshot | ----- ^^^^^^ Incompatible value of type `str` @@ -40,7 +40,7 @@ def _(source: str | None): ```snapshot error[invalid-assignment]: Object of type `str | None` is not assignable to `str` - --> src/mdtest_snippet.py:2:13 + --> src/mdtest_snippet.py:2:19 | 2 | target: str = source # snapshot | --- ^^^^^^ Incompatible value of type `str | None` @@ -58,7 +58,7 @@ def _(source: int): ```snapshot error[invalid-assignment]: Object of type `int` is not assignable to `str | None` - --> src/mdtest_snippet.py:4:13 + --> src/mdtest_snippet.py:4:26 | 4 | target: str | None = source # snapshot | ---------- ^^^^^^ Incompatible value of type `int` @@ -75,7 +75,7 @@ def _(source: str | None): ```snapshot error[invalid-assignment]: Object of type `str | None` is not assignable to `bytes | None` - --> src/mdtest_snippet.py:6:13 + --> src/mdtest_snippet.py:6:28 | 6 | target: bytes | None = source # snapshot | ------------ ^^^^^^ Incompatible value of type `str | None` @@ -116,7 +116,7 @@ def _(source: Intersection[HasBar, HasNeither]): ```snapshot error[invalid-assignment]: Object of type `HasBar & HasNeither` is not assignable to `SupportsFooAndBar` - --> src/mdtest_snippet.py:23:13 + --> src/mdtest_snippet.py:23:33 | 23 | target: SupportsFooAndBar = source # snapshot | ----------------- ^^^^^^ Incompatible value of type `HasBar & HasNeither` @@ -138,7 +138,7 @@ def _(source: HasFoo): ```snapshot error[invalid-assignment]: Object of type `HasFoo` is not assignable to `SupportsFoo & SupportsBar` - --> src/mdtest_snippet.py:25:13 + --> src/mdtest_snippet.py:25:54 | 25 | target: Intersection[SupportsFoo, SupportsBar] = source # snapshot | -------------------------------------- ^^^^^^ Incompatible value of type `HasFoo` @@ -158,7 +158,7 @@ def _(source: Intersection[HasFoo, HasNeither]): ```snapshot error[invalid-assignment]: Object of type `HasFoo & HasNeither` is not assignable to `SupportsFoo & SupportsBar` - --> src/mdtest_snippet.py:27:13 + --> src/mdtest_snippet.py:27:54 | 27 | target: Intersection[SupportsFoo, SupportsBar] = source # snapshot | -------------------------------------- ^^^^^^ Incompatible value of type `HasFoo & HasNeither` @@ -183,7 +183,7 @@ def _(source: tuple[int, str, bool]): ```snapshot error[invalid-assignment]: Object of type `tuple[int, str, bool]` is not assignable to `tuple[int, bytes, bool]` - --> src/mdtest_snippet.py:2:13 + --> src/mdtest_snippet.py:2:39 | 2 | target: tuple[int, bytes, bool] = source # snapshot | ----------------------- ^^^^^^ Incompatible value of type `tuple[int, str, bool]` @@ -201,7 +201,7 @@ def _(source: tuple[int, str]): ```snapshot error[invalid-assignment]: Object of type `tuple[int, str]` is not assignable to `tuple[int, str, bool]` - --> src/mdtest_snippet.py:4:13 + --> src/mdtest_snippet.py:4:37 | 4 | target: tuple[int, str, bool] = source # snapshot | --------------------- ^^^^^^ Incompatible value of type `tuple[int, str]` @@ -225,7 +225,7 @@ target: Callable[[int, bytes], bool] = source # snapshot ```snapshot error[invalid-assignment]: Object of type `def source(x: int, y: str) -> None` is not assignable to `(int, bytes, /) -> bool` - --> src/mdtest_snippet.py:6:9 + --> src/mdtest_snippet.py:6:40 | 6 | target: Callable[[int, bytes], bool] = source # snapshot | ---------------------------- ^^^^^^ Incompatible value of type `def source(x: int, y: str) -> None` @@ -243,7 +243,7 @@ def _(source: Callable[[int, str], bool]): ```snapshot error[invalid-assignment]: Object of type `(int, str, /) -> bool` is not assignable to `(int, bytes, /) -> bool` - --> src/mdtest_snippet.py:8:13 + --> src/mdtest_snippet.py:8:44 | 8 | target: Callable[[int, bytes], bool] = source # snapshot | ---------------------------- ^^^^^^ Incompatible value of type `(int, str, /) -> bool` @@ -261,7 +261,7 @@ def _(source: Callable[[int, bytes], None]): ```snapshot error[invalid-assignment]: Object of type `(int, bytes, /) -> None` is not assignable to `(int, bytes, /) -> bool` - --> src/mdtest_snippet.py:10:13 + --> src/mdtest_snippet.py:10:44 | 10 | target: Callable[[int, bytes], bool] = source # snapshot | ---------------------------- ^^^^^^ Incompatible value of type `(int, bytes, /) -> None` @@ -279,7 +279,7 @@ def _(source: Callable[[int, str], bool]): ```snapshot error[invalid-assignment]: Object of type `(int, str, /) -> bool` is not assignable to `(int, /) -> bool` - --> src/mdtest_snippet.py:12:13 + --> src/mdtest_snippet.py:12:37 | 12 | target: Callable[[int], bool] = source # snapshot | --------------------- ^^^^^^ Incompatible value of type `(int, str, /) -> bool` @@ -299,7 +299,7 @@ target: Callable[[int], bool] = source # snapshot ```snapshot error[invalid-assignment]: Object of type `def source(x: int, extra: str) -> bool` is not assignable to `(int, /) -> bool` - --> src/mdtest_snippet.py:16:9 + --> src/mdtest_snippet.py:16:33 | 16 | target: Callable[[int], bool] = source # snapshot | --------------------- ^^^^^^ Incompatible value of type `def source(x: int, extra: str) -> bool` @@ -319,7 +319,7 @@ target: Callable[[str], Any] = Number # snapshot ```snapshot error[invalid-assignment]: Object of type `` is not assignable to `(str, /) -> Any` - --> src/mdtest_snippet.py:20:9 + --> src/mdtest_snippet.py:20:32 | 20 | target: Callable[[str], Any] = Number # snapshot | -------------------- ^^^^^^ Incompatible value of type `` @@ -370,7 +370,7 @@ bound_method_target: Callable[[int], str] = greeter.greet # snapshot ```snapshot error[invalid-assignment]: Object of type `bound method Greeter.greet(name: str, greeting: str = "Hello") -> str` is not assignable to `(int, /) -> str` - --> src/mdtest_snippet.py:34:22 + --> src/mdtest_snippet.py:34:45 | 34 | bound_method_target: Callable[[int], str] = greeter.greet # snapshot | -------------------- ^^^^^^^^^^^^^ Incompatible value of type `bound method Greeter.greet(name: str, greeting: str = "Hello") -> str` @@ -390,7 +390,7 @@ known_bound_method_target: Callable[[str], bool] = callable_base.__call__ # sna ```snapshot error[invalid-assignment]: Object of type `` is not assignable to `(str, /) -> bool` - --> src/mdtest_snippet.py:38:28 + --> src/mdtest_snippet.py:38:52 | 38 | known_bound_method_target: Callable[[str], bool] = callable_base.__call__ # snapshot | --------------------- ^^^^^^^^^^^^^^^^^^^^^^ Incompatible value of type `` @@ -414,7 +414,7 @@ partial_target: Callable[[bytes], bool] = partial_predicate # snapshot ```snapshot error[invalid-assignment]: Object of type `partial[(y: str) -> bool]` is not assignable to `(bytes, /) -> bool` - --> src/mdtest_snippet.py:45:17 + --> src/mdtest_snippet.py:45:43 | 45 | partial_target: Callable[[bytes], bool] = partial_predicate # snapshot | ----------------------- ^^^^^^^^^^^^^^^^^ Incompatible value of type `partial[(y: str) -> bool]` @@ -550,7 +550,7 @@ def _(source: Person): ```snapshot error[invalid-assignment]: Object of type `Person` is not assignable to `Other` - --> src/mdtest_snippet.py:10:13 + --> src/mdtest_snippet.py:10:21 | 10 | target: Other = source # snapshot | ----- ^^^^^^ Incompatible value of type `Person` @@ -572,7 +572,7 @@ def _(source: Person): ```snapshot error[invalid-assignment]: Object of type `Person` is not assignable to `PersonWithAge` - --> src/mdtest_snippet.py:16:13 + --> src/mdtest_snippet.py:16:29 | 16 | target: PersonWithAge = source # snapshot | ------------- ^^^^^^ Incompatible value of type `Person` @@ -594,7 +594,7 @@ def _(source: PersonWithOptionalAge): ```snapshot error[invalid-assignment]: Object of type `PersonWithOptionalAge` is not assignable to `PersonWithAge` - --> src/mdtest_snippet.py:22:13 + --> src/mdtest_snippet.py:22:29 | 22 | target: PersonWithAge = source # snapshot | ------------- ^^^^^^ Incompatible value of type `PersonWithOptionalAge` @@ -615,7 +615,7 @@ def _(source: PersonWithReadOnlyName): ```snapshot error[invalid-assignment]: Object of type `PersonWithReadOnlyName` is not assignable to `Person` - --> src/mdtest_snippet.py:27:13 + --> src/mdtest_snippet.py:27:22 | 27 | target: Person = source # snapshot | ------ ^^^^^^ Incompatible value of type `PersonWithReadOnlyName` @@ -633,7 +633,7 @@ def _(source: PersonWithAge): ```snapshot error[invalid-assignment]: Object of type `PersonWithAge` is not assignable to `PersonWithOptionalAge` - --> src/mdtest_snippet.py:29:13 + --> src/mdtest_snippet.py:29:37 | 29 | target: PersonWithOptionalAge = source # snapshot | --------------------- ^^^^^^ Incompatible value of type `PersonWithAge` @@ -652,7 +652,7 @@ def _(source: Person): ```snapshot error[invalid-assignment]: Object of type `Person` is not assignable to `dict[str, Any]` - --> src/mdtest_snippet.py:31:13 + --> src/mdtest_snippet.py:31:30 | 31 | target: dict[str, Any] = source # snapshot | -------------- ^^^^^^ Incompatible value of type `Person` @@ -767,7 +767,7 @@ bad: Box[tuple[int, str, bool]] # snapshot: invalid-type-arguments ```snapshot error[invalid-type-arguments]: Type `tuple[int, str, bool]` is not assignable to upper bound `tuple[int, bytes, bool]` of type variable `T@Box` - --> src/mdtest_snippet.py:3:1 + --> src/mdtest_snippet.py:7:10 | 3 | T = TypeVar("T", bound=tuple[int, bytes, bool]) | - Type variable defined here @@ -797,7 +797,7 @@ def _(source: DoesNotHaveCheck): ```snapshot error[invalid-assignment]: Object of type `DoesNotHaveCheck` is not assignable to `SupportsCheck` - --> src/mdtest_snippet.py:9:13 + --> src/mdtest_snippet.py:9:29 | 9 | target: SupportsCheck = source # snapshot | ------------- ^^^^^^ Incompatible value of type `DoesNotHaveCheck` @@ -820,7 +820,7 @@ def _(source: CheckWithWrongSignature): ```snapshot error[invalid-assignment]: Object of type `CheckWithWrongSignature` is not assignable to `SupportsCheck` - --> src/mdtest_snippet.py:15:13 + --> src/mdtest_snippet.py:15:29 | 15 | target: SupportsCheck = source # snapshot | ------------- ^^^^^^ Incompatible value of type `CheckWithWrongSignature` @@ -846,7 +846,7 @@ def _(source: DoesNotHaveName): ```snapshot error[invalid-assignment]: Object of type `DoesNotHaveName` is not assignable to `SupportsName` - --> src/mdtest_snippet.py:23:13 + --> src/mdtest_snippet.py:23:28 | 23 | target: SupportsName = source # snapshot | ------------ ^^^^^^ Incompatible value of type `DoesNotHaveName` @@ -868,7 +868,7 @@ def _(source: SupportsSomethingElse): ```snapshot error[invalid-assignment]: Object of type `SupportsSomethingElse` is not assignable to `SupportsCheck` - --> src/mdtest_snippet.py:28:13 + --> src/mdtest_snippet.py:28:29 | 28 | target: SupportsCheck = source # snapshot | ------------- ^^^^^^ Incompatible value of type `SupportsSomethingElse` @@ -914,7 +914,7 @@ def _(source: BytesName): ```snapshot error[invalid-assignment]: Object of type `BytesName` is not assignable to `ReadableName` - --> src/mdtest_snippet.py:54:13 + --> src/mdtest_snippet.py:54:28 | 54 | target: ReadableName = source # snapshot | ------------ ^^^^^^ Incompatible value of type `BytesName` @@ -932,7 +932,7 @@ def _(source: ReadOnlyName): ```snapshot error[invalid-assignment]: Object of type `ReadOnlyName` is not assignable to `WritableName` - --> src/mdtest_snippet.py:56:13 + --> src/mdtest_snippet.py:56:28 | 56 | target: WritableName = source # snapshot | ------------ ^^^^^^ Incompatible value of type `ReadOnlyName` @@ -950,7 +950,7 @@ def _(source: BytesSetterName): ```snapshot error[invalid-assignment]: Object of type `BytesSetterName` is not assignable to `WritableName` - --> src/mdtest_snippet.py:58:13 + --> src/mdtest_snippet.py:58:28 | 58 | target: WritableName = source # snapshot | ------------ ^^^^^^ Incompatible value of type `BytesSetterName` @@ -985,7 +985,7 @@ def _(source: ReadOnlyNameProtocol): ```snapshot error[invalid-assignment]: Object of type `ReadOnlyNameProtocol` is not assignable to `WritableName` - --> src/mdtest_snippet.py:72:13 + --> src/mdtest_snippet.py:72:28 | 72 | target: WritableName = source # snapshot | ------------ ^^^^^^ Incompatible value of type `ReadOnlyNameProtocol` @@ -1003,7 +1003,7 @@ def _(source: BytesNameProtocol): ```snapshot error[invalid-assignment]: Object of type `BytesNameProtocol` is not assignable to `WritableName` - --> src/mdtest_snippet.py:74:13 + --> src/mdtest_snippet.py:74:28 | 74 | target: WritableName = source # snapshot | ------------ ^^^^^^ Incompatible value of type `BytesNameProtocol` @@ -1021,7 +1021,7 @@ def _(source: BytesSetterNameProtocol): ```snapshot error[invalid-assignment]: Object of type `BytesSetterNameProtocol` is not assignable to `WritableName` - --> src/mdtest_snippet.py:76:13 + --> src/mdtest_snippet.py:76:28 | 76 | target: WritableName = source # snapshot | ------------ ^^^^^^ Incompatible value of type `BytesSetterNameProtocol` @@ -1044,7 +1044,7 @@ def _(source: SupportsCheckWithOtherSignature): ```snapshot error[invalid-assignment]: Object of type `SupportsCheckWithOtherSignature` is not assignable to `SupportsCheck` - --> src/mdtest_snippet.py:81:13 + --> src/mdtest_snippet.py:81:29 | 81 | target: SupportsCheck = source # snapshot | ------------- ^^^^^^ Incompatible value of type `SupportsCheckWithOtherSignature` @@ -1077,7 +1077,7 @@ def _(source: HasName): ```snapshot error[invalid-assignment]: Object of type `HasName` is not assignable to `StringOrName` - --> src/mdtest_snippet.py:13:13 + --> src/mdtest_snippet.py:13:28 | 13 | target: StringOrName = source # snapshot | ------------ ^^^^^^ Incompatible value of type `HasName` @@ -1103,7 +1103,7 @@ target: Callable[[tuple[int, bytes]], bool] = source # snapshot ```snapshot error[invalid-assignment]: Object of type `def source(x: tuple[int, str]) -> bool` is not assignable to `(tuple[int, bytes], /) -> bool` - --> src/mdtest_snippet.py:6:9 + --> src/mdtest_snippet.py:6:47 | 6 | target: Callable[[tuple[int, bytes]], bool] = source # snapshot | ----------------------------------- ^^^^^^ Incompatible value of type `def source(x: tuple[int, str]) -> bool` @@ -1132,7 +1132,7 @@ def _(source: Incompatible): ```snapshot error[invalid-assignment]: Object of type `Incompatible` is not assignable to `SupportsCheck` - --> src/mdtest_snippet.py:12:13 + --> src/mdtest_snippet.py:12:29 | 12 | target: SupportsCheck = source # snapshot | ------------- ^^^^^^ Incompatible value of type `Incompatible` @@ -1162,7 +1162,7 @@ def _(source: HasNeither): ```snapshot error[invalid-assignment]: Object of type `HasNeither` is not assignable to `SupportsFoo | SupportsBar` - --> src/mdtest_snippet.py:12:13 + --> src/mdtest_snippet.py:12:41 | 12 | target: SupportsFoo | SupportsBar = source # snapshot | ------------------------- ^^^^^^ Incompatible value of type `HasNeither` @@ -1184,7 +1184,7 @@ def _(source: int): ```snapshot error[invalid-assignment]: Object of type `int` is not assignable to `str | bytes | bool | None` - --> src/mdtest_snippet.py:2:13 + --> src/mdtest_snippet.py:2:41 | 2 | target: str | bytes | bool | None = source # snapshot | ------------------------- ^^^^^^ Incompatible value of type `int` @@ -1210,7 +1210,7 @@ def _(source: Intersection[DoesNotSupportFoo1, DoesNotSupportFoo2]): ```snapshot error[invalid-assignment]: Object of type `DoesNotSupportFoo1 & DoesNotSupportFoo2` is not assignable to `SupportsFoo` - --> src/mdtest_snippet.py:11:13 + --> src/mdtest_snippet.py:11:27 | 11 | target: SupportsFoo = source # snapshot | ----------- ^^^^^^ Incompatible value of type `DoesNotSupportFoo1 & DoesNotSupportFoo2` @@ -1249,7 +1249,7 @@ def _(source: IncompatibleFoo): ```snapshot error[invalid-assignment]: Object of type `IncompatibleFoo` is not assignable to `SupportsFooAndBar` - --> src/mdtest_snippet.py:16:13 + --> src/mdtest_snippet.py:16:33 | 16 | target: SupportsFooAndBar = source # snapshot | ----------------- ^^^^^^ Incompatible value of type `IncompatibleFoo` @@ -1271,7 +1271,7 @@ def _(source: list[str]): ```snapshot error[invalid-assignment]: Object of type `list[str]` is not assignable to `Iterable[bytes]` - --> src/mdtest_snippet.py:4:13 + --> src/mdtest_snippet.py:4:31 | 4 | target: Iterable[bytes] = source # snapshot | --------------- ^^^^^^ Incompatible value of type `list[str]` @@ -1297,7 +1297,7 @@ def _(source: list[bool]): ```snapshot error[invalid-assignment]: Object of type `list[bool]` is not assignable to `list[int]` - --> src/mdtest_snippet.py:2:13 + --> src/mdtest_snippet.py:2:25 | 2 | target: list[int] = source # snapshot | --------- ^^^^^^ Incompatible value of type `list[bool]` @@ -1356,7 +1356,7 @@ def _(source: MutableSequence[bool]): ```snapshot error[invalid-assignment]: Object of type `set[bool]` is not assignable to `set[int]` - --> src/mdtest_snippet.py:7:13 + --> src/mdtest_snippet.py:7:24 | 7 | target: set[int] = source # snapshot | -------- ^^^^^^ Incompatible value of type `set[bool]` @@ -1368,7 +1368,7 @@ info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/# error[invalid-assignment]: Object of type `dict[str, bool]` is not assignable to `dict[str, int]` - --> src/mdtest_snippet.py:10:13 + --> src/mdtest_snippet.py:10:30 | 10 | target: dict[str, int] = source # snapshot | -------------- ^^^^^^ Incompatible value of type `dict[str, bool]` @@ -1380,7 +1380,7 @@ info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/# error[invalid-assignment]: Object of type `dict[bool, str]` is not assignable to `dict[int, str]` - --> src/mdtest_snippet.py:13:13 + --> src/mdtest_snippet.py:13:30 | 13 | target: dict[int, str] = source # snapshot | -------------- ^^^^^^ Incompatible value of type `dict[bool, str]` @@ -1391,7 +1391,7 @@ info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/# error[invalid-assignment]: Object of type `dict[bool, bool]` is not assignable to `dict[int, int]` - --> src/mdtest_snippet.py:16:13 + --> src/mdtest_snippet.py:16:30 | 16 | target: dict[int, int] = source # snapshot | -------------- ^^^^^^ Incompatible value of type `dict[bool, bool]` @@ -1402,7 +1402,7 @@ info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/# error[invalid-assignment]: Object of type `defaultdict[str, bool]` is not assignable to `defaultdict[str, int]` - --> src/mdtest_snippet.py:19:13 + --> src/mdtest_snippet.py:19:37 | 19 | target: defaultdict[str, int] = source # snapshot | --------------------- ^^^^^^ Incompatible value of type `defaultdict[str, bool]` @@ -1414,7 +1414,7 @@ info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/# error[invalid-assignment]: Object of type `defaultdict[bool, str]` is not assignable to `defaultdict[int, str]` - --> src/mdtest_snippet.py:22:13 + --> src/mdtest_snippet.py:22:37 | 22 | target: defaultdict[int, str] = source # snapshot | --------------------- ^^^^^^ Incompatible value of type `defaultdict[bool, str]` @@ -1425,7 +1425,7 @@ info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/# error[invalid-assignment]: Object of type `OrderedDict[str, bool]` is not assignable to `OrderedDict[str, int]` - --> src/mdtest_snippet.py:25:13 + --> src/mdtest_snippet.py:25:37 | 25 | target: OrderedDict[str, int] = source # snapshot | --------------------- ^^^^^^ Incompatible value of type `OrderedDict[str, bool]` @@ -1437,7 +1437,7 @@ info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/# error[invalid-assignment]: Object of type `OrderedDict[bool, str]` is not assignable to `OrderedDict[int, str]` - --> src/mdtest_snippet.py:28:13 + --> src/mdtest_snippet.py:28:37 | 28 | target: OrderedDict[int, str] = source # snapshot | --------------------- ^^^^^^ Incompatible value of type `OrderedDict[bool, str]` @@ -1448,7 +1448,7 @@ info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/# error[invalid-assignment]: Object of type `ChainMap[str, bool]` is not assignable to `ChainMap[str, int]` - --> src/mdtest_snippet.py:31:13 + --> src/mdtest_snippet.py:31:34 | 31 | target: ChainMap[str, int] = source # snapshot | ------------------ ^^^^^^ Incompatible value of type `ChainMap[str, bool]` @@ -1460,7 +1460,7 @@ info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/# error[invalid-assignment]: Object of type `ChainMap[bool, str]` is not assignable to `ChainMap[int, str]` - --> src/mdtest_snippet.py:34:13 + --> src/mdtest_snippet.py:34:34 | 34 | target: ChainMap[int, str] = source # snapshot | ------------------ ^^^^^^ Incompatible value of type `ChainMap[bool, str]` @@ -1471,7 +1471,7 @@ info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/# error[invalid-assignment]: Object of type `deque[bool]` is not assignable to `deque[int]` - --> src/mdtest_snippet.py:37:13 + --> src/mdtest_snippet.py:37:26 | 37 | target: deque[int] = source # snapshot | ---------- ^^^^^^ Incompatible value of type `deque[bool]` @@ -1483,7 +1483,7 @@ info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/# error[invalid-assignment]: Object of type `Counter[bool]` is not assignable to `Counter[int]` - --> src/mdtest_snippet.py:40:13 + --> src/mdtest_snippet.py:40:28 | 40 | target: Counter[int] = source # snapshot | ------------ ^^^^^^ Incompatible value of type `Counter[bool]` @@ -1494,7 +1494,7 @@ info: For more information, see https://docs.astral.sh/ty/reference/typing-faq/# error[invalid-assignment]: Object of type `MutableSequence[bool]` is not assignable to `MutableSequence[int]` - --> src/mdtest_snippet.py:43:13 + --> src/mdtest_snippet.py:43:36 | 43 | target: MutableSequence[int] = source # snapshot | -------------------- ^^^^^^ Incompatible value of type `MutableSequence[bool]` @@ -1520,7 +1520,7 @@ def _(source: MyContainer[bool]): ```snapshot error[invalid-assignment]: Object of type `MyContainer[bool]` is not assignable to `MyContainer[int]` - --> src/mdtest_snippet.py:52:13 + --> src/mdtest_snippet.py:52:32 | 52 | target: MyContainer[int] = source # snapshot | ---------------- ^^^^^^ Incompatible value of type `MyContainer[bool]` @@ -1539,7 +1539,7 @@ def _(source: list[int]): ```snapshot error[invalid-assignment]: Object of type `list[int]` is not assignable to `list[str]` - --> src/mdtest_snippet.py:54:13 + --> src/mdtest_snippet.py:54:25 | 54 | target: list[str] = source # snapshot | --------- ^^^^^^ Incompatible value of type `list[int]` @@ -1573,7 +1573,7 @@ def f() -> tuple[int, str]: ```snapshot error[invalid-return-type]: Return type does not match returned value - --> src/mdtest_snippet.py:1:12 + --> src/mdtest_snippet.py:2:12 | 1 | def f() -> tuple[int, str]: | --------------- Expected `tuple[int, str]` because of return type @@ -1612,7 +1612,7 @@ def f() -> Generator[tuple[int, str], None, None]: ```snapshot error[invalid-yield]: Yield expression type does not match annotation - --> src/mdtest_snippet.py:3:12 + --> src/mdtest_snippet.py:4:11 | 3 | def f() -> Generator[tuple[int, str], None, None]: | -------------------------------------- Function annotated with yield type `tuple[int, str]` here diff --git a/crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_assignment_syntactic_variants.md b/crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_assignment_syntactic_variants.md index e945dc6f9a8567..ee3be82f454794 100644 --- a/crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_assignment_syntactic_variants.md +++ b/crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_assignment_syntactic_variants.md @@ -13,7 +13,7 @@ Here, we point to the type annotation directly: ```snapshot error[invalid-assignment]: Object of type `Literal["three"]` is not assignable to `int` - --> src/mdtest_snippet.py:1:4 + --> src/mdtest_snippet.py:1:10 | 1 | x: int = "three" # snapshot: invalid-assignment | --- ^^^^^^^ Incompatible value of type `Literal["three"]` @@ -33,7 +33,7 @@ type in an annotation on the variable name: ```snapshot error[invalid-assignment]: Object of type `Literal["three"]` is not assignable to `int` - --> src/mdtest_snippet.py:2:1 + --> src/mdtest_snippet.py:2:5 | 2 | x = "three" # snapshot: invalid-assignment | - ^^^^^^^ Incompatible value of type `Literal["three"]` @@ -53,7 +53,7 @@ Similar here, we could ideally point to the type annotation: ```snapshot error[invalid-assignment]: Object of type `Literal["three"]` is not assignable to `int` - --> src/mdtest_snippet.py:3:2 + --> src/mdtest_snippet.py:3:7 | 3 | (x := "three") # snapshot: invalid-assignment | - ^^^^^^^ Incompatible value of type `Literal["three"]` @@ -76,7 +76,7 @@ x: str = ( ```snapshot error[invalid-assignment]: Object of type `Literal[15]` is not assignable to `str` - --> src/mdtest_snippet.py:4:4 + --> src/mdtest_snippet.py:4:10 | 4 | x: str = ( | ____---___^ @@ -105,7 +105,7 @@ tuple: ```snapshot error[invalid-assignment]: Object of type `Literal["a"]` is not assignable to `int` - --> src/mdtest_snippet.py:4:1 + --> src/mdtest_snippet.py:4:8 | 4 | x, y = ("a", "b") # snapshot: invalid-assignment | - ^^^^^^^^^^ Incompatible value of type `Literal["a"]` @@ -114,7 +114,7 @@ error[invalid-assignment]: Object of type `Literal["a"]` is not assignable to `i error[invalid-assignment]: Object of type `Literal[0]` is not assignable to `str` - --> src/mdtest_snippet.py:6:4 + --> src/mdtest_snippet.py:6:8 | 6 | x, y = (0, 0) # snapshot: invalid-assignment | - ^^^^^^ Incompatible value of type `Literal[0]` diff --git a/crates/ty_python_semantic/resources/mdtest/diagnostics/shadowing.md b/crates/ty_python_semantic/resources/mdtest/diagnostics/shadowing.md index d6cd3d037877d5..688eefbc00c6f3 100644 --- a/crates/ty_python_semantic/resources/mdtest/diagnostics/shadowing.md +++ b/crates/ty_python_semantic/resources/mdtest/diagnostics/shadowing.md @@ -13,7 +13,7 @@ C = 1 # snapshot: invalid-assignment ```snapshot error[invalid-assignment]: Object of type `Literal[1]` is not assignable to `` - --> src/mdtest_snippet.py:3:1 + --> src/mdtest_snippet.py:3:5 | 3 | C = 1 # snapshot: invalid-assignment | - ^ Incompatible value of type `Literal[1]` @@ -32,7 +32,7 @@ f = 1 # snapshot: invalid-assignment ```snapshot error[invalid-assignment]: Object of type `Literal[1]` is not assignable to `def f() -> Unknown` - --> src/mdtest_snippet.py:3:1 + --> src/mdtest_snippet.py:3:5 | 3 | f = 1 # snapshot: invalid-assignment | - ^ Incompatible value of type `Literal[1]` diff --git a/crates/ty_python_semantic/resources/mdtest/expression/yield_and_yield_from.md b/crates/ty_python_semantic/resources/mdtest/expression/yield_and_yield_from.md index c72210d37d6a1e..6889b128e2b336 100644 --- a/crates/ty_python_semantic/resources/mdtest/expression/yield_and_yield_from.md +++ b/crates/ty_python_semantic/resources/mdtest/expression/yield_and_yield_from.md @@ -209,7 +209,7 @@ def invalid_generator() -> Generator[int, None, None]: ```snapshot error[invalid-yield]: Yield expression type does not match annotation - --> src/mdtest_snippet.py:3:28 + --> src/mdtest_snippet.py:5:11 | 3 | def invalid_generator() -> Generator[int, None, None]: | -------------------------- Function annotated with yield type `int` here @@ -276,7 +276,7 @@ def outer() -> Generator[int, str, None]: ```snapshot error[invalid-yield]: Send type does not match annotation - --> src/mdtest_snippet.py:6:16 + --> src/mdtest_snippet.py:8:16 | 6 | def outer() -> Generator[int, str, None]: | ------------------------- Function annotated with send type `str` here @@ -299,7 +299,7 @@ reveal_type(non_gen) # revealed: def non_gen() -> Generator[int, int, None] ```snapshot error[invalid-return-type]: Return type does not match returned value - --> src/mdtest_snippet.py:3:18 + --> src/mdtest_snippet.py:5:12 | 3 | def non_gen() -> Generator[int, int, None]: | ------------------------- Expected `Generator[int, int, None]` because of return type diff --git a/crates/ty_python_semantic/resources/mdtest/generics/legacy/classes.md b/crates/ty_python_semantic/resources/mdtest/generics/legacy/classes.md index 5d198e0e98ef1d..308043c34a057c 100644 --- a/crates/ty_python_semantic/resources/mdtest/generics/legacy/classes.md +++ b/crates/ty_python_semantic/resources/mdtest/generics/legacy/classes.md @@ -117,7 +117,7 @@ class ParamSpecOuterClass(Generic[P]): ```snapshot error[shadowed-type-variable]: Generic class `InnerClass` uses ParamSpec `P` already bound by an enclosing scope - --> src/mdtest_snippet.py:70:7 + --> src/mdtest_snippet.py:72:11 | 70 | class ParamSpecOuterClass(Generic[P]): | ------------------------------- ParamSpec `P` is bound in this enclosing scope diff --git a/crates/ty_python_semantic/resources/mdtest/generics/pep695/aliases.md b/crates/ty_python_semantic/resources/mdtest/generics/pep695/aliases.md index 5d92ddcddd0b7a..e6abd346ab9e7c 100644 --- a/crates/ty_python_semantic/resources/mdtest/generics/pep695/aliases.md +++ b/crates/ty_python_semantic/resources/mdtest/generics/pep695/aliases.md @@ -704,7 +704,7 @@ type Alias1[*Ts, T = int] = tuple[*Ts, T] ```snapshot error[invalid-type-variable-default]: Type parameters with defaults cannot follow a TypeVarTuple parameter - --> src/mdtest_snippet.py:2:13 + --> src/mdtest_snippet.py:2:18 | 2 | type Alias1[*Ts, T = int] = tuple[*Ts, T] | --- ^^^^^^^ `T` has a default @@ -720,7 +720,7 @@ type Alias2[T1, *Ts, T2 = int] = tuple[T1, *Ts, T2] ```snapshot error[invalid-type-variable-default]: Type parameters with defaults cannot follow a TypeVarTuple parameter - --> src/mdtest_snippet.py:4:17 + --> src/mdtest_snippet.py:4:22 | 4 | type Alias2[T1, *Ts, T2 = int] = tuple[T1, *Ts, T2] | --- ^^^^^^^^ `T2` has a default @@ -736,7 +736,7 @@ type Alias3[*Ts, T1 = int, T2 = str] = tuple[*Ts, T1, T2] ```snapshot error[invalid-type-variable-default]: Type parameters with defaults cannot follow a TypeVarTuple parameter - --> src/mdtest_snippet.py:6:13 + --> src/mdtest_snippet.py:6:18 | 6 | type Alias3[*Ts, T1 = int, T2 = str] = tuple[*Ts, T1, T2] | --- ^^^^^^^^ -------- `T2` also has a default @@ -755,7 +755,7 @@ type Alias4[*Us, *Ts = *tuple[int, str]] = tuple[*Us, *Ts] ```snapshot error[invalid-type-variable-default]: Type parameters with defaults cannot follow a TypeVarTuple parameter - --> src/mdtest_snippet.py:10:13 + --> src/mdtest_snippet.py:10:18 | 10 | type Alias4[*Us, *Ts = *tuple[int, str]] = tuple[*Us, *Ts] | --- ^^^^^^^^^^^^^^^^^^^^^^ `Ts` has a default diff --git a/crates/ty_python_semantic/resources/mdtest/liskov.md b/crates/ty_python_semantic/resources/mdtest/liskov.md index fedbb4a604ca03..d97620369dd6e3 100644 --- a/crates/ty_python_semantic/resources/mdtest/liskov.md +++ b/crates/ty_python_semantic/resources/mdtest/liskov.md @@ -250,7 +250,7 @@ class Sub16(Super2): ```snapshot error[invalid-method-override]: Invalid override of method `method2` - --> src/mdtest_snippet.pyi:43:9 + --> src/mdtest_snippet.pyi:46:9 | 43 | def method2(self, x): ... | ---------------- `Super2.method2` defined here @@ -271,7 +271,7 @@ class Sub17(Super2): ```snapshot error[invalid-method-override]: Invalid override of method `method2` - --> src/mdtest_snippet.pyi:43:9 + --> src/mdtest_snippet.pyi:48:9 | 43 | def method2(self, x): ... | ---------------- `Super2.method2` defined here @@ -304,7 +304,7 @@ class Sub19(Super3): ```snapshot error[invalid-method-override]: Invalid override of method `method3` - --> src/mdtest_snippet.pyi:50:9 + --> src/mdtest_snippet.pyi:55:9 | 50 | def method3(self, *, x): ... | ------------------- `Super3.method3` defined here @@ -336,7 +336,7 @@ class Sub21(Super4): ```snapshot error[invalid-method-override]: Invalid override of method `method` - --> src/mdtest_snippet.pyi:57:9 + --> src/mdtest_snippet.pyi:62:9 | 57 | def method(self, *args: int, **kwargs: str): ... | --------------------------------------- `Super4.method` defined here @@ -650,7 +650,7 @@ class Compatible(ReturnsBool, ReturnsInt): ... ```snapshot error[invalid-method-override]: Base classes for class `BasicConflict` define method `method` incompatibly - --> src/mdtest_snippet.pyi:2:9 + --> src/mdtest_snippet.pyi:10:7 | 2 | def method(self) -> str: ... | ------ `ReturnsStr.method` defined here @@ -902,7 +902,7 @@ class StaticClassConflict(StaticMethod, ClassMethod): ... # error: [invalid-met ```snapshot error[invalid-method-override]: Base classes for class `ClassInstanceConflict` define method `kind` incompatibly - --> src/mdtest_snippet.pyi:10:9 + --> src/mdtest_snippet.pyi:13:7 | 10 | def kind(cls, value: int) -> int: ... | ---- `ClassMethod.kind` defined here @@ -1142,7 +1142,7 @@ class ThirdChild(GradualParent): ```snapshot error[invalid-method-override]: Invalid override of method `method` - --> src/stub.pyi:4:9 + --> src/stub.pyi:7:9 | 4 | def method(self, x: int) -> None: ... | ---------------------------- `Grandparent.method` defined here @@ -1183,7 +1183,7 @@ info: This violates the Liskov Substitution Principle error[invalid-method-override]: Invalid override of method `method` - --> src/stub.pyi:25:9 + --> src/stub.pyi:28:9 | 25 | def method(self) -> int: ... | ------------------- `GrandparentWithReturnType.method` defined here @@ -1196,7 +1196,7 @@ info: This violates the Liskov Substitution Principle error[invalid-method-override]: Invalid override of method `method` - --> src/stub.pyi:28:9 + --> src/stub.pyi:33:9 | 28 | def method(self) -> str: ... # snapshot: invalid-method-override | ------------------- `ParentWithReturnType.method` defined here @@ -1248,7 +1248,7 @@ class D(C): ```snapshot error[invalid-method-override]: Invalid override of method `get` - --> src/other_stub.pyi:2:9 + --> src/other_stub.pyi:5:9 | 2 | def get(self, default): ... | ------------------ `A.get` defined here @@ -1683,7 +1683,7 @@ class D(C): ```snapshot error[invalid-method-override]: Invalid override of method `x` - --> src/bar.pyi:4:9 + --> src/bar.pyi:7:5 | 4 | def x(self, y: int): ... | --------------- `A.x` defined here @@ -1701,7 +1701,7 @@ info: This violates the Liskov Substitution Principle error[invalid-method-override]: Invalid override of method `x` - --> src/bar.pyi:10:5 + --> src/bar.pyi:13:9 | 10 | x = foo.x | --------- `C.x` defined here diff --git a/crates/ty_python_semantic/resources/mdtest/override.md b/crates/ty_python_semantic/resources/mdtest/override.md index 6ebc2647aa0d22..4ac37e9501c0fd 100644 --- a/crates/ty_python_semantic/resources/mdtest/override.md +++ b/crates/ty_python_semantic/resources/mdtest/override.md @@ -584,7 +584,7 @@ class ExplicitChild(Parent): ```snapshot error[missing-override-decorator]: Method `method` overrides `Parent.method` but is not decorated with `@override` - --> src/mdtest_snippet.py:4:9 + --> src/mdtest_snippet.py:7:9 | 4 | def method(self) -> None: ... | ------ `Parent.method` defined here @@ -621,7 +621,7 @@ class ExplicitChild(Parent): ```snapshot error[missing-override-decorator]: Method `method` overrides `Parent.method` but is not decorated with `@override` - --> src/mdtest_snippet.py:4:9 + --> src/mdtest_snippet.py:7:9 | 4 | def method(self) -> None: ... | ------ `Parent.method` defined here diff --git a/crates/ty_python_semantic/resources/mdtest/protocols.md b/crates/ty_python_semantic/resources/mdtest/protocols.md index 562344fcadfbfa..ad50e24a50e885 100644 --- a/crates/ty_python_semantic/resources/mdtest/protocols.md +++ b/crates/ty_python_semantic/resources/mdtest/protocols.md @@ -4233,7 +4233,7 @@ iterable: Iterable[int] = DirectIterable # snapshot ```snapshot error[invalid-assignment]: Object of type `` is not assignable to `Iterable[int]` - --> src/mdtest_snippet.py:20:11 + --> src/mdtest_snippet.py:20:27 | 20 | iterable: Iterable[int] = DirectIterable # snapshot | ------------- ^^^^^^^^^^^^^^ Incompatible value of type `` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_value_type_f\342\200\246_(155d53762388f9ad).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_value_type_f\342\200\246_(155d53762388f9ad).snap" index c50782f01483a5..f5b7c6efe4b72f 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_value_type_f\342\200\246_(155d53762388f9ad).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Invalid_value_type_f\342\200\246_(155d53762388f9ad).snap" @@ -26,7 +26,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/subscript/assignment_dia ``` error[invalid-assignment]: Invalid assignment to key "retries" with declared type `int` on TypedDict `Config` - --> src/mdtest_snippet.py:7:5 + --> src/mdtest_snippet.py:7:25 | 7 | config["retries"] = "three" # error: [invalid-assignment] | ------ --------- ^^^^^^^ value of type `Literal["three"]` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Misspelled_key_for_`\342\200\246_(7cf0fa634e2a2d59).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Misspelled_key_for_`\342\200\246_(7cf0fa634e2a2d59).snap" index 2e0d30897d9b08..b902d9d89b0d1a 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Misspelled_key_for_`\342\200\246_(7cf0fa634e2a2d59).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Misspelled_key_for_`\342\200\246_(7cf0fa634e2a2d59).snap" @@ -26,7 +26,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/subscript/assignment_dia ``` error[invalid-key]: Unknown key "Retries" for TypedDict `Config` - --> src/mdtest_snippet.py:7:5 + --> src/mdtest_snippet.py:7:12 | 7 | config["Retries"] = 30.0 # error: [invalid-key] | ------ ^^^^^^^^^ Did you mean "retries"? diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Unknown_key_for_all_\342\200\246_(8a0f0e8ceccc51b2).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Unknown_key_for_all_\342\200\246_(8a0f0e8ceccc51b2).snap" index 1c327fa2dc1380..d831b9bcbe0554 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Unknown_key_for_all_\342\200\246_(8a0f0e8ceccc51b2).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Unknown_key_for_all_\342\200\246_(8a0f0e8ceccc51b2).snap" @@ -33,7 +33,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/subscript/assignment_dia ``` error[invalid-key]: Unknown key "nane" for TypedDict `Animal` - --> src/mdtest_snippet.py:14:5 + --> src/mdtest_snippet.py:14:11 | 14 | being["nane"] = "unknown" | ----- ^^^^^^ Unknown key "nane" @@ -44,7 +44,7 @@ error[invalid-key]: Unknown key "nane" for TypedDict `Animal` ``` error[invalid-key]: Unknown key "nane" for TypedDict `Person` - --> src/mdtest_snippet.py:14:5 + --> src/mdtest_snippet.py:14:11 | 14 | being["nane"] = "unknown" | ----- ^^^^^^ Unknown key "nane" diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Unknown_key_for_one_\342\200\246_(b515711c0a451a86).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Unknown_key_for_one_\342\200\246_(b515711c0a451a86).snap" index efcd16a430cae1..f79d5e454b2ba3 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Unknown_key_for_one_\342\200\246_(b515711c0a451a86).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/assignment_diagnosti\342\200\246_-_Subscript_assignment\342\200\246_-_Unknown_key_for_one_\342\200\246_(b515711c0a451a86).snap" @@ -31,7 +31,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/subscript/assignment_dia ``` error[invalid-key]: Unknown key "legs" for TypedDict `Person` - --> src/mdtest_snippet.py:12:5 + --> src/mdtest_snippet.py:12:11 | 12 | being["legs"] = 4 # error: [invalid-key] | ----- ^^^^^^ Unknown key "legs" diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___PEP\342\200\246_-_Default_type_paramet\342\200\246_(6bb09b09c131074).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___PEP\342\200\246_-_Default_type_paramet\342\200\246_(6bb09b09c131074).snap" index 101bcd35c03b61..281636a2c502cf 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___PEP\342\200\246_-_Default_type_paramet\342\200\246_(6bb09b09c131074).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/classes.md_-_Generic_classes___PEP\342\200\246_-_Default_type_paramet\342\200\246_(6bb09b09c131074).snap" @@ -48,7 +48,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/generics/pep695/classes. ``` error[invalid-type-variable-default]: Type parameters with defaults cannot follow a TypeVarTuple parameter - --> src/mdtest_snippet.py:2:11 + --> src/mdtest_snippet.py:2:16 | 2 | class Foo[*Ts, T = int]: ... | --- ^^^^^^^ `T` has a default @@ -60,7 +60,7 @@ info: See https://typing.python.org/en/latest/spec/generics.html#defaults-follow ``` error[invalid-type-variable-default]: Type parameters with defaults cannot follow a TypeVarTuple parameter - --> src/mdtest_snippet.py:5:15 + --> src/mdtest_snippet.py:5:20 | 5 | class Bar[T1, *Ts, T2 = int]: ... | --- ^^^^^^^^ `T2` has a default @@ -72,7 +72,7 @@ info: See https://typing.python.org/en/latest/spec/generics.html#defaults-follow ``` error[invalid-type-variable-default]: Type parameters with defaults cannot follow a TypeVarTuple parameter - --> src/mdtest_snippet.py:8:11 + --> src/mdtest_snippet.py:8:16 | 8 | class Baz[*Ts, T1 = int, T2 = str]: ... | --- ^^^^^^^^ -------- `T2` also has a default @@ -85,7 +85,7 @@ info: See https://typing.python.org/en/latest/spec/generics.html#defaults-follow ``` error[invalid-type-variable-default]: Type parameters with defaults cannot follow a TypeVarTuple parameter - --> src/mdtest_snippet.py:15:11 + --> src/mdtest_snippet.py:15:16 | 15 | class Qux[*Ts, **P = [int, str]]: ... | --- ^^^^^^^^^^^^^^^^ `P` has a default @@ -97,7 +97,7 @@ info: See https://typing.python.org/en/latest/spec/generics.html#defaults-follow ``` error[invalid-type-variable-default]: Type parameters with defaults cannot follow a TypeVarTuple parameter - --> src/mdtest_snippet.py:18:12 + --> src/mdtest_snippet.py:18:17 | 18 | class Quux[*Ts, T1 = int, **P = [int, str]]: ... | --- ^^^^^^^^ ---------------- `P` also has a default @@ -110,7 +110,7 @@ info: See https://typing.python.org/en/latest/spec/generics.html#defaults-follow ``` error[invalid-type-variable-default]: Type parameters with defaults cannot follow a TypeVarTuple parameter - --> src/mdtest_snippet.py:21:13 + --> src/mdtest_snippet.py:21:18 | 21 | class Corge[*Ts, T1 = int, T2 = str, **P = [int, str]]: ... | --- ^^^^^^^^ -------- ---------------- `P` also has a default @@ -124,7 +124,7 @@ info: See https://typing.python.org/en/latest/spec/generics.html#defaults-follow ``` error[invalid-type-form]: Generic class `Grault` cannot have multiple `TypeVarTuple` type parameters - --> src/mdtest_snippet.py:25:14 + --> src/mdtest_snippet.py:25:19 | 25 | class Grault[*Us, *Ts = *tuple[int, str]]: ... | --- ^^^^^^^^^^^^^^^^^^^^^^ `Ts` is an additional TypeVarTuple @@ -136,7 +136,7 @@ info: See https://typing.python.org/en/latest/spec/generics.html#multiple-type-v ``` error[invalid-type-variable-default]: Type parameters with defaults cannot follow a TypeVarTuple parameter - --> src/mdtest_snippet.py:25:14 + --> src/mdtest_snippet.py:25:19 | 25 | class Grault[*Us, *Ts = *tuple[int, str]]: ... | --- ^^^^^^^^^^^^^^^^^^^^^^ `Ts` has a default diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Abstract_method_in_g\342\200\246_(6d8b024dda7ced11).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Abstract_method_in_g\342\200\246_(6d8b024dda7ced11).snap" index 886437d06db308..d5efd8ded34682 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Abstract_method_in_g\342\200\246_(6d8b024dda7ced11).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Abstract_method_in_g\342\200\246_(6d8b024dda7ced11).snap" @@ -32,7 +32,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/final.md ``` error[abstract-method-in-final-class]: Final class `Child` has unimplemented abstract methods - --> src/mdtest_snippet.py:5:5 + --> src/mdtest_snippet.py:12:7 | 5 | / @abstractmethod 6 | | def method(self) -> int: ... diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Basic_case_with_ABC_(21e412599c45972a).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Basic_case_with_ABC_(21e412599c45972a).snap" index 37388abf6f14d6..72524030115871 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Basic_case_with_ABC_(21e412599c45972a).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Basic_case_with_ABC_(21e412599c45972a).snap" @@ -30,7 +30,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/final.md ``` error[abstract-method-in-final-class]: Final class `Derived` has unimplemented abstract methods - --> src/mdtest_snippet.py:5:5 + --> src/mdtest_snippet.py:10:7 | 5 | / @abstractmethod 6 | | def foo(self) -> int: diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(ecae0f4510696c95).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(ecae0f4510696c95).snap" index 047c946360ab05..a7c2cb85906a16 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(ecae0f4510696c95).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(ecae0f4510696c95).snap" @@ -45,7 +45,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/final.md ``` error[abstract-method-in-final-class]: Final class `Abstract` has unimplemented abstract methods - --> src/mdtest_snippet.py:4:1 + --> src/mdtest_snippet.py:6:7 | 4 | @final | ------ diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(f807ff3716d8ab0d).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(f807ff3716d8ab0d).snap" index 3550f7d2707193..13b15610c9a293 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(f807ff3716d8ab0d).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(f807ff3716d8ab0d).snap" @@ -45,7 +45,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/final.md ``` error[abstract-method-in-final-class]: Final class `Abstract` has unimplemented abstract methods - --> src/mdtest_snippet.py:4:1 + --> src/mdtest_snippet.py:6:7 | 4 | @final | ------ diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Multiple_abstract_me\342\200\246_(feafee9a4abbe8d1).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Multiple_abstract_me\342\200\246_(feafee9a4abbe8d1).snap" index cc943c02636c9f..05eaf2da1e1d5d 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Multiple_abstract_me\342\200\246_(feafee9a4abbe8d1).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Multiple_abstract_me\342\200\246_(feafee9a4abbe8d1).snap" @@ -41,7 +41,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/final.md ``` error[abstract-method-in-final-class]: Final class `MissingAll` has unimplemented abstract methods - --> src/mdtest_snippet.py:12:1 + --> src/mdtest_snippet.py:13:7 | 12 | @final | ------ @@ -58,7 +58,7 @@ error[abstract-method-in-final-class]: Final class `MissingAll` has unimplemente ``` error[abstract-method-in-final-class]: Final class `PartiallyImplemented` has unimplemented abstract methods - --> src/mdtest_snippet.py:16:1 + --> src/mdtest_snippet.py:17:7 | 16 | @final | ------ diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Protocol_with_implic\342\200\246_(e373f31c7a7d88e7).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Protocol_with_implic\342\200\246_(e373f31c7a7d88e7).snap" index 74d69091de5aa7..e1896646dd420e 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Protocol_with_implic\342\200\246_(e373f31c7a7d88e7).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Protocol_with_implic\342\200\246_(e373f31c7a7d88e7).snap" @@ -169,7 +169,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/final.md ``` error[abstract-method-in-final-class]: Final class `Q` has unimplemented abstract methods - --> src/mdtest_snippet.py:11:5 + --> src/mdtest_snippet.py:14:7 | 11 | def still_abstractmethod(self): ... | ----------------------------------- `still_abstractmethod` declared as abstract on superclass `P` @@ -189,7 +189,7 @@ help: Change the body of `still_abstractmethod` to `return` or `return None` if ``` error[abstract-method-in-final-class]: Final class `S` has unimplemented abstract methods - --> src/mdtest_snippet.py:18:5 + --> src/mdtest_snippet.py:21:7 | 18 | def also_still_abstractmethod(self) -> None: ... | ------------------------------------------------ `also_still_abstractmethod` declared as abstract on superclass `R` @@ -209,7 +209,7 @@ help: Change the body of `also_still_abstractmethod` to `return` or `return None ``` error[abstract-method-in-final-class]: Final class `RaisesSub` has unimplemented abstract methods - --> src/mdtest_snippet.py:24:5 + --> src/mdtest_snippet.py:28:7 | 24 | / def even_this_is_abstract(self): 25 | | raise NotImplementedError @@ -229,7 +229,7 @@ info: `Raises.even_this_is_abstract` is implicitly abstract because `Raises` is ``` error[abstract-method-in-final-class]: Final class `AlsoRaisesSub` has unimplemented abstract methods - --> src/mdtest_snippet.py:31:5 + --> src/mdtest_snippet.py:35:7 | 31 | / def also_abstractmethod(self) -> Never: 32 | | raise NotImplementedError @@ -249,7 +249,7 @@ info: `AlsoRaises.also_abstractmethod` is implicitly abstract because `AlsoRaise ``` error[abstract-method-in-final-class]: Final class `StrangeSub` has unimplemented abstract methods - --> src/mdtest_snippet.py:41:9 + --> src/mdtest_snippet.py:45:11 | 41 | / def weird_abstractmethod(self): 42 | | raise x @@ -269,7 +269,7 @@ info: `Strange.weird_abstractmethod` is implicitly abstract because `Strange` is ``` error[abstract-method-in-final-class]: Final class `HasOverloadSub` has unimplemented abstract methods - --> src/mdtest_snippet.py:51:9 + --> src/mdtest_snippet.py:54:7 | 51 | def foo(self, x: int) -> str: ... | --- `foo` declared as abstract on superclass `HasOverloads` @@ -288,7 +288,7 @@ info: `HasOverloads.foo` is implicitly abstract because `HasOverloads` is a `Pro ``` error[abstract-method-in-final-class]: Final class `HasAbstractSub` has unimplemented abstract methods - --> src/mdtest_snippet.py:122:1 + --> src/mdtest_snippet.py:123:7 | 122 | @final | ------ @@ -309,7 +309,7 @@ info: `HasAbstract.a` is implicitly abstract because `HasAbstract` is a `Protoco ``` error[abstract-method-in-final-class]: Final class `HasAbstract2Sub` has unimplemented abstract methods - --> src/mdtest_snippet.py:125:1 + --> src/mdtest_snippet.py:126:7 | 125 | @final | ------ @@ -331,7 +331,7 @@ info: `HasAbstract2.a` is implicitly abstract because `HasAbstract2` is a `Proto ``` error[abstract-method-in-final-class]: Final class `HasAbstract3Sub` has unimplemented abstract methods - --> src/mdtest_snippet.py:128:1 + --> src/mdtest_snippet.py:129:7 | 128 | @final | ------ @@ -352,7 +352,7 @@ info: `HasAbstract4.a` is implicitly abstract because `HasAbstract4` is a `Proto ``` error[abstract-method-in-final-class]: Final class `HasAbstract4Sub` has unimplemented abstract methods - --> src/mdtest_snippet.py:131:1 + --> src/mdtest_snippet.py:132:7 | 131 | @final | ------ @@ -373,7 +373,7 @@ info: `HasAbstract4.a` is implicitly abstract because `HasAbstract4` is a `Proto ``` error[abstract-method-in-final-class]: Final class `HasAbstract5Sub` has unimplemented abstract methods - --> src/mdtest_snippet.py:134:1 + --> src/mdtest_snippet.py:135:7 | 134 | @final | ------ @@ -394,7 +394,7 @@ info: `HasAbstract5.a` is implicitly abstract because `HasAbstract5` is a `Proto ``` error[abstract-method-in-final-class]: Final class `HasAbstract6Sub` has unimplemented abstract methods - --> src/mdtest_snippet.py:137:1 + --> src/mdtest_snippet.py:138:7 | 137 | @final | ------ @@ -415,7 +415,7 @@ info: `HasAbstract6.a` is implicitly abstract because `HasAbstract6` is a `Proto ``` error[abstract-method-in-final-class]: Final class `HasAbstract7Sub` has unimplemented abstract methods - --> src/mdtest_snippet.py:140:1 + --> src/mdtest_snippet.py:141:7 | 140 | @final | ------ @@ -437,7 +437,7 @@ info: `HasAbstract7.a` is implicitly abstract because `HasAbstract7` is a `Proto ``` error[abstract-method-in-final-class]: Final class `HasAbstract8Sub` has unimplemented abstract methods - --> src/mdtest_snippet.py:143:1 + --> src/mdtest_snippet.py:144:7 | 143 | @final | ------ @@ -459,7 +459,7 @@ info: `HasAbstract8.a` is implicitly abstract because `HasAbstract8` is a `Proto ``` error[abstract-method-in-final-class]: Final class `HasAbstract9Sub` has unimplemented abstract methods - --> src/mdtest_snippet.py:146:1 + --> src/mdtest_snippet.py:147:7 | 146 | @final | ------ @@ -480,7 +480,7 @@ info: `HasAbstract9.a` is implicitly abstract because `HasAbstract9` is a `Proto ``` error[abstract-method-in-final-class]: Final class `HasAbstract10Sub` has unimplemented abstract methods - --> src/mdtest_snippet.py:149:1 + --> src/mdtest_snippet.py:150:7 | 149 | @final | ------ diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Overloaded_methods_d\342\200\246_(861757f48340ed92).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Overloaded_methods_d\342\200\246_(861757f48340ed92).snap" index 065ada538e9129..9fa15ee4303f4d 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Overloaded_methods_d\342\200\246_(861757f48340ed92).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_Overloaded_methods_d\342\200\246_(861757f48340ed92).snap" @@ -188,7 +188,7 @@ note: This is an unsafe fix and may change runtime behavior ``` error[invalid-overload]: `@final` decorator should be applied only to the first overload - --> src/stub.pyi:26:5 + --> src/stub.pyi:31:9 | 26 | / @overload 27 | | def bar(self, x: str) -> str: ... @@ -204,7 +204,7 @@ error[invalid-overload]: `@final` decorator should be applied only to the first ``` error[invalid-overload]: `@final` decorator should be applied only to the first overload - --> src/stub.pyi:32:5 + --> src/stub.pyi:37:9 | 32 | / @overload 33 | | def baz(self, x: str) -> str: ... @@ -304,7 +304,7 @@ note: This is an unsafe fix and may change runtime behavior ``` error[invalid-overload]: `@final` decorator should be applied only to the overload implementation - --> src/main.py:23:5 + --> src/main.py:25:9 | 23 | @overload | --------- @@ -321,7 +321,7 @@ error[invalid-overload]: `@final` decorator should be applied only to the overlo ``` error[invalid-overload]: `@final` decorator should be applied only to the overload implementation - --> src/main.py:31:5 + --> src/main.py:33:9 | 31 | @final | ------ @@ -338,7 +338,7 @@ error[invalid-overload]: `@final` decorator should be applied only to the overlo ``` error[invalid-overload]: `@final` decorator should be applied only to the overload implementation - --> src/main.py:41:5 + --> src/main.py:43:9 | 41 | @overload | --------- @@ -353,7 +353,7 @@ error[invalid-overload]: `@final` decorator should be applied only to the overlo ``` error[invalid-overload]: `@final` decorator should be applied only to the overload implementation - --> src/main.py:49:5 + --> src/main.py:51:9 | 49 | @final | ------ diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/function.md_-_Call_expression_-_PEP-484_convention_f\342\200\246_(ee99fadd6476677e).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/function.md_-_Call_expression_-_PEP-484_convention_f\342\200\246_(ee99fadd6476677e).snap" index 30c6a9c64c319d..5aa525fd6cb675 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/function.md_-_Call_expression_-_PEP-484_convention_f\342\200\246_(ee99fadd6476677e).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/function.md_-_Call_expression_-_PEP-484_convention_f\342\200\246_(ee99fadd6476677e).snap" @@ -99,7 +99,7 @@ info: Function signature here ``` warning[invalid-legacy-positional-parameter]: Invalid use of the legacy convention for positional-only parameters - --> src/mdtest_snippet.py:9:7 + --> src/mdtest_snippet.py:9:15 | 9 | def g(x: int, __y: str): ... | - ^^^ Parameter name begins with `__` but will not be treated as positional-only @@ -111,7 +111,7 @@ info: A parameter can only be positional-only if it precedes all positional-or-k ``` warning[invalid-legacy-positional-parameter]: Invalid use of the legacy convention for positional-only parameters - --> src/mdtest_snippet.py:20:8 + --> src/mdtest_snippet.py:20:16 | 20 | def g2(x: int, __y: str): ... # error: [invalid-legacy-positional-parameter] | - ^^^ Parameter name begins with `__` but will not be treated as positional-only @@ -123,7 +123,7 @@ info: A parameter can only be positional-only if it precedes all positional-or-k ``` warning[invalid-legacy-positional-parameter]: Invalid use of the legacy convention for positional-only parameters - --> src/mdtest_snippet.py:22:8 + --> src/mdtest_snippet.py:22:16 | 22 | def g2(x: str, __y: int): ... # error: [invalid-legacy-positional-parameter] | - ^^^ Parameter name begins with `__` but will not be treated as positional-only @@ -135,7 +135,7 @@ info: A parameter can only be positional-only if it precedes all positional-or-k ``` warning[invalid-legacy-positional-parameter]: Invalid use of the legacy convention for positional-only parameters - --> src/mdtest_snippet.py:23:8 + --> src/mdtest_snippet.py:23:22 | 23 | def g2(x: str | int, __y: int | str): ... # error: [invalid-legacy-positional-parameter] | - ^^^ Parameter name begins with `__` but will not be treated as positional-only @@ -147,7 +147,7 @@ info: A parameter can only be positional-only if it precedes all positional-or-k ``` warning[invalid-legacy-positional-parameter]: Invalid use of the legacy convention for positional-only parameters - --> src/mdtest_snippet.py:41:8 + --> src/mdtest_snippet.py:41:11 | 41 | def g4(a, __b): ... # error: [invalid-legacy-positional-parameter] | - ^^^ Parameter name begins with `__` but will not be treated as positional-only @@ -159,7 +159,7 @@ info: A parameter can only be positional-only if it precedes all positional-or-k ``` warning[invalid-legacy-positional-parameter]: Invalid use of the legacy convention for positional-only parameters - --> src/mdtest_snippet.py:55:23 + --> src/mdtest_snippet.py:55:29 | 55 | def static_method(self, __x: int): ... # error: [invalid-legacy-positional-parameter] | ---- ^^^ Parameter name begins with `__` but will not be treated as positional-only diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_AST_nodes_that_are_o\342\200\246_(58a3839a9bc7026d).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_AST_nodes_that_are_o\342\200\246_(58a3839a9bc7026d).snap" index eda29190437849..39dff0c499cb42 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_AST_nodes_that_are_o\342\200\246_(58a3839a9bc7026d).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid.md_-_Tests_for_invalid_ty\342\200\246_-_Diagnostics_for_comm\342\200\246_-_AST_nodes_that_are_o\342\200\246_(58a3839a9bc7026d).snap" @@ -62,7 +62,7 @@ info: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotat ``` error[invalid-syntax-in-forward-annotation]: Syntax error in forward annotation - --> src/mdtest_snippet.py:9:9 + --> src/mdtest_snippet.py:9:17 | 9 | d: "invalid syntax", | --------^^^^^^ diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Non-callable_`__awai\342\200\246_(d78580fb6720e4ea).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Non-callable_`__awai\342\200\246_(d78580fb6720e4ea).snap" index e76efae52cfe1d..0dcb38a2984922 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Non-callable_`__awai\342\200\246_(d78580fb6720e4ea).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/invalid_await.md_-_Invalid_await_diagno\342\200\246_-_Non-callable_`__awai\342\200\246_(d78580fb6720e4ea).snap" @@ -42,7 +42,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_awai ``` error[invalid-await]: `NonCallableAwait` is not awaitable - --> src/mdtest_snippet.py:2:5 + --> src/mdtest_snippet.py:5:11 | 2 | __await__ = 42 | --------- attribute defined here diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Must_not_be_redefine\342\200\246_(b1be57970f924722).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Must_not_be_redefine\342\200\246_(b1be57970f924722).snap" index e1ef92d90ffc47..61620f66280799 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Must_not_be_redefine\342\200\246_(b1be57970f924722).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/legacy_typevars.md_-_Legacy_typevar_creat\342\200\246_-_Must_not_be_redefine\342\200\246_(b1be57970f924722).snap" @@ -25,7 +25,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/legacy_typev ``` error[invalid-legacy-type-variable]: Cannot redefine `T` as a type variable - --> src/mdtest_snippet.py:3:1 + --> src/mdtest_snippet.py:6:1 | 3 | T = TypeVar("T") | - Previously defined here diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_`typing.NamedTuple`_-_Definition_(bbf79630502e65e9).snap b/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_`typing.NamedTuple`_-_Definition_(bbf79630502e65e9).snap index 3e06bc9057a4ee..57be141c4500dd 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_`typing.NamedTuple`_-_Definition_(bbf79630502e65e9).snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/named_tuple.md_-_`NamedTuple`_-_`typing.NamedTuple`_-_Definition_(bbf79630502e65e9).snap @@ -41,7 +41,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/named_tuple.md ``` error[invalid-named-tuple]: NamedTuple field without default value cannot follow field(s) with default value(s) - --> src/mdtest_snippet.py:4:5 + --> src/mdtest_snippet.py:6:5 | 4 | altitude: float = 0.0 | --------------------- Earlier field `altitude` defined here with a default value @@ -53,7 +53,7 @@ error[invalid-named-tuple]: NamedTuple field without default value cannot follow ``` error[invalid-named-tuple]: NamedTuple field without default value cannot follow field(s) with default value(s) - --> src/mdtest_snippet.py:4:5 + --> src/mdtest_snippet.py:8:5 | 4 | altitude: float = 0.0 | --------------------- Earlier field `altitude` defined here with a default value @@ -67,7 +67,7 @@ error[invalid-named-tuple]: NamedTuple field without default value cannot follow ``` error[invalid-named-tuple]: NamedTuple field without default value cannot follow field(s) with default value(s) - --> src/mdtest_snippet.py:14:5 + --> src/mdtest_snippet.py:15:5 | 14 | altitude: float = 0.0 | --------------------- Earlier field `altitude` defined here with a default value @@ -78,7 +78,7 @@ error[invalid-named-tuple]: NamedTuple field without default value cannot follow ``` error[invalid-named-tuple]: NamedTuple field without default value cannot follow field(s) with default value(s) - --> src/mdtest_snippet.py:14:5 + --> src/mdtest_snippet.py:16:5 | 14 | altitude: float = 0.0 | --------------------- Earlier field `altitude` defined here with a default value diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_At_least_two_overloa\342\200\246_(84dadf8abd8f2f2).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_At_least_two_overloa\342\200\246_(84dadf8abd8f2f2).snap" index d023427e92b329..be70aba4af6f21 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_At_least_two_overloa\342\200\246_(84dadf8abd8f2f2).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_At_least_two_overloa\342\200\246_(84dadf8abd8f2f2).snap" @@ -36,7 +36,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/overloads.md ``` error[invalid-overload]: Overloaded function `func` requires at least two overloads - --> src/mdtest_snippet.py:3:1 + --> src/mdtest_snippet.py:5:5 | 3 | @overload | --------- @@ -48,7 +48,7 @@ error[invalid-overload]: Overloaded function `func` requires at least two overlo ``` error[invalid-overload]: Overloaded function `func` requires at least two overloads - --> src/mdtest_snippet.pyi:3:1 + --> src/mdtest_snippet.pyi:5:5 | 3 | @overload | --------- diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@classmethod`_(aaa04d4cfa3adaba).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@classmethod`_(aaa04d4cfa3adaba).snap" index 6fcb7b1c60455a..dda5ef18da3f63 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@classmethod`_(aaa04d4cfa3adaba).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@classmethod`_(aaa04d4cfa3adaba).snap" @@ -95,7 +95,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/overloads.md ``` error[invalid-overload]: Overloaded function `try_from1` does not use the `@classmethod` decorator consistently - --> src/mdtest_snippet.py:12:5 + --> src/mdtest_snippet.py:16:9 | 12 | @overload | --------- @@ -146,7 +146,7 @@ error[call-non-callable]: Object of type `CheckClassMethod` is not callable ``` error[invalid-assignment]: Object of type `bound method .from_value(x: int) -> int` is not assignable to `(str, /) -> str` - --> src/mdtest_snippet.py:76:6 + --> src/mdtest_snippet.py:76:29 | 76 | bad: Callable[[str], str] = Base.from_value | -------------------- ^^^^^^^^^^^^^^^ Incompatible value of type `bound method .from_value(x: int) -> int` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@final`_(f8e529ec23a61665).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@final`_(f8e529ec23a61665).snap" index 284d5de34f4904..91268b403dde72 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@final`_(f8e529ec23a61665).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@final`_(f8e529ec23a61665).snap" @@ -76,7 +76,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/overloads.md ``` error[invalid-overload]: `@final` decorator should be applied only to the overload implementation - --> src/mdtest_snippet.py:12:5 + --> src/mdtest_snippet.py:15:9 | 12 | @overload | --------- @@ -94,7 +94,7 @@ error[invalid-overload]: `@final` decorator should be applied only to the overlo ``` error[invalid-overload]: `@final` decorator should be applied only to the overload implementation - --> src/mdtest_snippet.py:23:5 + --> src/mdtest_snippet.py:26:9 | 23 | @overload | --------- @@ -110,7 +110,7 @@ error[invalid-overload]: `@final` decorator should be applied only to the overlo ``` error[invalid-overload]: `@final` decorator should be applied only to the first overload - --> src/mdtest_snippet.pyi:9:5 + --> src/mdtest_snippet.pyi:14:9 | 9 | / @overload 10 | | def method2(self, x: int) -> int: ... @@ -126,7 +126,7 @@ error[invalid-overload]: `@final` decorator should be applied only to the first ``` error[invalid-overload]: `@final` decorator should be applied only to the first overload - --> src/mdtest_snippet.pyi:15:5 + --> src/mdtest_snippet.pyi:19:9 | 15 | / @overload 16 | | def method3(self, x: int) -> int: ... @@ -141,7 +141,7 @@ error[invalid-overload]: `@final` decorator should be applied only to the first ``` error[invalid-overload]: `@final` decorator should be applied only to the first overload - --> src/mdtest_snippet.pyi:15:5 + --> src/mdtest_snippet.pyi:22:9 | 15 | / @overload 16 | | def method3(self, x: int) -> int: ... diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@override`_(2df210735ca532f9).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@override`_(2df210735ca532f9).snap" index dd869f372dcda1..349cfd46e33b0f 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@override`_(2df210735ca532f9).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@override`_(2df210735ca532f9).snap" @@ -84,7 +84,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/overloads.md ``` error[invalid-overload]: `@override` decorator should be applied only to the overload implementation - --> src/mdtest_snippet.py:23:5 + --> src/mdtest_snippet.py:26:9 | 23 | @overload | --------- @@ -100,7 +100,7 @@ error[invalid-overload]: `@override` decorator should be applied only to the ove ``` error[invalid-overload]: `@override` decorator should be applied only to the overload implementation - --> src/mdtest_snippet.py:31:5 + --> src/mdtest_snippet.py:34:9 | 31 | @overload | --------- @@ -118,7 +118,7 @@ error[invalid-overload]: `@override` decorator should be applied only to the ove ``` error[invalid-overload]: `@override` decorator should be applied only to the first overload - --> src/mdtest_snippet.pyi:17:5 + --> src/mdtest_snippet.pyi:22:9 | 17 | / @overload 18 | | def method(self, x: int) -> int: ... diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/override.md_-_`typing.override`_-_Basics_(b7c220f8171f11f0).snap b/crates/ty_python_semantic/resources/mdtest/snapshots/override.md_-_`typing.override`_-_Basics_(b7c220f8171f11f0).snap index 48a0a8d2a00463..bfd766091c37b0 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/override.md_-_`typing.override`_-_Basics_(b7c220f8171f11f0).snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/override.md_-_`typing.override`_-_Basics_(b7c220f8171f11f0).snap @@ -194,7 +194,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/override.md ``` error[invalid-explicit-override]: Method `___reprrr__` is decorated with `@override` but does not override anything - --> src/mdtest_snippet.pyi:98:5 + --> src/mdtest_snippet.pyi:99:9 | 98 | @override | --------- @@ -206,7 +206,7 @@ info: No `___reprrr__` definitions were found on any superclasses of `Invalid` ``` error[invalid-explicit-override]: Method `foo` is decorated with `@override` but does not override anything - --> src/mdtest_snippet.pyi:100:5 + --> src/mdtest_snippet.pyi:102:9 | 100 | @override | --------- @@ -219,7 +219,7 @@ info: No `foo` definitions were found on any superclasses of `Invalid` ``` error[invalid-explicit-override]: Method `bar` is decorated with `@override` but does not override anything - --> src/mdtest_snippet.pyi:104:5 + --> src/mdtest_snippet.pyi:105:9 | 104 | @override | --------- @@ -231,7 +231,7 @@ info: No `bar` definitions were found on any superclasses of `Invalid` ``` error[invalid-explicit-override]: Method `baz` is decorated with `@override` but does not override anything - --> src/mdtest_snippet.pyi:107:5 + --> src/mdtest_snippet.pyi:108:9 | 107 | @override | --------- @@ -243,7 +243,7 @@ info: No `baz` definitions were found on any superclasses of `Invalid` ``` error[invalid-explicit-override]: Method `eggs` is decorated with `@override` but does not override anything - --> src/mdtest_snippet.pyi:109:5 + --> src/mdtest_snippet.pyi:111:9 | 109 | @override | --------- @@ -256,7 +256,7 @@ info: No `eggs` definitions were found on any superclasses of `Invalid` ``` error[invalid-explicit-override]: Method `bad_property1` is decorated with `@override` but does not override anything - --> src/mdtest_snippet.pyi:113:5 + --> src/mdtest_snippet.pyi:114:9 | 113 | @override | --------- @@ -268,7 +268,7 @@ info: No `bad_property1` definitions were found on any superclasses of `Invalid` ``` error[invalid-explicit-override]: Method `bad_property2` is decorated with `@override` but does not override anything - --> src/mdtest_snippet.pyi:115:5 + --> src/mdtest_snippet.pyi:117:9 | 115 | @override | --------- @@ -281,7 +281,7 @@ info: No `bad_property2` definitions were found on any superclasses of `Invalid` ``` error[invalid-explicit-override]: Method `bad_settable_property` is decorated with `@override` but does not override anything - --> src/mdtest_snippet.pyi:119:5 + --> src/mdtest_snippet.pyi:120:9 | 119 | @override | --------- @@ -293,7 +293,7 @@ info: No `bad_settable_property` definitions were found on any superclasses of ` ``` error[invalid-explicit-override]: Method `lossy` is decorated with `@override` but does not override anything - --> src/mdtest_snippet.pyi:124:5 + --> src/mdtest_snippet.pyi:125:9 | 124 | @override | --------- @@ -305,7 +305,7 @@ info: No `lossy` definitions were found on any superclasses of `Invalid` ``` error[invalid-explicit-override]: Method `lossy2` is decorated with `@override` but does not override anything - --> src/mdtest_snippet.pyi:126:5 + --> src/mdtest_snippet.pyi:128:9 | 126 | @override | --------- diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/paramspec.md_-_PEP_695_`ParamSpec`_-_`ParamSpec`_cannot_s\342\200\246_(8243f67799c93e3c).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/paramspec.md_-_PEP_695_`ParamSpec`_-_`ParamSpec`_cannot_s\342\200\246_(8243f67799c93e3c).snap" index 53c9b8e2e7af5f..4216032909859a 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/paramspec.md_-_PEP_695_`ParamSpec`_-_`ParamSpec`_cannot_s\342\200\246_(8243f67799c93e3c).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/paramspec.md_-_PEP_695_`ParamSpec`_-_`ParamSpec`_cannot_s\342\200\246_(8243f67799c93e3c).snap" @@ -48,7 +48,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/generics/pep695/paramspe ``` error[invalid-type-arguments]: ParamSpec `P` cannot be used to specialize type variable `T` - --> src/mdtest_snippet.py:9:9 + --> src/mdtest_snippet.py:11:20 | 9 | def f[**P, T](): | - ParamSpec `P` defined here diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Generator_functions_-_Synchronous_(6a32ec69d15117b8).snap b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Generator_functions_-_Synchronous_(6a32ec69d15117b8).snap index 42bded3518998e..563566ebf33b3c 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Generator_functions_-_Synchronous_(6a32ec69d15117b8).snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Generator_functions_-_Synchronous_(6a32ec69d15117b8).snap @@ -66,7 +66,7 @@ info: See https://docs.python.org/3/glossary.html#term-generator for more detail ``` error[invalid-return-type]: Return type does not match returned value - --> src/mdtest_snippet.py:22:30 + --> src/mdtest_snippet.py:24:12 | 22 | def invalid_return_type() -> typing.Generator[None, None, None]: | ---------------------------------- Expected `None` because of return type @@ -78,7 +78,7 @@ error[invalid-return-type]: Return type does not match returned value ``` error[invalid-return-type]: Return type does not match returned value - --> src/mdtest_snippet.py:25:23 + --> src/mdtest_snippet.py:27:12 | 25 | def wrong_return() -> typing.Generator[int, int, int]: | ------------------------------- Expected `int` because of return type @@ -100,7 +100,7 @@ info: Consider changing the return annotation to `-> None` or adding a `return` ``` error[invalid-return-type]: Return type does not match returned value - --> src/mdtest_snippet.py:33:35 + --> src/mdtest_snippet.py:36:12 | 33 | def iterator_must_not_return() -> typing.Iterator[int]: | -------------------- Expected `None` because of return type diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_conditional_\342\200\246_(94c036c5d3803ab2).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_conditional_\342\200\246_(94c036c5d3803ab2).snap" index aa7a54f5e9115d..6588600c7e8433 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_conditional_\342\200\246_(94c036c5d3803ab2).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_conditional_\342\200\246_(94c036c5d3803ab2).snap" @@ -33,7 +33,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/function/return_type.md ``` error[invalid-return-type]: Return type does not match returned value - --> src/mdtest_snippet.py:1:22 + --> src/mdtest_snippet.py:6:16 | 1 | def f(cond: bool) -> str: | --- Expected `str` because of return type @@ -48,7 +48,7 @@ error[invalid-return-type]: Return type does not match returned value ``` error[invalid-return-type]: Return type does not match returned value - --> src/mdtest_snippet.py:8:22 + --> src/mdtest_snippet.py:11:16 | 8 | def f(cond: bool) -> str: | --- Expected `str` because of return type diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type_(a91e0c67519cd77f).snap b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type_(a91e0c67519cd77f).snap index 5c3a100538a6d9..fe4187e42bf297 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type_(a91e0c67519cd77f).snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type_(a91e0c67519cd77f).snap @@ -59,7 +59,7 @@ info: Consider changing the return annotation to `-> None` or adding a `return` ``` error[invalid-return-type]: Return type does not match returned value - --> src/mdtest_snippet.py:5:12 + --> src/mdtest_snippet.py:7:12 | 5 | def f() -> str: | --- Expected `str` because of return type @@ -71,7 +71,7 @@ error[invalid-return-type]: Return type does not match returned value ``` error[invalid-return-type]: Return type does not match returned value - --> src/mdtest_snippet.py:9:12 + --> src/mdtest_snippet.py:11:5 | 9 | def f() -> int: | --- Expected `int` because of return type @@ -98,7 +98,7 @@ info: - or as `@abstractmethod`-decorated methods on abstract classes ``` error[invalid-return-type]: Return type does not match returned value - --> src/mdtest_snippet.py:22:12 + --> src/mdtest_snippet.py:24:12 | 22 | def f() -> A[int]: | ------ Expected `mdtest_snippet.A[int]` because of return type @@ -110,7 +110,7 @@ error[invalid-return-type]: Return type does not match returned value ``` error[invalid-return-type]: Return type does not match returned value - --> src/mdtest_snippet.py:28:12 + --> src/mdtest_snippet.py:30:12 | 28 | def g() -> B: | - Expected `mdtest_snippet.B` because of return type diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type_\342\200\246_(c3a523878447af6b).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type_\342\200\246_(c3a523878447af6b).snap" index 0d29532dfaa22c..68ae2d8b0ae7a1 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type_\342\200\246_(c3a523878447af6b).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/return_type.md_-_Function_return_type_-_Invalid_return_type_\342\200\246_(c3a523878447af6b).snap" @@ -32,7 +32,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/function/return_type.md ``` error[invalid-return-type]: Return type does not match returned value - --> src/mdtest_snippet.pyi:1:12 + --> src/mdtest_snippet.pyi:3:12 | 1 | def f() -> int: | --- Expected `int` because of return type diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_class_within\342\200\246_(3259718bf20b45a2).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_class_within\342\200\246_(3259718bf20b45a2).snap" index 4f386ac1497476..6f2552df1ac19c 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_class_within\342\200\246_(3259718bf20b45a2).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_class_within\342\200\246_(3259718bf20b45a2).snap" @@ -27,7 +27,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/generics/scoping.md ``` error[shadowed-type-variable]: Generic class `Bad1` uses type variable `T` already bound by an enclosing scope - --> src/mdtest_snippet.py:3:5 + --> src/mdtest_snippet.py:6:11 | 3 | def f[T](x: T, y: T) -> None: | ------------------------ Type variable `T` is bound in this enclosing scope @@ -40,7 +40,7 @@ error[shadowed-type-variable]: Generic class `Bad1` uses type variable `T` alrea ``` error[shadowed-type-variable]: Generic class `Bad2` uses type variable `T` already bound by an enclosing scope - --> src/mdtest_snippet.py:3:5 + --> src/mdtest_snippet.py:8:11 | 3 | def f[T](x: T, y: T) -> None: | ------------------------ Type variable `T` is bound in this enclosing scope diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_class_within\342\200\246_(711fb86287c4d87b).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_class_within\342\200\246_(711fb86287c4d87b).snap" index b9d2eaba14af89..702a9a71edc9cd 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_class_within\342\200\246_(711fb86287c4d87b).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Nested_formal_typeva\342\200\246_-_Generic_class_within\342\200\246_(711fb86287c4d87b).snap" @@ -27,7 +27,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/generics/scoping.md ``` error[shadowed-type-variable]: Generic class `Bad1` uses type variable `T` already bound by an enclosing scope - --> src/mdtest_snippet.py:3:7 + --> src/mdtest_snippet.py:6:11 | 3 | class C[T]: | - Type variable `T` is bound in this enclosing scope @@ -40,7 +40,7 @@ error[shadowed-type-variable]: Generic class `Bad1` uses type variable `T` alrea ``` error[shadowed-type-variable]: Generic class `Bad2` uses type variable `T` already bound by an enclosing scope - --> src/mdtest_snippet.py:3:7 + --> src/mdtest_snippet.py:8:11 | 3 | class C[T]: | - Type variable `T` is bound in this enclosing scope diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Function_nested_in_c\342\200\246_(1a50b4ccb10b95dd).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Function_nested_in_c\342\200\246_(1a50b4ccb10b95dd).snap" index 02256a188b160a..4cd746fe2a00e6 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Function_nested_in_c\342\200\246_(1a50b4ccb10b95dd).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Function_nested_in_c\342\200\246_(1a50b4ccb10b95dd).snap" @@ -23,7 +23,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/generics/scoping.md ``` error[invalid-type-variable-default]: Invalid default for type parameter `U` - --> src/mdtest_snippet.py:1:9 + --> src/mdtest_snippet.py:3:15 | 1 | class C[T]: | - `T` defined here diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_in_me\342\200\246_(2ed4c18a38ed9090).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_in_me\342\200\246_(2ed4c18a38ed9090).snap" index 9b7642bd65e528..2a31bc02c20b22 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_in_me\342\200\246_(2ed4c18a38ed9090).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_in_me\342\200\246_(2ed4c18a38ed9090).snap" @@ -28,7 +28,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/generics/scoping.md ``` error[invalid-type-variable-default]: Invalid use of type variable `T2` - --> src/mdtest_snippet.py:4:1 + --> src/mdtest_snippet.py:8:25 | 4 | T2 = TypeVar("T2", default=T1) | ------------------------------ `T2` defined here diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_in_ne\342\200\246_(a1aca17ea750ffdd).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_in_ne\342\200\246_(a1aca17ea750ffdd).snap" index 31fc5220dcbe28..8e30747b701891 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_in_ne\342\200\246_(a1aca17ea750ffdd).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_in_ne\342\200\246_(a1aca17ea750ffdd).snap" @@ -29,7 +29,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/generics/scoping.md ``` error[invalid-type-variable-default]: Invalid use of type variable `U` - --> src/mdtest_snippet.py:4:1 + --> src/mdtest_snippet.py:8:18 | 4 | U = TypeVar("U", default=T) | --------------------------- `U` defined here diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_order\342\200\246_(d075a45828c9dbc5).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_order\342\200\246_(d075a45828c9dbc5).snap" index b0d02b14ef75c3..b188fdd2335687 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_order\342\200\246_(d075a45828c9dbc5).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_order\342\200\246_(d075a45828c9dbc5).snap" @@ -43,7 +43,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/generics/scoping.md ``` error[invalid-type-variable-default]: Type parameters without defaults cannot follow type parameters with defaults - --> src/mdtest_snippet.py:9:10 + --> src/mdtest_snippet.py:9:17 | 9 | def f(x: T1, y: T2) -> tuple[T1, T2]: | -- ^^ Type variable `T2` does not have a default @@ -61,7 +61,7 @@ error[invalid-type-variable-default]: Type parameters without defaults cannot fo ``` error[invalid-type-variable-default]: Type parameters without defaults cannot follow type parameters with defaults - --> src/mdtest_snippet.py:13:17 + --> src/mdtest_snippet.py:13:24 | 13 | def g(x: T2, y: T1, z: T3) -> tuple[T2, T1, T3]: | -- ^^ Type variable `T3` does not have a default @@ -80,7 +80,7 @@ error[invalid-type-variable-default]: Type parameters without defaults cannot fo ``` error[invalid-type-variable-default]: Type parameters without defaults cannot follow type parameters with defaults - --> src/mdtest_snippet.py:17:10 + --> src/mdtest_snippet.py:17:17 | 17 | def h(x: T1, y: T2, z: DefaultStrT, w: T3) -> tuple[T1, T2, DefaultStrT, T3]: | -- ^^ Type variables `T2` and `T3` do not have defaults diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_with_\342\200\246_(ce8defbeaf54e06c).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_with_\342\200\246_(ce8defbeaf54e06c).snap" index 2abad477e49eee..8e2a4102a54ae1 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_with_\342\200\246_(ce8defbeaf54e06c).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Legacy_TypeVar_with_\342\200\246_(ce8defbeaf54e06c).snap" @@ -31,7 +31,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/generics/scoping.md ``` error[invalid-type-variable-default]: Invalid use of type variable `U` - --> src/mdtest_snippet.py:4:1 + --> src/mdtest_snippet.py:7:12 | 4 | U = TypeVar("U", default=T) | --------------------------- `U` defined here diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Nested_functions_(3f2ee9fa81da0177).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Nested_functions_(3f2ee9fa81da0177).snap" index 34f1b560ac019f..d461955cf64c33 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Nested_functions_(3f2ee9fa81da0177).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Nested_functions_(3f2ee9fa81da0177).snap" @@ -23,7 +23,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/generics/scoping.md ``` error[invalid-type-variable-default]: Invalid default for type parameter `U` - --> src/mdtest_snippet.py:1:11 + --> src/mdtest_snippet.py:3:19 | 1 | def outer[T](): | - `T` defined here diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Type_alias_nested_in\342\200\246_(de027dcc5360f252).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Type_alias_nested_in\342\200\246_(de027dcc5360f252).snap" index 12740107dd8578..7b56d2abb1080f 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Type_alias_nested_in\342\200\246_(de027dcc5360f252).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/scoping.md_-_Scoping_rules_for_ty\342\200\246_-_Type_parameter_defau\342\200\246_-_Type_alias_nested_in\342\200\246_(de027dcc5360f252).snap" @@ -24,7 +24,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/generics/scoping.md ``` error[invalid-type-variable-default]: Invalid default for type parameter `U` - --> src/mdtest_snippet.py:1:9 + --> src/mdtest_snippet.py:3:20 | 1 | class C[T]: | - `T` defined here diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Diagnostics_(e5289abf5c570c29).snap b/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Diagnostics_(e5289abf5c570c29).snap index da81f71a2886c3..aedd64b9907ba6 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Diagnostics_(e5289abf5c570c29).snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Diagnostics_(e5289abf5c570c29).snap @@ -76,7 +76,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/typed_dict.md ``` error[invalid-key]: Unknown key "nane" for TypedDict `Person` - --> src/mdtest_snippet.py:8:5 + --> src/mdtest_snippet.py:8:12 | 8 | person["nane"] # error: [invalid-key] | ------ ^^^^^^ Did you mean "name"? @@ -94,7 +94,7 @@ note: This is an unsafe fix and may change runtime behavior ``` error[invalid-key]: Unknown key "nane" for TypedDict `Person` - --> src/mdtest_snippet.py:13:5 + --> src/mdtest_snippet.py:13:12 | 13 | person[NAME_KEY] # error: [invalid-key] | ------ ^^^^^^^^ Unknown key "nane" - did you mean "name"? @@ -114,7 +114,7 @@ error[invalid-key]: TypedDict `Person` can only be subscripted with a string lit ``` error[invalid-assignment]: Invalid assignment to key "age" with declared type `int | None` on TypedDict `Person` - --> src/mdtest_snippet.py:19:5 + --> src/mdtest_snippet.py:19:21 | 19 | person["age"] = "42" # error: [invalid-assignment] | ------ ----- ^^^^ value of type `Literal["42"]` @@ -131,7 +131,7 @@ info: Item declaration ``` error[invalid-key]: Unknown key "nane" for TypedDict `Person` - --> src/mdtest_snippet.py:22:5 + --> src/mdtest_snippet.py:22:12 | 22 | person["nane"] = "Alice" # error: [invalid-key] | ------ ^^^^^^ Did you mean "name"? @@ -158,7 +158,7 @@ error[invalid-key]: TypedDict `Person` can only be subscripted with a string lit ``` error[invalid-key]: Unknown key "unknown" for TypedDict `Person` - --> src/mdtest_snippet.py:29:21 + --> src/mdtest_snippet.py:29:50 | 29 | alice: Person = {"name": "Alice", "age": 30, "unknown": "Foo"} | -----------------------------^^^^^^^^^-------- @@ -170,7 +170,7 @@ error[invalid-key]: Unknown key "unknown" for TypedDict `Person` ``` error[invalid-key]: Unknown key "unknown" for TypedDict `Person` - --> src/mdtest_snippet.py:32:11 + --> src/mdtest_snippet.py:32:38 | 32 | bob = Person(name="Bob", age=25, unknown="Bar") | ------ TypedDict `Person` ^^^^^^^^^^^^^ Unknown key "unknown" @@ -179,7 +179,7 @@ error[invalid-key]: Unknown key "unknown" for TypedDict `Person` ``` error[invalid-assignment]: Cannot assign to key "id" on TypedDict `Employee` - --> src/mdtest_snippet.py:40:5 + --> src/mdtest_snippet.py:40:14 | 40 | employee["id"] = 42 # error: [invalid-assignment] | -------- ^^^^ key is marked read-only @@ -195,7 +195,7 @@ info: Item declaration ``` error[invalid-key]: Unknown key "nane" for TypedDict `Person` - --> src/mdtest_snippet.py:43:5 + --> src/mdtest_snippet.py:43:12 | 43 | person['nane'] = "Alice" # fmt: skip | ------ ^^^^^^ Did you mean 'name'? diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Has_a_`__bool__`_met\342\200\246_(15636dc4074e5335).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Has_a_`__bool__`_met\342\200\246_(15636dc4074e5335).snap" index c8384e3d688765..787dad66d8ac6d 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Has_a_`__bool__`_met\342\200\246_(15636dc4074e5335).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Has_a_`__bool__`_met\342\200\246_(15636dc4074e5335).snap" @@ -32,7 +32,7 @@ error[unsupported-bool-conversion]: Boolean conversion is not supported for type 8 | 10 and a and True | ^ info: `str` is not assignable to `bool` - --> src/mdtest_snippet.py:2:9 + --> src/mdtest_snippet.py:2:27 | 2 | def __bool__(self) -> str: | -------- ^^^ Incorrect return type diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Has_a_`__bool__`_met\342\200\246_(ce8b8da49eaf4cda).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Has_a_`__bool__`_met\342\200\246_(ce8b8da49eaf4cda).snap" index 159bf8b5271b79..aea2c2c52356cb 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Has_a_`__bool__`_met\342\200\246_(ce8b8da49eaf4cda).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/unsupported_bool_con\342\200\246_-_Different_ways_that_\342\200\246_-_Has_a_`__bool__`_met\342\200\246_(ce8b8da49eaf4cda).snap" @@ -32,7 +32,7 @@ error[unsupported-bool-conversion]: Boolean conversion is not supported for type 8 | 10 and a and True | ^ info: `__bool__` methods must only have a `self` parameter - --> src/mdtest_snippet.py:2:9 + --> src/mdtest_snippet.py:2:17 | 2 | def __bool__(self, foo): | --------^^^^^^^^^^^ Incorrect parameters diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_A_constrained_defaul\342\200\246_(b62ed1f409042cc).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_A_constrained_defaul\342\200\246_(b62ed1f409042cc).snap" index acf1062b8fd864..77083e0d90bd86 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_A_constrained_defaul\342\200\246_(b62ed1f409042cc).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_A_constrained_defaul\342\200\246_(b62ed1f409042cc).snap" @@ -30,7 +30,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/generics/legacy/variable ``` error[invalid-type-variable-default]: TypeVar default is inconsistent with the TypeVar's constraints - --> src/mdtest_snippet.py:11:18 + --> src/mdtest_snippet.py:11:41 | 11 | U = TypeVar("U", bool, complex, default=T1) | ------------- ^^ Constraint `int` of default `T1` is not one of the constraints of `U` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_A_non-constrained_de\342\200\246_(ff24930259abfb3).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_A_non-constrained_de\342\200\246_(ff24930259abfb3).snap" index f09d6694cc708e..4b0d93355bed5f 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_A_non-constrained_de\342\200\246_(ff24930259abfb3).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_A_non-constrained_de\342\200\246_(ff24930259abfb3).snap" @@ -29,7 +29,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/generics/legacy/variable ``` error[invalid-type-variable-default]: TypeVar default is inconsistent with the TypeVar's constraints - --> src/mdtest_snippet.py:7:18 + --> src/mdtest_snippet.py:7:38 | 7 | S = TypeVar("S", float, str, default=T1) | ---------- ^^ Bounded TypeVar cannot be used as the default for a constrained TypeVar @@ -46,7 +46,7 @@ info: `T1` has bound `int` but is not constrained ``` error[invalid-type-variable-default]: TypeVar default is inconsistent with the TypeVar's constraints - --> src/mdtest_snippet.py:10:18 + --> src/mdtest_snippet.py:10:38 | 10 | U = TypeVar("U", str, bytes, default=T2) | ---------- ^^ Unbounded TypeVar cannot be used as the default for a constrained TypeVar diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_An_unbounded_default\342\200\246_(a2759fd9d2731a7d).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_An_unbounded_default\342\200\246_(a2759fd9d2731a7d).snap" index a1ab433f0d4abd..52ce5e3590ad3a 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_An_unbounded_default\342\200\246_(a2759fd9d2731a7d).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_An_unbounded_default\342\200\246_(a2759fd9d2731a7d).snap" @@ -25,7 +25,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/generics/legacy/variable ``` error[invalid-type-variable-default]: TypeVar default is not assignable to the TypeVar's upper bound - --> src/mdtest_snippet.py:3:1 + --> src/mdtest_snippet.py:6:26 | 3 | T1 = TypeVar("T1") | ------------------ `T1` defined here diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_Concrete_default_wit\342\200\246_(30284a6490652e58).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_Concrete_default_wit\342\200\246_(30284a6490652e58).snap" index 0f5ce1e3bdd1cd..3e0cff3a6bd522 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_Concrete_default_wit\342\200\246_(30284a6490652e58).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_Concrete_default_wit\342\200\246_(30284a6490652e58).snap" @@ -32,7 +32,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/generics/legacy/variable ``` error[invalid-type-variable-default]: TypeVar default is inconsistent with the TypeVar's constraints - --> src/mdtest_snippet.py:4:18 + --> src/mdtest_snippet.py:4:36 | 4 | T = TypeVar("T", int, str, default=bytes) | -------- ^^^^^ `bytes` is not one of the constraints of `T` @@ -43,7 +43,7 @@ error[invalid-type-variable-default]: TypeVar default is inconsistent with the T ``` error[invalid-type-variable-default]: TypeVar default is inconsistent with the TypeVar's constraints - --> src/mdtest_snippet.py:10:18 + --> src/mdtest_snippet.py:10:36 | 10 | U = TypeVar("U", int, str, default=bool) | -------- ^^^^ `bool` is not one of the constraints of `U` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_Concrete_default_wit\342\200\246_(37f9b6583c0633f5).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_Concrete_default_wit\342\200\246_(37f9b6583c0633f5).snap" index 0f06aa5ebe6858..b46e4d503a65ca 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_Concrete_default_wit\342\200\246_(37f9b6583c0633f5).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Invalid_defaults_-_Concrete_default_wit\342\200\246_(37f9b6583c0633f5).snap" @@ -25,7 +25,7 @@ mdtest path: crates/ty_python_semantic/resources/mdtest/generics/legacy/variable ``` error[invalid-type-variable-default]: TypeVar default is not assignable to the TypeVar's upper bound - --> src/mdtest_snippet.py:4:24 + --> src/mdtest_snippet.py:4:37 | 4 | T = TypeVar("T", bound=str, default=int) | --- ^^^ Default of `T` diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Shadowing_checks_use\342\200\246_(7e6bb178099059fe).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Shadowing_checks_use\342\200\246_(7e6bb178099059fe).snap" index 24f1fd1a745411..e254c1e6537d02 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Shadowing_checks_use\342\200\246_(7e6bb178099059fe).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/variables.md_-_Legacy_type_variable\342\200\246_-_Type_variables_-_Shadowing_checks_use\342\200\246_(7e6bb178099059fe).snap" @@ -42,7 +42,7 @@ warning[mismatched-type-name]: The name passed to `TypeVar` must match the varia ``` error[shadowed-type-variable]: Generic class `Bad` uses type variable `Q` already bound by an enclosing scope - --> src/mdtest_snippet.py:10:7 + --> src/mdtest_snippet.py:14:11 | 10 | class Outer(Generic[Q]): | ----------------- Type variable `Q` is bound in this enclosing scope @@ -56,7 +56,7 @@ error[shadowed-type-variable]: Generic class `Bad` uses type variable `Q` alread ``` error[shadowed-type-variable]: Generic class `Bad` uses type variable `Q` already bound by an enclosing scope - --> src/mdtest_snippet.py:10:7 + --> src/mdtest_snippet.py:14:11 | 10 | class Outer(Generic[Q]): | ----------------- Type variable `Q` is bound in this enclosing scope From 602a877bd6d9f3bb6c9ac830bb325405c41dbeaa Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 16 Jul 2026 19:53:37 -0500 Subject: [PATCH 27/34] Bless underlining change Reasons - Primary now has precedence over context when overlapping - The primary now always has the same symbol, independent of level --- crates/ruff_db/src/diagnostic/render.rs | 2 +- crates/ty_ide/src/hover.rs | 10 +++++----- ...2\200\246_-_`@classmethod`_(aaa04d4cfa3adaba).snap" | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/ruff_db/src/diagnostic/render.rs b/crates/ruff_db/src/diagnostic/render.rs index f4015573bf1d62..81f4274537f849 100644 --- a/crates/ruff_db/src/diagnostic/render.rs +++ b/crates/ruff_db/src/diagnostic/render.rs @@ -2347,7 +2347,7 @@ watermelon 3 | canary 4 | dog 5 | elephant - | ---- + | ^^^^ | | | giant land mammal | but afraid of mice diff --git a/crates/ty_ide/src/hover.rs b/crates/ty_ide/src/hover.rs index 595e77822a2a41..689abf81a7087e 100644 --- a/crates/ty_ide/src/hover.rs +++ b/crates/ty_ide/src/hover.rs @@ -1187,7 +1187,7 @@ mod tests { --> main.py:12:5 | 12 | x = S(1) - | - + | ^ | | | source | Cursor offset @@ -1228,7 +1228,7 @@ mod tests { --> main.py:12:5 | 12 | x = S(1) - | - + | ^ | | | source | Cursor offset @@ -2075,7 +2075,7 @@ mod tests { --> main.py:14:5 | 14 | foo.a - | - + | ^ | | | source | Cursor offset @@ -5950,7 +5950,7 @@ def function(): --> main.py:2:12 | 2 | result = 5 + 3 - | - + | ^ | | | source | Cursor offset @@ -5993,7 +5993,7 @@ def function(): --> main.py:15:8 | 15 | Test() + Test() - | - + | ^ | | | source | Cursor offset diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@classmethod`_(aaa04d4cfa3adaba).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@classmethod`_(aaa04d4cfa3adaba).snap" index dda5ef18da3f63..6d5aa767120705 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@classmethod`_(aaa04d4cfa3adaba).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/overloads.md_-_Overloads_-_Invalid_-_Inconsistent_decorat\342\200\246_-_`@classmethod`_(aaa04d4cfa3adaba).snap" @@ -129,7 +129,7 @@ error[invalid-overload]: Overloaded function `try_from3` does not use the `@clas --> src/mdtest_snippet.py:40:9 | 40 | def try_from3(cls, x: int | str) -> CheckClassMethod | None: - | --------- + | ^^^^^^^^^ | | | Missing here From 4672619cd7da2df925509377ab425f4548224956 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 17 Jul 2026 15:05:07 -0500 Subject: [PATCH 28/34] Bless trailing whitespace --- crates/ty_python_semantic/resources/mdtest/liskov.md | 4 ++-- ..._Equality_with_elemen\342\200\246_(39b614d4707c0661).snap" | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/ty_python_semantic/resources/mdtest/liskov.md b/crates/ty_python_semantic/resources/mdtest/liskov.md index d97620369dd6e3..68be19b918238d 100644 --- a/crates/ty_python_semantic/resources/mdtest/liskov.md +++ b/crates/ty_python_semantic/resources/mdtest/liskov.md @@ -1741,12 +1741,12 @@ error[invalid-method-override]: Invalid override of method `__eq__` info: parameter `value` has an incompatible type: `object` is not assignable to `Bad` info: This violates the Liskov Substitution Principle help: It is recommended for `__eq__` to work with arbitrary objects, for example: -help +help: help: def __eq__(self, other: object) -> bool: help: if not isinstance(other, Bad): help: return False help: return -help +help: ``` ## Class-private names do not override diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Equality_with_elemen\342\200\246_(39b614d4707c0661).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Equality_with_elemen\342\200\246_(39b614d4707c0661).snap" index 9584e58b4e628a..f6b01187be41db 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Equality_with_elemen\342\200\246_(39b614d4707c0661).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/tuples.md_-_Comparison___Tuples_-_Equality_with_elemen\342\200\246_(39b614d4707c0661).snap" @@ -48,12 +48,12 @@ error[invalid-method-override]: Invalid override of method `__eq__` info: incompatible return types: `NotBoolable` is not assignable to `bool` info: This violates the Liskov Substitution Principle help: It is recommended for `__eq__` to work with arbitrary objects, for example: -help +help: help: def __eq__(self, other: object) -> bool: help: if not isinstance(other, A): help: return False help: return -help +help: ``` From 84a1b5e70771651b35fed832d9ece84b419c712a Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 17 Jul 2026 15:27:15 -0500 Subject: [PATCH 29/34] Bless snippets always being rendered, even when empty --- crates/ty/tests/cli/fixes.rs | 5 ++++- crates/ty_ide/src/goto_declaration.rs | 10 ++++++++-- crates/ty_ide/src/goto_type_definition.rs | 14 ++++++++------ 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/crates/ty/tests/cli/fixes.rs b/crates/ty/tests/cli/fixes.rs index b751e0d11073da..21424a58e0485b 100644 --- a/crates/ty/tests/cli/fixes.rs +++ b/crates/ty/tests/cli/fixes.rs @@ -221,7 +221,10 @@ fn fix_unfixable() -> anyhow::Result<()> { exit_code: 1 ----- stdout ----- error[invalid-syntax]: unexpected EOF while parsing - --> has_syntax_error.py:1:1 + --> has_syntax_error.py:2:1 + | + 2 | + | ^ Found 2 diagnostics (1 fixed, 1 remaining). diff --git a/crates/ty_ide/src/goto_declaration.rs b/crates/ty_ide/src/goto_declaration.rs index 48924e71e7c8fd..21b591f97eb4fd 100644 --- a/crates/ty_ide/src/goto_declaration.rs +++ b/crates/ty_ide/src/goto_declaration.rs @@ -380,7 +380,10 @@ FOO = 0 1 | from lib import module | ^^^^^^ Clicking here info: Found 1 declaration - --> lib/module.py:1:1 + --> lib/module.py:1:1 + | + 1 | + | - "); } @@ -2550,7 +2553,10 @@ def ab(a: int, *, c: int): ... 2 | from .subpkg.submod import val | ^^^^^^ Clicking here info: Found 1 declaration - --> mypackage/subpkg/__init__.py:1:1 + --> mypackage/subpkg/__init__.py:1:1 + | + 1 | + | - "); } diff --git a/crates/ty_ide/src/goto_type_definition.rs b/crates/ty_ide/src/goto_type_definition.rs index c5969957bd6026..080b43f01ef7df 100644 --- a/crates/ty_ide/src/goto_type_definition.rs +++ b/crates/ty_ide/src/goto_type_definition.rs @@ -1832,9 +1832,10 @@ def function(): 4 | x = subpkg | ^^^^^^ Clicking here info: Found 1 type definition - --> mypackage/subpkg/__init__.py:1:1 - | - | + --> mypackage/subpkg/__init__.py:1:1 + | + 1 | + | - "); } @@ -1866,9 +1867,10 @@ def function(): 2 | from .subpkg.submod import val | ^^^^^^ Clicking here info: Found 1 type definition - --> mypackage/subpkg/__init__.py:1:1 - | - | + --> mypackage/subpkg/__init__.py:1:1 + | + 1 | + | - "); } From af581aeb3537ded1821a46601117ae5e8825281b Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 17 Jul 2026 15:52:38 -0500 Subject: [PATCH 30/34] Bless fixes for respecting term width The old renderer allowed the snipper to go past the term width. --- .../ruff_linter__rules__pyupgrade__tests__UP031_0.py.snap | 2 +- ..._-_Diagnostic_when_ther\342\200\246_(ecae0f4510696c95).snap" | 2 +- ..._-_Diagnostic_when_ther\342\200\246_(f807ff3716d8ab0d).snap" | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP031_0.py.snap b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP031_0.py.snap index c521ec1aa2bad8..5251a71ac32d34 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP031_0.py.snap +++ b/crates/ruff_linter/src/rules/pyupgrade/snapshots/ruff_linter__rules__pyupgrade__tests__UP031_0.py.snap @@ -828,7 +828,7 @@ UP031 [*] Use format specifiers instead of percent format | 116 | path = "%s-%s-%s.pem" % ( | ________^ -117 | | safe_domain_name(cn), # common name, which should be filename safe because it is IDNA-encoded, but in case of a malformed cert ma… +117 | | safe_domain_name(cn), # common name, which should be filename safe because it is IDNA-encoded, but in case of a malformed cert … 118 | | cert.not_valid_after.date().isoformat().replace("-", ""), # expiration date 119 | | hexlify(cert.fingerprint(hashes.SHA256())).decode("ascii")[0:8], # fingerprint prefix 120 | | ) diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(ecae0f4510696c95).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(ecae0f4510696c95).snap" index a7c2cb85906a16..3ecf3bac7c081f 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(ecae0f4510696c95).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(ecae0f4510696c95).snap" @@ -49,7 +49,7 @@ error[abstract-method-in-final-class]: Final class `Abstract` has unimplemented | 4 | @final | ------ -5 | # error: [abstract-method-in-final-class] "Final class `Abstract` has unimplemented abstract methods `aaaaaaaaaa`, `bbbbbbbb`, `ccccccc… +5 | # error: [abstract-method-in-final-class] "Final class `Abstract` has unimplemented abstract methods `aaaaaaaaaa`, `bbbbbbbb`, `ccccc… 6 | class Abstract(ABC): | ^^^^^^^^ Abstract methods `aaaaaaaaaa`, `bbbbbbbb`, `cccccccc`, `ddddddddd`, `eeeeeeeee`, `ffffffff`, `ggggggg`, `hhhhhhhh`, `iiiiiiiii` and `kkkkkkkkkk` are unimplemented 7 | / @abstractmethod diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(f807ff3716d8ab0d).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(f807ff3716d8ab0d).snap" index 13b15610c9a293..f1323f512dac85 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(f807ff3716d8ab0d).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/final.md_-_Tests_for_the_`@typi\342\200\246_-_A_`@final`_class_mus\342\200\246_-_Diagnostic_when_ther\342\200\246_(f807ff3716d8ab0d).snap" @@ -49,7 +49,7 @@ error[abstract-method-in-final-class]: Final class `Abstract` has unimplemented | 4 | @final | ------ -5 | # error: [abstract-method-in-final-class] "Final class `Abstract` has 10 unimplemented abstract methods, including `aaaaaaaaaa`, `bbbbb… +5 | # error: [abstract-method-in-final-class] "Final class `Abstract` has 10 unimplemented abstract methods, including `aaaaaaaaaa`, `bbb… 6 | class Abstract(ABC): | ^^^^^^^^ 10 abstract methods are unimplemented, including `aaaaaaaaaa`, `bbbbbbbb` and `cccccccc` 7 | / @abstractmethod From b53c27ab971087444dc8c7b6c6626fc94b82f339 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 17 Jul 2026 16:35:11 -0500 Subject: [PATCH 31/34] Bless annotation location between newline and first character The annotation is between the newline and the first character, so this is the more correct place to render it. --- .../invalid_syntax@match_stmt_expected_case_block.py.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expected_case_block.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expected_case_block.py.snap index 5c0854d664cceb..561ee48a269582 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expected_case_block.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@match_stmt_expected_case_block.py.snap @@ -126,8 +126,8 @@ Module( | 1 | match x: 2 | x = 1 - | ^ Syntax Error: Expected a statement 3 | match x: + | ^ Syntax Error: Expected a statement 4 | match y: 5 | case _: ... | From 3f239d6b0cc10587892df6c64b3d1ccd96053440 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 20 Jul 2026 09:07:18 -0500 Subject: [PATCH 32/34] Bless new multi-line annotation markers --- crates/ruff_db/src/diagnostic/render.rs | 29 +++++++++---------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/crates/ruff_db/src/diagnostic/render.rs b/crates/ruff_db/src/diagnostic/render.rs index 81f4274537f849..6b475416be2ca6 100644 --- a/crates/ruff_db/src/diagnostic/render.rs +++ b/crates/ruff_db/src/diagnostic/render.rs @@ -2169,10 +2169,8 @@ watermelon | 2 | beetle 3 | canary - 4 | dog - | __^ - 5 | | elephant - | | _^ + 4 | / dog + 5 | |/ elephant 6 | || finch | ||_____^ 7 | | gorilla @@ -2198,10 +2196,8 @@ watermelon | 2 | beetle 3 | canary - 4 | dog - | __^ - 5 | | elephant - | | _^ + 4 | / dog + 5 | |/ elephant 6 | || finch | ||_____^ 7 | | gorilla @@ -2229,10 +2225,8 @@ watermelon | 3 | canary 4 | dog - 5 | elephant - | __^ - 6 | | finch - | | _^ + 5 | / elephant + 6 | |/ finch 7 | || gorilla | ||_______^ | |_______| @@ -2264,13 +2258,11 @@ watermelon | 3 | canary 4 | dog - 5 | elephant - | _^ - | |_| + 5 | // elephant 6 | || finch | ||_____^ - 7 | | gorilla - | |_______^ + 7 | | gorilla + | |________^ 8 | hippopotamus 9 | inchworm | @@ -2292,8 +2284,7 @@ watermelon | 3 | canary 4 | dog - 5 | elephant - | __^ + 5 | / elephant 6 | | finch | |__^___^ | _| From ece9c3152337f3ea91a12abbd8bcfe7f7da82e04 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 20 Jul 2026 11:35:33 -0500 Subject: [PATCH 33/34] Bless slight newline behavior change When to go past the end-of-line to represent the newline has changed. The two renderers diverged in their newline behavior and I tried to restore the old behavior as much as possible and I hit my timebox for getting this exactly right since this didn't seem the most important to get perfectly the same. --- crates/ruff_db/src/diagnostic/render.rs | 2 +- ...rules__pycodestyle__tests__preview__W391_W391.ipynb.snap | 6 +++--- ..._rules__pycodestyle__tests__preview__W391_W391_2.py.snap | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/ruff_db/src/diagnostic/render.rs b/crates/ruff_db/src/diagnostic/render.rs index 6b475416be2ca6..8621883ad87c18 100644 --- a/crates/ruff_db/src/diagnostic/render.rs +++ b/crates/ruff_db/src/diagnostic/render.rs @@ -2077,7 +2077,7 @@ watermelon 4 | dog 5 | / elephant 6 | | finch - | |______^ + | |_____^ 7 | gorilla 8 | hippopotamus | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391.ipynb.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391.ipynb.snap index 9c9b72a525953a..bb07af429c7b39 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391.ipynb.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391.ipynb.snap @@ -9,7 +9,7 @@ W391 [*] Too many newlines at end of cell 5 | / 6 | | 7 | | - | |__^ + | |_^ 8 | 9 | 1 + 1 | @@ -31,7 +31,7 @@ W391 [*] Too many newlines at end of cell 12 | | 13 | | 14 | | - | |__^ + | |_^ 15 | 16 | 1+1 | @@ -50,7 +50,7 @@ W391 [*] Too many newlines at end of cell | 19 | / 20 | | - | |__^ + | |_^ help: Remove trailing newlines | 19 | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391_2.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391_2.py.snap index 64639baa614075..a53365244c042b 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391_2.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__preview__W391_W391_2.py.snap @@ -10,7 +10,7 @@ W391 [*] Too many newlines at end of file 15 | | 16 | | 17 | | - | |__^ + | |_^ help: Remove trailing newlines | 13 | bar() From 5eec5d375495d75e2cce153956ca638ab6e9b60e Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 20 Jul 2026 12:30:39 -0500 Subject: [PATCH 34/34] Bless blobs --- .../e2e__publish_diagnostics__full_diagnostic_output.snap | 2 +- ...tics__document_diagnostic_caching_rendered_source_after.snap | 2 +- ...ics__document_diagnostic_caching_rendered_source_before.snap | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ty_server/tests/e2e/snapshots/e2e__publish_diagnostics__full_diagnostic_output.snap b/crates/ty_server/tests/e2e/snapshots/e2e__publish_diagnostics__full_diagnostic_output.snap index 02d34942a05c69..a5a61422daf381 100644 --- a/crates/ty_server/tests/e2e/snapshots/e2e__publish_diagnostics__full_diagnostic_output.snap +++ b/crates/ty_server/tests/e2e/snapshots/e2e__publish_diagnostics__full_diagnostic_output.snap @@ -69,7 +69,7 @@ PublishDiagnosticsParams { data: Some( Object { "diagnostic_id": String("invalid-return-type"), - "rendered": String("\u{1b}[1m\u{1b}[91merror[invalid-return-type]\u{1b}[0m: \u{1b}[1mReturn type does not match returned value\u{1b}[0m\n \u{1b}[1m\u{1b}[94m-->\u{1b}[0m src/foo.py:1:14\n \u{1b}[1m\u{1b}[94m|\u{1b}[0m\n\u{1b}[1m\u{1b}[94m1 |\u{1b}[0m def foo() -> str:\n \u{1b}[1m\u{1b}[94m|\u{1b}[0m \u{1b}[1m\u{1b}[33m---\u{1b}[0m \u{1b}[1m\u{1b}[33mExpected `str` because of return type\u{1b}[0m\n\u{1b}[1m\u{1b}[94m2 |\u{1b}[0m return 42\n \u{1b}[1m\u{1b}[94m|\u{1b}[0m \u{1b}[1m\u{1b}[91m^^\u{1b}[0m \u{1b}[1m\u{1b}[91mexpected `str`, found `Literal[42]`\u{1b}[0m\n \u{1b}[1m\u{1b}[94m|\u{1b}[0m\n\n"), + "rendered": String("\u{1b}[1m\u{1b}[91merror[invalid-return-type]\u{1b}[0m\u{1b}[1m: Return type does not match returned value\u{1b}[0m\n \u{1b}[1m\u{1b}[94m--> \u{1b}[0msrc/foo.py:2:12\n \u{1b}[1m\u{1b}[94m|\u{1b}[0m\n\u{1b}[1m\u{1b}[94m1\u{1b}[0m \u{1b}[1m\u{1b}[94m|\u{1b}[0m def foo() -> str:\n \u{1b}[1m\u{1b}[94m|\u{1b}[0m \u{1b}[1m\u{1b}[94m---\u{1b}[0m \u{1b}[1m\u{1b}[94mExpected `str` because of return type\u{1b}[0m\n\u{1b}[1m\u{1b}[94m2\u{1b}[0m \u{1b}[1m\u{1b}[94m|\u{1b}[0m return 42\n \u{1b}[1m\u{1b}[94m|\u{1b}[0m \u{1b}[1m\u{1b}[91m^^\u{1b}[0m \u{1b}[1m\u{1b}[91mexpected `str`, found `Literal[42]`\u{1b}[0m\n\n"), }, ), }, diff --git a/crates/ty_server/tests/e2e/snapshots/e2e__pull_diagnostics__document_diagnostic_caching_rendered_source_after.snap b/crates/ty_server/tests/e2e/snapshots/e2e__pull_diagnostics__document_diagnostic_caching_rendered_source_after.snap index ff9985b20df9b5..62b4eacc155e21 100644 --- a/crates/ty_server/tests/e2e/snapshots/e2e__pull_diagnostics__document_diagnostic_caching_rendered_source_after.snap +++ b/crates/ty_server/tests/e2e/snapshots/e2e__pull_diagnostics__document_diagnostic_caching_rendered_source_after.snap @@ -61,7 +61,7 @@ RelatedFullDocumentDiagnosticReport( data: Some( Object { "diagnostic_id": String("invalid-return-type"), - "rendered": String("\u{1b}[1m\u{1b}[91merror[invalid-return-type]\u{1b}[0m: \u{1b}[1mReturn type does not match returned value\u{1b}[0m\n \u{1b}[1m\u{1b}[94m-->\u{1b}[0m src/foo.py:1:14\n \u{1b}[1m\u{1b}[94m|\u{1b}[0m\n\u{1b}[1m\u{1b}[94m1 |\u{1b}[0m def foo() -> str:\n \u{1b}[1m\u{1b}[94m|\u{1b}[0m \u{1b}[1m\u{1b}[33m---\u{1b}[0m \u{1b}[1m\u{1b}[33mExpected `str` because of return type\u{1b}[0m\n\u{1b}[1m\u{1b}[94m2 |\u{1b}[0m return 42 # after!\n \u{1b}[1m\u{1b}[94m|\u{1b}[0m \u{1b}[1m\u{1b}[91m^^\u{1b}[0m \u{1b}[1m\u{1b}[91mexpected `str`, found `Literal[42]`\u{1b}[0m\n \u{1b}[1m\u{1b}[94m|\u{1b}[0m\n\n"), + "rendered": String("\u{1b}[1m\u{1b}[91merror[invalid-return-type]\u{1b}[0m\u{1b}[1m: Return type does not match returned value\u{1b}[0m\n \u{1b}[1m\u{1b}[94m--> \u{1b}[0msrc/foo.py:2:12\n \u{1b}[1m\u{1b}[94m|\u{1b}[0m\n\u{1b}[1m\u{1b}[94m1\u{1b}[0m \u{1b}[1m\u{1b}[94m|\u{1b}[0m def foo() -> str:\n \u{1b}[1m\u{1b}[94m|\u{1b}[0m \u{1b}[1m\u{1b}[94m---\u{1b}[0m \u{1b}[1m\u{1b}[94mExpected `str` because of return type\u{1b}[0m\n\u{1b}[1m\u{1b}[94m2\u{1b}[0m \u{1b}[1m\u{1b}[94m|\u{1b}[0m return 42 # after!\n \u{1b}[1m\u{1b}[94m|\u{1b}[0m \u{1b}[1m\u{1b}[91m^^\u{1b}[0m \u{1b}[1m\u{1b}[91mexpected `str`, found `Literal[42]`\u{1b}[0m\n\n"), }, ), }, diff --git a/crates/ty_server/tests/e2e/snapshots/e2e__pull_diagnostics__document_diagnostic_caching_rendered_source_before.snap b/crates/ty_server/tests/e2e/snapshots/e2e__pull_diagnostics__document_diagnostic_caching_rendered_source_before.snap index 81151c4ae34e12..686521e8a53f5f 100644 --- a/crates/ty_server/tests/e2e/snapshots/e2e__pull_diagnostics__document_diagnostic_caching_rendered_source_before.snap +++ b/crates/ty_server/tests/e2e/snapshots/e2e__pull_diagnostics__document_diagnostic_caching_rendered_source_before.snap @@ -61,7 +61,7 @@ RelatedFullDocumentDiagnosticReport( data: Some( Object { "diagnostic_id": String("invalid-return-type"), - "rendered": String("\u{1b}[1m\u{1b}[91merror[invalid-return-type]\u{1b}[0m: \u{1b}[1mReturn type does not match returned value\u{1b}[0m\n \u{1b}[1m\u{1b}[94m-->\u{1b}[0m src/foo.py:1:14\n \u{1b}[1m\u{1b}[94m|\u{1b}[0m\n\u{1b}[1m\u{1b}[94m1 |\u{1b}[0m def foo() -> str:\n \u{1b}[1m\u{1b}[94m|\u{1b}[0m \u{1b}[1m\u{1b}[33m---\u{1b}[0m \u{1b}[1m\u{1b}[33mExpected `str` because of return type\u{1b}[0m\n\u{1b}[1m\u{1b}[94m2 |\u{1b}[0m return 42 # before\n \u{1b}[1m\u{1b}[94m|\u{1b}[0m \u{1b}[1m\u{1b}[91m^^\u{1b}[0m \u{1b}[1m\u{1b}[91mexpected `str`, found `Literal[42]`\u{1b}[0m\n \u{1b}[1m\u{1b}[94m|\u{1b}[0m\n\n"), + "rendered": String("\u{1b}[1m\u{1b}[91merror[invalid-return-type]\u{1b}[0m\u{1b}[1m: Return type does not match returned value\u{1b}[0m\n \u{1b}[1m\u{1b}[94m--> \u{1b}[0msrc/foo.py:2:12\n \u{1b}[1m\u{1b}[94m|\u{1b}[0m\n\u{1b}[1m\u{1b}[94m1\u{1b}[0m \u{1b}[1m\u{1b}[94m|\u{1b}[0m def foo() -> str:\n \u{1b}[1m\u{1b}[94m|\u{1b}[0m \u{1b}[1m\u{1b}[94m---\u{1b}[0m \u{1b}[1m\u{1b}[94mExpected `str` because of return type\u{1b}[0m\n\u{1b}[1m\u{1b}[94m2\u{1b}[0m \u{1b}[1m\u{1b}[94m|\u{1b}[0m return 42 # before\n \u{1b}[1m\u{1b}[94m|\u{1b}[0m \u{1b}[1m\u{1b}[91m^^\u{1b}[0m \u{1b}[1m\u{1b}[91mexpected `str`, found `Literal[42]`\u{1b}[0m\n\n"), }, ), },