-
Notifications
You must be signed in to change notification settings - Fork 704
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
Switching to Fourmolu 0.14 #9424
Comments
I honestly expected a larger diff, good to know it is not so. I find some new formatting rules weird but it is minor thing and such is life with an automatic formatter. |
I'm not terribly impacted since I hardly qualify as a cabal dev, but I don't really find it acceptable. One whole half of the value proposition of a code formatter is that you don't have to do combat with whitespace changes in the Mines of Git History. 🧙♂️ Sure, an automatic formatter changes your code before you commit it, but that's supposed to be so that it doesn't get changed later... |
you can |
We have a file that stores commits to ignore and git does that for us already :) |
Neat! I guess that counteracts my issue? |
Almost. If a PR introduces more reformatting than its scope (happens with e.g. indentation), then it gets squashed+merged, and you have to go back with |
I'm sorry I'm not quite following the technical discussion here, but just wanted to add my vote for upgrading to 0.14, as I expect it to be less confusing for newcomers to align with the latest release of the formatter rather than to some past version. I don't think any new arguments against the upgrade are brought: all the same annoyances applied when we initially did this, and yet we went ahead with it... On a similar note, I'd also switch the |
I'm not quite sure what this means. If you run fourmolu once and make a commit, then you can just take that hash and add it to the ignore-revs file. Then merge the PR (dont squash) and itll be good. If you really want to squash, merge the fourmolu change first, then make a separate PR to ignore the rev after committing the formatting change to master.
Perhaps a bit weird at first, but it follows from the fixity rules. With the new fixity rules, Ormolu will actually group the fixities appropriately. In fact, I think it would allow the following, which IMO is much clearer than the current situation: root
</> dir
</> file <.> ext
It would really have to be a case-by-case basis. I'm weakly opposed to flags only existing for the purpose of backwards compatibility. Each flag also adds branches to Fourmolu that makes it harder to resolve conflicts when merging Ormolu. Ormolu/Fourmolu is not perfect and is still improving, and IMO it'd be a shame to propagate poor formatting just to avoid a one-time change. Perhaps for an especially egregious change, but I'd generally prefer not. |
@brandonchinn178 Thank you for your feedback. :) In our situation I think that diffs like the one you have in your repo would be acceptable but the arbitrary changes that we receive from Ormolu can be a little daunting at times. Personally I'm happy that we get to collaborate like this and this fills me with trust. |
Great news about the tiny diff. I'm for switching, too. |
I have no problems with keeping up to date with fourmolu. Expecially if can count on @brandonchinn178's help and advice. |
I asked the Cabal maintainers about this a couple weeks ago, and it sounds like they want a Fourmolu release including this commit before they'll upgrade: fourmolu/fourmolu@4e2af8f I'm happy to do the work of upgrading to a new formatter after that lands (I like having the formatter available, even if it's not perfect). |
Now that Fourmolu has integrated the Cabal codebase as a regression test (for which we are very grateful), let's examine what would change if we switched to 0.14: https://github.com/fourmolu/fourmolu/blob/main/compat-tests/cabal.diff
Question 1 (for cabal devs): Is this acceptable to us?
Question 2 (for Fourmolu devs): Are you willing to ask and receive help to provide the next versions of fourmolu with flags to deactivate arbitrary changes from Ormolu?
cc @brandonchinn178
The text was updated successfully, but these errors were encountered: