Loading black.py +8 −3 Changes for black.py: 8 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -885,9 +885,14 @@ def maybe_remove_trailing_comma(self, closing: Leaf) -> bool: self.remove_trailing_comma() return True # For parens let's check if it's safe to remove the comma. If the # trailing one is the only one, we might mistakenly change a tuple # into a different type by removing the comma. # For parens let's check if it's safe to remove the comma. # Imports are always safe. if self.is_import: self.remove_trailing_comma() return True # Otheriwsse, if the trailing one is the only one, we might mistakenly # change a tuple into a different type by removing the comma. depth = closing.bracket_depth + 1 commas = 0 opening = closing.opening_bracket Loading tests/import_spacing.py +4 −0 Changes for tests/import_spacing.py: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,9 @@ # flake8: noqa from logging import ( ERROR, ) import sys # This relies on each of the submodules having an __all__ variable. Loading Loading @@ -48,6 +51,7 @@ # flake8: noqa from logging import ERROR import sys # This relies on each of the submodules having an __all__ variable. Loading Loading
black.py +8 −3 Changes for black.py: 8 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -885,9 +885,14 @@ def maybe_remove_trailing_comma(self, closing: Leaf) -> bool: self.remove_trailing_comma() return True # For parens let's check if it's safe to remove the comma. If the # trailing one is the only one, we might mistakenly change a tuple # into a different type by removing the comma. # For parens let's check if it's safe to remove the comma. # Imports are always safe. if self.is_import: self.remove_trailing_comma() return True # Otheriwsse, if the trailing one is the only one, we might mistakenly # change a tuple into a different type by removing the comma. depth = closing.bracket_depth + 1 commas = 0 opening = closing.opening_bracket Loading
tests/import_spacing.py +4 −0 Changes for tests/import_spacing.py: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,9 @@ # flake8: noqa from logging import ( ERROR, ) import sys # This relies on each of the submodules having an __all__ variable. Loading Loading @@ -48,6 +51,7 @@ # flake8: noqa from logging import ERROR import sys # This relies on each of the submodules having an __all__ variable. Loading