haskell-actions / run-ormolu

Ormolu GitHub action
Other
31 stars 6 forks source link

add "mode" input #29

Closed aryairani closed 1 year ago

aryairani commented 1 year ago

Adding the mode input lets me change ormolu to inplace mode, which allows me to automatically format and commit my PRs instead of kicking them back to the contributor and making them figure out how to use ormolu 😅 .

It's split into multiple commits for cherry-picking.

mrkkrp commented 1 year ago

Wow, isn't it pretty annoying to have a commit history with every other message being "automated ormolu commit"?

aryairani commented 1 year ago

To clarify, those "automated ormolu commit"s are not part of this PR, they're just part of an example that used it.

But to your question: It's not every other message, it's once per push, and even then only if the HEAD commit is improperly formatted and would otherwise fail CI and be kicked back to the contributor, who would manually run ormolu and commit the results with a message like "manual ormolu commit", which itself is better than the most common commit message, "wip". So it's not more annoying, no. 😅

mrkkrp commented 1 year ago

and commit the results with a message like "manual ormolu commit"

I'd just squash the changes and never have any re-formatting commits.

mrkkrp commented 1 year ago

But I guess it doesn't hurt to have an extra setting for people who want this kind of workflow. I will return to this in the coming week and take another look, then merge.

mrkkrp commented 1 year ago

Applied as 46243e8f9feea0d49006f70d6a41a69ac5b14fed.

mrkkrp commented 1 year ago

Would you like me to make a new release with this feature? Is it urgent for you?

aryairani commented 1 year ago

@mrkkrp I'm using it already from my fork, so it's not urgent; but once it's released I'll switch back to using the original repo :)

mrkkrp commented 1 year ago

v14 is now available :)