Loading README.md +4 −2 Changes for README.md: 4 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -944,10 +944,12 @@ More details can be found in [CONTRIBUTING](CONTRIBUTING.md). ### 19.2b0 * *Black* no longer normalizes numeric literals to include `_` separators. * long `del` statements are now split into multiple lines (#698) * *Black* no longer normalizes numeric literals to include `_` separators (#696) * new option `--target-version` to control which Python versions *Black*-formatted code should target *Black*-formatted code should target (#618) ### 18.9b0 Loading black.py +11 −1 Changes for black.py: 11 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -1646,6 +1646,7 @@ def __attrs_post_init__(self) -> None: self.visit_expr_stmt = partial(v, keywords=Ø, parens=ASSIGNMENTS) self.visit_return_stmt = partial(v, keywords={"return"}, parens={"return"}) self.visit_import_from = partial(v, keywords=Ø, parens={"import"}) self.visit_del_stmt = partial(v, keywords=Ø, parens={"del"}) self.visit_async_funcdef = self.visit_async_stmt self.visit_decorated = self.visit_decorators Loading Loading @@ -3350,7 +3351,16 @@ def _v(node: ast.AST, depth: int = 0) -> Iterator[str]: if isinstance(value, list): for item in value: if isinstance(item, ast.AST): # Ignore nested tuples within del statements, because we may insert # parentheses and they change the AST. if ( field == "targets" and isinstance(node, ast.Delete) and isinstance(item, ast.Tuple) ): for item in item.elts: yield from _v(item, depth + 2) elif isinstance(item, ast.AST): yield from _v(item, depth + 2) elif isinstance(value, ast.AST): Loading tests/data/cantfit.py +8 −0 Changes for tests/data/cantfit.py: 8 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ if key in self.connect_kwargs: raise ValueError(err.format(key)) concatenated_strings = "some strings that are" "concatenated implicitly, so if you put them on separate" "lines it will fit" del concatenated_strings, string_variable_name, normal_function_name, normal_name, need_more_to_make_the_line_long_enough # output Loading Loading @@ -91,3 +92,10 @@ "concatenated implicitly, so if you put them on separate" "lines it will fit" ) del ( concatenated_strings, string_variable_name, normal_function_name, normal_name, need_more_to_make_the_line_long_enough, ) Loading
README.md +4 −2 Changes for README.md: 4 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -944,10 +944,12 @@ More details can be found in [CONTRIBUTING](CONTRIBUTING.md). ### 19.2b0 * *Black* no longer normalizes numeric literals to include `_` separators. * long `del` statements are now split into multiple lines (#698) * *Black* no longer normalizes numeric literals to include `_` separators (#696) * new option `--target-version` to control which Python versions *Black*-formatted code should target *Black*-formatted code should target (#618) ### 18.9b0 Loading
black.py +11 −1 Changes for black.py: 11 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -1646,6 +1646,7 @@ def __attrs_post_init__(self) -> None: self.visit_expr_stmt = partial(v, keywords=Ø, parens=ASSIGNMENTS) self.visit_return_stmt = partial(v, keywords={"return"}, parens={"return"}) self.visit_import_from = partial(v, keywords=Ø, parens={"import"}) self.visit_del_stmt = partial(v, keywords=Ø, parens={"del"}) self.visit_async_funcdef = self.visit_async_stmt self.visit_decorated = self.visit_decorators Loading Loading @@ -3350,7 +3351,16 @@ def _v(node: ast.AST, depth: int = 0) -> Iterator[str]: if isinstance(value, list): for item in value: if isinstance(item, ast.AST): # Ignore nested tuples within del statements, because we may insert # parentheses and they change the AST. if ( field == "targets" and isinstance(node, ast.Delete) and isinstance(item, ast.Tuple) ): for item in item.elts: yield from _v(item, depth + 2) elif isinstance(item, ast.AST): yield from _v(item, depth + 2) elif isinstance(value, ast.AST): Loading
tests/data/cantfit.py +8 −0 Changes for tests/data/cantfit.py: 8 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ if key in self.connect_kwargs: raise ValueError(err.format(key)) concatenated_strings = "some strings that are" "concatenated implicitly, so if you put them on separate" "lines it will fit" del concatenated_strings, string_variable_name, normal_function_name, normal_name, need_more_to_make_the_line_long_enough # output Loading Loading @@ -91,3 +92,10 @@ "concatenated implicitly, so if you put them on separate" "lines it will fit" ) del ( concatenated_strings, string_variable_name, normal_function_name, normal_name, need_more_to_make_the_line_long_enough, )