You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on #1150 I noticed that running pre-commit run --all on main right now generates a lot of diffs from the end-of-line fixer and the trailing whitespace remover:
These are admittedly trivial, but changes from something like black would be more annoying to be in an apparently-inconsistent state. black happens to be checked separately in CI right now, but you could imagine some other pre-commit checks being added that weren't also checked in CI, since they're not locked together. It can also hurt during version upgrades - if you upgrade black but don't remember to run it on everything, pre-commit won't save you on commit because it would only look at changed files.
A pattern I've often used is to run pre-commit run --all in CI. If you've pre-commit installed it should never fail your CI runs, so it shouldn't impact dev cycles much, but it also ensures that any code that does get merged will comply with all pre-commit checks.
Basic support is pretty simple - I like to use a separate GitHub Actions workflow like
Mostly just setting up for https://github.com/pre-commit/action, then using it. I use a separate workflow because checks don't usually need to run on all platforms/Python versions.
But, since Textual is open source, you could instead use https://pre-commit.ci/ , which comes with a variety of extra benefits as laid out on that page (mainly auto-updates and auto-fixing PRs).
The text was updated successfully, but these errors were encountered:
While working on #1150 I noticed that running
pre-commit run --all
onmain
right now generates a lot of diffs from the end-of-line fixer and the trailing whitespace remover:These are admittedly trivial, but changes from something like
black
would be more annoying to be in an apparently-inconsistent state.black
happens to be checked separately in CI right now, but you could imagine some otherpre-commit
checks being added that weren't also checked in CI, since they're not locked together. It can also hurt during version upgrades - if you upgradeblack
but don't remember to run it on everything,pre-commit
won't save you on commit because it would only look at changed files.A pattern I've often used is to run
pre-commit run --all
in CI. If you'vepre-commit install
ed it should never fail your CI runs, so it shouldn't impact dev cycles much, but it also ensures that any code that does get merged will comply with allpre-commit
checks.Basic support is pretty simple - I like to use a separate GitHub Actions workflow like
Mostly just setting up for https://github.com/pre-commit/action, then using it. I use a separate workflow because checks don't usually need to run on all platforms/Python versions.
But, since Textual is open source, you could instead use https://pre-commit.ci/ , which comes with a variety of extra benefits as laid out on that page (mainly auto-updates and auto-fixing PRs).
The text was updated successfully, but these errors were encountered: