From 9a87711896a9dc03c673a0d86abe9b54a15877a3 Mon Sep 17 00:00:00 2001 From: Shaan Majid <70789625+shaanmajid@users.noreply.github.com> Date: Fri, 6 Feb 2026 12:59:46 -0600 Subject: [PATCH 1/3] chore: switch to prek.toml configuration format --- .config/taplo.toml | 2 ++ .pre-commit-config.yaml | 55 ----------------------------- prek.toml | 77 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 55 deletions(-) delete mode 100644 .pre-commit-config.yaml create mode 100644 prek.toml diff --git a/.config/taplo.toml b/.config/taplo.toml index 0cffd2a2c..8adca03fc 100644 --- a/.config/taplo.toml +++ b/.config/taplo.toml @@ -1,2 +1,4 @@ +exclude = ["prek.toml"] + [formatting] align_comments = false diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index 5ae58a59a..000000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,55 +0,0 @@ -fail_fast: true -default_install_hook_types: [pre-push] -exclude: | - (?x)^( - .*/(snapshots)/.*| - )$ - -repos: - - repo: builtin - hooks: - - id: trailing-whitespace - - id: mixed-line-ending - - id: check-yaml - - id: check-toml - - id: end-of-file-fixer - - - repo: https://github.com/crate-ci/typos - rev: v1.42.3 - hooks: - - id: typos - - - repo: https://github.com/executablebooks/mdformat - rev: '1.0.0' - hooks: - - id: mdformat - language: python # ensures that Renovate can update additional_dependencies - args: [--number, --compact-tables, --align-semantic-breaks-in-lists] - additional_dependencies: - - mdformat-mkdocs==5.1.4 - - mdformat-simple-breaks==0.1.0 - - - repo: local - hooks: - - id: taplo-fmt - name: taplo fmt - entry: taplo fmt --config .config/taplo.toml - language: python - additional_dependencies: ["taplo==0.9.3"] - types: [toml] - - - repo: local - hooks: - - id: cargo-fmt - name: cargo fmt - entry: cargo fmt -- - language: system - types: [rust] - pass_filenames: false # This makes it a lot faster - - - id: cargo-clippy - name: cargo clippy - language: system - types: [rust] - pass_filenames: false - entry: cargo clippy --all-targets --all-features -- -D warnings diff --git a/prek.toml b/prek.toml new file mode 100644 index 000000000..bfce9d772 --- /dev/null +++ b/prek.toml @@ -0,0 +1,77 @@ +fail_fast = true +default_install_hook_types = ["pre-push"] +exclude = """ +(?x)^( + .*/(snapshots)/.*| +)$ +""" + +[[repos]] +repo = "builtin" +hooks = [ + { id = "trailing-whitespace" }, + { id = "mixed-line-ending" }, + { id = "check-yaml" }, + { id = "check-toml" }, + { id = "end-of-file-fixer" } +] + +[[repos]] +repo = "https://github.com/crate-ci/typos" +rev = "v1.42.3" +hooks = [ + { id = "typos" } +] + +[[repos]] +repo = "https://github.com/executablebooks/mdformat" +rev = "1.0.0" +hooks = [ + { + id = "mdformat", + language = "python", + args = [ + "--number", + "--compact-tables", + "--align-semantic-breaks-in-lists" + ], + additional_dependencies = [ + "mdformat-mkdocs==5.1.4", + "mdformat-simple-breaks==0.1.0" + ] + } +] + +[[repos]] +repo = "local" +hooks = [ + { + id = "taplo-fmt", + name = "taplo fmt", + entry = "taplo fmt --config .config/taplo.toml", + language = "python", + additional_dependencies = ["taplo==0.9.3"], + types = ["toml"] + } +] + +[[repos]] +repo = "local" +hooks = [ + { + id = "cargo-fmt", + name = "cargo fmt", + entry = "cargo fmt --", + language = "system", + types = ["rust"], + pass_filenames = false + }, + { + id = "cargo-clippy", + name = "cargo clippy", + language = "system", + types = ["rust"], + pass_filenames = false, + entry = "cargo clippy --all-targets --all-features -- -D warnings" + } +] From 78ab834230b9bf30a9e092b49b77d0764a2a2f22 Mon Sep 17 00:00:00 2001 From: Shaan Majid <70789625+shaanmajid@users.noreply.github.com> Date: Fri, 6 Feb 2026 12:59:50 -0600 Subject: [PATCH 2/3] chore(renovate): remove pre-commit manager configuration --- .github/renovate.json5 | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 07e3139e5..cd2a0fa20 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -20,13 +20,8 @@ 'internal' ], semanticCommits: 'disabled', - // pre-commit is currently in beta testing, must opt in - 'pre-commit': { - enabled: true - }, enabledManagers: [ 'github-actions', - 'pre-commit', 'cargo', 'custom.regex', ], @@ -68,11 +63,6 @@ // Pin GitHub Actions to immutable SHAs pinDigests: true }, - { - groupName: 'pre-commit', - matchManagers: ['pre-commit'], - matchFileNames: ['.pre-commit-config.yaml'] - }, // Annotate GitHub Actions SHAs with a SemVer version. { extends: [ @@ -108,7 +98,7 @@ enabled: false }, { - matchManagers: [ 'cargo', 'pre-commit', 'github-actions', 'custom.regex' ], + matchManagers: [ 'cargo', 'github-actions', 'custom.regex' ], minimumReleaseAge: '7 days' } ] From a3c7e84467c49602ec6850b86aecbc02ea91d4f9 Mon Sep 17 00:00:00 2001 From: Shaan Majid <70789625+shaanmajid@users.noreply.github.com> Date: Fri, 6 Feb 2026 12:59:54 -0600 Subject: [PATCH 3/3] ci: bump prek-action to v1.1.1 Needed to properly invalidate cache with prek.toml (j178/prek-action#65). --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96c02061a..5c2308120 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,7 +104,7 @@ jobs: - name: "rustfmt" run: cargo fmt --all --check - name: Run prek checks - uses: j178/prek-action@564dda4cfa5e96aafdc4a5696c4bf7b46baae5ac # v1.1.0 + uses: j178/prek-action@0bb87d7f00b0c99306c8bcb8b8beba1eb581c037 # v1.1.1 env: PREK_SKIP: cargo-fmt,cargo-clippy