From 793bb7fb6faf6029f995e6f53b6ecd03f07ff8c0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 17:24:09 +0000 Subject: [PATCH 1/5] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.2.0 → v0.3.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.2.0...v0.3.4) - [github.com/psf/black-pre-commit-mirror: 24.1.1 → 24.3.0](https://github.com/psf/black-pre-commit-mirror/compare/24.1.1...24.3.0) - [github.com/PyCQA/bandit: 1.7.7 → 1.7.8](https://github.com/PyCQA/bandit/compare/1.7.7...1.7.8) - [github.com/Lucas-C/pre-commit-hooks: v1.5.4 → v1.5.5](https://github.com/Lucas-C/pre-commit-hooks/compare/v1.5.4...v1.5.5) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c52fdcb552d..7e3fd3e1841 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,24 +1,24 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.2.0 + rev: v0.3.4 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.1.1 + rev: 24.3.0 hooks: - id: black - repo: https://github.com/PyCQA/bandit - rev: 1.7.7 + rev: 1.7.8 hooks: - id: bandit args: [--severity-level=high] files: ^src/ - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.5.4 + rev: v1.5.5 hooks: - id: remove-tabs exclude: (Makefile$|\.bat$|\.cmake$|\.eps$|\.fits$|\.gd$|\.opt$) From 88ddcde8d858b48a5361a2f00f3c989ab32c7f67 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 17:24:28 +0000 Subject: [PATCH 2/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- Tests/bench_cffi_access.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Tests/bench_cffi_access.py b/Tests/bench_cffi_access.py index c4ab3bdccb3..1d66b6636b1 100644 --- a/Tests/bench_cffi_access.py +++ b/Tests/bench_cffi_access.py @@ -32,9 +32,7 @@ def timer(func, label, *args) -> None: break endtime = time.time() print( - "{}: completed {} iterations in {:.4f}s, {:.6f}s per iteration".format( - label, x + 1, endtime - starttime, (endtime - starttime) / (x + 1.0) - ) + f"{label}: completed {x + 1} iterations in {endtime - starttime:.4f}s, {(endtime - starttime) / (x + 1.0):.6f}s per iteration" ) From 97c6e46f34c53ad9780e32ce8b1978ad01bc2d5d Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 1 Apr 2024 20:49:19 +0300 Subject: [PATCH 3/5] Fix lint --- Tests/bench_cffi_access.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tests/bench_cffi_access.py b/Tests/bench_cffi_access.py index 1d66b6636b1..d2a08c07bc4 100644 --- a/Tests/bench_cffi_access.py +++ b/Tests/bench_cffi_access.py @@ -32,7 +32,8 @@ def timer(func, label, *args) -> None: break endtime = time.time() print( - f"{label}: completed {x + 1} iterations in {endtime - starttime:.4f}s, {(endtime - starttime) / (x + 1.0):.6f}s per iteration" + f"{label}: completed {x + 1} iterations in {endtime - starttime:.4f}s, " + f"{(endtime - starttime) / (x + 1.0):.6f}s per iteration" ) From 55b8f9126bd5b0dd11c6cbe76b6b91c0d7630f5b Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 1 Apr 2024 20:49:47 +0300 Subject: [PATCH 4/5] Move Ruff's fix=true up from pre-commit to pyproject --- .pre-commit-config.yaml | 2 +- pyproject.toml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7e3fd3e1841..c7156d93722 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ repos: rev: v0.3.4 hooks: - id: ruff - args: [--fix, --exit-non-zero-on-fix] + args: [--exit-non-zero-on-fix] - repo: https://github.com/psf/black-pre-commit-mirror rev: 24.3.0 diff --git a/pyproject.toml b/pyproject.toml index 740b0ebeac6..3ce082fb980 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -96,6 +96,9 @@ config-settings = "raqm=enable raqm=vendor fribidi=vendor imagequant=disable" test-command = "cd {project} && .github/workflows/wheels-test.sh" test-extras = "tests" +[tool.ruff] +fix = true + [tool.ruff.lint] select = [ "C4", # flake8-comprehensions From 78670404862642a37d9895af56ba2003165f6871 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 1 Apr 2024 20:55:19 +0300 Subject: [PATCH 5/5] Check GHA, RTD and Renovate config with pre-commit --- .pre-commit-config.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c7156d93722..51625eb4c89 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,6 +42,13 @@ repos: - id: trailing-whitespace exclude: ^.github/.*TEMPLATE|^Tests/(fonts|images)/ + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.28.1 + hooks: + - id: check-github-workflows + - id: check-readthedocs + - id: check-renovate + - repo: https://github.com/sphinx-contrib/sphinx-lint rev: v0.9.1 hooks: @@ -62,5 +69,10 @@ repos: hooks: - id: tox-ini-fmt + - repo: meta + hooks: + - id: check-hooks-apply + - id: check-useless-excludes + ci: autoupdate_schedule: monthly