Skip to content

build: Migrate from pre-commit to prek - #209

Merged
joshuarli merged 1 commit into
mainfrom
chore/prek
Nov 13, 2026
Merged

joshuarli merged 1 commit into
mainfrom
chore/prek

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Switches the repo's hook runner from pre-commit to prek, matching sentry-options-automator. .pre-commit-config.yaml stays as is, since prek reads it directly. The .pre-commit-hooks.yaml we publish for consumers doesn't change.

  • The dev dependency pre-commit is replaced with prek>=0.5.10.
  • devenv sync now runs prek install --prepare-hooks -f. The -f replaces any pre-commit shim already in .git/hooks.
  • CI now caches ~/.cache/prek and runs prek prepare-hooks, then prek run --files on the changed files. That last step moved into scripts/prek-changed-files.sh, so the paths-filter output is passed in through an env var instead of being pasted into the shell text. The script also exits cleanly when a PR only deletes files.
  • The local sentry-options-gen-stubs hook used additional_dependencies: ["."]. prek builds hook envs in a temp dir, so . doesn't point at the repo and env setup fails. The generator only uses the standard library, so the hook now runs python sentry-options-gen-stubs/__init__.py with no extra deps.

Not in this PR: a shellcheck hook. Adding one in POSIX mode would flag the existing bash scripts/bump-version.sh, so it's better done together with porting that script.

via @joshuarli.

--

View Session [Sentry]

Co-Authored-By: Joshua Li <14209781+joshuarli@users.noreply.github.com>
@joshuarli
joshuarli merged commit 0b1b7be into main Nov 13, 2026
27 checks passed
@joshuarli
joshuarli deleted the chore/prek branch November 13, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant