From 823b32306dd8c1d82e1ad50b4aba6e89399b1b9e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2024 08:10:34 +0000 Subject: [PATCH] MAINT: autoupdate pre-commit hooks (#348) * MAINT: address Ruff issues --- .pre-commit-config.yaml | 8 ++++---- src/compwa_policy/check_dev_files/ruff.py | 6 +++--- src/compwa_policy/set_nb_cells.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 310b5cc5..2127779f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,14 +16,14 @@ repos: - id: check-useless-excludes - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.3.5 + rev: v0.5.5 hooks: - id: ruff args: [--fix] - id: ruff-format - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-ast - id: check-case-conflict @@ -82,7 +82,7 @@ repos: exclude: (?x)^(labels/.*\.toml)$ - repo: https://github.com/streetsidesoftware/cspell-cli - rev: v8.6.1 + rev: v8.13.0 hooks: - id: cspell @@ -108,6 +108,6 @@ repos: - python - repo: https://github.com/ComPWA/mirrors-pyright - rev: v1.1.357 + rev: v1.1.374 hooks: - id: pyright diff --git a/src/compwa_policy/check_dev_files/ruff.py b/src/compwa_policy/check_dev_files/ruff.py index 02acf192..863d2b63 100644 --- a/src/compwa_policy/check_dev_files/ruff.py +++ b/src/compwa_policy/check_dev_files/ruff.py @@ -175,9 +175,9 @@ def _move_ruff_lint_config(pyproject: ModifiablePyproject) -> None: lint_config = pyproject.get_table("tool.ruff.lint", create=True) lint_config.update(lint_arrays) lint_tables = {k: v for k, v in lint_settings.items() if isinstance(v, abc.Mapping)} - for table in lint_tables: - lint_config = pyproject.get_table(f"tool.ruff.lint.{table}", create=True) - lint_config.update(lint_tables[table]) + for table_name, values in lint_tables.items(): + lint_config = pyproject.get_table(f"tool.ruff.lint.{table_name}", create=True) + lint_config.update(values) for key in lint_settings: del global_settings[key] if lint_arrays or lint_tables: diff --git a/src/compwa_policy/set_nb_cells.py b/src/compwa_policy/set_nb_cells.py index 9c4d4d43..3b5d87f7 100644 --- a/src/compwa_policy/set_nb_cells.py +++ b/src/compwa_policy/set_nb_cells.py @@ -166,7 +166,7 @@ def _insert_autolink_concat(filename: str) -> None: return new_cell = nbformat.v4.new_markdown_cell(expected_cell_content) del new_cell["id"] # following nbformat_minor = 4 - notebook["cells"].insert(cell_id, new_cell) + notebook["cells"].insert(cell_id, new_cell) # noqa: B909 nbformat.validate(notebook) nbformat.write(notebook, filename) return