From bd4e0ab33c717e62f4c594f6f4f4ee977a169f7f Mon Sep 17 00:00:00 2001 From: "scitools-ci[bot]" <107775138+scitools-ci[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 02:21:45 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=81=20TEMPLATE=20DEVIATIONS:=20synced?= =?UTF-8?q?=20local=20'.pre-commit-config.yaml'=20with=20remote=20'templat?= =?UTF-8?q?es/.pre-commit-config.yaml'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 93 +++++++++++++++++++++++++++++++---------- 1 file changed, 71 insertions(+), 22 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3cf686b..15a6640 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,15 +1,35 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks +# See https://pre-commit.ci/#configuration +# See https://github.com/scientific-python/cookie#sp-repo-review + +ci: + autofix_prs: false + autoupdate_commit_msg: "chore: update pre-commit hooks" + + +# Alphabetised, for lack of a better order. +files: | + (?x)( + benchmarks\/.+\.py| + docs\/.+\.py| + lib\/.+\.py| + noxfile\.py| + pyproject\.toml| + setup\.py| + src\/.+\.py + ) +minimum_pre_commit_version: 1.21.0 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: 'v4.6.0' + rev: v4.6.0 hooks: # Prevent giant files from being committed. - id: check-added-large-files # Check whether files parse as valid Python. - id: check-ast - # Check for file name conflicts on case-insensitive filesytems. + # Check for file name conflicts on case-insensitive filesystems. - id: check-case-conflict # Check for files that contain merge conflict strings. - id: check-merge-conflict @@ -19,37 +39,66 @@ repos: - id: check-toml # Check YAML file syntax. - id: check-yaml - # Makes sure files end in a newline and only a newline + # Makes sure files end in a newline and only a newline. + # Duplicates Ruff W292 but also works on non-Python files. - id: end-of-file-fixer - # Replaces or checks mixed line ending + # Replaces or checks mixed line ending. - id: mixed-line-ending # Don't commit to main branch. - id: no-commit-to-branch + # Trims trailing whitespace. + # Duplicates Ruff W291 but also works on non-Python files. + - id: trailing-whitespace -- repo: https://github.com/psf/black - rev: '24.4.2' +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.4.4" hooks: - - id: black + - id: ruff types: [file, python] - args: [--config=./pyproject.toml, .] + args: [--fix, --show-fixes] + - id: ruff-format + types: [file, python] + +- repo: https://github.com/codespell-project/codespell + rev: "v2.2.6" + hooks: + - id: codespell + types_or: [asciidoc, python, markdown, rst] + additional_dependencies: [tomli] -- repo: https://github.com/PyCQA/flake8 - rev: '7.1.0' +- repo: https://github.com/adamchainz/blacken-docs + rev: 1.16.0 hooks: - - id: flake8 - types: [file, python] - args: [--config=./.flake8] + - id: blacken-docs + types: [file, rst] -- repo: https://github.com/pycqa/isort - rev: '5.13.2' +- repo: https://github.com/aio-libs/sort-all + rev: v1.2.0 hooks: - - id: isort + - id: sort-all types: [file, python] - args: ["--profile", "black", "--filter-files"] -- repo: https://github.com/codespell-project/codespell - rev: 'v2.3.0' +- repo: https://github.com/pre-commit/mirrors-mypy + rev: 'v1.10.0' hooks: - - id: codespell - types_or: [python, markdown, rst] - additional_dependencies: [tomli] + - id: mypy + exclude: 'noxfile\.py|docs/conf\.py' + +- repo: https://github.com/abravalheri/validate-pyproject + # More exhaustive than Ruff RUF200. + rev: "v0.18" + hooks: + - id: validate-pyproject + +- repo: https://github.com/scientific-python/cookie + rev: 2024.04.23 + hooks: + - id: sp-repo-review + additional_dependencies: ["repo-review[cli]"] + args: ["--show=errskip"] + +- repo: https://github.com/numpy/numpydoc + rev: v1.7.0 + hooks: + - id: numpydoc-validation + types: [file, python] \ No newline at end of file