Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
4 changes: 2 additions & 2 deletions demo/qapplication.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ 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)

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)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/test_command_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion tests/test_registries.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.<locals>:asdf' is not a valid"):
with pytest.raises(ValidationError, match=r"'x\.\<locals\>\:asdf' is not a valid"):
Action(id="test", title="test", callback="x.<locals>:asdf")
Loading