Skip to content

Commit 3f7e8fe

Browse files
committed
Use prek in docuemntation
1 parent 2c68057 commit 3f7e8fe

8 files changed

Lines changed: 25 additions & 25 deletions

File tree

.devcontainer/post-create.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ rustup component add clippy rustfmt
55
cargo install cargo-insta
66
cargo fetch
77

8-
pip install maturin pre-commit
8+
pip install maturin prek

.github/actionlint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Configuration for the actionlint tool, which we run via pre-commit
1+
# Configuration for the actionlint tool, which we run via prek
22
# to verify the correctness of the syntax in our GitHub Actions workflows.
33

44
self-hosted-runner:

.github/renovate.json5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@
7676
enabled: false,
7777
},
7878
{
79-
groupName: "pre-commit dependencies",
79+
groupName: "prek dependencies",
8080
matchManagers: ["pre-commit"],
81-
description: "Weekly update of pre-commit dependencies",
81+
description: "Weekly update of prek dependencies",
8282
},
8383
{
8484
groupName: "NPM Development dependencies",

.github/workflows/ci.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,8 @@ jobs:
769769
- name: "Remove wheels from cache"
770770
run: rm -rf target/wheels
771771

772-
pre-commit:
773-
name: "pre-commit"
772+
prek:
773+
name: "prek"
774774
runs-on: ${{ github.repository == 'astral-sh/ruff' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }}
775775
timeout-minutes: 10
776776
steps:
@@ -784,17 +784,17 @@ jobs:
784784
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
785785
with:
786786
node-version: 24
787-
- name: "Cache pre-commit"
787+
- name: "Cache prek"
788788
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
789789
with:
790-
path: ~/.cache/pre-commit
791-
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
792-
- name: "Run pre-commit"
790+
path: ~/.cache/prek
791+
key: prek-${{ hashFiles('.pre-commit-config.yaml') }}
792+
- name: "Run prek"
793793
run: |
794794
echo '```console' > "$GITHUB_STEP_SUMMARY"
795-
# Enable color output for pre-commit and remove it for the summary
796-
# Use --hook-stage=manual to enable slower pre-commit hooks that are skipped by default
797-
SKIP=cargo-fmt uvx --python="${PYTHON_VERSION}" pre-commit run --all-files --show-diff-on-failure --color=always --hook-stage=manual | \
795+
# Enable color output for prek and remove it for the summary
796+
# Use --hook-stage=manual to enable slower hooks that are skipped by default
797+
SKIP=cargo-fmt uvx prek run --all-files --show-diff-on-failure --color always --hook-stage manual | \
798798
tee >(sed -E 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})*)?[mGK]//g' >> "$GITHUB_STEP_SUMMARY") >&1
799799
exit_code="${PIPESTATUS[0]}"
800800
echo '```' >> "$GITHUB_STEP_SUMMARY"

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ repos:
119119
- id: actionlint
120120
stages:
121121
# This hook is disabled by default, since it's quite slow.
122-
# To run all hooks *including* this hook, use `uvx pre-commit run -a --hook-stage=manual`.
123-
# To run *just* this hook, use `uvx pre-commit run -a actionlint --hook-stage=manual`.
122+
# To run all hooks *including* this hook, use `uvx prek run -a --hook-stage=manual`.
123+
# To run *just* this hook, use `uvx prek run -a actionlint --hook-stage=manual`.
124124
- manual
125125
args:
126126
- "-ignore=SC2129" # ignorable stylistic lint from shellcheck

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ When working on ty, PR titles should start with `[ty]` and be tagged with the `t
6565
- All changes must be tested. If you're not testing your changes, you're not done.
6666
- Get your tests to pass. If you didn't run the tests, your code does not work.
6767
- Follow existing code style. Check neighboring files for patterns.
68-
- Always run `uvx pre-commit run -a` at the end of a task.
68+
- Always run `uvx prek run -a` at the end of a task.
6969
- Avoid writing significant amounts of new code. This is often a sign that we're missing an existing method or mechanism that could help solve the problem. Look for existing utilities first.
7070
- Avoid falling back to patterns that require `panic!`, `unreachable!`, or `.unwrap()`. Instead, try to encode those constraints in the type system.
7171
- Prefer let chains (`if let` combined with `&&`) over nested `if let` statements to reduce indentation and improve readability.

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ cargo install cargo-insta
5353
You'll need [uv](https://docs.astral.sh/uv/getting-started/installation/) (or `pipx` and `pip`) to
5454
run Python utility commands.
5555

56-
You can optionally install pre-commit hooks to automatically run the validation checks
56+
You can optionally install hooks to automatically run the validation checks
5757
when making a commit:
5858

5959
```shell
60-
uv tool install pre-commit
61-
pre-commit install
60+
uv tool install prek
61+
prek install
6262
```
6363

6464
We recommend [nextest](https://nexte.st/) to run Ruff's test suite (via `cargo nextest run`),
@@ -85,7 +85,7 @@ and that it passes both the lint and test validation checks:
8585
```shell
8686
cargo clippy --workspace --all-targets --all-features -- -D warnings # Rust linting
8787
RUFF_UPDATE_SCHEMA=1 cargo test # Rust testing and updating ruff.schema.json
88-
uvx pre-commit run --all-files --show-diff-on-failure # Rust and Python formatting, Markdown and Python linting, etc.
88+
uvx prek run -a # Rust and Python formatting, Markdown and Python linting, etc.
8989
```
9090

9191
These checks will run on GitHub Actions when you open your pull request, but running them locally
@@ -381,7 +381,7 @@ Commit each step of this process separately for easier review.
381381
382382
- Often labels will be missing from pull requests they will need to be manually organized into the proper section
383383
- Changes should be edited to be user-facing descriptions, avoiding internal details
384-
- Square brackets (eg, `[ruff]` project name) will be automatically escaped by `pre-commit`
384+
- Square brackets (eg, `[ruff]` project name) will be automatically escaped by `prek`
385385
386386
Additionally, for minor releases:
387387

crates/ty/CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ cargo install cargo-insta
3434
You'll need [uv](https://docs.astral.sh/uv/getting-started/installation/) (or `pipx` and `pip`) to
3535
run Python utility commands.
3636

37-
You can optionally install pre-commit hooks to automatically run the validation checks
37+
You can optionally install hooks to automatically run the validation checks
3838
when making a commit:
3939

4040
```shell
41-
uv tool install pre-commit
42-
pre-commit install
41+
uv tool install prek
42+
prek install
4343
```
4444

4545
We recommend [nextest](https://nexte.st/) to run ty's test suite (via `cargo nextest run`),
@@ -66,7 +66,7 @@ and that it passes both the lint and test validation checks:
6666
```shell
6767
cargo clippy --workspace --all-targets --all-features -- -D warnings # Rust linting
6868
cargo test # Rust testing
69-
uvx pre-commit run --all-files --show-diff-on-failure # Rust and Python formatting, Markdown and Python linting, etc.
69+
uvx prek run -a # Rust and Python formatting, Markdown and Python linting, etc.
7070
```
7171

7272
These checks will run on GitHub Actions when you open your pull request, but running them locally

0 commit comments

Comments
 (0)