Skip to content

Commit

Permalink
Format fixes by ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
knutnergaard authored and github-actions[bot] committed Dec 5, 2024
1 parent aa9df90 commit fde1ca2
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 9 deletions.
4 changes: 3 additions & 1 deletion Lib/fontParts/base/bPoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ def _get_contour(self) -> Optional[BaseContour]:
return None
return self._contour()

def _set_contour(self, contour: Optional[Union[BaseContour, Callable[[], BaseContour]]]) -> None:
def _set_contour(
self, contour: Optional[Union[BaseContour, Callable[[], BaseContour]]]
) -> None:
if self._contour is not None:
raise AssertionError("contour for bPoint already set")
if contour is not None:
Expand Down
4 changes: 3 additions & 1 deletion Lib/fontParts/base/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ def _get_glyph(self) -> Optional[BaseGlyph]:
return None
return self._glyph()

def _set_glyph(self, glyph: Optional[Union[BaseGlyph, Callable[[], BaseGlyph]]]) -> None:
def _set_glyph(
self, glyph: Optional[Union[BaseGlyph, Callable[[], BaseGlyph]]]
) -> None:
if self._glyph is not None:
raise AssertionError("glyph for component already set")
if glyph is not None:
Expand Down
4 changes: 3 additions & 1 deletion Lib/fontParts/base/contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ def _get_glyph(self) -> Optional[BaseGlyph]:
return None
return self._glyph()

def _set_glyph(self, glyph: Optional[Union[BaseGlyph, Callable[[], BaseGlyph]]]) -> None:
def _set_glyph(
self, glyph: Optional[Union[BaseGlyph, Callable[[], BaseGlyph]]]
) -> None:
if self._glyph is not None:
raise AssertionError("glyph for contour already set")
if glyph is not None:
Expand Down
4 changes: 3 additions & 1 deletion Lib/fontParts/base/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ def _get_font(self) -> Optional[BaseFont]:
return None
return self._font()

def _set_font(self, font: Optional[Union[BaseFont, Callable[[], BaseFont]]]) -> None:
def _set_font(
self, font: Optional[Union[BaseFont, Callable[[], BaseFont]]]
) -> None:
if self._font is not None and self._font != font:
raise AssertionError("font for groups already set and is not same as font")
if font is not None:
Expand Down
4 changes: 3 additions & 1 deletion Lib/fontParts/base/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,9 @@ def _get_font(self) -> Optional[BaseFont]:
return None
return self._font()

def _set_font(self, font: Optional[Union[BaseFont, Callable[[], BaseFont]]]) -> None:
def _set_font(
self, font: Optional[Union[BaseFont, Callable[[], BaseFont]]]
) -> None:
if self._font is not None:
raise AssertionError("font for layer already set")
if font is not None:
Expand Down
8 changes: 6 additions & 2 deletions Lib/fontParts/base/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ def _get_glyph(self) -> Optional[BaseGlyph]:
return None
return self._glyph()

def _set_glyph(self, glyph: Optional[Union[BaseGlyph, Callable[[], BaseGlyph]]]) -> None:
def _set_glyph(
self, glyph: Optional[Union[BaseGlyph, Callable[[], BaseGlyph]]]
) -> None:
if self._font is not None:
raise AssertionError("font for lib already set")
if self._glyph is not None and self._glyph() != glyph:
Expand Down Expand Up @@ -132,7 +134,9 @@ def _get_font(self) -> Optional[BaseFont]:
return self.glyph.font
return None

def _set_font(self, font: Optional[Union[BaseFont, Callable[[], BaseFont]]]) -> None:
def _set_font(
self, font: Optional[Union[BaseFont, Callable[[], BaseFont]]]
) -> None:
if self._font is not None and self._font() != font:
raise AssertionError("font for lib already set and is not same as font")
if self._glyph is not None:
Expand Down
4 changes: 3 additions & 1 deletion Lib/fontParts/base/point.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ def _get_contour(self) -> Optional[BaseContour]:
return None
return self._contour()

def _set_contour(self, contour: Optional[Union[BaseContour, Callable[[], BaseContour]]]) -> None:
def _set_contour(
self, contour: Optional[Union[BaseContour, Callable[[], BaseContour]]]
) -> None:
if self._contour is not None:
raise AssertionError("contour for point already set")
if contour is not None:
Expand Down
4 changes: 3 additions & 1 deletion Lib/fontParts/base/segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ def _get_contour(self) -> Optional[BaseContour]:
return None
return self._contour()

def _set_contour(self, contour: Optional[Union[BaseContour, Callable[[], BaseContour]]]) -> None:
def _set_contour(
self, contour: Optional[Union[BaseContour, Callable[[], BaseContour]]]
) -> None:
if self._contour is not None:
raise AssertionError("contour for segment already set")
if contour is not None:
Expand Down

0 comments on commit fde1ca2

Please sign in to comment.