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

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

docstring_singles_function.py:8:5: Q002 [*] Single quote docstring found but double quotes preferred
   |
 7 |   def foo2():
 8 |       '''
   |  _____^
 9 | |         function without params, multiline docstring
10 | |     '''
   | |_______^ Q002
11 |       ''' not a docstring'''
12 |       return
   |
   = help: Replace single quotes docstring with double quotes

ℹ Safe fix
5  5  | 
6  6  | 
7  7  | def foo2():
8     |-    '''
   8  |+    """
9  9  |         function without params, multiline docstring
10    |-    '''
   10 |+    """
11 11 |     ''' not a docstring'''
12 12 |     return
13 13 | 

docstring_singles_function.py:27:5: Q002 [*] Single quote docstring found but double quotes preferred
   |
26 | def function_with_single_docstring(a):
27 |     'Single line docstring'
   |     ^^^^^^^^^^^^^^^^^^^^^^^ Q002
   |
   = help: Replace single quotes docstring with double quotes

ℹ Safe fix
24 24 | 
25 25 | 
26 26 | def function_with_single_docstring(a):
27    |-    'Single line docstring'
   27 |+    "Single line docstring"
28 28 | 
29 29 | 
30 30 | def double_inside_single(a):


