From aa77a712c92c89c23b983d551c8f8f74b408dc50 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 17:26:24 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v4.6.0) - [github.com/astral-sh/ruff-pre-commit: v0.3.4 → v0.5.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.3.4...v0.5.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bb52240..343d514 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: no-commit-to-branch - id: debug-statements @@ -14,7 +14,7 @@ repos: - id: check-toml - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.3.4 + rev: v0.5.0 hooks: - id: ruff-format - id: ruff From 4996508d161be6e76264a5eb12bcb83fae14622e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Mon, 1 Jul 2024 19:38:10 +0200 Subject: [PATCH 2/2] STY: apply unsafe fixes from ruff 0.5 --- src/idefix_cli/_backports.py | 2 +- src/idefix_cli/_commands/digest.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/idefix_cli/_backports.py b/src/idefix_cli/_backports.py index 9e71032..8fc80eb 100644 --- a/src/idefix_cli/_backports.py +++ b/src/idefix_cli/_backports.py @@ -53,7 +53,7 @@ def __new__(cls, *values): if len(values) == 3: # check that errors argument is a string if not isinstance(values[2], str): - raise TypeError("errors must be a string, not %r" % (values[2])) + raise TypeError(f"errors must be a string, not {values[2]!r}") value = str(*values) member = str.__new__(cls, value) member._value_ = value diff --git a/src/idefix_cli/_commands/digest.py b/src/idefix_cli/_commands/digest.py index 7988894..1fad4cb 100644 --- a/src/idefix_cli/_commands/digest.py +++ b/src/idefix_cli/_commands/digest.py @@ -34,7 +34,7 @@ def _log_to_data(log: list[str]): def _data_to_json(header: str, data: dict[str, list[str]]) -> str: - res: list[str] = ['"%s": {' % header] + res: list[str] = [f'"{header}": {{'] ncolumns = len(data) for icol, (name, record) in enumerate(data.items()): if icol < ncolumns - 1: