Loading black.py +2 −1 Changes for black.py: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -2329,7 +2329,8 @@ def bracket_split_build_line( # Since body is a new indent level, remove spurious leading whitespace. normalize_prefix(leaves[0], inside_brackets=True) # Ensure a trailing comma when expected. if original.is_import and len(leaves) == 1: if original.is_import: if leaves[-1].type != token.COMMA: leaves.append(Leaf(token.COMMA, ",")) # Populate the line for leaf in leaves: Loading docs/reference/reference_functions.rst +2 −0 Changes for docs/reference/reference_functions.rst: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -79,6 +79,8 @@ Parsing Split functions --------------- .. autofunction:: black.bracket_split_build_line .. autofunction:: black.bracket_split_succeeded_or_raise .. autofunction:: black.delimiter_split Loading tests/data/comments2.py +14 −0 Changes for tests/data/comments2.py: 14 added lines, 0 removed lines. Original line number Diff line number Diff line from com.my_lovely_company.my_lovely_team.my_lovely_project.my_lovely_component import ( MyLovelyCompanyTeamProjectComponent # NOT DRY ) from com.my_lovely_company.my_lovely_team.my_lovely_project.my_lovely_component import ( MyLovelyCompanyTeamProjectComponent as component # DRY ) # Please keep __all__ alphabetized within each category. __all__ = [ Loading Loading @@ -148,6 +155,13 @@ def inline_comments_in_brackets_ruin_everything(): # output from com.my_lovely_company.my_lovely_team.my_lovely_project.my_lovely_component import ( MyLovelyCompanyTeamProjectComponent, # NOT DRY ) from com.my_lovely_company.my_lovely_team.my_lovely_project.my_lovely_component import ( MyLovelyCompanyTeamProjectComponent as component, # DRY ) # Please keep __all__ alphabetized within each category. __all__ = [ Loading tests/data/comments4.py +8 −0 Changes for tests/data/comments4.py: 8 added lines, 0 removed lines. Original line number Diff line number Diff line from com.my_lovely_company.my_lovely_team.my_lovely_project.my_lovely_component import ( MyLovelyCompanyTeamProjectComponent, # NOT DRY ) from com.my_lovely_company.my_lovely_team.my_lovely_project.my_lovely_component import ( MyLovelyCompanyTeamProjectComponent as component, # DRY ) class C: @pytest.mark.parametrize( ("post_data", "message"), Loading Loading
black.py +2 −1 Changes for black.py: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -2329,7 +2329,8 @@ def bracket_split_build_line( # Since body is a new indent level, remove spurious leading whitespace. normalize_prefix(leaves[0], inside_brackets=True) # Ensure a trailing comma when expected. if original.is_import and len(leaves) == 1: if original.is_import: if leaves[-1].type != token.COMMA: leaves.append(Leaf(token.COMMA, ",")) # Populate the line for leaf in leaves: Loading
docs/reference/reference_functions.rst +2 −0 Changes for docs/reference/reference_functions.rst: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -79,6 +79,8 @@ Parsing Split functions --------------- .. autofunction:: black.bracket_split_build_line .. autofunction:: black.bracket_split_succeeded_or_raise .. autofunction:: black.delimiter_split Loading
tests/data/comments2.py +14 −0 Changes for tests/data/comments2.py: 14 added lines, 0 removed lines. Original line number Diff line number Diff line from com.my_lovely_company.my_lovely_team.my_lovely_project.my_lovely_component import ( MyLovelyCompanyTeamProjectComponent # NOT DRY ) from com.my_lovely_company.my_lovely_team.my_lovely_project.my_lovely_component import ( MyLovelyCompanyTeamProjectComponent as component # DRY ) # Please keep __all__ alphabetized within each category. __all__ = [ Loading Loading @@ -148,6 +155,13 @@ def inline_comments_in_brackets_ruin_everything(): # output from com.my_lovely_company.my_lovely_team.my_lovely_project.my_lovely_component import ( MyLovelyCompanyTeamProjectComponent, # NOT DRY ) from com.my_lovely_company.my_lovely_team.my_lovely_project.my_lovely_component import ( MyLovelyCompanyTeamProjectComponent as component, # DRY ) # Please keep __all__ alphabetized within each category. __all__ = [ Loading
tests/data/comments4.py +8 −0 Changes for tests/data/comments4.py: 8 added lines, 0 removed lines. Original line number Diff line number Diff line from com.my_lovely_company.my_lovely_team.my_lovely_project.my_lovely_component import ( MyLovelyCompanyTeamProjectComponent, # NOT DRY ) from com.my_lovely_company.my_lovely_team.my_lovely_project.my_lovely_component import ( MyLovelyCompanyTeamProjectComponent as component, # DRY ) class C: @pytest.mark.parametrize( ("post_data", "message"), Loading