From e24d855816f993f4e669a6a9eedfcab710c8d348 Mon Sep 17 00:00:00 2001 From: Evan Rittenhouse Date: Thu, 15 Jun 2023 14:45:47 -0500 Subject: [PATCH 1/2] Add Applicability to flake8_quotes fixes --- .../rules/flake8_quotes/rules/from_tokens.rs | 26 +++++-------------- ...ing_doubles_over_docstring_doubles.py.snap | 10 +++---- ...ubles_over_docstring_doubles_class.py.snap | 4 +-- ...es_over_docstring_doubles_function.py.snap | 10 +++---- ...docstring_doubles_module_multiline.py.snap | 4 +-- ...ocstring_doubles_module_singleline.py.snap | 4 +-- ...ing_doubles_over_docstring_singles.py.snap | 6 ++--- ...ubles_over_docstring_singles_class.py.snap | 6 ++--- ...es_over_docstring_singles_function.py.snap | 6 ++--- ...docstring_singles_module_multiline.py.snap | 2 +- ...ocstring_singles_module_singleline.py.snap | 2 +- ...ing_singles_over_docstring_doubles.py.snap | 6 ++--- ...ngles_over_docstring_doubles_class.py.snap | 6 ++--- ...es_over_docstring_doubles_function.py.snap | 6 ++--- ...docstring_doubles_module_multiline.py.snap | 2 +- ...ocstring_doubles_module_singleline.py.snap | 2 +- ...ing_singles_over_docstring_singles.py.snap | 12 ++++----- ...ngles_over_docstring_singles_class.py.snap | 4 +-- ...es_over_docstring_singles_function.py.snap | 10 +++---- ...docstring_singles_module_multiline.py.snap | 4 +-- ...ocstring_singles_module_singleline.py.snap | 4 +-- ...ests__require_doubles_over_singles.py.snap | 6 ++--- ...quire_doubles_over_singles_escaped.py.snap | 4 +-- ...uire_doubles_over_singles_implicit.py.snap | 14 +++++----- ...bles_over_singles_multiline_string.py.snap | 2 +- ...ests__require_singles_over_doubles.py.snap | 6 ++--- ...quire_singles_over_doubles_escaped.py.snap | 6 ++--- ...uire_singles_over_doubles_implicit.py.snap | 14 +++++----- ...gles_over_doubles_multiline_string.py.snap | 2 +- 29 files changed, 88 insertions(+), 102 deletions(-) diff --git a/crates/ruff/src/rules/flake8_quotes/rules/from_tokens.rs b/crates/ruff/src/rules/flake8_quotes/rules/from_tokens.rs index 87e9e8651c0c8..77c8e35788b92 100644 --- a/crates/ruff/src/rules/flake8_quotes/rules/from_tokens.rs +++ b/crates/ruff/src/rules/flake8_quotes/rules/from_tokens.rs @@ -284,11 +284,7 @@ fn docstring(locator: &Locator, range: TextRange, settings: &Settings) -> Option fixed_contents.push_str("e); fixed_contents.push_str(string_contents); fixed_contents.push_str("e); - #[allow(deprecated)] - diagnostic.set_fix(Fix::unspecified(Edit::range_replacement( - fixed_contents, - range, - ))); + diagnostic.set_fix(Fix::manual(Edit::range_replacement(fixed_contents, range))); } Some(diagnostic) } @@ -358,11 +354,7 @@ fn strings(locator: &Locator, sequence: &[TextRange], settings: &Settings) -> Ve fixed_contents.push_str(quote); fixed_contents.push_str(string_contents); fixed_contents.push_str(quote); - #[allow(deprecated)] - diagnostic.set_fix(Fix::unspecified(Edit::range_replacement( - fixed_contents, - *range, - ))); + diagnostic.set_fix(Fix::manual(Edit::range_replacement(fixed_contents, *range))); } diagnostics.push(diagnostic); } else { @@ -425,11 +417,8 @@ fn strings(locator: &Locator, sequence: &[TextRange], settings: &Settings) -> Ve fixed_contents.push(quote); - #[allow(deprecated)] - diagnostic.set_fix(Fix::unspecified(Edit::range_replacement( - fixed_contents, - *range, - ))); + diagnostic + .set_fix(Fix::manual(Edit::range_replacement(fixed_contents, *range))); } diagnostics.push(diagnostic); } @@ -452,11 +441,8 @@ fn strings(locator: &Locator, sequence: &[TextRange], settings: &Settings) -> Ve fixed_contents.push(quote); fixed_contents.push_str(string_contents); fixed_contents.push(quote); - #[allow(deprecated)] - diagnostic.set_fix(Fix::unspecified(Edit::range_replacement( - fixed_contents, - *range, - ))); + diagnostic + .set_fix(Fix::manual(Edit::range_replacement(fixed_contents, *range))); } diagnostics.push(diagnostic); } diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles.py.snap index 56a74f2ee0775..fdd88c868beac 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles.py.snap @@ -14,7 +14,7 @@ docstring_doubles.py:5:1: Q001 [*] Double quote multiline found but single quote | = help: Replace double multiline quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 2 2 | Double quotes multiline module docstring 3 3 | """ 4 4 | @@ -41,7 +41,7 @@ docstring_doubles.py:16:5: Q001 [*] Double quote multiline found but single quot | = help: Replace double multiline quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 13 13 | Double quotes multiline class docstring 14 14 | """ 15 15 | @@ -66,7 +66,7 @@ docstring_doubles.py:21:21: Q001 [*] Double quote multiline found but single quo | = help: Replace double multiline quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 18 18 | """ 19 19 | 20 20 | # The colon in the list indexing below is an edge case for the docstring scanner @@ -92,7 +92,7 @@ docstring_doubles.py:30:9: Q001 [*] Double quote multiline found but single quot | = help: Replace double multiline quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 27 27 | 28 28 | some_expression = 'hello world' 29 29 | @@ -117,7 +117,7 @@ docstring_doubles.py:35:13: Q001 [*] Double quote multiline found but single quo | = help: Replace double multiline quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 32 32 | """ 33 33 | 34 34 | if l: diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_class.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_class.py.snap index 39bbce6bb649a..8ffce1723deec 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_class.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_class.py.snap @@ -12,7 +12,7 @@ docstring_doubles_class.py:3:5: Q001 [*] Double quote multiline found but single | = help: Replace double multiline quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 1 1 | class SingleLineDocstrings(): 2 2 | """ Double quotes single line class docstring """ 3 |- """ Not a docstring """ @@ -32,7 +32,7 @@ docstring_doubles_class.py:5:23: Q001 [*] Double quote multiline found but singl | = help: Replace double multiline quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 2 2 | """ Double quotes single line class docstring """ 3 3 | """ Not a docstring """ 4 4 | diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_function.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_function.py.snap index 8116a793715b0..ccc02077423ec 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_function.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_function.py.snap @@ -11,7 +11,7 @@ docstring_doubles_function.py:3:5: Q001 [*] Double quote multiline found but sin | = help: Replace double multiline quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 1 1 | def foo(): 2 2 | """function without params, single line docstring""" 3 |- """ not a docstring""" @@ -30,7 +30,7 @@ docstring_doubles_function.py:11:5: Q001 [*] Double quote multiline found but si | = help: Replace double multiline quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 8 8 | """ 9 9 | function without params, multiline docstring 10 10 | """ @@ -51,7 +51,7 @@ docstring_doubles_function.py:15:39: Q001 [*] Double quote multiline found but s | = help: Replace double multiline quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 12 12 | return 13 13 | 14 14 | @@ -74,7 +74,7 @@ docstring_doubles_function.py:17:5: Q001 [*] Double quote multiline found but si | = help: Replace double multiline quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 14 14 | 15 15 | def fun_with_params_no_docstring(a, b=""" 16 16 | not a @@ -93,7 +93,7 @@ docstring_doubles_function.py:22:5: Q001 [*] Double quote multiline found but si | = help: Replace double multiline quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 19 19 | 20 20 | 21 21 | def fun_with_params_no_docstring2(a, b=c[foo():], c=\ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap index 83e43cece81cb..ee424752a922d 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap @@ -14,7 +14,7 @@ docstring_doubles_module_multiline.py:4:1: Q001 [*] Double quote multiline found | = help: Replace double multiline quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 1 1 | """ 2 2 | Double quotes multiline module docstring 3 3 | """ @@ -38,7 +38,7 @@ docstring_doubles_module_multiline.py:9:1: Q001 [*] Double quote multiline found | = help: Replace double multiline quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 6 6 | """ 7 7 | def foo(): 8 8 | pass diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap index 2b1e4c9f7b0bd..f874db3196149 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap @@ -11,7 +11,7 @@ docstring_doubles_module_singleline.py:2:1: Q001 [*] Double quote multiline foun | = help: Replace double multiline quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 1 1 | """ Double quotes singleline module docstring """ 2 |-""" this is not a docstring """ 2 |+''' this is not a docstring ''' @@ -28,7 +28,7 @@ docstring_doubles_module_singleline.py:6:1: Q001 [*] Double quote multiline foun | = help: Replace double multiline quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 3 3 | 4 4 | def foo(): 5 5 | pass diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles.py.snap index 5b500bfc981c3..002882e13e99a 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles.py.snap @@ -12,7 +12,7 @@ docstring_singles.py:1:1: Q002 [*] Single quote docstring found but double quote | = help: Replace single quotes docstring with double quotes -ℹ Suggested fix +ℹ Possible fix 1 |-''' 1 |+""" 2 2 | Single quotes multiline module docstring @@ -36,7 +36,7 @@ docstring_singles.py:14:5: Q002 [*] Single quote docstring found but double quot | = help: Replace single quotes docstring with double quotes -ℹ Suggested fix +ℹ Possible fix 11 11 | class Cls(MakeKlass(''' 12 12 | class params \t not a docstring 13 13 | ''')): @@ -63,7 +63,7 @@ docstring_singles.py:26:9: Q002 [*] Single quote docstring found but double quot | = help: Replace single quotes docstring with double quotes -ℹ Suggested fix +ℹ Possible fix 23 23 | def f(self, bar=''' 24 24 | definitely not a docstring''', 25 25 | val=l[Cls():3]): diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap index 1ff2255082f08..81dfe60689b14 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap @@ -10,7 +10,7 @@ docstring_singles_class.py:2:5: Q002 [*] Single quote docstring found but double | = help: Replace single quotes docstring with double quotes -ℹ Suggested fix +ℹ Possible fix 1 1 | class SingleLineDocstrings(): 2 |- ''' Double quotes single line class docstring ''' 2 |+ """ Double quotes single line class docstring """ @@ -27,7 +27,7 @@ docstring_singles_class.py:6:9: Q002 [*] Single quote docstring found but double | = help: Replace single quotes docstring with double quotes -ℹ Suggested fix +ℹ Possible fix 3 3 | ''' Not a docstring ''' 4 4 | 5 5 | def foo(self, bar='''not a docstring'''): @@ -46,7 +46,7 @@ docstring_singles_class.py:9:29: Q002 [*] Single quote docstring found but doubl | = help: Replace single quotes docstring with double quotes -ℹ Suggested fix +ℹ Possible fix 6 6 | ''' Double quotes single line method docstring''' 7 7 | pass 8 8 | diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap index b0065abd9974f..196c61eaaea4e 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap @@ -11,7 +11,7 @@ docstring_singles_function.py:2:5: Q002 [*] Single quote docstring found but dou | = help: Replace single quotes docstring with double quotes -ℹ Suggested fix +ℹ Possible fix 1 1 | def foo(): 2 |- '''function without params, single line docstring''' 2 |+ """function without params, single line docstring""" @@ -32,7 +32,7 @@ docstring_singles_function.py:8:5: Q002 [*] Single quote docstring found but dou | = help: Replace single quotes docstring with double quotes -ℹ Suggested fix +ℹ Possible fix 5 5 | 6 6 | 7 7 | def foo2(): @@ -53,7 +53,7 @@ docstring_singles_function.py:27:5: Q002 [*] Single quote docstring found but do | = help: Replace single quotes docstring with double quotes -ℹ Suggested fix +ℹ Possible fix 24 24 | 25 25 | 26 26 | def function_with_single_docstring(a): diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_multiline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_multiline.py.snap index a4858db55df13..f593ef5690761 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_multiline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_multiline.py.snap @@ -12,7 +12,7 @@ docstring_singles_module_multiline.py:1:1: Q002 [*] Single quote docstring found | = help: Replace single quotes docstring with double quotes -ℹ Suggested fix +ℹ Possible fix 1 |-''' 1 |+""" 2 2 | Double quotes multiline module docstring diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_singleline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_singleline.py.snap index b6f815e5e1783..dc2e625dd7d8e 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_singleline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_singleline.py.snap @@ -9,7 +9,7 @@ docstring_singles_module_singleline.py:1:1: Q002 [*] Single quote docstring foun | = help: Replace single quotes docstring with double quotes -ℹ Suggested fix +ℹ Possible fix 1 |-''' Double quotes singleline module docstring ''' 1 |+""" Double quotes singleline module docstring """ 2 2 | ''' this is not a docstring ''' diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles.py.snap index 60352254df933..32b69db72134e 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles.py.snap @@ -12,7 +12,7 @@ docstring_doubles.py:1:1: Q002 [*] Double quote docstring found but single quote | = help: Replace double quotes docstring with single quotes -ℹ Suggested fix +ℹ Possible fix 1 |-""" 1 |+''' 2 2 | Double quotes multiline module docstring @@ -35,7 +35,7 @@ docstring_doubles.py:12:5: Q002 [*] Double quote docstring found but single quot | = help: Replace double quotes docstring with single quotes -ℹ Suggested fix +ℹ Possible fix 9 9 | l = [] 10 10 | 11 11 | class Cls: @@ -62,7 +62,7 @@ docstring_doubles.py:24:9: Q002 [*] Double quote docstring found but single quot | = help: Replace double quotes docstring with single quotes -ℹ Suggested fix +ℹ Possible fix 21 21 | def f(self, bar=""" 22 22 | definitely not a docstring""", 23 23 | val=l[Cls():3]): diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap index 743b6d652581a..86d182ded1add 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap @@ -10,7 +10,7 @@ docstring_doubles_class.py:2:5: Q002 [*] Double quote docstring found but single | = help: Replace double quotes docstring with single quotes -ℹ Suggested fix +ℹ Possible fix 1 1 | class SingleLineDocstrings(): 2 |- """ Double quotes single line class docstring """ 2 |+ ''' Double quotes single line class docstring ''' @@ -27,7 +27,7 @@ docstring_doubles_class.py:6:9: Q002 [*] Double quote docstring found but single | = help: Replace double quotes docstring with single quotes -ℹ Suggested fix +ℹ Possible fix 3 3 | """ Not a docstring """ 4 4 | 5 5 | def foo(self, bar="""not a docstring"""): @@ -46,7 +46,7 @@ docstring_doubles_class.py:9:29: Q002 [*] Double quote docstring found but singl | = help: Replace double quotes docstring with single quotes -ℹ Suggested fix +ℹ Possible fix 6 6 | """ Double quotes single line method docstring""" 7 7 | pass 8 8 | diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap index 87d3c0c358937..521bf3a4cd1ba 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap @@ -11,7 +11,7 @@ docstring_doubles_function.py:2:5: Q002 [*] Double quote docstring found but sin | = help: Replace double quotes docstring with single quotes -ℹ Suggested fix +ℹ Possible fix 1 1 | def foo(): 2 |- """function without params, single line docstring""" 2 |+ '''function without params, single line docstring''' @@ -32,7 +32,7 @@ docstring_doubles_function.py:8:5: Q002 [*] Double quote docstring found but sin | = help: Replace double quotes docstring with single quotes -ℹ Suggested fix +ℹ Possible fix 5 5 | 6 6 | 7 7 | def foo2(): @@ -53,7 +53,7 @@ docstring_doubles_function.py:27:5: Q002 [*] Double quote docstring found but si | = help: Replace double quotes docstring with single quotes -ℹ Suggested fix +ℹ Possible fix 24 24 | 25 25 | 26 26 | def function_with_single_docstring(a): diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_multiline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_multiline.py.snap index 4a4a7d27dc82a..ea5caf8245b42 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_multiline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_multiline.py.snap @@ -12,7 +12,7 @@ docstring_doubles_module_multiline.py:1:1: Q002 [*] Double quote docstring found | = help: Replace double quotes docstring with single quotes -ℹ Suggested fix +ℹ Possible fix 1 |-""" 1 |+''' 2 2 | Double quotes multiline module docstring diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_singleline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_singleline.py.snap index ba51829241ae5..5b844cbbc87fa 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_singleline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_singleline.py.snap @@ -9,7 +9,7 @@ docstring_doubles_module_singleline.py:1:1: Q002 [*] Double quote docstring foun | = help: Replace double quotes docstring with single quotes -ℹ Suggested fix +ℹ Possible fix 1 |-""" Double quotes singleline module docstring """ 1 |+''' Double quotes singleline module docstring ''' 2 2 | """ this is not a docstring """ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles.py.snap index 8724ea381aa00..f2acc38880104 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles.py.snap @@ -14,7 +14,7 @@ docstring_singles.py:5:1: Q001 [*] Single quote multiline found but double quote | = help: Replace single multiline quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 2 2 | Single quotes multiline module docstring 3 3 | ''' 4 4 | @@ -41,7 +41,7 @@ docstring_singles.py:11:21: Q001 [*] Single quote multiline found but double quo | = help: Replace single multiline quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 8 8 | 9 9 | l = [] 10 10 | @@ -68,7 +68,7 @@ docstring_singles.py:18:5: Q001 [*] Single quote multiline found but double quot | = help: Replace single multiline quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 15 15 | Single quotes multiline class docstring 16 16 | ''' 17 17 | @@ -93,7 +93,7 @@ docstring_singles.py:23:21: Q001 [*] Single quote multiline found but double quo | = help: Replace single multiline quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 20 20 | ''' 21 21 | 22 22 | # The colon in the list indexing below is an edge case for the docstring scanner @@ -119,7 +119,7 @@ docstring_singles.py:32:9: Q001 [*] Single quote multiline found but double quot | = help: Replace single multiline quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 29 29 | 30 30 | some_expression = 'hello world' 31 31 | @@ -144,7 +144,7 @@ docstring_singles.py:37:13: Q001 [*] Single quote multiline found but double quo | = help: Replace single multiline quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 34 34 | ''' 35 35 | 36 36 | if l: diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_class.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_class.py.snap index e8fc6da0e571b..488a567f242d8 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_class.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_class.py.snap @@ -12,7 +12,7 @@ docstring_singles_class.py:3:5: Q001 [*] Single quote multiline found but double | = help: Replace single multiline quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 1 1 | class SingleLineDocstrings(): 2 2 | ''' Double quotes single line class docstring ''' 3 |- ''' Not a docstring ''' @@ -32,7 +32,7 @@ docstring_singles_class.py:5:23: Q001 [*] Single quote multiline found but doubl | = help: Replace single multiline quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 2 2 | ''' Double quotes single line class docstring ''' 3 3 | ''' Not a docstring ''' 4 4 | diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_function.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_function.py.snap index 1c5f902f93aff..1748426747637 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_function.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_function.py.snap @@ -11,7 +11,7 @@ docstring_singles_function.py:3:5: Q001 [*] Single quote multiline found but dou | = help: Replace single multiline quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 1 1 | def foo(): 2 2 | '''function without params, single line docstring''' 3 |- ''' not a docstring''' @@ -30,7 +30,7 @@ docstring_singles_function.py:11:5: Q001 [*] Single quote multiline found but do | = help: Replace single multiline quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 8 8 | ''' 9 9 | function without params, multiline docstring 10 10 | ''' @@ -51,7 +51,7 @@ docstring_singles_function.py:15:39: Q001 [*] Single quote multiline found but d | = help: Replace single multiline quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 12 12 | return 13 13 | 14 14 | @@ -74,7 +74,7 @@ docstring_singles_function.py:17:5: Q001 [*] Single quote multiline found but do | = help: Replace single multiline quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 14 14 | 15 15 | def fun_with_params_no_docstring(a, b=''' 16 16 | not a @@ -93,7 +93,7 @@ docstring_singles_function.py:22:5: Q001 [*] Single quote multiline found but do | = help: Replace single multiline quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 19 19 | 20 20 | 21 21 | def fun_with_params_no_docstring2(a, b=c[foo():], c=\ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap index 6286084ba4897..4f241ff2e1375 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap @@ -14,7 +14,7 @@ docstring_singles_module_multiline.py:4:1: Q001 [*] Single quote multiline found | = help: Replace single multiline quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 1 1 | ''' 2 2 | Double quotes multiline module docstring 3 3 | ''' @@ -38,7 +38,7 @@ docstring_singles_module_multiline.py:9:1: Q001 [*] Single quote multiline found | = help: Replace single multiline quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 6 6 | ''' 7 7 | def foo(): 8 8 | pass diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap index 4b822211beb18..234153f6c22e2 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap @@ -11,7 +11,7 @@ docstring_singles_module_singleline.py:2:1: Q001 [*] Single quote multiline foun | = help: Replace single multiline quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 1 1 | ''' Double quotes singleline module docstring ''' 2 |-''' this is not a docstring ''' 2 |+""" this is not a docstring """ @@ -28,7 +28,7 @@ docstring_singles_module_singleline.py:6:1: Q001 [*] Single quote multiline foun | = help: Replace single multiline quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 3 3 | 4 4 | def foo(): 5 5 | pass diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles.py.snap index 7513bc9db0740..f32e2d8cec16c 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles.py.snap @@ -10,7 +10,7 @@ singles.py:1:25: Q000 [*] Single quotes found but double quotes preferred | = help: Replace single quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 1 |-this_should_be_linted = 'single quote string' 1 |+this_should_be_linted = "single quote string" 2 2 | this_should_be_linted = u'double quote string' @@ -27,7 +27,7 @@ singles.py:2:25: Q000 [*] Single quotes found but double quotes preferred | = help: Replace single quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 1 1 | this_should_be_linted = 'single quote string' 2 |-this_should_be_linted = u'double quote string' 2 |+this_should_be_linted = u"double quote string" @@ -44,7 +44,7 @@ singles.py:3:25: Q000 [*] Single quotes found but double quotes preferred | = help: Replace single quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 1 1 | this_should_be_linted = 'single quote string' 2 2 | this_should_be_linted = u'double quote string' 3 |-this_should_be_linted = f'double quote string' diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap index c78cedfe0af16..0d21cc6e72017 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap @@ -10,7 +10,7 @@ singles_escaped.py:1:26: Q003 [*] Change outer quotes to avoid escaping inner qu | = help: Change outer quotes to avoid escaping inner quotes -ℹ Suggested fix +ℹ Possible fix 1 |-this_should_raise_Q003 = "This is a \"string\"" 1 |+this_should_raise_Q003 = 'This is a "string"' 2 2 | this_is_fine = "'This' is a \"string\"" @@ -27,7 +27,7 @@ singles_escaped.py:9:5: Q003 [*] Change outer quotes to avoid escaping inner quo | = help: Change outer quotes to avoid escaping inner quotes -ℹ Suggested fix +ℹ Possible fix 6 6 | this_is_fine = R"This is a \"string\"" 7 7 | this_should_raise = ( 8 8 | "This is a" diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap index 23f7be19e5166..5e959d833a8f2 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap @@ -11,7 +11,7 @@ singles_implicit.py:2:5: Q000 [*] Single quotes found but double quotes preferre | = help: Replace single quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 1 1 | x = ( 2 |- 'This' 2 |+ "This" @@ -30,7 +30,7 @@ singles_implicit.py:3:5: Q000 [*] Single quotes found but double quotes preferre | = help: Replace single quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 1 1 | x = ( 2 2 | 'This' 3 |- 'is' @@ -49,7 +49,7 @@ singles_implicit.py:4:5: Q000 [*] Single quotes found but double quotes preferre | = help: Replace single quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 1 1 | x = ( 2 2 | 'This' 3 3 | 'is' @@ -69,7 +69,7 @@ singles_implicit.py:8:5: Q000 [*] Single quotes found but double quotes preferre | = help: Replace single quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 5 5 | ) 6 6 | 7 7 | x = ( @@ -90,7 +90,7 @@ singles_implicit.py:9:5: Q000 [*] Single quotes found but double quotes preferre | = help: Replace single quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 6 6 | 7 7 | x = ( 8 8 | 'This' \ @@ -110,7 +110,7 @@ singles_implicit.py:10:5: Q000 [*] Single quotes found but double quotes preferr | = help: Replace single quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 7 7 | x = ( 8 8 | 'This' \ 9 9 | 'is' \ @@ -129,7 +129,7 @@ singles_implicit.py:27:1: Q000 [*] Single quotes found but double quotes preferr | = help: Replace single quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 24 24 | 25 25 | if True: 26 26 | 'This can use "single" quotes' diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_multiline_string.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_multiline_string.py.snap index 8477c544b36fc..eab1465fb348f 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_multiline_string.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_multiline_string.py.snap @@ -13,7 +13,7 @@ singles_multiline_string.py:1:5: Q001 [*] Single quote multiline found but doubl | = help: Replace single multiline quotes with double quotes -ℹ Suggested fix +ℹ Possible fix 1 |-s = ''' This 'should' 1 |+s = """ This 'should' 2 2 | be diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles.py.snap index b7206b147ee5e..f65b7ab187cc3 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles.py.snap @@ -10,7 +10,7 @@ doubles.py:1:25: Q000 [*] Double quotes found but single quotes preferred | = help: Replace double quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 1 |-this_should_be_linted = "double quote string" 1 |+this_should_be_linted = 'double quote string' 2 2 | this_should_be_linted = u"double quote string" @@ -27,7 +27,7 @@ doubles.py:2:25: Q000 [*] Double quotes found but single quotes preferred | = help: Replace double quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 1 1 | this_should_be_linted = "double quote string" 2 |-this_should_be_linted = u"double quote string" 2 |+this_should_be_linted = u'double quote string' @@ -44,7 +44,7 @@ doubles.py:3:25: Q000 [*] Double quotes found but single quotes preferred | = help: Replace double quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 1 1 | this_should_be_linted = "double quote string" 2 2 | this_should_be_linted = u"double quote string" 3 |-this_should_be_linted = f"double quote string" diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap index 743d3219d33ad..38d6912827593 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap @@ -10,7 +10,7 @@ doubles_escaped.py:1:26: Q003 [*] Change outer quotes to avoid escaping inner qu | = help: Change outer quotes to avoid escaping inner quotes -ℹ Suggested fix +ℹ Possible fix 1 |-this_should_raise_Q003 = 'This is a \'string\'' 1 |+this_should_raise_Q003 = "This is a 'string'" 2 2 | this_should_raise_Q003 = 'This is \\ a \\\'string\'' @@ -27,7 +27,7 @@ doubles_escaped.py:2:26: Q003 [*] Change outer quotes to avoid escaping inner qu | = help: Change outer quotes to avoid escaping inner quotes -ℹ Suggested fix +ℹ Possible fix 1 1 | this_should_raise_Q003 = 'This is a \'string\'' 2 |-this_should_raise_Q003 = 'This is \\ a \\\'string\'' 2 |+this_should_raise_Q003 = "This is \\ a \\'string'" @@ -45,7 +45,7 @@ doubles_escaped.py:10:5: Q003 [*] Change outer quotes to avoid escaping inner qu | = help: Change outer quotes to avoid escaping inner quotes -ℹ Suggested fix +ℹ Possible fix 7 7 | this_is_fine = R'This is a \'string\'' 8 8 | this_should_raise = ( 9 9 | 'This is a' diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap index 6b1bb3c26ae74..5165dfd606231 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap @@ -11,7 +11,7 @@ doubles_implicit.py:2:5: Q000 [*] Double quotes found but single quotes preferre | = help: Replace double quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 1 1 | x = ( 2 |- "This" 2 |+ 'This' @@ -30,7 +30,7 @@ doubles_implicit.py:3:5: Q000 [*] Double quotes found but single quotes preferre | = help: Replace double quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 1 1 | x = ( 2 2 | "This" 3 |- "is" @@ -49,7 +49,7 @@ doubles_implicit.py:4:5: Q000 [*] Double quotes found but single quotes preferre | = help: Replace double quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 1 1 | x = ( 2 2 | "This" 3 3 | "is" @@ -69,7 +69,7 @@ doubles_implicit.py:8:5: Q000 [*] Double quotes found but single quotes preferre | = help: Replace double quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 5 5 | ) 6 6 | 7 7 | x = ( @@ -90,7 +90,7 @@ doubles_implicit.py:9:5: Q000 [*] Double quotes found but single quotes preferre | = help: Replace double quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 6 6 | 7 7 | x = ( 8 8 | "This" \ @@ -110,7 +110,7 @@ doubles_implicit.py:10:5: Q000 [*] Double quotes found but single quotes preferr | = help: Replace double quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 7 7 | x = ( 8 8 | "This" \ 9 9 | "is" \ @@ -129,7 +129,7 @@ doubles_implicit.py:27:1: Q000 [*] Double quotes found but single quotes preferr | = help: Replace double quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 24 24 | 25 25 | if True: 26 26 | "This can use 'double' quotes" diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_multiline_string.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_multiline_string.py.snap index 67502e94f227d..7ede1f44eceb1 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_multiline_string.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_multiline_string.py.snap @@ -13,7 +13,7 @@ doubles_multiline_string.py:1:5: Q001 [*] Double quote multiline found but singl | = help: Replace double multiline quotes with single quotes -ℹ Suggested fix +ℹ Possible fix 1 |-s = """ This "should" 1 |+s = ''' This "should" 2 2 | be From 963d2e2fd0de101f019bb49c2af0a5b56fa73b72 Mon Sep 17 00:00:00 2001 From: Evan Rittenhouse Date: Thu, 15 Jun 2023 15:32:47 -0500 Subject: [PATCH 2/2] Change from manual to automatic --- .../rules/flake8_quotes/rules/from_tokens.rs | 22 ++++++++++++++----- ...ing_doubles_over_docstring_doubles.py.snap | 10 ++++----- ...ubles_over_docstring_doubles_class.py.snap | 4 ++-- ...es_over_docstring_doubles_function.py.snap | 10 ++++----- ...docstring_doubles_module_multiline.py.snap | 4 ++-- ...ocstring_doubles_module_singleline.py.snap | 4 ++-- ...ing_doubles_over_docstring_singles.py.snap | 6 ++--- ...ubles_over_docstring_singles_class.py.snap | 6 ++--- ...es_over_docstring_singles_function.py.snap | 6 ++--- ...docstring_singles_module_multiline.py.snap | 2 +- ...ocstring_singles_module_singleline.py.snap | 2 +- ...ing_singles_over_docstring_doubles.py.snap | 6 ++--- ...ngles_over_docstring_doubles_class.py.snap | 6 ++--- ...es_over_docstring_doubles_function.py.snap | 6 ++--- ...docstring_doubles_module_multiline.py.snap | 2 +- ...ocstring_doubles_module_singleline.py.snap | 2 +- ...ing_singles_over_docstring_singles.py.snap | 12 +++++----- ...ngles_over_docstring_singles_class.py.snap | 4 ++-- ...es_over_docstring_singles_function.py.snap | 10 ++++----- ...docstring_singles_module_multiline.py.snap | 4 ++-- ...ocstring_singles_module_singleline.py.snap | 4 ++-- ...ests__require_doubles_over_singles.py.snap | 6 ++--- ...quire_doubles_over_singles_escaped.py.snap | 4 ++-- ...uire_doubles_over_singles_implicit.py.snap | 14 ++++++------ ...bles_over_singles_multiline_string.py.snap | 2 +- ...ests__require_singles_over_doubles.py.snap | 6 ++--- ...quire_singles_over_doubles_escaped.py.snap | 6 ++--- ...uire_singles_over_doubles_implicit.py.snap | 14 ++++++------ ...gles_over_doubles_multiline_string.py.snap | 2 +- 29 files changed, 98 insertions(+), 88 deletions(-) diff --git a/crates/ruff/src/rules/flake8_quotes/rules/from_tokens.rs b/crates/ruff/src/rules/flake8_quotes/rules/from_tokens.rs index 77c8e35788b92..6f0000e92c6da 100644 --- a/crates/ruff/src/rules/flake8_quotes/rules/from_tokens.rs +++ b/crates/ruff/src/rules/flake8_quotes/rules/from_tokens.rs @@ -284,7 +284,10 @@ fn docstring(locator: &Locator, range: TextRange, settings: &Settings) -> Option fixed_contents.push_str("e); fixed_contents.push_str(string_contents); fixed_contents.push_str("e); - diagnostic.set_fix(Fix::manual(Edit::range_replacement(fixed_contents, range))); + diagnostic.set_fix(Fix::automatic(Edit::range_replacement( + fixed_contents, + range, + ))); } Some(diagnostic) } @@ -354,7 +357,10 @@ fn strings(locator: &Locator, sequence: &[TextRange], settings: &Settings) -> Ve fixed_contents.push_str(quote); fixed_contents.push_str(string_contents); fixed_contents.push_str(quote); - diagnostic.set_fix(Fix::manual(Edit::range_replacement(fixed_contents, *range))); + diagnostic.set_fix(Fix::automatic(Edit::range_replacement( + fixed_contents, + *range, + ))); } diagnostics.push(diagnostic); } else { @@ -417,8 +423,10 @@ fn strings(locator: &Locator, sequence: &[TextRange], settings: &Settings) -> Ve fixed_contents.push(quote); - diagnostic - .set_fix(Fix::manual(Edit::range_replacement(fixed_contents, *range))); + diagnostic.set_fix(Fix::automatic(Edit::range_replacement( + fixed_contents, + *range, + ))); } diagnostics.push(diagnostic); } @@ -441,8 +449,10 @@ fn strings(locator: &Locator, sequence: &[TextRange], settings: &Settings) -> Ve fixed_contents.push(quote); fixed_contents.push_str(string_contents); fixed_contents.push(quote); - diagnostic - .set_fix(Fix::manual(Edit::range_replacement(fixed_contents, *range))); + diagnostic.set_fix(Fix::automatic(Edit::range_replacement( + fixed_contents, + *range, + ))); } diagnostics.push(diagnostic); } diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles.py.snap index fdd88c868beac..00664f27377a2 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles.py.snap @@ -14,7 +14,7 @@ docstring_doubles.py:5:1: Q001 [*] Double quote multiline found but single quote | = help: Replace double multiline quotes with single quotes -ℹ Possible fix +ℹ Fix 2 2 | Double quotes multiline module docstring 3 3 | """ 4 4 | @@ -41,7 +41,7 @@ docstring_doubles.py:16:5: Q001 [*] Double quote multiline found but single quot | = help: Replace double multiline quotes with single quotes -ℹ Possible fix +ℹ Fix 13 13 | Double quotes multiline class docstring 14 14 | """ 15 15 | @@ -66,7 +66,7 @@ docstring_doubles.py:21:21: Q001 [*] Double quote multiline found but single quo | = help: Replace double multiline quotes with single quotes -ℹ Possible fix +ℹ Fix 18 18 | """ 19 19 | 20 20 | # The colon in the list indexing below is an edge case for the docstring scanner @@ -92,7 +92,7 @@ docstring_doubles.py:30:9: Q001 [*] Double quote multiline found but single quot | = help: Replace double multiline quotes with single quotes -ℹ Possible fix +ℹ Fix 27 27 | 28 28 | some_expression = 'hello world' 29 29 | @@ -117,7 +117,7 @@ docstring_doubles.py:35:13: Q001 [*] Double quote multiline found but single quo | = help: Replace double multiline quotes with single quotes -ℹ Possible fix +ℹ Fix 32 32 | """ 33 33 | 34 34 | if l: diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_class.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_class.py.snap index 8ffce1723deec..1cac8d3b146a3 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_class.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_class.py.snap @@ -12,7 +12,7 @@ docstring_doubles_class.py:3:5: Q001 [*] Double quote multiline found but single | = help: Replace double multiline quotes with single quotes -ℹ Possible fix +ℹ Fix 1 1 | class SingleLineDocstrings(): 2 2 | """ Double quotes single line class docstring """ 3 |- """ Not a docstring """ @@ -32,7 +32,7 @@ docstring_doubles_class.py:5:23: Q001 [*] Double quote multiline found but singl | = help: Replace double multiline quotes with single quotes -ℹ Possible fix +ℹ Fix 2 2 | """ Double quotes single line class docstring """ 3 3 | """ Not a docstring """ 4 4 | diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_function.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_function.py.snap index ccc02077423ec..561aba67daa59 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_function.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_function.py.snap @@ -11,7 +11,7 @@ docstring_doubles_function.py:3:5: Q001 [*] Double quote multiline found but sin | = help: Replace double multiline quotes with single quotes -ℹ Possible fix +ℹ Fix 1 1 | def foo(): 2 2 | """function without params, single line docstring""" 3 |- """ not a docstring""" @@ -30,7 +30,7 @@ docstring_doubles_function.py:11:5: Q001 [*] Double quote multiline found but si | = help: Replace double multiline quotes with single quotes -ℹ Possible fix +ℹ Fix 8 8 | """ 9 9 | function without params, multiline docstring 10 10 | """ @@ -51,7 +51,7 @@ docstring_doubles_function.py:15:39: Q001 [*] Double quote multiline found but s | = help: Replace double multiline quotes with single quotes -ℹ Possible fix +ℹ Fix 12 12 | return 13 13 | 14 14 | @@ -74,7 +74,7 @@ docstring_doubles_function.py:17:5: Q001 [*] Double quote multiline found but si | = help: Replace double multiline quotes with single quotes -ℹ Possible fix +ℹ Fix 14 14 | 15 15 | def fun_with_params_no_docstring(a, b=""" 16 16 | not a @@ -93,7 +93,7 @@ docstring_doubles_function.py:22:5: Q001 [*] Double quote multiline found but si | = help: Replace double multiline quotes with single quotes -ℹ Possible fix +ℹ Fix 19 19 | 20 20 | 21 21 | def fun_with_params_no_docstring2(a, b=c[foo():], c=\ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap index ee424752a922d..dc6f5236d41f5 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap @@ -14,7 +14,7 @@ docstring_doubles_module_multiline.py:4:1: Q001 [*] Double quote multiline found | = help: Replace double multiline quotes with single quotes -ℹ Possible fix +ℹ Fix 1 1 | """ 2 2 | Double quotes multiline module docstring 3 3 | """ @@ -38,7 +38,7 @@ docstring_doubles_module_multiline.py:9:1: Q001 [*] Double quote multiline found | = help: Replace double multiline quotes with single quotes -ℹ Possible fix +ℹ Fix 6 6 | """ 7 7 | def foo(): 8 8 | pass diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap index f874db3196149..86ca4127b2bd6 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap @@ -11,7 +11,7 @@ docstring_doubles_module_singleline.py:2:1: Q001 [*] Double quote multiline foun | = help: Replace double multiline quotes with single quotes -ℹ Possible fix +ℹ Fix 1 1 | """ Double quotes singleline module docstring """ 2 |-""" this is not a docstring """ 2 |+''' this is not a docstring ''' @@ -28,7 +28,7 @@ docstring_doubles_module_singleline.py:6:1: Q001 [*] Double quote multiline foun | = help: Replace double multiline quotes with single quotes -ℹ Possible fix +ℹ Fix 3 3 | 4 4 | def foo(): 5 5 | pass diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles.py.snap index 002882e13e99a..2315b0b9f0bb0 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles.py.snap @@ -12,7 +12,7 @@ docstring_singles.py:1:1: Q002 [*] Single quote docstring found but double quote | = help: Replace single quotes docstring with double quotes -ℹ Possible fix +ℹ Fix 1 |-''' 1 |+""" 2 2 | Single quotes multiline module docstring @@ -36,7 +36,7 @@ docstring_singles.py:14:5: Q002 [*] Single quote docstring found but double quot | = help: Replace single quotes docstring with double quotes -ℹ Possible fix +ℹ Fix 11 11 | class Cls(MakeKlass(''' 12 12 | class params \t not a docstring 13 13 | ''')): @@ -63,7 +63,7 @@ docstring_singles.py:26:9: Q002 [*] Single quote docstring found but double quot | = help: Replace single quotes docstring with double quotes -ℹ Possible fix +ℹ Fix 23 23 | def f(self, bar=''' 24 24 | definitely not a docstring''', 25 25 | val=l[Cls():3]): diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap index 81dfe60689b14..2c822e35c8c29 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap @@ -10,7 +10,7 @@ docstring_singles_class.py:2:5: Q002 [*] Single quote docstring found but double | = help: Replace single quotes docstring with double quotes -ℹ Possible fix +ℹ Fix 1 1 | class SingleLineDocstrings(): 2 |- ''' Double quotes single line class docstring ''' 2 |+ """ Double quotes single line class docstring """ @@ -27,7 +27,7 @@ docstring_singles_class.py:6:9: Q002 [*] Single quote docstring found but double | = help: Replace single quotes docstring with double quotes -ℹ Possible fix +ℹ Fix 3 3 | ''' Not a docstring ''' 4 4 | 5 5 | def foo(self, bar='''not a docstring'''): @@ -46,7 +46,7 @@ docstring_singles_class.py:9:29: Q002 [*] Single quote docstring found but doubl | = help: Replace single quotes docstring with double quotes -ℹ Possible fix +ℹ Fix 6 6 | ''' Double quotes single line method docstring''' 7 7 | pass 8 8 | diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap index 196c61eaaea4e..6d878507cedd8 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap @@ -11,7 +11,7 @@ docstring_singles_function.py:2:5: Q002 [*] Single quote docstring found but dou | = help: Replace single quotes docstring with double quotes -ℹ Possible fix +ℹ Fix 1 1 | def foo(): 2 |- '''function without params, single line docstring''' 2 |+ """function without params, single line docstring""" @@ -32,7 +32,7 @@ docstring_singles_function.py:8:5: Q002 [*] Single quote docstring found but dou | = help: Replace single quotes docstring with double quotes -ℹ Possible fix +ℹ Fix 5 5 | 6 6 | 7 7 | def foo2(): @@ -53,7 +53,7 @@ docstring_singles_function.py:27:5: Q002 [*] Single quote docstring found but do | = help: Replace single quotes docstring with double quotes -ℹ Possible fix +ℹ Fix 24 24 | 25 25 | 26 26 | def function_with_single_docstring(a): diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_multiline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_multiline.py.snap index f593ef5690761..3ec2a92e01ff5 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_multiline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_multiline.py.snap @@ -12,7 +12,7 @@ docstring_singles_module_multiline.py:1:1: Q002 [*] Single quote docstring found | = help: Replace single quotes docstring with double quotes -ℹ Possible fix +ℹ Fix 1 |-''' 1 |+""" 2 2 | Double quotes multiline module docstring diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_singleline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_singleline.py.snap index dc2e625dd7d8e..75b12d38c6cd9 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_singleline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_singleline.py.snap @@ -9,7 +9,7 @@ docstring_singles_module_singleline.py:1:1: Q002 [*] Single quote docstring foun | = help: Replace single quotes docstring with double quotes -ℹ Possible fix +ℹ Fix 1 |-''' Double quotes singleline module docstring ''' 1 |+""" Double quotes singleline module docstring """ 2 2 | ''' this is not a docstring ''' diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles.py.snap index 32b69db72134e..3e4aff52d5e14 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles.py.snap @@ -12,7 +12,7 @@ docstring_doubles.py:1:1: Q002 [*] Double quote docstring found but single quote | = help: Replace double quotes docstring with single quotes -ℹ Possible fix +ℹ Fix 1 |-""" 1 |+''' 2 2 | Double quotes multiline module docstring @@ -35,7 +35,7 @@ docstring_doubles.py:12:5: Q002 [*] Double quote docstring found but single quot | = help: Replace double quotes docstring with single quotes -ℹ Possible fix +ℹ Fix 9 9 | l = [] 10 10 | 11 11 | class Cls: @@ -62,7 +62,7 @@ docstring_doubles.py:24:9: Q002 [*] Double quote docstring found but single quot | = help: Replace double quotes docstring with single quotes -ℹ Possible fix +ℹ Fix 21 21 | def f(self, bar=""" 22 22 | definitely not a docstring""", 23 23 | val=l[Cls():3]): diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap index 86d182ded1add..4f1be427c9a67 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap @@ -10,7 +10,7 @@ docstring_doubles_class.py:2:5: Q002 [*] Double quote docstring found but single | = help: Replace double quotes docstring with single quotes -ℹ Possible fix +ℹ Fix 1 1 | class SingleLineDocstrings(): 2 |- """ Double quotes single line class docstring """ 2 |+ ''' Double quotes single line class docstring ''' @@ -27,7 +27,7 @@ docstring_doubles_class.py:6:9: Q002 [*] Double quote docstring found but single | = help: Replace double quotes docstring with single quotes -ℹ Possible fix +ℹ Fix 3 3 | """ Not a docstring """ 4 4 | 5 5 | def foo(self, bar="""not a docstring"""): @@ -46,7 +46,7 @@ docstring_doubles_class.py:9:29: Q002 [*] Double quote docstring found but singl | = help: Replace double quotes docstring with single quotes -ℹ Possible fix +ℹ Fix 6 6 | """ Double quotes single line method docstring""" 7 7 | pass 8 8 | diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap index 521bf3a4cd1ba..013f064e86b0a 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap @@ -11,7 +11,7 @@ docstring_doubles_function.py:2:5: Q002 [*] Double quote docstring found but sin | = help: Replace double quotes docstring with single quotes -ℹ Possible fix +ℹ Fix 1 1 | def foo(): 2 |- """function without params, single line docstring""" 2 |+ '''function without params, single line docstring''' @@ -32,7 +32,7 @@ docstring_doubles_function.py:8:5: Q002 [*] Double quote docstring found but sin | = help: Replace double quotes docstring with single quotes -ℹ Possible fix +ℹ Fix 5 5 | 6 6 | 7 7 | def foo2(): @@ -53,7 +53,7 @@ docstring_doubles_function.py:27:5: Q002 [*] Double quote docstring found but si | = help: Replace double quotes docstring with single quotes -ℹ Possible fix +ℹ Fix 24 24 | 25 25 | 26 26 | def function_with_single_docstring(a): diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_multiline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_multiline.py.snap index ea5caf8245b42..e2c5e024afbe6 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_multiline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_multiline.py.snap @@ -12,7 +12,7 @@ docstring_doubles_module_multiline.py:1:1: Q002 [*] Double quote docstring found | = help: Replace double quotes docstring with single quotes -ℹ Possible fix +ℹ Fix 1 |-""" 1 |+''' 2 2 | Double quotes multiline module docstring diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_singleline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_singleline.py.snap index 5b844cbbc87fa..c6332e463fa27 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_singleline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_singleline.py.snap @@ -9,7 +9,7 @@ docstring_doubles_module_singleline.py:1:1: Q002 [*] Double quote docstring foun | = help: Replace double quotes docstring with single quotes -ℹ Possible fix +ℹ Fix 1 |-""" Double quotes singleline module docstring """ 1 |+''' Double quotes singleline module docstring ''' 2 2 | """ this is not a docstring """ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles.py.snap index f2acc38880104..90eb8de9cc3cb 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles.py.snap @@ -14,7 +14,7 @@ docstring_singles.py:5:1: Q001 [*] Single quote multiline found but double quote | = help: Replace single multiline quotes with double quotes -ℹ Possible fix +ℹ Fix 2 2 | Single quotes multiline module docstring 3 3 | ''' 4 4 | @@ -41,7 +41,7 @@ docstring_singles.py:11:21: Q001 [*] Single quote multiline found but double quo | = help: Replace single multiline quotes with double quotes -ℹ Possible fix +ℹ Fix 8 8 | 9 9 | l = [] 10 10 | @@ -68,7 +68,7 @@ docstring_singles.py:18:5: Q001 [*] Single quote multiline found but double quot | = help: Replace single multiline quotes with double quotes -ℹ Possible fix +ℹ Fix 15 15 | Single quotes multiline class docstring 16 16 | ''' 17 17 | @@ -93,7 +93,7 @@ docstring_singles.py:23:21: Q001 [*] Single quote multiline found but double quo | = help: Replace single multiline quotes with double quotes -ℹ Possible fix +ℹ Fix 20 20 | ''' 21 21 | 22 22 | # The colon in the list indexing below is an edge case for the docstring scanner @@ -119,7 +119,7 @@ docstring_singles.py:32:9: Q001 [*] Single quote multiline found but double quot | = help: Replace single multiline quotes with double quotes -ℹ Possible fix +ℹ Fix 29 29 | 30 30 | some_expression = 'hello world' 31 31 | @@ -144,7 +144,7 @@ docstring_singles.py:37:13: Q001 [*] Single quote multiline found but double quo | = help: Replace single multiline quotes with double quotes -ℹ Possible fix +ℹ Fix 34 34 | ''' 35 35 | 36 36 | if l: diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_class.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_class.py.snap index 488a567f242d8..323f502a2235d 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_class.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_class.py.snap @@ -12,7 +12,7 @@ docstring_singles_class.py:3:5: Q001 [*] Single quote multiline found but double | = help: Replace single multiline quotes with double quotes -ℹ Possible fix +ℹ Fix 1 1 | class SingleLineDocstrings(): 2 2 | ''' Double quotes single line class docstring ''' 3 |- ''' Not a docstring ''' @@ -32,7 +32,7 @@ docstring_singles_class.py:5:23: Q001 [*] Single quote multiline found but doubl | = help: Replace single multiline quotes with double quotes -ℹ Possible fix +ℹ Fix 2 2 | ''' Double quotes single line class docstring ''' 3 3 | ''' Not a docstring ''' 4 4 | diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_function.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_function.py.snap index 1748426747637..fe7371af8f65b 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_function.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_function.py.snap @@ -11,7 +11,7 @@ docstring_singles_function.py:3:5: Q001 [*] Single quote multiline found but dou | = help: Replace single multiline quotes with double quotes -ℹ Possible fix +ℹ Fix 1 1 | def foo(): 2 2 | '''function without params, single line docstring''' 3 |- ''' not a docstring''' @@ -30,7 +30,7 @@ docstring_singles_function.py:11:5: Q001 [*] Single quote multiline found but do | = help: Replace single multiline quotes with double quotes -ℹ Possible fix +ℹ Fix 8 8 | ''' 9 9 | function without params, multiline docstring 10 10 | ''' @@ -51,7 +51,7 @@ docstring_singles_function.py:15:39: Q001 [*] Single quote multiline found but d | = help: Replace single multiline quotes with double quotes -ℹ Possible fix +ℹ Fix 12 12 | return 13 13 | 14 14 | @@ -74,7 +74,7 @@ docstring_singles_function.py:17:5: Q001 [*] Single quote multiline found but do | = help: Replace single multiline quotes with double quotes -ℹ Possible fix +ℹ Fix 14 14 | 15 15 | def fun_with_params_no_docstring(a, b=''' 16 16 | not a @@ -93,7 +93,7 @@ docstring_singles_function.py:22:5: Q001 [*] Single quote multiline found but do | = help: Replace single multiline quotes with double quotes -ℹ Possible fix +ℹ Fix 19 19 | 20 20 | 21 21 | def fun_with_params_no_docstring2(a, b=c[foo():], c=\ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap index 4f241ff2e1375..ca3d7d259d2e3 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap @@ -14,7 +14,7 @@ docstring_singles_module_multiline.py:4:1: Q001 [*] Single quote multiline found | = help: Replace single multiline quotes with double quotes -ℹ Possible fix +ℹ Fix 1 1 | ''' 2 2 | Double quotes multiline module docstring 3 3 | ''' @@ -38,7 +38,7 @@ docstring_singles_module_multiline.py:9:1: Q001 [*] Single quote multiline found | = help: Replace single multiline quotes with double quotes -ℹ Possible fix +ℹ Fix 6 6 | ''' 7 7 | def foo(): 8 8 | pass diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap index 234153f6c22e2..3d9926a1e614c 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap @@ -11,7 +11,7 @@ docstring_singles_module_singleline.py:2:1: Q001 [*] Single quote multiline foun | = help: Replace single multiline quotes with double quotes -ℹ Possible fix +ℹ Fix 1 1 | ''' Double quotes singleline module docstring ''' 2 |-''' this is not a docstring ''' 2 |+""" this is not a docstring """ @@ -28,7 +28,7 @@ docstring_singles_module_singleline.py:6:1: Q001 [*] Single quote multiline foun | = help: Replace single multiline quotes with double quotes -ℹ Possible fix +ℹ Fix 3 3 | 4 4 | def foo(): 5 5 | pass diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles.py.snap index f32e2d8cec16c..83354230b36ec 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles.py.snap @@ -10,7 +10,7 @@ singles.py:1:25: Q000 [*] Single quotes found but double quotes preferred | = help: Replace single quotes with double quotes -ℹ Possible fix +ℹ Fix 1 |-this_should_be_linted = 'single quote string' 1 |+this_should_be_linted = "single quote string" 2 2 | this_should_be_linted = u'double quote string' @@ -27,7 +27,7 @@ singles.py:2:25: Q000 [*] Single quotes found but double quotes preferred | = help: Replace single quotes with double quotes -ℹ Possible fix +ℹ Fix 1 1 | this_should_be_linted = 'single quote string' 2 |-this_should_be_linted = u'double quote string' 2 |+this_should_be_linted = u"double quote string" @@ -44,7 +44,7 @@ singles.py:3:25: Q000 [*] Single quotes found but double quotes preferred | = help: Replace single quotes with double quotes -ℹ Possible fix +ℹ Fix 1 1 | this_should_be_linted = 'single quote string' 2 2 | this_should_be_linted = u'double quote string' 3 |-this_should_be_linted = f'double quote string' diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap index 0d21cc6e72017..6dd7d7e8f60dc 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap @@ -10,7 +10,7 @@ singles_escaped.py:1:26: Q003 [*] Change outer quotes to avoid escaping inner qu | = help: Change outer quotes to avoid escaping inner quotes -ℹ Possible fix +ℹ Fix 1 |-this_should_raise_Q003 = "This is a \"string\"" 1 |+this_should_raise_Q003 = 'This is a "string"' 2 2 | this_is_fine = "'This' is a \"string\"" @@ -27,7 +27,7 @@ singles_escaped.py:9:5: Q003 [*] Change outer quotes to avoid escaping inner quo | = help: Change outer quotes to avoid escaping inner quotes -ℹ Possible fix +ℹ Fix 6 6 | this_is_fine = R"This is a \"string\"" 7 7 | this_should_raise = ( 8 8 | "This is a" diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap index 5e959d833a8f2..24ebd5c6f392d 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap @@ -11,7 +11,7 @@ singles_implicit.py:2:5: Q000 [*] Single quotes found but double quotes preferre | = help: Replace single quotes with double quotes -ℹ Possible fix +ℹ Fix 1 1 | x = ( 2 |- 'This' 2 |+ "This" @@ -30,7 +30,7 @@ singles_implicit.py:3:5: Q000 [*] Single quotes found but double quotes preferre | = help: Replace single quotes with double quotes -ℹ Possible fix +ℹ Fix 1 1 | x = ( 2 2 | 'This' 3 |- 'is' @@ -49,7 +49,7 @@ singles_implicit.py:4:5: Q000 [*] Single quotes found but double quotes preferre | = help: Replace single quotes with double quotes -ℹ Possible fix +ℹ Fix 1 1 | x = ( 2 2 | 'This' 3 3 | 'is' @@ -69,7 +69,7 @@ singles_implicit.py:8:5: Q000 [*] Single quotes found but double quotes preferre | = help: Replace single quotes with double quotes -ℹ Possible fix +ℹ Fix 5 5 | ) 6 6 | 7 7 | x = ( @@ -90,7 +90,7 @@ singles_implicit.py:9:5: Q000 [*] Single quotes found but double quotes preferre | = help: Replace single quotes with double quotes -ℹ Possible fix +ℹ Fix 6 6 | 7 7 | x = ( 8 8 | 'This' \ @@ -110,7 +110,7 @@ singles_implicit.py:10:5: Q000 [*] Single quotes found but double quotes preferr | = help: Replace single quotes with double quotes -ℹ Possible fix +ℹ Fix 7 7 | x = ( 8 8 | 'This' \ 9 9 | 'is' \ @@ -129,7 +129,7 @@ singles_implicit.py:27:1: Q000 [*] Single quotes found but double quotes preferr | = help: Replace single quotes with double quotes -ℹ Possible fix +ℹ Fix 24 24 | 25 25 | if True: 26 26 | 'This can use "single" quotes' diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_multiline_string.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_multiline_string.py.snap index eab1465fb348f..20cd5ce322456 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_multiline_string.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_multiline_string.py.snap @@ -13,7 +13,7 @@ singles_multiline_string.py:1:5: Q001 [*] Single quote multiline found but doubl | = help: Replace single multiline quotes with double quotes -ℹ Possible fix +ℹ Fix 1 |-s = ''' This 'should' 1 |+s = """ This 'should' 2 2 | be diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles.py.snap index f65b7ab187cc3..0550913c80e3b 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles.py.snap @@ -10,7 +10,7 @@ doubles.py:1:25: Q000 [*] Double quotes found but single quotes preferred | = help: Replace double quotes with single quotes -ℹ Possible fix +ℹ Fix 1 |-this_should_be_linted = "double quote string" 1 |+this_should_be_linted = 'double quote string' 2 2 | this_should_be_linted = u"double quote string" @@ -27,7 +27,7 @@ doubles.py:2:25: Q000 [*] Double quotes found but single quotes preferred | = help: Replace double quotes with single quotes -ℹ Possible fix +ℹ Fix 1 1 | this_should_be_linted = "double quote string" 2 |-this_should_be_linted = u"double quote string" 2 |+this_should_be_linted = u'double quote string' @@ -44,7 +44,7 @@ doubles.py:3:25: Q000 [*] Double quotes found but single quotes preferred | = help: Replace double quotes with single quotes -ℹ Possible fix +ℹ Fix 1 1 | this_should_be_linted = "double quote string" 2 2 | this_should_be_linted = u"double quote string" 3 |-this_should_be_linted = f"double quote string" diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap index 38d6912827593..6a31d7a11fa36 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap @@ -10,7 +10,7 @@ doubles_escaped.py:1:26: Q003 [*] Change outer quotes to avoid escaping inner qu | = help: Change outer quotes to avoid escaping inner quotes -ℹ Possible fix +ℹ Fix 1 |-this_should_raise_Q003 = 'This is a \'string\'' 1 |+this_should_raise_Q003 = "This is a 'string'" 2 2 | this_should_raise_Q003 = 'This is \\ a \\\'string\'' @@ -27,7 +27,7 @@ doubles_escaped.py:2:26: Q003 [*] Change outer quotes to avoid escaping inner qu | = help: Change outer quotes to avoid escaping inner quotes -ℹ Possible fix +ℹ Fix 1 1 | this_should_raise_Q003 = 'This is a \'string\'' 2 |-this_should_raise_Q003 = 'This is \\ a \\\'string\'' 2 |+this_should_raise_Q003 = "This is \\ a \\'string'" @@ -45,7 +45,7 @@ doubles_escaped.py:10:5: Q003 [*] Change outer quotes to avoid escaping inner qu | = help: Change outer quotes to avoid escaping inner quotes -ℹ Possible fix +ℹ Fix 7 7 | this_is_fine = R'This is a \'string\'' 8 8 | this_should_raise = ( 9 9 | 'This is a' diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap index 5165dfd606231..dcd5cd4f75133 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap @@ -11,7 +11,7 @@ doubles_implicit.py:2:5: Q000 [*] Double quotes found but single quotes preferre | = help: Replace double quotes with single quotes -ℹ Possible fix +ℹ Fix 1 1 | x = ( 2 |- "This" 2 |+ 'This' @@ -30,7 +30,7 @@ doubles_implicit.py:3:5: Q000 [*] Double quotes found but single quotes preferre | = help: Replace double quotes with single quotes -ℹ Possible fix +ℹ Fix 1 1 | x = ( 2 2 | "This" 3 |- "is" @@ -49,7 +49,7 @@ doubles_implicit.py:4:5: Q000 [*] Double quotes found but single quotes preferre | = help: Replace double quotes with single quotes -ℹ Possible fix +ℹ Fix 1 1 | x = ( 2 2 | "This" 3 3 | "is" @@ -69,7 +69,7 @@ doubles_implicit.py:8:5: Q000 [*] Double quotes found but single quotes preferre | = help: Replace double quotes with single quotes -ℹ Possible fix +ℹ Fix 5 5 | ) 6 6 | 7 7 | x = ( @@ -90,7 +90,7 @@ doubles_implicit.py:9:5: Q000 [*] Double quotes found but single quotes preferre | = help: Replace double quotes with single quotes -ℹ Possible fix +ℹ Fix 6 6 | 7 7 | x = ( 8 8 | "This" \ @@ -110,7 +110,7 @@ doubles_implicit.py:10:5: Q000 [*] Double quotes found but single quotes preferr | = help: Replace double quotes with single quotes -ℹ Possible fix +ℹ Fix 7 7 | x = ( 8 8 | "This" \ 9 9 | "is" \ @@ -129,7 +129,7 @@ doubles_implicit.py:27:1: Q000 [*] Double quotes found but single quotes preferr | = help: Replace double quotes with single quotes -ℹ Possible fix +ℹ Fix 24 24 | 25 25 | if True: 26 26 | "This can use 'double' quotes" diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_multiline_string.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_multiline_string.py.snap index 7ede1f44eceb1..07ee108c2520a 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_multiline_string.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_multiline_string.py.snap @@ -13,7 +13,7 @@ doubles_multiline_string.py:1:5: Q001 [*] Double quote multiline found but singl | = help: Replace double multiline quotes with single quotes -ℹ Possible fix +ℹ Fix 1 |-s = """ This "should" 1 |+s = ''' This "should" 2 2 | be