From: Łukasz Langa Date: Wed, 9 May 2018 04:01:50 +0000 (-0700) Subject: Automatic management of parentheses in `elif`, too X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/1b51e2c07887bdd0aa12f8e79215ea72cbbc2ab4?hp=c9b73b99ac567ce30c36596371bf0a1fad8191c9 Automatic management of parentheses in `elif`, too --- diff --git a/black.py b/black.py index c2363e4..0fa9df0 100644 --- a/black.py +++ b/black.py @@ -1375,7 +1375,9 @@ class LineGenerator(Visitor[Line]): v = self.visit_stmt Ø: Set[str] = set() self.visit_assert_stmt = partial(v, keywords={"assert"}, parens={"assert", ","}) - self.visit_if_stmt = partial(v, keywords={"if", "else", "elif"}, parens={"if"}) + self.visit_if_stmt = partial( + v, keywords={"if", "else", "elif"}, parens={"if", "elif"} + ) self.visit_while_stmt = partial(v, keywords={"while", "else"}, parens={"while"}) self.visit_for_stmt = partial(v, keywords={"for", "else"}, parens={"for", "in"}) self.visit_try_stmt = partial(