X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/3455389e486e0bb1d8a8318cb5f266b7ec8964dd..a42aef780630bce97c01dbf33a1947ea108e6e29:/black.py diff --git a/black.py b/black.py index 3d5ea14..3bb83da 100644 --- a/black.py +++ b/black.py @@ -1815,6 +1815,13 @@ def normalize_prefix(leaf: Leaf, *, inside_brackets: bool) -> None: def normalize_string_quotes(leaf: Leaf) -> None: + """Prefer double quotes but only if it doesn't cause more escaping. + + Adds or removes backslashes as appropriate. Doesn't parse and fix + strings nested in f-strings (yet). + + Note: Mutates its argument. + """ value = leaf.value.lstrip("furbFURB") if value[:3] == '"""': return