diff --git a/src/black/linegen.py b/src/black/linegen.py index 712c3c4b3c5..cb5331b4f92 100644 --- a/src/black/linegen.py +++ b/src/black/linegen.py @@ -273,7 +273,7 @@ def visit_STRING(self, leaf: Leaf) -> Iterator[Line]: if is_multiline_string(leaf): indent = " " * 4 * self.current_line.depth - docstring = fix_docstring(docstring, indent, self.mode.preview) + docstring = fix_docstring(docstring, indent, preview=self.mode.preview) else: docstring = docstring.strip() diff --git a/src/black/strings.py b/src/black/strings.py index e10e94d15e7..427d9ddf5f6 100644 --- a/src/black/strings.py +++ b/src/black/strings.py @@ -60,7 +60,7 @@ def lines_with_leading_tabs_expanded(s: str) -> List[str]: return lines -def fix_docstring(docstring: str, prefix: str, preview: bool) -> str: +def fix_docstring(docstring: str, prefix: str, *, preview: bool) -> str: # https://www.python.org/dev/peps/pep-0257/#handling-docstring-indentation if not docstring: return ""