Repository navigation
build: Migrate from pre-commit to prek - #209
Merged
Merged
Conversation
Co-Authored-By: Joshua Li <14209781+joshuarli@users.noreply.github.com>
joshuarli
approved these changes
Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Switches the repo's hook runner from pre-commit to prek, matching sentry-options-automator.
.pre-commit-config.yamlstays as is, since prek reads it directly. The.pre-commit-hooks.yamlwe publish for consumers doesn't change.pre-commitis replaced withprek>=0.5.10.devenv syncnow runsprek install --prepare-hooks -f. The-freplaces any pre-commit shim already in.git/hooks.~/.cache/prekand runsprek prepare-hooks, thenprek run --fileson the changed files. That last step moved intoscripts/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.sentry-options-gen-stubshook usedadditional_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 runspython sentry-options-gen-stubs/__init__.pywith 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]