Skip to content

Commit 32a4f22

Browse files
committed
Support multi-line string with fmt: skip decoration
1 parent 788178e commit 32a4f22

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/darker/__main__.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,12 @@ def _blacken_single_file( # pylint: disable=too-many-arguments,too-many-locals
204204
)
205205
for i, line in enumerate(rev2_isorted.lines):
206206
line_num = i + 1
207-
if line_num not in modified_line_nums:
207+
if (
208+
line_num not in modified_line_nums
209+
and not line.endswith("\\")
210+
and not line.endswith('"')
211+
and not line.endswith("'")
212+
):
208213
line = f"{line} {FMT_DARKER_SKIP}"
209214
lines.append(line)
210215
rev2_isorted_decorated = TextDocument.from_lines(

0 commit comments

Comments
 (0)