From e0c1069ee97c4f041d69e29141f992416f4f100e Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 29 Jul 2023 12:44:30 -0400 Subject: [PATCH] handle fstring continuation in 3.12 --- pycodestyle.py | 2 +- testing/data/E12not.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pycodestyle.py b/pycodestyle.py index b10c498d..445281c1 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -686,7 +686,7 @@ def continued_indentation(logical_line, tokens, indent_level, hang_closing, if verbose >= 4: print(f"bracket depth {depth} indent to {start[1]}") # deal with implicit string concatenation - elif token_type in (tokenize.STRING, tokenize.COMMENT): + elif token_type in (tokenize.STRING, tokenize.COMMENT, FSTRING_START): indent_chances[start[1]] = str # visual indent after assert/raise/with elif not row and not depth and text in ["assert", "raise", "with"]: diff --git a/testing/data/E12not.py b/testing/data/E12not.py index 86c0fdd7..a92739e5 100644 --- a/testing/data/E12not.py +++ b/testing/data/E12not.py @@ -435,6 +435,9 @@ def unicode2html(s): help = br"print total number of errors " \ br"to standard error" +help = f"print total number of errors " \ + f"to standard error" + d = dict('foo', help="exclude files or directories which match these " "comma separated patterns (default: %s)" % DEFAULT_EXCLUDE)