---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
---
B021 f-string used as docstring. Python will interpret this as a joined string, rather than a docstring.
 --> B021.py:1:1
  |
1 | / f"""
2 | | Should emit:
3 | | B021 - on lines 14, 22, 30, 38, 46, 54, 62, 70, 73
4 | | """
  | |___^
5 |
6 |   VARIABLE = "world"
  |

B021 f-string used as docstring. Python will interpret this as a joined string, rather than a docstring.
  --> B021.py:14:5
   |
13 | def foo2():
14 |     f"""hello {VARIABLE}!"""
   |     ^^^^^^^^^^^^^^^^^^^^^^^^
   |

B021 f-string used as docstring. Python will interpret this as a joined string, rather than a docstring.
  --> B021.py:22:5
   |
21 | class bar2:
22 |     f"""hello {VARIABLE}!"""
   |     ^^^^^^^^^^^^^^^^^^^^^^^^
   |

B021 f-string used as docstring. Python will interpret this as a joined string, rather than a docstring.
  --> B021.py:30:5
   |
29 | def foo2():
30 |     f"""hello {VARIABLE}!"""
   |     ^^^^^^^^^^^^^^^^^^^^^^^^
   |

B021 f-string used as docstring. Python will interpret this as a joined string, rather than a docstring.
  --> B021.py:38:5
   |
37 | class bar2:
38 |     f"""hello {VARIABLE}!"""
   |     ^^^^^^^^^^^^^^^^^^^^^^^^
   |

B021 f-string used as docstring. Python will interpret this as a joined string, rather than a docstring.
  --> B021.py:46:5
   |
45 | def foo2():
46 |     f"hello {VARIABLE}!"
   |     ^^^^^^^^^^^^^^^^^^^^
   |

B021 f-string used as docstring. Python will interpret this as a joined string, rather than a docstring.
  --> B021.py:54:5
   |
53 | class bar2:
54 |     f"hello {VARIABLE}!"
   |     ^^^^^^^^^^^^^^^^^^^^
   |

B021 f-string used as docstring. Python will interpret this as a joined string, rather than a docstring.
  --> B021.py:62:5
   |
61 | def foo2():
62 |     f"hello {VARIABLE}!"
   |     ^^^^^^^^^^^^^^^^^^^^
   |

B021 f-string used as docstring. Python will interpret this as a joined string, rather than a docstring.
  --> B021.py:70:5
   |
69 | class bar2:
70 |     f"hello {VARIABLE}!"
   |     ^^^^^^^^^^^^^^^^^^^^
   |

B021 f-string used as docstring. Python will interpret this as a joined string, rather than a docstring.
  --> B021.py:74:5
   |
73 | def baz():
74 |     f"""I'm probably a docstring: {VARIABLE}!"""
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
75 |     print(f"""I'm a normal string""")
76 |     f"""Don't detect me!"""
   |
