From 031873627030021aa1ac3c0cc299dfa6426d7d1a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 16 Feb 2026 17:26:26 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v6.0.0) - https://github.com/psf/black → https://github.com/psf/black-pre-commit-mirror - [github.com/psf/black-pre-commit-mirror: 23.3.0 → 26.1.0](https://github.com/psf/black-pre-commit-mirror/compare/23.3.0...26.1.0) - [github.com/astral-sh/ruff-pre-commit: v0.0.277 → v0.15.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.277...v0.15.1) - [github.com/asottile/pyupgrade: v3.9.0 → v3.21.2](https://github.com/asottile/pyupgrade/compare/v3.9.0...v3.21.2) --- .pre-commit-config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 70c7874..83d8563 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v6.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -11,16 +11,16 @@ repos: - id: check-added-large-files - id: requirements-txt-fixer - id: check-vcs-permalinks - - repo: https://github.com/psf/black - rev: 23.3.0 + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 26.1.0 hooks: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.277 + rev: v0.15.1 hooks: - id: ruff - repo: https://github.com/asottile/pyupgrade - rev: v3.9.0 + rev: v3.21.2 hooks: - id: pyupgrade args: ["--py38-plus"] From 2017bf166098981046e731bd42ec019e578dc6d4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 16 Feb 2026 17:26:35 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pyflp/_descriptors.py | 18 ++++++------------ pyflp/_models.py | 12 ++++-------- tests/test_project.py | 9 ++------- 3 files changed, 12 insertions(+), 27 deletions(-) diff --git a/pyflp/_descriptors.py b/pyflp/_descriptors.py index 22b5e34..49ae600 100644 --- a/pyflp/_descriptors.py +++ b/pyflp/_descriptors.py @@ -31,16 +31,14 @@ class ROProperty(Protocol[T_co]): """Protocol for a read-only descriptor.""" - def __get__(self, ins: Any, owner: Any = None) -> T_co | Self | None: - ... + def __get__(self, ins: Any, owner: Any = None) -> T_co | Self | None: ... @runtime_checkable class RWProperty(ROProperty[T], Protocol): """Protocol for a read-write descriptor.""" - def __set__(self, ins: Any, value: T) -> None: - ... + def __set__(self, ins: Any, value: T) -> None: ... class NamedPropMixin: @@ -59,12 +57,10 @@ def __init__(self, *ids: EventEnum, default: T | None = None, readonly: bool = F self._readonly = readonly @overload - def _get_event(self, ins: ItemModel[VE]) -> ItemModel[VE]: - ... + def _get_event(self, ins: ItemModel[VE]) -> ItemModel[VE]: ... @overload - def _get_event(self, ins: EventModel) -> AnyEvent | None: - ... + def _get_event(self, ins: EventModel) -> AnyEvent | None: ... def _get_event(self, ins: ItemModel[VE] | EventModel): if isinstance(ins, ItemModel): @@ -85,12 +81,10 @@ def default(self) -> T | None: # Configure version based defaults here return self._default @abc.abstractmethod - def _get(self, ev_or_ins: Any) -> T | None: - ... + def _get(self, ev_or_ins: Any) -> T | None: ... @abc.abstractmethod - def _set(self, ev_or_ins: Any, value: T) -> None: - ... + def _set(self, ev_or_ins: Any, value: T) -> None: ... @final def __get__(self, ins: Any, owner: Any = None) -> T | Self | None: diff --git a/pyflp/_models.py b/pyflp/_models.py index 52a5c91..9528310 100644 --- a/pyflp/_models.py +++ b/pyflp/_models.py @@ -89,24 +89,20 @@ def __eq__(self, o: object) -> bool: @runtime_checkable class ModelCollection(Iterable[MT_co], Protocol[MT_co]): @overload - def __getitem__(self, i: int | str) -> MT_co: - ... + def __getitem__(self, i: int | str) -> MT_co: ... @overload - def __getitem__(self, i: slice) -> Sequence[MT_co]: - ... + def __getitem__(self, i: slice) -> Sequence[MT_co]: ... def supports_slice(func: Callable[[ModelCollection[MT_co], str | int | slice], MT_co]): """Wraps a :meth:`ModelCollection.__getitem__` to return a sequence if required.""" @overload - def wrapper(self: ModelCollection[MT_co], i: int | str) -> MT_co: - ... + def wrapper(self: ModelCollection[MT_co], i: int | str) -> MT_co: ... @overload - def wrapper(self: ModelCollection[MT_co], i: slice) -> Sequence[MT_co]: - ... + def wrapper(self: ModelCollection[MT_co], i: slice) -> Sequence[MT_co]: ... @functools.wraps(func) def wrapper(self: Any, i: Any) -> MT_co | Sequence[MT_co]: diff --git a/tests/test_project.py b/tests/test_project.py index 8dec7be..7570e09 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -13,10 +13,7 @@ def test_project(project: Project): assert project.artists == "demberto" assert project.channel_count == 19 - assert ( - project.comments - == textwrap.dedent( - """\ + assert project.comments == textwrap.dedent("""\ This is a testing FLP used by PyFLP - An FL Studio project file parser. Notes for contributors: @@ -25,9 +22,7 @@ def test_project(project: Project): Terms: "item(s)": Refers to a channel, insert, slot, track, pattern, timemarker, etc. - """ - ).replace("\n", "\r") - ) # Who the hell uses \r? + """).replace("\n", "\r") # Who the hell uses \r? assert project.created_on == datetime.datetime(2022, 9, 16, 20, 47, 12, 746000) assert project.data_path == pathlib.Path("") assert project.format == FileFormat.Project