---
source: crates/ruff_linter/src/rules/flake8_quotes/mod.rs
snapshot_kind: text
---
docstring_singles_class.py:2:5: Q002 [*] Single quote docstring found but double quotes preferred
  |
1 | class SingleLineDocstrings():
2 |     ''' Double quotes single line class docstring '''
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Q002
3 |     ''' Not a docstring '''
  |
  = help: Replace single quotes docstring with double quotes

ℹ Safe fix
1 1 | class SingleLineDocstrings():
2   |-    ''' Double quotes single line class docstring '''
  2 |+    """ Double quotes single line class docstring """
3 3 |     ''' Not a docstring '''
4 4 | 
5 5 |     def foo(self, bar='''not a docstring'''):

docstring_singles_class.py:6:9: Q002 [*] Single quote docstring found but double quotes preferred
  |
5 |     def foo(self, bar='''not a docstring'''):
6 |         ''' Double quotes single line method docstring'''
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Q002
7 |         pass
  |
  = help: Replace single quotes docstring with double quotes

ℹ Safe fix
3 3 |     ''' Not a docstring '''
4 4 | 
5 5 |     def foo(self, bar='''not a docstring'''):
6   |-        ''' Double quotes single line method docstring'''
  6 |+        """ Double quotes single line method docstring"""
7 7 |         pass
8 8 | 
9 9 |     class Nested(foo()[:]): ''' inline docstring '''; pass

docstring_singles_class.py:9:29: Q002 [*] Single quote docstring found but double quotes preferred
  |
7 |         pass
8 | 
9 |     class Nested(foo()[:]): ''' inline docstring '''; pass
  |                             ^^^^^^^^^^^^^^^^^^^^^^^^ Q002
  |
  = help: Replace single quotes docstring with double quotes

ℹ Safe fix
6 6 |         ''' Double quotes single line method docstring'''
7 7 |         pass
8 8 | 
9   |-    class Nested(foo()[:]): ''' inline docstring '''; pass
  9 |+    class Nested(foo()[:]): """ inline docstring """; pass
