From 8b447973238953a567be5b4d4b61195b969d5cef Mon Sep 17 00:00:00 2001 From: Kentaro Wada Date: Mon, 5 Sep 2022 20:05:26 +0900 Subject: [PATCH] Support multi-line string when using fmt: skip decoration --- src/darker/__main__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/darker/__main__.py b/src/darker/__main__.py index 79afde758..0b7236340 100644 --- a/src/darker/__main__.py +++ b/src/darker/__main__.py @@ -204,7 +204,12 @@ def _blacken_single_file( # pylint: disable=too-many-arguments,too-many-locals ) for i, line in enumerate(rev2_isorted.lines): line_num = i + 1 - if line_num not in modified_line_nums: + if ( + line_num not in modified_line_nums + and not line.endswith("\\") + and not line.endswith('"') + and not line.endswith("'") + ): line = f"{line} {FMT_DARKER_SKIP}" lines.append(line) rev2_isorted_decorated = TextDocument.from_lines(