From e95745359cda0a51a6e49ea912a273425ccc9242 Mon Sep 17 00:00:00 2001 From: Moshe Atlow Date: Tue, 4 Jun 2024 15:32:59 +0300 Subject: [PATCH] chore: fix lint --- .github/workflows/lint_python.yml | 3 +-- pyproject.toml | 1 - tap2junit/tap13.py | 10 ++++------ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/lint_python.yml b/.github/workflows/lint_python.yml index b3e57ac..e1c9e1c 100644 --- a/.github/workflows/lint_python.yml +++ b/.github/workflows/lint_python.yml @@ -15,9 +15,8 @@ jobs: - run: pip install --upgrade pip setuptools wheel - run: pip install --editable ".[dev]" - run: codespell . - - run: ruff --output-format=github . + - run: ruff check --output-format=github . - run: black --check . - run: mypy . - run: pytest -vv . - run: pytest --doctest-modules . - - run: safety check diff --git a/pyproject.toml b/pyproject.toml index fb5d21b..79c83a2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,6 @@ dev = [ "pytest", "pytest-clarity", "ruff", - "safety", ] [project.scripts] diff --git a/tap2junit/tap13.py b/tap2junit/tap13.py index 8cb4d6a..214902c 100644 --- a/tap2junit/tap13.py +++ b/tap2junit/tap13.py @@ -191,16 +191,16 @@ def _parse(self, source): t_attrs["id"] = self.__tests_counter[-1] t_attrs["id"] = int(t_attrs["id"]) if t_attrs["id"] < self.__tests_counter[-1]: - raise ValueError("Descending test id on line: %r" % line) + raise ValueError(f"Descending test id on line: {line!r}") # according to TAP13 specs, missing tests must be handled as # 'not ok' so here we add the missing tests in sequence while t_attrs["id"] > self.__tests_counter[-1]: + counter = self.__tests_counter[-1] self.tests.append( Test( "not ok", self.__tests_counter[-1], - comment="DIAG: Test %s not present" - % self.__tests_counter[-1], + comment=f"DIAG: Test {counter} not present", ) ) self.__tests_counter[-1] += 1 @@ -210,9 +210,7 @@ def _parse(self, source): # according to TAP13 specs, everything after this is an # explanation of why testing must be stopped t.diagnostics = t.diagnostics or t.description - t.description = ( - "Bail out for Test %s" % self.__tests_counter[-1] - ) + t.description = f"Bail out for Test {self.__tests_counter[-1]}" self.tests.append(t) in_test = True continue