Skip to content

Commit bf98bec

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent b073264 commit bf98bec

3 files changed

Lines changed: 12 additions & 27 deletions

File tree

pyflp/_descriptors.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,14 @@
3131
class ROProperty(Protocol[T_co]):
3232
"""Protocol for a read-only descriptor."""
3333

34-
def __get__(self, ins: Any, owner: Any = None) -> T_co | Self | None:
35-
...
34+
def __get__(self, ins: Any, owner: Any = None) -> T_co | Self | None: ...
3635

3736

3837
@runtime_checkable
3938
class RWProperty(ROProperty[T], Protocol):
4039
"""Protocol for a read-write descriptor."""
4140

42-
def __set__(self, ins: Any, value: T) -> None:
43-
...
41+
def __set__(self, ins: Any, value: T) -> None: ...
4442

4543

4644
class NamedPropMixin:
@@ -59,12 +57,10 @@ def __init__(self, *ids: EventEnum, default: T | None = None, readonly: bool = F
5957
self._readonly = readonly
6058

6159
@overload
62-
def _get_event(self, ins: ItemModel[VE]) -> ItemModel[VE]:
63-
...
60+
def _get_event(self, ins: ItemModel[VE]) -> ItemModel[VE]: ...
6461

6562
@overload
66-
def _get_event(self, ins: EventModel) -> AnyEvent | None:
67-
...
63+
def _get_event(self, ins: EventModel) -> AnyEvent | None: ...
6864

6965
def _get_event(self, ins: ItemModel[VE] | EventModel):
7066
if isinstance(ins, ItemModel):
@@ -85,12 +81,10 @@ def default(self) -> T | None: # Configure version based defaults here
8581
return self._default
8682

8783
@abc.abstractmethod
88-
def _get(self, ev_or_ins: Any) -> T | None:
89-
...
84+
def _get(self, ev_or_ins: Any) -> T | None: ...
9085

9186
@abc.abstractmethod
92-
def _set(self, ev_or_ins: Any, value: T) -> None:
93-
...
87+
def _set(self, ev_or_ins: Any, value: T) -> None: ...
9488

9589
@final
9690
def __get__(self, ins: Any, owner: Any = None) -> T | Self | None:

pyflp/_models.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,24 +89,20 @@ def __eq__(self, o: object) -> bool:
8989
@runtime_checkable
9090
class ModelCollection(Iterable[MT_co], Protocol[MT_co]):
9191
@overload
92-
def __getitem__(self, i: int | str) -> MT_co:
93-
...
92+
def __getitem__(self, i: int | str) -> MT_co: ...
9493

9594
@overload
96-
def __getitem__(self, i: slice) -> Sequence[MT_co]:
97-
...
95+
def __getitem__(self, i: slice) -> Sequence[MT_co]: ...
9896

9997

10098
def supports_slice(func: Callable[[ModelCollection[MT_co], str | int | slice], MT_co]):
10199
"""Wraps a :meth:`ModelCollection.__getitem__` to return a sequence if required."""
102100

103101
@overload
104-
def wrapper(self: ModelCollection[MT_co], i: int | str) -> MT_co:
105-
...
102+
def wrapper(self: ModelCollection[MT_co], i: int | str) -> MT_co: ...
106103

107104
@overload
108-
def wrapper(self: ModelCollection[MT_co], i: slice) -> Sequence[MT_co]:
109-
...
105+
def wrapper(self: ModelCollection[MT_co], i: slice) -> Sequence[MT_co]: ...
110106

111107
@functools.wraps(func)
112108
def wrapper(self: Any, i: Any) -> MT_co | Sequence[MT_co]:

tests/test_project.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313
def test_project(project: Project):
1414
assert project.artists == "demberto"
1515
assert project.channel_count == 19
16-
assert (
17-
project.comments
18-
== textwrap.dedent(
19-
"""\
16+
assert project.comments == textwrap.dedent("""\
2017
This is a testing FLP used by PyFLP - An FL Studio project file parser.
2118
2219
Notes for contributors:
@@ -25,9 +22,7 @@ def test_project(project: Project):
2522
2623
Terms:
2724
"item(s)": Refers to a channel, insert, slot, track, pattern, timemarker, etc.
28-
"""
29-
).replace("\n", "\r")
30-
) # Who the hell uses \r?
25+
""").replace("\n", "\r") # Who the hell uses \r?
3126
assert project.created_on == datetime.datetime(2022, 9, 16, 20, 47, 12, 746000)
3227
assert project.data_path == pathlib.Path("")
3328
assert project.format == FileFormat.Project

0 commit comments

Comments
 (0)