Loading black.py +7 −1 Changes for black.py: 7 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -510,7 +510,13 @@ def maybe_remove_trailing_comma(self, closing: Leaf) -> bool: ): return False if closing.type == token.RSQB or closing.type == token.RBRACE: if closing.type == token.RBRACE: self.leaves.pop() return True if closing.type == token.RSQB: comma = self.leaves[-1] if comma.parent and comma.parent.type == syms.listmaker: self.leaves.pop() return True Loading tests/expression.py +9 −1 Changes for tests/expression.py: 9 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ (1, 2, 3) [] [1, 2, 3, 4, 5, 6, 7, 8, 9, (10 or A), (11 or B), (12 or C)] [1, 2, 3,] {i for i in (1, 2, 3)} {(i ** 2) for i in (1, 2, 3)} {(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))} Loading Loading @@ -84,7 +85,10 @@ list[str] dict[str, int] tuple[str, ...] tuple[str, int, float, dict[str, int]] tuple[str, int, float, dict[str, int],] very_long_variable_name_filters: t.List[ t.Tuple[str, t.Union[str, t.List[t.Optional[str]]]], ] slice[0] slice[0:1] slice[0:1:2] Loading Loading @@ -207,6 +211,7 @@ async def f(): (1, 2, 3) [] [1, 2, 3, 4, 5, 6, 7, 8, 9, (10 or A), (11 or B), (12 or C)] [1, 2, 3] {i for i in (1, 2, 3)} {(i ** 2) for i in (1, 2, 3)} {(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))} Loading Loading @@ -248,6 +253,9 @@ async def f(): dict[str, int] tuple[str, ...] tuple[str, int, float, dict[str, int]] very_long_variable_name_filters: t.List[ t.Tuple[str, t.Union[str, t.List[t.Optional[str]]]], ] slice[0] slice[0:1] slice[0:1:2] Loading Loading
black.py +7 −1 Changes for black.py: 7 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -510,7 +510,13 @@ def maybe_remove_trailing_comma(self, closing: Leaf) -> bool: ): return False if closing.type == token.RSQB or closing.type == token.RBRACE: if closing.type == token.RBRACE: self.leaves.pop() return True if closing.type == token.RSQB: comma = self.leaves[-1] if comma.parent and comma.parent.type == syms.listmaker: self.leaves.pop() return True Loading
tests/expression.py +9 −1 Changes for tests/expression.py: 9 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ (1, 2, 3) [] [1, 2, 3, 4, 5, 6, 7, 8, 9, (10 or A), (11 or B), (12 or C)] [1, 2, 3,] {i for i in (1, 2, 3)} {(i ** 2) for i in (1, 2, 3)} {(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))} Loading Loading @@ -84,7 +85,10 @@ list[str] dict[str, int] tuple[str, ...] tuple[str, int, float, dict[str, int]] tuple[str, int, float, dict[str, int],] very_long_variable_name_filters: t.List[ t.Tuple[str, t.Union[str, t.List[t.Optional[str]]]], ] slice[0] slice[0:1] slice[0:1:2] Loading Loading @@ -207,6 +211,7 @@ async def f(): (1, 2, 3) [] [1, 2, 3, 4, 5, 6, 7, 8, 9, (10 or A), (11 or B), (12 or C)] [1, 2, 3] {i for i in (1, 2, 3)} {(i ** 2) for i in (1, 2, 3)} {(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))} Loading Loading @@ -248,6 +253,9 @@ async def f(): dict[str, int] tuple[str, ...] tuple[str, int, float, dict[str, int]] very_long_variable_name_filters: t.List[ t.Tuple[str, t.Union[str, t.List[t.Optional[str]]]], ] slice[0] slice[0:1] slice[0:1:2] Loading