diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c52fdcb552d..51625eb4c89 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] + args: [--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$) @@ -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 diff --git a/Tests/bench_cffi_access.py b/Tests/bench_cffi_access.py index c4ab3bdccb3..d2a08c07bc4 100644 --- a/Tests/bench_cffi_access.py +++ b/Tests/bench_cffi_access.py @@ -32,9 +32,8 @@ 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, " + f"{(endtime - starttime) / (x + 1.0):.6f}s per iteration" ) 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