From 683c634164ede8307e2080c603768771f662a043 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Fri, 12 Jul 2024 09:18:51 -0400 Subject: [PATCH 1/4] Omit code frames for fixes with empty ranges --- crates/ruff_linter/src/message/text.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/crates/ruff_linter/src/message/text.rs b/crates/ruff_linter/src/message/text.rs index ed74f5a495bb6..2a41dd67d9b94 100644 --- a/crates/ruff_linter/src/message/text.rs +++ b/crates/ruff_linter/src/message/text.rs @@ -116,14 +116,16 @@ impl Emitter for TextEmitter { )?; if self.flags.intersects(EmitterFlags::SHOW_SOURCE) { - writeln!( - writer, - "{}", - MessageCodeFrame { - message, - notebook_index - } - )?; + if message.range().len() > TextSize::default() { + writeln!( + writer, + "{}", + MessageCodeFrame { + message, + notebook_index + } + )?; + } } if self.flags.intersects(EmitterFlags::SHOW_FIX_DIFF) { From 85c5270bee540084964eb49a8db19fd6d8ba0109 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Fri, 12 Jul 2024 10:34:06 -0400 Subject: [PATCH 2/4] Update crates/ruff_linter/src/message/text.rs Co-authored-by: Dhruv Manilawala --- crates/ruff_linter/src/message/text.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/ruff_linter/src/message/text.rs b/crates/ruff_linter/src/message/text.rs index 2a41dd67d9b94..43618d93f662a 100644 --- a/crates/ruff_linter/src/message/text.rs +++ b/crates/ruff_linter/src/message/text.rs @@ -116,7 +116,8 @@ impl Emitter for TextEmitter { )?; if self.flags.intersects(EmitterFlags::SHOW_SOURCE) { - if message.range().len() > TextSize::default() { + // The `0..0` range is used to highlight file-level diagnostics. + if message.range() != TextRange::default() { writeln!( writer, "{}", From 324a061ab40f332ea7b0ae3fde23c8f8ac69d165 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Fri, 12 Jul 2024 10:50:48 -0400 Subject: [PATCH 3/4] Fmt --- crates/ruff_linter/src/message/text.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ruff_linter/src/message/text.rs b/crates/ruff_linter/src/message/text.rs index 43618d93f662a..46b7cbb2c5333 100644 --- a/crates/ruff_linter/src/message/text.rs +++ b/crates/ruff_linter/src/message/text.rs @@ -116,7 +116,7 @@ impl Emitter for TextEmitter { )?; if self.flags.intersects(EmitterFlags::SHOW_SOURCE) { - // The `0..0` range is used to highlight file-level diagnostics. + // The `0..0` range is used to highlight file-level diagnostics. if message.range() != TextRange::default() { writeln!( writer, From 25361c24843c4e7798342f19c61701e67d652268 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Fri, 12 Jul 2024 11:17:24 -0400 Subject: [PATCH 4/4] Fixtures --- crates/ruff/tests/integration_test.rs | 134 ------------------ ...lake8_copyright__tests__char_boundary.snap | 6 - ...ake8_copyright__tests__invalid_author.snap | 8 -- ..._flake8_copyright__tests__late_notice.snap | 8 -- ...id_author_with_comma_invalid_no_space.snap | 6 - ...alid_author_with_comma_invalid_spaces.snap | 6 - ..._valid_author_with_dash_invalid_space.snap | 6 - ...valid_author_with_dash_invalid_spaces.snap | 6 - ...flake8_executable__tests__EXE002_1.py.snap | 5 - ...ke8_no_pep420__tests__test_fail_empty.snap | 4 - ..._no_pep420__tests__test_fail_nonempty.snap | 6 - ...ombined_required_imports_docstring.py.snap | 18 --- ...rt__tests__required_import_comment.py.snap | 10 -- ...uired_import_comments_and_newlines.py.snap | 9 -- ...__tests__required_import_docstring.py.snap | 10 -- ...import_docstring_with_continuation.py.snap | 9 -- ...ed_import_docstring_with_semicolon.py.snap | 8 -- ...s__required_import_existing_import.py.snap | 9 -- ...equired_import_multiline_docstring.py.snap | 10 -- ..._isort__tests__required_import_off.py.snap | 10 -- ...required_import_with_alias_comment.py.snap | 10 -- ...t_with_alias_comments_and_newlines.py.snap | 9 -- ...quired_import_with_alias_docstring.py.snap | 10 -- ..._alias_docstring_with_continuation.py.snap | 9 -- ...ith_alias_docstring_with_semicolon.py.snap | 8 -- ..._import_with_alias_existing_import.py.snap | 9 -- ...ort_with_alias_multiline_docstring.py.snap | 10 -- ...ts__required_import_with_alias_off.py.snap | 10 -- ..._tests__required_imports_docstring.py.snap | 18 --- ...straight_required_import_docstring.py.snap | 10 -- ...traight_required_import_docstring.pyi.snap | 10 -- ...999_N999__module__MODULE____init__.py.snap | 4 - ...module__invalid_name__0001_initial.py.snap | 4 - ...N999__module__invalid_name__import.py.snap | 4 - ..._module__mod with spaces____init__.py.snap | 4 - ..._module__mod-with-dashes____init__.py.snap | 4 - ...dule__valid_name__file-with-dashes.py.snap | 4 - ...__rules__pydocstyle__tests__D100_D.py.snap | 8 -- ...ts__D100__unrelated__pkg__D100_pub.py.snap | 4 - ...cstyle__tests__D104_D104____init__.py.snap | 4 - ...linter__rules__pydocstyle__tests__all.snap | 8 -- 41 files changed, 449 deletions(-) diff --git a/crates/ruff/tests/integration_test.rs b/crates/ruff/tests/integration_test.rs index 6022b54ac3f6b..fae9b4be2397b 100644 --- a/crates/ruff/tests/integration_test.rs +++ b/crates/ruff/tests/integration_test.rs @@ -1259,9 +1259,6 @@ fn redirect_direct() { exit_code: 1 ----- stdout ----- -:1:1: RUF950 Hey this is a test rule that was redirected from another. - | - | - Found 1 error. ----- stderr ----- @@ -1294,9 +1291,6 @@ fn redirect_prefix() { exit_code: 1 ----- stdout ----- -:1:1: RUF950 Hey this is a test rule that was redirected from another. - | - | - Found 1 error. ----- stderr ----- @@ -1314,9 +1308,6 @@ fn deprecated_direct() { exit_code: 1 ----- stdout ----- -:1:1: RUF920 Hey this is a deprecated test rule. - | - | - Found 1 error. ----- stderr ----- @@ -1334,13 +1325,7 @@ fn deprecated_multiple_direct() { exit_code: 1 ----- stdout ----- -:1:1: RUF920 Hey this is a deprecated test rule. - | - | - -:1:1: RUF921 Hey this is another deprecated test rule. - | - | - Found 2 errors. ----- stderr ----- @@ -1359,13 +1344,7 @@ fn deprecated_indirect() { exit_code: 1 ----- stdout ----- -:1:1: RUF920 Hey this is a deprecated test rule. - | - | - -:1:1: RUF921 Hey this is another deprecated test rule. - | - | - Found 2 errors. ----- stderr ----- @@ -1544,13 +1523,7 @@ fn check_hints_hidden_unsafe_fixes() { exit_code: 1 ----- stdout ----- -:1:1: RUF901 [*] Hey this is a stable test rule with a safe fix. - | - | - -:1:1: RUF902 Hey this is a stable test rule with an unsafe fix. - | - | - Found 2 errors. [*] 1 fixable with the `--fix` option (1 hidden fix can be enabled with the `--unsafe-fixes` option). @@ -1568,11 +1541,6 @@ fn check_hints_hidden_unsafe_fixes_with_no_safe_fixes() { exit_code: 1 ----- stdout ----- -:1:1: RUF902 Hey this is a stable test rule with an unsafe fix. - | - 1 | x = {'a': 1, 'a': 1} - | RUF902 - | - Found 1 error. No fixes available (1 hidden fix can be enabled with the `--unsafe-fixes` option). @@ -1591,13 +1559,7 @@ fn check_no_hint_for_hidden_unsafe_fixes_when_disabled() { exit_code: 1 ----- stdout ----- -:1:1: RUF901 [*] Hey this is a stable test rule with a safe fix. - | - | - -:1:1: RUF902 Hey this is a stable test rule with an unsafe fix. - | - | - Found 2 errors. [*] 1 fixable with the --fix option. @@ -1617,11 +1579,6 @@ fn check_no_hint_for_hidden_unsafe_fixes_with_no_safe_fixes_when_disabled() { exit_code: 1 ----- stdout ----- -:1:1: RUF902 Hey this is a stable test rule with an unsafe fix. - | - 1 | x = {'a': 1, 'a': 1} - | RUF902 - | - Found 1 error. ----- stderr ----- @@ -1639,13 +1596,7 @@ fn check_shows_unsafe_fixes_with_opt_in() { exit_code: 1 ----- stdout ----- -:1:1: RUF901 [*] Hey this is a stable test rule with a safe fix. - | - | - -:1:1: RUF902 [*] Hey this is a stable test rule with an unsafe fix. - | - | - Found 2 errors. [*] 2 fixable with the --fix option. @@ -1667,11 +1618,6 @@ fn fix_applies_safe_fixes_by_default() { ----- stderr ----- -:1:1: RUF902 Hey this is a stable test rule with an unsafe fix. - | - 1 | # fix from stable-test-rule-safe-fix - | RUF902 - | - Found 2 errors (1 fixed, 1 remaining). No fixes available (1 hidden fix can be enabled with the `--unsafe-fixes` option). "###); @@ -1709,11 +1655,6 @@ fn fix_does_not_apply_display_only_fixes() { def add_to_list(item, some_list=[]): ... ----- stderr ----- -:1:1: RUF903 Hey this is a stable test rule with a display only fix. - | - 1 | def add_to_list(item, some_list=[]): ... - | RUF903 - | - Found 1 error. "###); } @@ -1732,11 +1673,6 @@ fn fix_does_not_apply_display_only_fixes_with_unsafe_fixes_enabled() { def add_to_list(item, some_list=[]): ... ----- stderr ----- -:1:1: RUF903 Hey this is a stable test rule with a display only fix. - | - 1 | def add_to_list(item, some_list=[]): ... - | RUF903 - | - Found 1 error. "###); } @@ -1754,9 +1690,6 @@ fn fix_only_unsafe_fixes_available() { ----- stderr ----- -:1:1: RUF902 Hey this is a stable test rule with an unsafe fix. - | - | - Found 1 error. No fixes available (1 hidden fix can be enabled with the `--unsafe-fixes` option). "###); @@ -1893,13 +1826,7 @@ extend-unsafe-fixes = ["RUF901"] exit_code: 1 ----- stdout ----- -:1:1: RUF901 Hey this is a stable test rule with a safe fix. - | - | - -:1:1: RUF902 Hey this is a stable test rule with an unsafe fix. - | - | - Found 2 errors. No fixes available (2 hidden fixes can be enabled with the `--unsafe-fixes` option). @@ -1931,13 +1858,7 @@ extend-safe-fixes = ["RUF902"] exit_code: 1 ----- stdout ----- -:1:1: RUF901 [*] Hey this is a stable test rule with a safe fix. - | - | - -:1:1: RUF902 [*] Hey this is a stable test rule with an unsafe fix. - | - | - Found 2 errors. [*] 2 fixable with the `--fix` option. @@ -1971,13 +1892,7 @@ extend-safe-fixes = ["RUF902"] exit_code: 1 ----- stdout ----- -:1:1: RUF901 [*] Hey this is a stable test rule with a safe fix. - | - | - -:1:1: RUF902 Hey this is a stable test rule with an unsafe fix. - | - | - Found 2 errors. [*] 1 fixable with the `--fix` option (1 hidden fix can be enabled with the `--unsafe-fixes` option). @@ -2013,61 +1928,12 @@ extend-safe-fixes = ["RUF9"] exit_code: 1 ----- stdout ----- -:1:1: RUF900 Hey this is a stable test rule. - | - 1 | x = {'a': 1, 'a': 1} - | RUF900 - 2 | print(('foo')) - 3 | print(str('foo')) - | - -:1:1: RUF901 Hey this is a stable test rule with a safe fix. - | - 1 | x = {'a': 1, 'a': 1} - | RUF901 - 2 | print(('foo')) - 3 | print(str('foo')) - | - -:1:1: RUF902 [*] Hey this is a stable test rule with an unsafe fix. - | - 1 | x = {'a': 1, 'a': 1} - | RUF902 - 2 | print(('foo')) - 3 | print(str('foo')) - | - -:1:1: RUF903 Hey this is a stable test rule with a display only fix. - | - 1 | x = {'a': 1, 'a': 1} - | RUF903 - 2 | print(('foo')) - 3 | print(str('foo')) - | - -:1:1: RUF920 Hey this is a deprecated test rule. - | - 1 | x = {'a': 1, 'a': 1} - | RUF920 - 2 | print(('foo')) - 3 | print(str('foo')) - | - -:1:1: RUF921 Hey this is another deprecated test rule. - | - 1 | x = {'a': 1, 'a': 1} - | RUF921 - 2 | print(('foo')) - 3 | print(str('foo')) - | - -:1:1: RUF950 Hey this is a test rule that was redirected from another. - | - 1 | x = {'a': 1, 'a': 1} - | RUF950 - 2 | print(('foo')) - 3 | print(str('foo')) - | - Found 7 errors. [*] 1 fixable with the `--fix` option (1 hidden fix can be enabled with the `--unsafe-fixes` option). diff --git a/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__char_boundary.snap b/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__char_boundary.snap index 1f52748b8e0a4..6bac4b05dc4e8 100644 --- a/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__char_boundary.snap +++ b/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__char_boundary.snap @@ -2,9 +2,3 @@ source: crates/ruff_linter/src/rules/flake8_copyright/mod.rs --- :1:1: CPY001 Missing copyright notice at top of file - | -1 | কককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককককক - | CPY001 - | - - diff --git a/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__invalid_author.snap b/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__invalid_author.snap index ee07c0714074b..6bac4b05dc4e8 100644 --- a/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__invalid_author.snap +++ b/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__invalid_author.snap @@ -2,11 +2,3 @@ source: crates/ruff_linter/src/rules/flake8_copyright/mod.rs --- :1:1: CPY001 Missing copyright notice at top of file - | -1 | # Copyright (C) 2023 Some Author - | CPY001 -2 | -3 | import os - | - - diff --git a/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__late_notice.snap b/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__late_notice.snap index 73a072d539644..6bac4b05dc4e8 100644 --- a/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__late_notice.snap +++ b/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__late_notice.snap @@ -2,11 +2,3 @@ source: crates/ruff_linter/src/rules/flake8_copyright/mod.rs --- :1:1: CPY001 Missing copyright notice at top of file - | -1 | # Content Content Content Content Content Content Content Content Content Content - | CPY001 -2 | # Content Content Content Content Content Content Content Content Content Content -3 | # Content Content Content Content Content Content Content Content Content Content - | - - diff --git a/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__valid_author_with_comma_invalid_no_space.snap b/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__valid_author_with_comma_invalid_no_space.snap index f863134fdeffa..6bac4b05dc4e8 100644 --- a/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__valid_author_with_comma_invalid_no_space.snap +++ b/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__valid_author_with_comma_invalid_no_space.snap @@ -2,9 +2,3 @@ source: crates/ruff_linter/src/rules/flake8_copyright/mod.rs --- :1:1: CPY001 Missing copyright notice at top of file - | -1 | # Copyright (C) 2022,2023 Ruff - | CPY001 -2 | -3 | import os - | diff --git a/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__valid_author_with_comma_invalid_spaces.snap b/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__valid_author_with_comma_invalid_spaces.snap index 4f23985e3cf82..6bac4b05dc4e8 100644 --- a/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__valid_author_with_comma_invalid_spaces.snap +++ b/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__valid_author_with_comma_invalid_spaces.snap @@ -2,9 +2,3 @@ source: crates/ruff_linter/src/rules/flake8_copyright/mod.rs --- :1:1: CPY001 Missing copyright notice at top of file - | -1 | # Copyright (C) 2022 , 2023 Ruff - | CPY001 -2 | -3 | import os - | diff --git a/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__valid_author_with_dash_invalid_space.snap b/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__valid_author_with_dash_invalid_space.snap index ad45336ac5c66..6bac4b05dc4e8 100644 --- a/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__valid_author_with_dash_invalid_space.snap +++ b/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__valid_author_with_dash_invalid_space.snap @@ -2,9 +2,3 @@ source: crates/ruff_linter/src/rules/flake8_copyright/mod.rs --- :1:1: CPY001 Missing copyright notice at top of file - | -1 | # Copyright (C) 2022- 2023 Ruff - | CPY001 -2 | -3 | import os - | diff --git a/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__valid_author_with_dash_invalid_spaces.snap b/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__valid_author_with_dash_invalid_spaces.snap index 353f1a5c87773..6bac4b05dc4e8 100644 --- a/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__valid_author_with_dash_invalid_spaces.snap +++ b/crates/ruff_linter/src/rules/flake8_copyright/snapshots/ruff_linter__rules__flake8_copyright__tests__valid_author_with_dash_invalid_spaces.snap @@ -2,9 +2,3 @@ source: crates/ruff_linter/src/rules/flake8_copyright/mod.rs --- :1:1: CPY001 Missing copyright notice at top of file - | -1 | # Copyright (C) 2022 - 2023 Ruff - | CPY001 -2 | -3 | import os - | diff --git a/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE002_1.py.snap b/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE002_1.py.snap index 2ca899f1c27d6..122fcb26569c7 100644 --- a/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE002_1.py.snap +++ b/crates/ruff_linter/src/rules/flake8_executable/snapshots/ruff_linter__rules__flake8_executable__tests__EXE002_1.py.snap @@ -2,8 +2,3 @@ source: crates/ruff_linter/src/rules/flake8_executable/mod.rs --- EXE002_1.py:1:1: EXE002 The file is executable but no shebang is present - | -1 | if __name__ == '__main__': - | EXE002 -2 | print('I should be executable.') - | diff --git a/crates/ruff_linter/src/rules/flake8_no_pep420/snapshots/ruff_linter__rules__flake8_no_pep420__tests__test_fail_empty.snap b/crates/ruff_linter/src/rules/flake8_no_pep420/snapshots/ruff_linter__rules__flake8_no_pep420__tests__test_fail_empty.snap index 1d73378623bbb..764fcdac4bfe1 100644 --- a/crates/ruff_linter/src/rules/flake8_no_pep420/snapshots/ruff_linter__rules__flake8_no_pep420__tests__test_fail_empty.snap +++ b/crates/ruff_linter/src/rules/flake8_no_pep420/snapshots/ruff_linter__rules__flake8_no_pep420__tests__test_fail_empty.snap @@ -2,7 +2,3 @@ source: crates/ruff_linter/src/rules/flake8_no_pep420/mod.rs --- example.py:1:1: INP001 File `./resources/test/fixtures/flake8_no_pep420/test_fail_empty/example.py` is part of an implicit namespace package. Add an `__init__.py`. - | - | - - diff --git a/crates/ruff_linter/src/rules/flake8_no_pep420/snapshots/ruff_linter__rules__flake8_no_pep420__tests__test_fail_nonempty.snap b/crates/ruff_linter/src/rules/flake8_no_pep420/snapshots/ruff_linter__rules__flake8_no_pep420__tests__test_fail_nonempty.snap index 4184e6b7a8087..dfbb8bccba1ee 100644 --- a/crates/ruff_linter/src/rules/flake8_no_pep420/snapshots/ruff_linter__rules__flake8_no_pep420__tests__test_fail_nonempty.snap +++ b/crates/ruff_linter/src/rules/flake8_no_pep420/snapshots/ruff_linter__rules__flake8_no_pep420__tests__test_fail_nonempty.snap @@ -2,9 +2,3 @@ source: crates/ruff_linter/src/rules/flake8_no_pep420/mod.rs --- example.py:1:1: INP001 File `./resources/test/fixtures/flake8_no_pep420/test_fail_nonempty/example.py` is part of an implicit namespace package. Add an `__init__.py`. - | -1 | print('hi') - | INP001 - | - - diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combined_required_imports_docstring.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combined_required_imports_docstring.py.snap index 3d79baab3d6f2..d65d89b7038d5 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combined_required_imports_docstring.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__combined_required_imports_docstring.py.snap @@ -2,14 +2,6 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- docstring.py:1:1: I002 [*] Missing required import: `from __future__ import annotations` - | -1 | """Hello, world!""" - | I002 -2 | -3 | x = 1 - | - = help: Insert required import: `from __future__ import annotations` - ℹ Safe fix 1 1 | """Hello, world!""" 2 |+from __future__ import annotations @@ -17,18 +9,8 @@ docstring.py:1:1: I002 [*] Missing required import: `from __future__ import anno 3 4 | x = 1 docstring.py:1:1: I002 [*] Missing required import: `from __future__ import generator_stop` - | -1 | """Hello, world!""" - | I002 -2 | -3 | x = 1 - | - = help: Insert required import: `from __future__ import generator_stop` - ℹ Safe fix 1 1 | """Hello, world!""" 2 |+from __future__ import generator_stop 2 3 | 3 4 | x = 1 - - diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_comment.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_comment.py.snap index 76bb967872894..313ec7cbb467d 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_comment.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_comment.py.snap @@ -2,18 +2,8 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- comment.py:1:1: I002 [*] Missing required import: `from __future__ import annotations` - | -1 | #!/usr/bin/env python3 - | I002 -2 | -3 | x = 1 - | - = help: Insert required import: `from __future__ import annotations` - ℹ Safe fix 1 1 | #!/usr/bin/env python3 2 |+from __future__ import annotations 2 3 | 3 4 | x = 1 - - diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_comments_and_newlines.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_comments_and_newlines.py.snap index 9210bc3fdf662..c5d92854a2864 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_comments_and_newlines.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_comments_and_newlines.py.snap @@ -2,13 +2,6 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- comments_and_newlines.py:1:1: I002 [*] Missing required import: `from __future__ import annotations` - | -1 | #!/usr/bin/env python3 - | I002 -2 | # A copyright notice could go here - | - = help: Insert required import: `from __future__ import annotations` - ℹ Safe fix 2 2 | # A copyright notice could go here 3 3 | @@ -16,5 +9,3 @@ comments_and_newlines.py:1:1: I002 [*] Missing required import: `from __future__ 5 |+from __future__ import annotations 5 6 | 6 7 | x = 1 - - diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_docstring.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_docstring.py.snap index 78771df79887b..4a513546859a8 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_docstring.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_docstring.py.snap @@ -2,18 +2,8 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- docstring.py:1:1: I002 [*] Missing required import: `from __future__ import annotations` - | -1 | """Hello, world!""" - | I002 -2 | -3 | x = 1 - | - = help: Insert required import: `from __future__ import annotations` - ℹ Safe fix 1 1 | """Hello, world!""" 2 |+from __future__ import annotations 2 3 | 3 4 | x = 1 - - diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_docstring_with_continuation.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_docstring_with_continuation.py.snap index b0f38f5a40c5f..c48ef63610db9 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_docstring_with_continuation.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_docstring_with_continuation.py.snap @@ -2,16 +2,7 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- docstring_with_continuation.py:1:1: I002 [*] Missing required import: `from __future__ import annotations` - | -1 | """Hello, world!"""; x = \ - | I002 -2 | 1; y = 2 - | - = help: Insert required import: `from __future__ import annotations` - ℹ Safe fix 1 |-"""Hello, world!"""; x = \ 1 |+"""Hello, world!"""; from __future__ import annotations; x = \ 2 2 | 1; y = 2 - - diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_docstring_with_semicolon.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_docstring_with_semicolon.py.snap index 7f8b98bb616a7..dfd35beb25140 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_docstring_with_semicolon.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_docstring_with_semicolon.py.snap @@ -2,14 +2,6 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- docstring_with_semicolon.py:1:1: I002 [*] Missing required import: `from __future__ import annotations` - | -1 | """Hello, world!"""; x = 1 - | I002 - | - = help: Insert required import: `from __future__ import annotations` - ℹ Safe fix 1 |-"""Hello, world!"""; x = 1 1 |+"""Hello, world!"""; from __future__ import annotations; x = 1 - - diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_existing_import.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_existing_import.py.snap index 6463cebb8809d..12ff6dbd5cc02 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_existing_import.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_existing_import.py.snap @@ -2,16 +2,7 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- existing_import.py:1:1: I002 [*] Missing required import: `from __future__ import annotations` - | -1 | from __future__ import generator_stop - | I002 -2 | import os - | - = help: Insert required import: `from __future__ import annotations` - ℹ Safe fix 1 |+from __future__ import annotations 1 2 | from __future__ import generator_stop 2 3 | import os - - diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_multiline_docstring.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_multiline_docstring.py.snap index 506a89181733b..18e6b94876b25 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_multiline_docstring.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_multiline_docstring.py.snap @@ -2,19 +2,9 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- multiline_docstring.py:1:1: I002 [*] Missing required import: `from __future__ import annotations` - | -1 | """a - | I002 -2 | b""" -3 | # b - | - = help: Insert required import: `from __future__ import annotations` - ℹ Safe fix 1 1 | """a 2 2 | b""" 3 3 | # b 4 |+from __future__ import annotations 4 5 | import os - - diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_off.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_off.py.snap index c49aa309b89aa..5107b912908db 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_off.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_off.py.snap @@ -2,19 +2,9 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- off.py:1:1: I002 [*] Missing required import: `from __future__ import annotations` - | -1 | # isort: off - | I002 -2 | -3 | x = 1 - | - = help: Insert required import: `from __future__ import annotations` - ℹ Safe fix 1 1 | # isort: off 2 |+from __future__ import annotations 2 3 | 3 4 | x = 1 4 5 | # isort: on - - diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_comment.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_comment.py.snap index c3562e1031188..ea3f16c36b1e7 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_comment.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_comment.py.snap @@ -2,18 +2,8 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- comment.py:1:1: I002 [*] Missing required import: `from __future__ import annotations as _annotations` - | -1 | #!/usr/bin/env python3 - | I002 -2 | -3 | x = 1 - | - = help: Insert required import: `from __future__ import annotations as _annotations` - ℹ Safe fix 1 1 | #!/usr/bin/env python3 2 |+from __future__ import annotations as _annotations 2 3 | 3 4 | x = 1 - - diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_comments_and_newlines.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_comments_and_newlines.py.snap index 4d8a6d08f4fb9..509094af63e6a 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_comments_and_newlines.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_comments_and_newlines.py.snap @@ -2,13 +2,6 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- comments_and_newlines.py:1:1: I002 [*] Missing required import: `from __future__ import annotations as _annotations` - | -1 | #!/usr/bin/env python3 - | I002 -2 | # A copyright notice could go here - | - = help: Insert required import: `from __future__ import annotations as _annotations` - ℹ Safe fix 2 2 | # A copyright notice could go here 3 3 | @@ -16,5 +9,3 @@ comments_and_newlines.py:1:1: I002 [*] Missing required import: `from __future__ 5 |+from __future__ import annotations as _annotations 5 6 | 6 7 | x = 1 - - diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_docstring.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_docstring.py.snap index 4da75d80e387e..21c36c4e30461 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_docstring.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_docstring.py.snap @@ -2,18 +2,8 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- docstring.py:1:1: I002 [*] Missing required import: `from __future__ import annotations as _annotations` - | -1 | """Hello, world!""" - | I002 -2 | -3 | x = 1 - | - = help: Insert required import: `from __future__ import annotations as _annotations` - ℹ Safe fix 1 1 | """Hello, world!""" 2 |+from __future__ import annotations as _annotations 2 3 | 3 4 | x = 1 - - diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_docstring_with_continuation.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_docstring_with_continuation.py.snap index 0c09ca2fdeba7..0a40adb35a58c 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_docstring_with_continuation.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_docstring_with_continuation.py.snap @@ -2,16 +2,7 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- docstring_with_continuation.py:1:1: I002 [*] Missing required import: `from __future__ import annotations as _annotations` - | -1 | """Hello, world!"""; x = \ - | I002 -2 | 1; y = 2 - | - = help: Insert required import: `from __future__ import annotations as _annotations` - ℹ Safe fix 1 |-"""Hello, world!"""; x = \ 1 |+"""Hello, world!"""; from __future__ import annotations as _annotations; x = \ 2 2 | 1; y = 2 - - diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_docstring_with_semicolon.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_docstring_with_semicolon.py.snap index 8b9d317851742..3c61e64a8ba79 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_docstring_with_semicolon.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_docstring_with_semicolon.py.snap @@ -2,14 +2,6 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- docstring_with_semicolon.py:1:1: I002 [*] Missing required import: `from __future__ import annotations as _annotations` - | -1 | """Hello, world!"""; x = 1 - | I002 - | - = help: Insert required import: `from __future__ import annotations as _annotations` - ℹ Safe fix 1 |-"""Hello, world!"""; x = 1 1 |+"""Hello, world!"""; from __future__ import annotations as _annotations; x = 1 - - diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_existing_import.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_existing_import.py.snap index b7b33620be67e..96e891413b4af 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_existing_import.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_existing_import.py.snap @@ -2,16 +2,7 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- existing_import.py:1:1: I002 [*] Missing required import: `from __future__ import annotations as _annotations` - | -1 | from __future__ import generator_stop - | I002 -2 | import os - | - = help: Insert required import: `from __future__ import annotations as _annotations` - ℹ Safe fix 1 |+from __future__ import annotations as _annotations 1 2 | from __future__ import generator_stop 2 3 | import os - - diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_multiline_docstring.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_multiline_docstring.py.snap index 77fb0f6fb2f88..6426ab3898496 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_multiline_docstring.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_multiline_docstring.py.snap @@ -2,19 +2,9 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- multiline_docstring.py:1:1: I002 [*] Missing required import: `from __future__ import annotations as _annotations` - | -1 | """a - | I002 -2 | b""" -3 | # b - | - = help: Insert required import: `from __future__ import annotations as _annotations` - ℹ Safe fix 1 1 | """a 2 2 | b""" 3 3 | # b 4 |+from __future__ import annotations as _annotations 4 5 | import os - - diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_off.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_off.py.snap index 94781ad81cd76..4387774dddd69 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_off.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_import_with_alias_off.py.snap @@ -2,19 +2,9 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- off.py:1:1: I002 [*] Missing required import: `from __future__ import annotations as _annotations` - | -1 | # isort: off - | I002 -2 | -3 | x = 1 - | - = help: Insert required import: `from __future__ import annotations as _annotations` - ℹ Safe fix 1 1 | # isort: off 2 |+from __future__ import annotations as _annotations 2 3 | 3 4 | x = 1 4 5 | # isort: on - - diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_imports_docstring.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_imports_docstring.py.snap index 3d79baab3d6f2..d65d89b7038d5 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_imports_docstring.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__required_imports_docstring.py.snap @@ -2,14 +2,6 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- docstring.py:1:1: I002 [*] Missing required import: `from __future__ import annotations` - | -1 | """Hello, world!""" - | I002 -2 | -3 | x = 1 - | - = help: Insert required import: `from __future__ import annotations` - ℹ Safe fix 1 1 | """Hello, world!""" 2 |+from __future__ import annotations @@ -17,18 +9,8 @@ docstring.py:1:1: I002 [*] Missing required import: `from __future__ import anno 3 4 | x = 1 docstring.py:1:1: I002 [*] Missing required import: `from __future__ import generator_stop` - | -1 | """Hello, world!""" - | I002 -2 | -3 | x = 1 - | - = help: Insert required import: `from __future__ import generator_stop` - ℹ Safe fix 1 1 | """Hello, world!""" 2 |+from __future__ import generator_stop 2 3 | 3 4 | x = 1 - - diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__straight_required_import_docstring.py.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__straight_required_import_docstring.py.snap index b129e46c50199..6ce4357615da8 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__straight_required_import_docstring.py.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__straight_required_import_docstring.py.snap @@ -2,18 +2,8 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- docstring.py:1:1: I002 [*] Missing required import: `import os` - | -1 | """Hello, world!""" - | I002 -2 | -3 | x = 1 - | - = help: Insert required import: `import os` - ℹ Safe fix 1 1 | """Hello, world!""" 2 |+import os 2 3 | 3 4 | x = 1 - - diff --git a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__straight_required_import_docstring.pyi.snap b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__straight_required_import_docstring.pyi.snap index 9463d6dab32e1..9c789cb79e5e0 100644 --- a/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__straight_required_import_docstring.pyi.snap +++ b/crates/ruff_linter/src/rules/isort/snapshots/ruff_linter__rules__isort__tests__straight_required_import_docstring.pyi.snap @@ -2,18 +2,8 @@ source: crates/ruff_linter/src/rules/isort/mod.rs --- docstring.pyi:1:1: I002 [*] Missing required import: `import os` - | -1 | """Hello, world!""" - | I002 -2 | -3 | x = 1 - | - = help: Insert required import: `import os` - ℹ Safe fix 1 1 | """Hello, world!""" 2 |+import os 2 3 | 3 4 | x = 1 - - diff --git a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__MODULE____init__.py.snap b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__MODULE____init__.py.snap index a6d10e366b43f..d1796d8cb20cb 100644 --- a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__MODULE____init__.py.snap +++ b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__MODULE____init__.py.snap @@ -2,7 +2,3 @@ source: crates/ruff_linter/src/rules/pep8_naming/mod.rs --- __init__.py:1:1: N999 Invalid module name: 'MODULE' - | - | - - diff --git a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__invalid_name__0001_initial.py.snap b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__invalid_name__0001_initial.py.snap index b23ee6372bc3c..b173f1cdd9bc3 100644 --- a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__invalid_name__0001_initial.py.snap +++ b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__invalid_name__0001_initial.py.snap @@ -2,7 +2,3 @@ source: crates/ruff_linter/src/rules/pep8_naming/mod.rs --- 0001_initial.py:1:1: N999 Invalid module name: '0001_initial' - | - | - - diff --git a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__invalid_name__import.py.snap b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__invalid_name__import.py.snap index 025eda7263b07..ba4c79f6d565a 100644 --- a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__invalid_name__import.py.snap +++ b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__invalid_name__import.py.snap @@ -2,7 +2,3 @@ source: crates/ruff_linter/src/rules/pep8_naming/mod.rs --- import.py:1:1: N999 Invalid module name: 'import' - | - | - - diff --git a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__mod with spaces____init__.py.snap b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__mod with spaces____init__.py.snap index ea610ef580c8c..9a3176db8085a 100644 --- a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__mod with spaces____init__.py.snap +++ b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__mod with spaces____init__.py.snap @@ -2,7 +2,3 @@ source: crates/ruff_linter/src/rules/pep8_naming/mod.rs --- __init__.py:1:1: N999 Invalid module name: 'mod with spaces' - | - | - - diff --git a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__mod-with-dashes____init__.py.snap b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__mod-with-dashes____init__.py.snap index cda914441c947..f9bd14831bf9f 100644 --- a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__mod-with-dashes____init__.py.snap +++ b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__mod-with-dashes____init__.py.snap @@ -2,7 +2,3 @@ source: crates/ruff_linter/src/rules/pep8_naming/mod.rs --- __init__.py:1:1: N999 Invalid module name: 'mod-with-dashes' - | - | - - diff --git a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__valid_name__file-with-dashes.py.snap b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__valid_name__file-with-dashes.py.snap index 5ac41aed6edd6..06a6465c6195d 100644 --- a/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__valid_name__file-with-dashes.py.snap +++ b/crates/ruff_linter/src/rules/pep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__N999_N999__module__valid_name__file-with-dashes.py.snap @@ -2,7 +2,3 @@ source: crates/ruff_linter/src/rules/pep8_naming/mod.rs --- file-with-dashes.py:1:1: N999 Invalid module name: 'file-with-dashes' - | - | - - diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D100_D.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D100_D.py.snap index 2a12cdc327b67..6f91c05384df3 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D100_D.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D100_D.py.snap @@ -2,11 +2,3 @@ source: crates/ruff_linter/src/rules/pydocstyle/mod.rs --- D.py:1:1: D100 Missing docstring in public module - | -1 | # No docstring, so we can test D100 - | D100 -2 | from functools import wraps -3 | import os - | - - diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D100__unrelated__pkg__D100_pub.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D100__unrelated__pkg__D100_pub.py.snap index 6ed4a35eac64e..0d611a61a2af4 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D100__unrelated__pkg__D100_pub.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D100__unrelated__pkg__D100_pub.py.snap @@ -2,7 +2,3 @@ source: crates/ruff_linter/src/rules/pydocstyle/mod.rs --- D100_pub.py:1:1: D100 Missing docstring in public module - | - | - - diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D104_D104____init__.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D104_D104____init__.py.snap index 963470d0330fc..5885932f5bacb 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D104_D104____init__.py.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D104_D104____init__.py.snap @@ -2,7 +2,3 @@ source: crates/ruff_linter/src/rules/pydocstyle/mod.rs --- __init__.py:1:1: D104 Missing docstring in public package - | - | - - diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__all.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__all.snap index 6aad9dcce6e7d..8ab522d0216b3 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__all.snap +++ b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__all.snap @@ -2,12 +2,6 @@ source: crates/ruff_linter/src/rules/pydocstyle/mod.rs --- all.py:1:1: D100 Missing docstring in public module - | -1 | def public_func(): - | D100 -2 | pass - | - all.py:1:5: D103 Missing docstring in public function | 1 | def public_func(): @@ -30,5 +24,3 @@ all.py:10:11: D106 Missing docstring in public nested class | ^^^^^^^^^^^^^^^^^ D106 11 | pass | - -