diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 091ecc2..eb8015c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,8 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.7.0" + rev: "v0.9.2" hooks: - id: ruff args: ["--fix", "--show-fixes"] + - id: ruff-format diff --git a/plugin_test.py b/plugin_test.py index 3037fa7..b827269 100644 --- a/plugin_test.py +++ b/plugin_test.py @@ -49,7 +49,9 @@ def test_error(): result = testdir.runpytest_subprocess() result.stderr.re_match_lines( - [r"::error file=test_annotation_pytest_error\.py,line=8::test_error.*",] + [ + r"::error file=test_annotation_pytest_error\.py,line=8::test_error.*", + ] ) diff --git a/pyproject.toml b/pyproject.toml index a4c5cb6..70e582c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,7 +77,6 @@ extend-select = [ ] ignore = [ "PLR", # Design related pylint codes - "PT004", # Use underscore for non-returning fixture (use usefixture instead) ] isort.required-imports = ["from __future__ import annotations"] diff --git a/pytest_github_actions_annotate_failures/plugin.py b/pytest_github_actions_annotate_failures/plugin.py index 0c364ea..2c29fad 100644 --- a/pytest_github_actions_annotate_failures/plugin.py +++ b/pytest_github_actions_annotate_failures/plugin.py @@ -1,4 +1,3 @@ - from __future__ import annotations import contextlib @@ -133,6 +132,7 @@ def pytest_addoption(parser): help="Annotate failures in GitHub Actions.", ) + def pytest_configure(config): if not config.option.exclude_warning_annotations: config.pluginmanager.register(_AnnotateWarnings(), "annotate_warnings") @@ -160,9 +160,7 @@ def _build_workflow_command( ("title", title), ] - result = result + ",".join( - f"{k}={v}" for k, v in entries if v is not None - ) + result = result + ",".join(f"{k}={v}" for k, v in entries if v is not None) if message is not None: result = result + "::" + _escape(message)