From ed0c648710c592668c3c896f6fd290eddf0d7c0d Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Fri, 2 Jan 2026 06:50:58 +0000 Subject: [PATCH 1/7] Switch from pre-commit to prek - Replace pre-commit with prek in pyproject.toml dev dependencies - Update .pre-commit-config.yaml to use prek builtin hooks - Remove pre-commit CI configuration (ci: section) - Update GitHub Actions workflow to use prek commands - Update contributing documentation for prek --- .github/workflows/lint.yml | 8 ++--- .pre-commit-config.yaml | 59 ++++++------------------------------ docs/source/contributing.rst | 10 +++--- pyproject.toml | 2 +- 4 files changed, 19 insertions(+), 60 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4c01f743..a2e60494 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -35,9 +35,9 @@ jobs: - name: Lint run: | - uv run --extra=dev pre-commit run --all-files --hook-stage pre-commit --verbose - uv run --extra=dev pre-commit run --all-files --hook-stage pre-push --verbose - uv run --extra=dev pre-commit run --all-files --hook-stage manual --verbose + uv run --extra=dev prek run --all-files --hook-stage pre-commit --verbose + uv run --extra=dev prek run --all-files --hook-stage pre-push --verbose + uv run --extra=dev prek run --all-files --hook-stage manual --verbose env: UV_PYTHON: ${{ matrix.python-version }} @@ -47,7 +47,7 @@ jobs: completion-lint: needs: build runs-on: ubuntu-latest - if: always() # Run even if one matrix job fails + if: always() # Run even if one matrix job fails steps: - name: Check matrix job status run: |- diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f80c2aa4..82eeb111 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,58 +1,14 @@ --- fail_fast: true -# See https://pre-commit.com for more information -# See https://pre-commit.com/hooks.html for more hooks - -ci: - # We use system Python, with required dependencies specified in pyproject.toml. - # We therefore cannot use those dependencies in pre-commit CI. - skip: - - actionlint - - sphinx-lint - - check-manifest - - deptry - - doc8 - - docformatter - - docs - - interrogate - - interrogate-docs - - linkcheck - - mypy - - mypy-docs - - pylint - - pyproject-fmt-fix - - pyright - - pyright-docs - - pyright-verifytypes - - ty - - ty-docs - - pyroma - - ruff-check-fix - - ruff-check-fix-docs - - ruff-format-fix - - ruff-format-fix-docs - - shellcheck - - shellcheck-docs - - shfmt - - shfmt-docs - - spelling - - vulture - - vulture-docs - - yamlfix - - zizmor - - pyrefly - - pyrefly-docs +# See https://prek.j178.dev for more information + + default_install_hook_types: [pre-commit, pre-push, commit-msg] repos: - - repo: meta - hooks: - - id: check-useless-excludes - stages: [pre-commit] - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v6.0.0 + - repo: builtin hooks: - id: check-added-large-files stages: [pre-commit] @@ -76,11 +32,14 @@ repos: stages: [pre-commit] - id: end-of-file-fixer stages: [pre-commit] + - id: trailing-whitespace + stages: [pre-commit] + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: - id: file-contents-sorter files: spelling_private_dict\.txt$ stages: [pre-commit] - - id: trailing-whitespace - stages: [pre-commit] - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.10.0 hooks: diff --git a/docs/source/contributing.rst b/docs/source/contributing.rst index 0e531220..55d90239 100644 --- a/docs/source/contributing.rst +++ b/docs/source/contributing.rst @@ -27,11 +27,11 @@ and on Ubuntu with ``apt``: $ apt-get install -y enchant -Install ``pre-commit`` hooks: +Install ``prek`` hooks: .. code-block:: console - $ pre-commit install + $ prek install Linting ------- @@ -40,9 +40,9 @@ Run lint tools either by committing, or with: .. code-block:: console - $ pre-commit run --all-files --hook-stage pre-commit --verbose - $ pre-commit run --all-files --hook-stage pre-push --verbose - $ pre-commit run --all-files --hook-stage manual --verbose + $ prek run --all-files --hook-stage pre-commit --verbose + $ prek run --all-files --hook-stage pre-push --verbose + $ prek run --all-files --hook-stage manual --verbose .. _Homebrew: https://brew.sh diff --git a/pyproject.toml b/pyproject.toml index 51b8d55c..2aa05114 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,7 @@ optional-dependencies.dev = [ "interrogate==1.7.0", "mypy[faster-cache]==1.19.1", "mypy-strict-kwargs==2025.4.3", - "pre-commit==4.5.1", + "prek==0.2.25", "pydocstyle==6.3", "pygments==2.19.2", "pylint[spelling]==4.0.4", From 852127947726f91c4b4566c25bf3a26be3f2f38e Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Fri, 2 Jan 2026 07:05:06 +0000 Subject: [PATCH 2/7] Undo some unnecessary changes --- .pre-commit-config.yaml | 45 ++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 82eeb111..c18dc43f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,8 +3,6 @@ fail_fast: true # See https://prek.j178.dev for more information - - default_install_hook_types: [pre-commit, pre-push, commit-msg] repos: @@ -32,14 +30,11 @@ repos: stages: [pre-commit] - id: end-of-file-fixer stages: [pre-commit] - - id: trailing-whitespace - stages: [pre-commit] - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v6.0.0 - hooks: - id: file-contents-sorter files: spelling_private_dict\.txt$ stages: [pre-commit] + - id: trailing-whitespace + stages: [pre-commit] - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.10.0 hooks: @@ -81,7 +76,8 @@ repos: - id: shellcheck-docs name: shellcheck-docs - entry: uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=shell + entry: + uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=shell --language=console --command="shellcheck --shell=bash" language: python types_or: [markdown, rst] @@ -98,7 +94,8 @@ repos: - id: shfmt-docs name: shfmt-docs - entry: uv run --extra=dev doccmd --language=shell --language=console --skip-marker=shfmt + entry: + uv run --extra=dev doccmd --language=shell --language=console --skip-marker=shfmt --no-pad-file --command="shfmt --write --space-redirects --indent=4" language: python types_or: [markdown, rst] @@ -117,7 +114,8 @@ repos: - id: mypy-docs name: mypy-docs stages: [pre-push] - entry: uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python + entry: + uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python --command="mypy" language: python types_or: [markdown, rst] @@ -143,7 +141,8 @@ repos: - id: pyright-docs name: pyright-docs stages: [pre-push] - entry: uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python + entry: + uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python --command="pyright" language: python types_or: [markdown, rst] @@ -160,7 +159,8 @@ repos: - id: vulture-docs name: vulture docs - entry: uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python + entry: + uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python --command="vulture" language: python types_or: [markdown, rst] @@ -194,7 +194,8 @@ repos: - id: pylint-docs name: pylint-docs - entry: uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python + entry: + uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python --command="pylint" language: python stages: [manual] @@ -227,7 +228,8 @@ repos: - id: ruff-format-fix-docs name: Ruff format docs - entry: uv run --extra=dev doccmd --language=python --no-pad-file --command="ruff + entry: + uv run --extra=dev doccmd --language=python --no-pad-file --command="ruff format" language: python types_or: [markdown, rst] @@ -252,7 +254,8 @@ repos: - id: interrogate-docs name: interrogate docs - entry: uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python + entry: + uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python --command="interrogate" language: python types_or: [markdown, rst] @@ -270,7 +273,8 @@ repos: - id: linkcheck name: linkcheck - entry: uv run --extra=dev sphinx-build -M linkcheck docs/source docs/build + entry: + uv run --extra=dev sphinx-build -M linkcheck docs/source docs/build -W language: python types_or: [rst] @@ -280,7 +284,8 @@ repos: - id: spelling name: spelling - entry: uv run --extra=dev sphinx-build -M spelling docs/source docs/build + entry: + uv run --extra=dev sphinx-build -M spelling docs/source docs/build -W language: python types_or: [rst] @@ -317,7 +322,8 @@ repos: - id: ty-docs name: ty-docs stages: [pre-push] - entry: uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python + entry: + uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python --command="ty check" language: python types_or: [markdown, rst] @@ -360,7 +366,8 @@ repos: - id: pyrefly-docs name: pyrefly-docs stages: [pre-push] - entry: uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python + entry: + uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python --command="pyrefly check" language: python types_or: [markdown, rst] From e2c817a172fb46354c735495fde48b39f9e4e944 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Fri, 2 Jan 2026 07:10:53 +0000 Subject: [PATCH 3/7] Remove stage --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c18dc43f..3313df31 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ fail_fast: true # See https://prek.j178.dev for more information -default_install_hook_types: [pre-commit, pre-push, commit-msg] +default_install_hook_types: [pre-commit, pre-push] repos: - repo: builtin From 1a622a69c12d664cc3d46d0f0d130ba3dc9d4654 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Fri, 2 Jan 2026 07:12:37 +0000 Subject: [PATCH 4/7] Remove changes --- .pre-commit-config.yaml | 86 ++++++++++++++++++++++++++++------------- 1 file changed, 60 insertions(+), 26 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3313df31..d9a702af 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,12 +1,58 @@ --- fail_fast: true -# See https://prek.j178.dev for more information +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks + +ci: + # We use system Python, with required dependencies specified in pyproject.toml. + # We therefore cannot use those dependencies in pre-commit CI. + skip: + - actionlint + - sphinx-lint + - check-manifest + - deptry + - doc8 + - docformatter + - docs + - interrogate + - interrogate-docs + - linkcheck + - mypy + - mypy-docs + - pylint + - pyproject-fmt-fix + - pyright + - pyright-docs + - pyright-verifytypes + - ty + - ty-docs + - pyroma + - ruff-check-fix + - ruff-check-fix-docs + - ruff-format-fix + - ruff-format-fix-docs + - shellcheck + - shellcheck-docs + - shfmt + - shfmt-docs + - spelling + - vulture + - vulture-docs + - yamlfix + - zizmor + - pyrefly + - pyrefly-docs default_install_hook_types: [pre-commit, pre-push] repos: - - repo: builtin + - repo: meta + hooks: + - id: check-useless-excludes + stages: [pre-commit] + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 hooks: - id: check-added-large-files stages: [pre-commit] @@ -76,8 +122,7 @@ repos: - id: shellcheck-docs name: shellcheck-docs - entry: - uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=shell + entry: uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=shell --language=console --command="shellcheck --shell=bash" language: python types_or: [markdown, rst] @@ -94,8 +139,7 @@ repos: - id: shfmt-docs name: shfmt-docs - entry: - uv run --extra=dev doccmd --language=shell --language=console --skip-marker=shfmt + entry: uv run --extra=dev doccmd --language=shell --language=console --skip-marker=shfmt --no-pad-file --command="shfmt --write --space-redirects --indent=4" language: python types_or: [markdown, rst] @@ -114,8 +158,7 @@ repos: - id: mypy-docs name: mypy-docs stages: [pre-push] - entry: - uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python + entry: uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python --command="mypy" language: python types_or: [markdown, rst] @@ -141,8 +184,7 @@ repos: - id: pyright-docs name: pyright-docs stages: [pre-push] - entry: - uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python + entry: uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python --command="pyright" language: python types_or: [markdown, rst] @@ -159,8 +201,7 @@ repos: - id: vulture-docs name: vulture docs - entry: - uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python + entry: uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python --command="vulture" language: python types_or: [markdown, rst] @@ -194,8 +235,7 @@ repos: - id: pylint-docs name: pylint-docs - entry: - uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python + entry: uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python --command="pylint" language: python stages: [manual] @@ -228,8 +268,7 @@ repos: - id: ruff-format-fix-docs name: Ruff format docs - entry: - uv run --extra=dev doccmd --language=python --no-pad-file --command="ruff + entry: uv run --extra=dev doccmd --language=python --no-pad-file --command="ruff format" language: python types_or: [markdown, rst] @@ -254,8 +293,7 @@ repos: - id: interrogate-docs name: interrogate docs - entry: - uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python + entry: uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python --command="interrogate" language: python types_or: [markdown, rst] @@ -273,8 +311,7 @@ repos: - id: linkcheck name: linkcheck - entry: - uv run --extra=dev sphinx-build -M linkcheck docs/source docs/build + entry: uv run --extra=dev sphinx-build -M linkcheck docs/source docs/build -W language: python types_or: [rst] @@ -284,8 +321,7 @@ repos: - id: spelling name: spelling - entry: - uv run --extra=dev sphinx-build -M spelling docs/source docs/build + entry: uv run --extra=dev sphinx-build -M spelling docs/source docs/build -W language: python types_or: [rst] @@ -322,8 +358,7 @@ repos: - id: ty-docs name: ty-docs stages: [pre-push] - entry: - uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python + entry: uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python --command="ty check" language: python types_or: [markdown, rst] @@ -366,8 +401,7 @@ repos: - id: pyrefly-docs name: pyrefly-docs stages: [pre-push] - entry: - uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python + entry: uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python --command="pyrefly check" language: python types_or: [markdown, rst] From dee2727aa1c8f7462c99c17ca6acf01b2ad0b9c1 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Fri, 2 Jan 2026 07:12:59 +0000 Subject: [PATCH 5/7] Test a change --- src/vws/exceptions/vws_exceptions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vws/exceptions/vws_exceptions.py b/src/vws/exceptions/vws_exceptions.py index 48222376..e0e268e2 100644 --- a/src/vws/exceptions/vws_exceptions.py +++ b/src/vws/exceptions/vws_exceptions.py @@ -127,7 +127,7 @@ class ProjectInactiveError(VWSError): @beartype class MetadataTooLargeError(VWSError): """ - Exception raised when Vuforia returns a response with a result code + Exception raised when Vuforia returns responses with a result code 'MetadataTooLarge'. """ From bcb26d17a371a82c5a25754e9199ed2a80c0fe22 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Fri, 2 Jan 2026 07:13:08 +0000 Subject: [PATCH 6/7] Undo a change --- src/vws/exceptions/vws_exceptions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vws/exceptions/vws_exceptions.py b/src/vws/exceptions/vws_exceptions.py index e0e268e2..48222376 100644 --- a/src/vws/exceptions/vws_exceptions.py +++ b/src/vws/exceptions/vws_exceptions.py @@ -127,7 +127,7 @@ class ProjectInactiveError(VWSError): @beartype class MetadataTooLargeError(VWSError): """ - Exception raised when Vuforia returns responses with a result code + Exception raised when Vuforia returns a response with a result code 'MetadataTooLarge'. """ From 833c51f2a8ac442a80dbd4d8189e6df605b74775 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Fri, 2 Jan 2026 07:14:39 +0000 Subject: [PATCH 7/7] [pre-commit.ci lite] apply automatic fixes --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a2e60494..0a9661f4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -47,7 +47,7 @@ jobs: completion-lint: needs: build runs-on: ubuntu-latest - if: always() # Run even if one matrix job fails + if: always() # Run even if one matrix job fails steps: - name: Check matrix job status run: |-