Skip to content

Harden the Prettier hook with prek - #4314

Draft
zaniebot wants to merge 4 commits into
astral-sh:mainfrom
zaniebot:agent/lock-prettier-hooks
Draft

zaniebot wants to merge 4 commits into
astral-sh:mainfrom
zaniebot:agent/lock-prettier-hooks

Conversation

@zaniebot

@zaniebot zaniebot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

The frozen [email protected] hook still depends on an implicit Node/npm installation policy. Keep the existing mirror hook, require prek==0.4.13, and let prek manage Node 24.19.0 with Renovate updates limited to Node 24. Configure prek update to freeze revisions and wait seven days for new tags. Set npm_config_ignore_scripts=true and npm_config_min_release_age=7 in CI, and document the same caller-level settings for contributors. The YAML selection and formatting behavior remain unchanged. This freezes hook revisions, not the full transitive npm dependency tree.

Related: #4283 handles the documentation’s one-off tool pins. This leaves that command untouched to avoid a competing edit; moving it to prek exec prettier remains a separate follow-up. astral-sh/ruff#27842 applies the matching native prek policy, while astral-sh/ecosystem-analyzer#162 removes an unnecessary prettier hook.

@zaniebot zaniebot changed the title Lock Prettier for contributor checks Harden the Prettier hook with prek Aug 18, 2026
Comment thread CONTRIBUTING.md
Comment on lines +56 to +57
export npm_config_ignore_scripts=true
export npm_config_min_release_age=7

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we encode these in the pre-commit config instead?

@j178 j178 Sep 1, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These could be configured globally via default_env, but they are only applied during hook environment installation starting with prek 0.5.1. In earlier releases, they only took effect at hook runtime.

This branch has not been deployed

No deployments
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.

3 participants