Build: Add FIX_ON_COMMIT env var to force autofix in pre-commit hook#34547
Conversation
|
View your CI Pipeline Execution ↗ for commit 88238a6
☁️ Nx Cloud last updated this comment at |
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 50 | 50 | 0 |
| Self size | 20.53 MB | 20.47 MB | 🎉 -59 KB 🎉 |
| Dependency size | 16.56 MB | 16.56 MB | 🎉 -93 B 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/nextjs-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 93 | 93 | 0 |
| Self size | 1.12 MB | 1.12 MB | 🚨 +281 B 🚨 |
| Dependency size | 23.77 MB | 23.75 MB | 🎉 -12 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-native-web-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 122 | 122 | 0 |
| Self size | 30 KB | 30 KB | 0 B |
| Dependency size | 24.84 MB | 24.82 MB | 🎉 -12 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 83 | 83 | 0 |
| Self size | 36 KB | 35 KB | 🎉 -311 B 🎉 |
| Dependency size | 21.55 MB | 21.54 MB | 🎉 -12 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/cli
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 184 | 184 | 0 |
| Self size | 782 KB | 782 KB | 🎉 -86 B 🎉 |
| Dependency size | 68.17 MB | 68.11 MB | 🎉 -58 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/codemod
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 177 | 177 | 0 |
| Self size | 32 KB | 32 KB | 0 B |
| Dependency size | 66.70 MB | 66.64 MB | 🎉 -59 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
create-storybook
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 51 | 51 | 0 |
| Self size | 1.04 MB | 1.04 MB | 🚨 +1 KB 🚨 |
| Dependency size | 37.09 MB | 37.03 MB | 🎉 -59 KB 🎉 |
| Bundle Size Analyzer | node | node |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe changes add optional autofix functionality to the lint-staged configuration, controlled via a new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes ✨ Finishing Touches📝 Generate docstrings
Comment |
Closes #
What I did
Added a
FIX_ON_COMMITenvironment variable that, when set, forces the pre-commit hook to run formatting (oxfmt) and linting (eslint --fix) in autofix mode — regardless of whether the committer is an AI agent or a human.Previously, autofix was only enabled when
std-envdetected a package manager agent. Now you can setFIX_ON_COMMIT=1to get the same behavior manually.Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
Test by running:
FIX_ON_COMMIT=1 git commit— formatting and lint should autofix staged filesgit commit(without the env var, outside an agent context) — should run in check-only mode as beforeDocumentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsMake sure this PR contains one of the labels below:
Available labels
bug: Internal changes that fixes incorrect behavior.maintenance: User-facing maintenance tasks.dependencies: Upgrading (sometimes downgrading) dependencies.build: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup: Minor cleanup style change. Will not show up in release changelog.documentation: Documentation only changes. Will not show up in release changelog.feature request: Introducing a new feature.BREAKING CHANGE: Changes that break compatibility in some way with current major version.other: Changes that don't fit in the above categories.🦋 Canary release
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/coreteam here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>Summary by CodeRabbit
New Features
Documentation