---
source: crates/ruff_linter/src/rules/flake8_quotes/mod.rs
snapshot_kind: text
---
docstring_doubles_function.py:3:5: Q001 [*] Double quote multiline found but single quotes preferred
  |
1 | def foo():
2 |     """function without params, single line docstring"""
3 |     """ not a docstring"""
  |     ^^^^^^^^^^^^^^^^^^^^^^ Q001
4 |     return
  |
  = help: Replace double multiline quotes with single quotes

ℹ Safe fix
1 1 | def foo():
2 2 |     """function without params, single line docstring"""
3   |-    """ not a docstring"""
  3 |+    ''' not a docstring'''
4 4 |     return
5 5 | 
6 6 | 

docstring_doubles_function.py:11:5: Q001 [*] Double quote multiline found but single quotes preferred
   |
 9 |         function without params, multiline docstring
10 |     """
11 |     """ not a docstring"""
   |     ^^^^^^^^^^^^^^^^^^^^^^ Q001
12 |     return
   |
   = help: Replace double multiline quotes with single quotes

ℹ Safe fix
8  8  |     """
9  9  |         function without params, multiline docstring
10 10 |     """
11    |-    """ not a docstring"""
   11 |+    ''' not a docstring'''
12 12 |     return
13 13 | 
14 14 | 

docstring_doubles_function.py:15:39: Q001 [*] Double quote multiline found but single quotes preferred
   |
15 |   def fun_with_params_no_docstring(a, b="""
   |  _______________________________________^
16 | |     not a
17 | | """ """docstring"""):
   | |___^ Q001
18 |       pass
   |
   = help: Replace double multiline quotes with single quotes

ℹ Safe fix
12 12 |     return
13 13 | 
14 14 | 
15    |-def fun_with_params_no_docstring(a, b="""
   15 |+def fun_with_params_no_docstring(a, b='''
16 16 |     not a
17    |-""" """docstring"""):
   17 |+''' """docstring"""):
18 18 |     pass
19 19 | 
20 20 | 

docstring_doubles_function.py:17:5: Q001 [*] Double quote multiline found but single quotes preferred
   |
15 | def fun_with_params_no_docstring(a, b="""
16 |     not a
17 | """ """docstring"""):
   |     ^^^^^^^^^^^^^^^ Q001
18 |     pass
   |
   = help: Replace double multiline quotes with single quotes

ℹ Safe fix
14 14 | 
15 15 | def fun_with_params_no_docstring(a, b="""
16 16 |     not a
17    |-""" """docstring"""):
   17 |+""" '''docstring'''):
18 18 |     pass
19 19 | 
20 20 | 

docstring_doubles_function.py:22:5: Q001 [*] Double quote multiline found but single quotes preferred
   |
21 | def fun_with_params_no_docstring2(a, b=c[foo():], c=\
22 |     """ not a docstring """):
   |     ^^^^^^^^^^^^^^^^^^^^^^^ Q001
23 |     pass
   |
   = help: Replace double multiline quotes with single quotes

ℹ Safe fix
19 19 | 
20 20 | 
21 21 | def fun_with_params_no_docstring2(a, b=c[foo():], c=\
22    |-    """ not a docstring """):
   22 |+    ''' not a docstring '''):
23 23 |     pass
24 24 | 
25 25 |
