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

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

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