-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
chore: add workflow to automatically run prettier when renovate updates it #6370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks for the PR, @JamesHenry! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would have been nice to get this natively in Renovate with postUpgradeTasks
but it says they're only supported in self-hosted instances 😞...
{
"postUpgradeTasks": {
"commands": ["yarn format"],
"fileFilters": ["**/*"]
}
}
But, this feels like something a lot of repos have to solve in more situations. Surely folks need this whenever they update Prettier? So it's something I think we should tackle more holistically.
What about a post-commit hook to run yarn format
when the root package.json
changes? [their closest example, ignoring filename changes]
@JoshuaKGoldberg would a local hook be triggered/included in renovate's commit though? |
Hmm, good question. I don't actually know. Never mind me 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
yarn --ignore-scripts | ||
yarn format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a bit faster install, maybe?
yarn --ignore-scripts | |
yarn format | |
npx prettier --write . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will npx
respect the package.json
version of prettier?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It goes with the latest by default, which should be what the PR is upgrading to anyway.
cf25963
to
ade7707
Compare
PR Checklist
Overview
If a prettier update causes formatting to change (which it usually does) then right now a maintainer has to manually update the relevant renovate PR by running
yarn format
locally and committing the results.After this PR goes in, that
yarn format
and commit step will be done automatically on the PR without any maintainer involvement