mill icon indicating copy to clipboard operation
mill copied to clipboard

Have github actions automatically push PR autofixes

Open lihaoyi opened this issue 1 year ago • 2 comments

This will save the tedious process of noticing formatting/scalafix irregularities and having to run a manual command before pushing them.

lihaoyi avatar Sep 12 '24 10:09 lihaoyi

git push -f is just the way I've done this kind of CI-driven autofixes before, and it worked fine. The alternative is to ask people to git fetch the CI autofix before proceeding with local development, which works as well.

lihaoyi avatar Sep 12 '24 12:09 lihaoyi

git push -f is just the way I've done this kind of CI-driven autofixes before, and it worked fine. The alternative is to ask people to git fetch the CI autofix before proceeding with local development, which works as well.

I have a alias git pullr for that which stands for pull --rebase --autostash. It will rebase all local commits on top of upstream changes. It will also work with local uncommitted changes, which will be temporarily stashed.

git push -f without fetching is dangerous, since you may loose some commits, without even noticing. We definitely should not recommend this.

lefou avatar Sep 12 '24 13:09 lefou