From 7d6bd57a762945fb09de0b098576c78b38e63156 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 26 May 2026 16:50:36 -0400 Subject: [PATCH 1/5] docs: add prek tabs to GitHub Actions docs - Add tabs for prek and pre-commit in gha_basic.md with prek first - Reorder tabs in style.md to put prek before pre-commit - Add link definitions for pre-commit and prek - Add tabs.js script to gha_basic.md - Fix typo in style.md (hanges -> changes) Assisted-by: opencode:qwen3 --- docs/pages/guides/gha_basic.md | 29 +++++++++++++++++++++++------ docs/pages/guides/style.md | 18 +++++++++--------- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/docs/pages/guides/gha_basic.md b/docs/pages/guides/gha_basic.md index 387c7c36..3e07470c 100644 --- a/docs/pages/guides/gha_basic.md +++ b/docs/pages/guides/gha_basic.md @@ -55,11 +55,24 @@ run on PRs targeting those branches only). ## Pre-commit -If you use [pre-commit](https://pre-commit.com) (and you should), and you don't -want to / can't use [pre-commit.ci](https://pre-commit.ci) yet, then this is a -job that will check pre-commit for you: +{% rr PY006 %} If you use [pre-commit][] (or [prek][]) in CI, you can run it +directly in GitHub Actions. Prek is a faster Rust rewrite of pre-commit that +supports most real world usage. -{% raw %} +{% tabs runner %} {% tab prek Prek %} + +```yaml +lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: j178/prek-action@v2 +``` + +{% endtab %} {% tab pre-commit Pre-commit %} + +Pre-commit can run using the official action: ```yaml lint: @@ -73,7 +86,7 @@ lint: - uses: pre-commit/action@v3.0.1 ``` -{% endraw %} +{% endtab %} {% endtabs %} If you do use [pre-commit.ci](https://pre-commit.ci), but you need this job to run a manual check, like check-manifest, then you can keep it but just use @@ -757,6 +770,10 @@ changelog: -[gh-changelog]: https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes +[pre-commit]: https://pre-commit.com +[prek]: https://github.com/j178/prek +[gh-changelog]: https://docs.github.com/en/repositories/releasing-projects + + diff --git a/docs/pages/guides/style.md b/docs/pages/guides/style.md index 069be561..8d6625bf 100644 --- a/docs/pages/guides/style.md +++ b/docs/pages/guides/style.md @@ -17,7 +17,15 @@ custom_title: Style and static checks to check code style. The original, `pre-commit`, has support for more languages, but `prek` is a faster Rust rewrite that supports most real world usage. -{% tabs runner %} {% tab pre-commit Pre-commit %} +{% tabs runner %} {% tab prek Prek %} + +Prek can be installed through `brew` (macOS) or `pipx/uv` (anywhere). There are +two modes to use it locally; you can check manually with `prek run` (changes +only) or `prek run -a` (all). You can omit the `run`, as well; such as +`prek -a`. You can also run `prek install` to add checks as a git pre-commit +hook. + +{% endtab %} {% tab pre-commit Pre-commit %} Pre-commit can be installed through `brew` (macOS) or `pipx/uv` (anywhere). There are two modes to use it locally; you can check manually with @@ -28,14 +36,6 @@ gets its name). Pre-commit's setup is much slower than prek, but you can install `pre-commit-uv` with pre-commit to speed up the setup time quite a bit. -{% endtab %} {% tab prek Prek %} - -Prek can be installed through `brew` (macOS) or `pipx/uv` (anywhere). There are -two modes to use it locally; you can check manually with `prek run` (hanges -only) or `prek run -a` (all). You can omit the `run`, as well; such as -`prek -a`. You can also run `prek install` to add checks as a git pre-commit -hook. - {% endtab %} {% endtabs %} Local runs (with `-a`) are the standard way to use it. That will run all the From 1c924bf887f7d618583aae5414a074d87a3370fe Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 26 May 2026 17:03:03 -0400 Subject: [PATCH 2/5] Update docs/pages/guides/gha_basic.md --- docs/pages/guides/gha_basic.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/guides/gha_basic.md b/docs/pages/guides/gha_basic.md index 3e07470c..55be3420 100644 --- a/docs/pages/guides/gha_basic.md +++ b/docs/pages/guides/gha_basic.md @@ -55,7 +55,7 @@ run on PRs targeting those branches only). ## Pre-commit -{% rr PY006 %} If you use [pre-commit][] (or [prek][]) in CI, you can run it +If you use [pre-commit][] (or [prek][]) in CI, you can run it directly in GitHub Actions. Prek is a faster Rust rewrite of pre-commit that supports most real world usage. From 96c4edc5b591954e68d09129ff99f6ea433281b8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 26 May 2026 21:03:21 +0000 Subject: [PATCH 3/5] style: pre-commit fixes --- docs/pages/guides/gha_basic.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/pages/guides/gha_basic.md b/docs/pages/guides/gha_basic.md index 55be3420..f39ac699 100644 --- a/docs/pages/guides/gha_basic.md +++ b/docs/pages/guides/gha_basic.md @@ -55,9 +55,9 @@ run on PRs targeting those branches only). ## Pre-commit -If you use [pre-commit][] (or [prek][]) in CI, you can run it -directly in GitHub Actions. Prek is a faster Rust rewrite of pre-commit that -supports most real world usage. +If you use [pre-commit][] (or [prek][]) in CI, you can run it directly in GitHub +Actions. Prek is a faster Rust rewrite of pre-commit that supports most real +world usage. {% tabs runner %} {% tab prek Prek %} From 131bab26e13bdd6c9dbf1e18b8e26f86e7c01c58 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 26 May 2026 17:09:56 -0400 Subject: [PATCH 4/5] fix: minor fixes Signed-off-by: Henry Schreiner --- docs/pages/guides/gha_basic.md | 8 +++++--- docs/pages/guides/style.md | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/pages/guides/gha_basic.md b/docs/pages/guides/gha_basic.md index f39ac699..48a9bc0e 100644 --- a/docs/pages/guides/gha_basic.md +++ b/docs/pages/guides/gha_basic.md @@ -53,14 +53,16 @@ you use a develop branch, you probably will want to include that. You can also specify specific branches for pull requests instead of running on all PRs (will run on PRs targeting those branches only). -## Pre-commit +## Prek / Pre-commit -If you use [pre-commit][] (or [prek][]) in CI, you can run it directly in GitHub +If you use [prek][] or [pre-commit][] in CI, you can run it directly in GitHub Actions. Prek is a faster Rust rewrite of pre-commit that supports most real -world usage. +world usage and supports the same configuraiton and hooks. {% tabs runner %} {% tab prek Prek %} +Prek can run using the official action: + ```yaml lint: name: Lint diff --git a/docs/pages/guides/style.md b/docs/pages/guides/style.md index 8d6625bf..f4025896 100644 --- a/docs/pages/guides/style.md +++ b/docs/pages/guides/style.md @@ -47,8 +47,6 @@ a custom pre-commit hook before; it's quite elegant and does not add or commit the changes, it just makes the changes and allows you to check and add them. You can always override the hook with `-n`. -[pre-commit]: https://pre-commit.com - {% rr PC100 %} Here is a minimal `.pre-commit-config.yaml` file with some handy options: @@ -1047,6 +1045,8 @@ You also might like the following hook, which cleans Jupyter outputs: [schemastore]: https://schemastore.org [typos]: https://github.com/crate-ci/typos [typos-ref]: https://github.com/crate-ci/typos/blob/master/docs/reference.md +[pre-commit]: https://pre-commit.com +[prek]: https://prek.j178.dev From d3badd03e2e7359d05c210e61efd8e81d9c97315 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 26 May 2026 21:10:25 +0000 Subject: [PATCH 5/5] style: pre-commit fixes --- docs/pages/guides/gha_basic.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/guides/gha_basic.md b/docs/pages/guides/gha_basic.md index 48a9bc0e..a161cd96 100644 --- a/docs/pages/guides/gha_basic.md +++ b/docs/pages/guides/gha_basic.md @@ -57,7 +57,7 @@ run on PRs targeting those branches only). If you use [prek][] or [pre-commit][] in CI, you can run it directly in GitHub Actions. Prek is a faster Rust rewrite of pre-commit that supports most real -world usage and supports the same configuraiton and hooks. +world usage and supports the same configuration and hooks. {% tabs runner %} {% tab prek Prek %}