diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 12e51fe..23e3f0c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,20 +10,20 @@ repos: - id: validate-pyproject - repo: https://github.com/adhtruong/mirrors-typos - rev: v1.35.8 + rev: v1.39.0 hooks: - id: typos args: [--force-exclude] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.12.11 + rev: v0.14.4 hooks: - id: ruff-check args: ["--fix", "--unsafe-fixes"] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.17.1 + rev: v1.18.2 hooks: - id: mypy files: "^src/" diff --git a/demo/qapplication.py b/demo/qapplication.py index 236c575..df664b0 100644 --- a/demo/qapplication.py +++ b/demo/qapplication.py @@ -40,7 +40,7 @@ def new_file(self) -> None: def open(self) -> None: if self.maybe_save(): - fileName, filtr = QFileDialog.getOpenFileName(self) + fileName, _filtr = QFileDialog.getOpenFileName(self) if fileName: self.load_file(fileName) @@ -48,7 +48,7 @@ def save(self) -> bool: return self.save_file(self._cur_file) if self._cur_file else self.save_as() def save_as(self) -> bool: - fileName, filtr = QFileDialog.getSaveFileName(self) + fileName, _filtr = QFileDialog.getSaveFileName(self) if fileName: return self.save_file(fileName) diff --git a/tests/test_app.py b/tests/test_app.py index 8f43cfb..8da0f3e 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -45,7 +45,7 @@ def test_app(full_app: FullApp) -> None: def test_sorting(full_app: FullApp) -> None: groups = list(full_app.menus.iter_menu_groups(full_app.Menus.EDIT)) assert len(groups) == 3 - [g0, g1, g2] = groups + [_g0, g1, g2] = groups assert all(i.group == "1_undo_redo" for i in g1) assert all(i.group == "2_copy_paste" for i in g2) @@ -74,7 +74,7 @@ def test_action_import_by_string(full_app: FullApp) -> None: # tests what happens when the object is not callable cannot be found with pytest.raises( TypeError, - match="Command 'not.callable' did not resolve to a callble object", + match=r"Command 'not\.callable' did not resolve to a callble object", ): full_app.commands.execute_command(full_app.Commands.NOT_CALLABLE) # the second time we try within a session, nothing should happen diff --git a/tests/test_command_registry.py b/tests/test_command_registry.py index 7ef6545..c750725 100644 --- a/tests/test_command_registry.py +++ b/tests/test_command_registry.py @@ -14,10 +14,10 @@ def test_commands_registry() -> None: assert "(1 commands)" in repr(reg) assert id1 in str(reg) assert id1 in reg - with pytest.raises(KeyError, match="my.id2"): + with pytest.raises(KeyError, match=r"my\.id2"): reg["my.id2"] - with pytest.raises(ValueError, match="Command 'my.id' already registered"): + with pytest.raises(ValueError, match=r"Command 'my\.id' already registered"): reg.register_command(id1, lambda: 42, "My Title") assert reg.execute_command(id1, execute_asynchronously=True).result() == 42 diff --git a/tests/test_registries.py b/tests/test_registries.py index a011fa3..37ede1d 100644 --- a/tests/test_registries.py +++ b/tests/test_registries.py @@ -124,7 +124,9 @@ def test_register_action_keybindings_filter(kb: list[dict], msg: str) -> None: ), ], ) -def test_register_action_keybindings_priorization(kb1: str, kb2: str, kb3: str) -> None: +def test_register_action_keybindings_prioritization( + kb1: str, kb2: str, kb3: str +) -> None: """Check `get_context_prioritized_keybinding`.""" reg = KeyBindingsRegistry() diff --git a/tests/test_types.py b/tests/test_types.py index 64fdd41..3df6ad0 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -17,5 +17,5 @@ def test_action_validation() -> None: with pytest.raises(ValidationError): Action(id="test", title="test", callback=[]) - with pytest.raises(ValidationError, match="'x.:asdf' is not a valid"): + with pytest.raises(ValidationError, match=r"'x\.\\:asdf' is not a valid"): Action(id="test", title="test", callback="x.:asdf")