Skip to content

Commit

Permalink
MAINT: autoupdate pre-commit hooks (#348)
Browse files Browse the repository at this point in the history
* MAINT: address Ruff issues
  • Loading branch information
pre-commit-ci[bot] authored Aug 2, 2024
1 parent d3ae0f1 commit 823b323
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -108,6 +108,6 @@ repos:
- python

- repo: https://github.com/ComPWA/mirrors-pyright
rev: v1.1.357
rev: v1.1.374
hooks:
- id: pyright
6 changes: 3 additions & 3 deletions src/compwa_policy/check_dev_files/ruff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/compwa_policy/set_nb_cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 823b323

Please sign in to comment.