diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dbec99bc..375622d5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: - id: python-no-log-warn - id: text-unicode-replacement-char - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.9.9 + rev: v0.11.0 hooks: - id: ruff-format - id: ruff @@ -59,7 +59,7 @@ repos: - id: nbstripout exclude: (docs) - repo: https://github.com/crate-ci/typos - rev: v1.30.0 + rev: v1 hooks: - id: typos exclude: (\.ipynb) diff --git a/src/_pytask/logging.py b/src/_pytask/logging.py index 4cc343a2..46276f5e 100644 --- a/src/_pytask/logging.py +++ b/src/_pytask/logging.py @@ -1,4 +1,4 @@ -"""Add general logging capabilities.""" # noqa: A005 +"""Add general logging capabilities.""" from __future__ import annotations diff --git a/src/_pytask/profile.py b/src/_pytask/profile.py index 000a55b4..b34ef045 100644 --- a/src/_pytask/profile.py +++ b/src/_pytask/profile.py @@ -1,4 +1,4 @@ -"""Contains the code to profile the execution.""" # noqa: A005 +"""Contains the code to profile the execution.""" from __future__ import annotations diff --git a/src/_pytask/traceback.py b/src/_pytask/traceback.py index 71833ed9..d2b13222 100644 --- a/src/_pytask/traceback.py +++ b/src/_pytask/traceback.py @@ -1,4 +1,4 @@ -"""Process tracebacks.""" # noqa: A005 +"""Process tracebacks.""" from __future__ import annotations diff --git a/src/_pytask/typing.py b/src/_pytask/typing.py index eac5854d..f2ddba9b 100644 --- a/src/_pytask/typing.py +++ b/src/_pytask/typing.py @@ -1,4 +1,4 @@ -from __future__ import annotations # noqa: A005 +from __future__ import annotations import functools from enum import Enum diff --git a/src/_pytask/warnings.py b/src/_pytask/warnings.py index 0c307683..3b2325e8 100644 --- a/src/_pytask/warnings.py +++ b/src/_pytask/warnings.py @@ -1,4 +1,4 @@ -"""Contains code for capturing warnings.""" # noqa: A005 +"""Contains code for capturing warnings.""" from __future__ import annotations diff --git a/src/_pytask/warnings_utils.py b/src/_pytask/warnings_utils.py index 89a0b1e6..eb198f62 100644 --- a/src/_pytask/warnings_utils.py +++ b/src/_pytask/warnings_utils.py @@ -129,7 +129,7 @@ def _resolve_warning_category(category: str) -> type[Warning]: if not issubclass(cat, Warning): msg = f"{cat} is not a Warning subclass" raise TypeError(msg) - return cast(type[Warning], cat) + return cast("type[Warning]", cat) def warning_record_to_str(warning_message: warnings.WarningMessage) -> str: diff --git a/tests/test_console.py b/tests/test_console.py index 6aa74193..f9cd682a 100644 --- a/tests/test_console.py +++ b/tests/test_console.py @@ -80,7 +80,7 @@ def test_create_url_style_for_path(edtior_url_scheme, expected): + [(outcome, CollectionOutcome, "description") for outcome in CollectionOutcome], ) def test_create_summary_panel(capsys, outcome, outcome_enum, total_description): - counts = {out: 0 for out in outcome_enum} + counts = dict.fromkeys(outcome_enum, 0) counts[outcome] = 1 panel = create_summary_panel(counts, outcome_enum, total_description) console.print(panel)