Skip to content

Commit

Permalink
Make fix_docstring preview parameter keyword-only
Browse files Browse the repository at this point in the history
  • Loading branch information
TomFryers committed Feb 21, 2022
1 parent be791f5 commit 52a36b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/black/linegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion src/black/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down

0 comments on commit 52a36b5

Please sign in to comment.