-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
formatterRelated to the formatterRelated to the formatterhelp wantedContributions especially welcomeContributions especially welcome
Milestone
Description
When formatting typeshed (cargo run --bin ruff_dev -- format-dev --write typeshed), there is still a big diff with black wrt to empty lines.
E.g. given
class Feature:
def getMandatoryRelease(self) -> None: ...
compiler_flag: int
def getMandatoryRelease(self) -> None: ...
compiler_flag: int
if sys.platform != "win32":
def can_change_color() -> bool: ...
# Changed in Python 3.8.8 and 3.9.2
if sys.version_info >= (3, 8):
pass
if sys.platform == "win32":
class Dummy:
__new__: None
__init__: None
# Actual typename SummaryInformation, not exposed by the implementation
class _SummaryInformation:
def GetProperty(self, field: int) -> int | bytes | None: ...black will format this as
class Feature:
def getMandatoryRelease(self) -> None: ...
compiler_flag: int
def getMandatoryRelease(self) -> None: ...
compiler_flag: int
if sys.platform != "win32":
def can_change_color() -> bool: ...
# Changed in Python 3.8.8 and 3.9.2
if sys.version_info >= (3, 8):
pass
if sys.platform == "win32":
class Dummy:
__new__: None
__init__: None
# Actual typename SummaryInformation, not exposed by the implementation
class _SummaryInformation:
def GetProperty(self, field: int) -> int | bytes | None: ...while we format this as
class Feature:
def getMandatoryRelease(self) -> None: ...
compiler_flag: int
def getMandatoryRelease(self) -> None: ...
compiler_flag: int
if sys.platform != "win32":
def can_change_color() -> bool: ...
# Changed in Python 3.8.8 and 3.9.2
if sys.version_info >= (3, 8):
pass
if sys.platform == "win32":
class Dummy:
__new__: None
__init__: None
# Actual typename SummaryInformation, not exposed by the implementation
class _SummaryInformation:
def GetProperty(self, field: int) -> int | bytes | None: ...The task is to go through the typeshed diff and figure out each empty line rule we're still missing. If you implement this you don't need to (and probably shouldn't) fix everything at once but you can implement any part of it (as long as it doesn't decrease the similarity index).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
formatterRelated to the formatterRelated to the formatterhelp wantedContributions especially welcomeContributions especially welcome