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

Q002 [*] Double quote docstring found but single quotes preferred
 --> docstring_doubles_class.py:6:9
  |
5 |     def foo(self, bar="""not a docstring"""):
6 |         """ Double quotes single line method docstring"""
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7 |         pass
  |
help: Replace double quotes docstring with single 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 [*] Double quote docstring found but single quotes preferred
 --> docstring_doubles_class.py:9:29
  |
7 |         pass
8 |
9 |     class Nested(foo()[:]): """ inline docstring """; pass
  |                             ^^^^^^^^^^^^^^^^^^^^^^^^
  |
help: Replace double quotes docstring with single quotes
  |
8 |
  -     class Nested(foo()[:]): """ inline docstring """; pass
9 +     class Nested(foo()[:]): ''' inline docstring '''; pass
  |
