-
-
Notifications
You must be signed in to change notification settings - Fork 389
Bump Fourmolu to 0.4 #2254
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
Bump Fourmolu to 0.4 #2254
Conversation
import Data.Bifunctor (first) | ||
import qualified Data.Text as T | ||
import Development.IDE hiding (pluginHandlers) | ||
import Development.IDE.GHC.Compat as Compat hiding (Cpp) | ||
import qualified Development.IDE.GHC.Compat.Util as S |
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.
I don't know how this file was passing CI before? Seeing as this line causes stylish-haskell
to reformat all the other imports (I personally detest this behaviour, but that's an argument for another day).
@@ -22,7 +22,7 @@ library | |||
build-depends: | |||
, base >=4.12 && <5 | |||
, filepath | |||
, fourmolu ^>=0.3 | |||
, fourmolu ^>=0.3 || ^>=0.4 |
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.
Ideally, I'd remove 0.3 entirely, as 0.4 includes some important bug fixes. But this isn't possible while stylish-haskell
is tied to older versions of GHC and Cabal.
(Same applies to Ormolu here - right now, the latest version will never be chosen by the dependency solver)
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.
the latest version will never be chosen by the dependency solver
Actually, looks like this only applies to GHC < 9. The stylish-haskell
plugin is disabled for 9.0.1.
And if CI passes here for GHC 9.0.1, we know that Fourmolu 0.4 is being used, since it's the first version to support it.
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.
Maybe adding a comment about, to remove 0.3 some day?
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.
Maybe adding a comment about, to remove 0.3 some day?
Actually, I think there's no need. I'll probably end up at least trying to remove it every time I bump the upper bound, and eventually it'll be possible.
@georgefst many thanks to spend time on fourmolu/fourmolu#104 and this, getting support for ghc-9 |
I hope you dont mind i enabled fourmolu for ghc-9 to give it a shot in ci |
Thanks, but @brandonchinn178 has actually done most of the hard work recently. And in fact, as for GHC 9 support, the work was done upstream in Ormolu. |
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.
lgtm i hope fourmolu will continue rocking in the formatter side
There is a build error for ghc-9:
|
That import should have been removed in ec53fcb. Fixed in 46d3264. This would have been caught by |
Jumm they should afaiu, maybe is cargo culting and otoh it is enabled for hls itself, maybe it is time to give a try at least here |
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.
what about ghc-options: -Wall -Wredundant-constraints
, like hls itself?
(without -Wno-name-shadowing -Wno-unticked-promoted-constructors
if this does not need it)
Meh, I think there are legitimate use cases for redundant constraints, though it's very unlikely to come up in this plugin anyway.
I prefer to be warned.
No strong opinion, but again unlikely to come up. On the whole, I'd go for keeping things simple with just |
Agree with you, i forgot to mention |
Yeah, the fact that I know of no good way to do this in a multi-cabal-package project ( |
CI test failure looks unrelated to Fourmolu... |
Yeah, all pr's are affected by #2253 😢 |
Probably due to dependency changes? This PR does bump |
Ah, ok. |
I was wrong, not all pr's are affected only those which are updating the cabal.project index state so maybe a new dep version or the cache invalidation is triggering it |
Some of these have genuine bugs, as discussed in #2254 (comment). We also get to drop a load of CPP introduced in #2944. Users can still use older versions via CLI mode. This wasn't possible until recently because `stylish-haskell`'s `ghc-lib-parser` bounds were holding us back.
Some of these have genuine bugs, as discussed in #2254 (comment). We also get to drop a load of CPP introduced in #2944. Users can still use older versions via CLI mode. This wasn't possible until recently because `stylish-haskell`'s `ghc-lib-parser` bounds were holding us back.
Addresses the relevant checklist item in #297.