Fix formatting of trailing unescaped quotes in raw triple quoted strings (#6202)

**Summary** This prevents us from turning `r'''\""'''` into
`r"""\"""""`, which is invalid syntax.

This PR fixes CI, which is currently broken on main (in a way that still
passes on linter PRs and allows merging formatter PRs, but it's bad to
have a job be red). Once merged, i'll make the formatted ecosystem
checks a required check.

**Test Plan** Added a regression test.
This commit is contained in:
konsti 2023-07-31 19:25:16 +02:00 committed by GitHub
parent dbd60b2cf5
commit 9063f4524d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 6 deletions

View file

@ -30,6 +30,12 @@ U"Test"
r"Test"
R"Test"
# Block conversion if there is an unescaped quote just before the end of the triple
# quoted string
r'''\""'''
r'''""'''
r'\""'
'This string will not include \
backslashes or newline characters.'
@ -162,6 +168,12 @@ magic-trailing-comma = Respect
r"Test"
R"Test"
# Block conversion if there is an unescaped quote just before the end of the triple
# quoted string
r'''\""'''
r'''""'''
r'\""'
"This string will not include \
backslashes or newline characters."
@ -310,6 +322,12 @@ magic-trailing-comma = Respect
r'Test'
R'Test'
# Block conversion if there is an unescaped quote just before the end of the triple
# quoted string
r'''\""'''
r'''""'''
r'\""'
'This string will not include \
backslashes or newline characters.'