Skip to content

Commit 311ecb6

Browse files
yt-msMidnighter
authored andcommitted
docs(views): fix flake8 warnings
1 parent 47cb792 commit 311ecb6

File tree

3 files changed

+11
-38
lines changed

3 files changed

+11
-38
lines changed

src/structurizr/view/element_style.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,7 @@
3131

3232

3333
class ElementStyleIO(BaseModel):
34-
"""
35-
Represent an element's style.
36-
37-
Attributes:
38-
39-
"""
34+
"""Represent an element's style."""
4035

4136
tag: str
4237
width: Optional[int]
@@ -54,12 +49,7 @@ class ElementStyleIO(BaseModel):
5449

5550

5651
class ElementStyle(AbstractBase):
57-
"""
58-
Represent an element's style.
59-
60-
Attributes:
61-
62-
"""
52+
"""Represent an element's style."""
6353

6454
DEFAULT_WIDTH = 450
6555
DEFAULT_HEIGHT = 300
@@ -99,11 +89,12 @@ def __init__(
9989
self.description = description
10090

10191
def __repr__(self) -> str:
92+
"""Return repr(self)."""
10293
return f"{type(self).__name__}(tag={self.tag})"
10394

10495
@classmethod
10596
def hydrate(cls, element_style_io: ElementStyleIO) -> "ElementStyle":
106-
""""""
97+
"""Hydrate a new ElementStyle instance from its IO."""
10798
return cls(
10899
tag=element_style_io.tag,
109100
width=element_style_io.width,

src/structurizr/view/element_view.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,15 @@
2727

2828

2929
class ElementViewIO(BaseModel):
30-
"""
31-
Represent an instance of an element in a view.
32-
33-
Attributes:
34-
35-
"""
30+
"""Represent an instance of an element in a view."""
3631

3732
id: Optional[str]
3833
x: Optional[int]
3934
y: Optional[int]
4035

4136

4237
class ElementView(AbstractBase):
43-
"""
44-
Represent an instance of an element in a view.
45-
46-
Attributes:
47-
48-
"""
38+
"""Represent an instance of an element in a view."""
4939

5040
def __init__(
5141
self,
@@ -64,13 +54,15 @@ def __init__(
6454
self.y = y
6555

6656
def __repr__(self) -> str:
57+
"""Return repr(self)."""
6758
return f"{type(self).__name__}(id={self.id})"
6859

6960
@classmethod
7061
def hydrate(cls, element_view_io: ElementViewIO) -> "ElementView":
71-
""""""
62+
"""Hydrate a new ElementView instance from its IO."""
7263
return cls(id=element_view_io.id, x=element_view_io.x, y=element_view_io.y)
7364

7465
def copy_layout_information_from(self, source: "ElementView") -> None:
66+
"""Copy the layout information from another view."""
7567
self.x = source.x
7668
self.y = source.y

src/structurizr/view/font.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,14 @@
2828

2929

3030
class FontIO(BaseModel):
31-
"""
32-
Represent an instance of a font.
33-
34-
Attributes:
35-
36-
"""
31+
"""Represent an instance of a font."""
3732

3833
name: str
3934
url: Optional[HttpUrl] = None
4035

4136

4237
class Font(AbstractBase):
43-
"""
44-
Represent a font.
45-
46-
Attributes:
47-
48-
"""
38+
"""Represent a font."""
4939

5040
def __init__(self, *, name: str, url: Optional[str] = None, **kwargs) -> None:
5141
"""Initialize a font."""

0 commit comments

Comments
 (0)