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
fourmolu is a formatter forked from ormolu, but with the option to load its configuration from a file. If one chooses to do so (by adding a fourmolu.yaml to the project root), it outputs a message like Loaded config from fourmolu.yaml to stderr.
Now haskell-buffer-apply-command - which is called by haskell-mode-stylish-buffer - never checks the error code (which is 0 here in my case, as the buffer can successfully be formatted), but only the contents of the error file, containing the above message.
I've created an issue with fourmolu (fourmolu/fourmolu#110) to maybe suppress this message altogether, but I feel like disregarding the error code is not the optimal choice in this case.
I'd have created some PR for this, but I'm actually not really sure how to best handle the branches. Replacing the first check for err-file-empty-p with (= errcode 0) worked for me, but it leaves the case unhandled where:
Error code is 0
The output is empty
The error file is non-empty
The text was updated successfully, but these errors were encountered:
Really the preferred method here would be to not even support stylish in haskell-mode: there are numerous separate packages which can trivially provide support for formatters, and be installed according to users' needs. My own reformatter package makes it easy to construct such things. I imagine that the existing ormolu emacs package can trivially be made to run fourmolu instead.
I'm using a patched version of fourmolu for now (for months, actually; just forgot to answer here).
I've installed reformatter (but haven't configured it yet) since what you're saying really makes sense and this will surely make my life easier with other languages in Emacs in the long run, thanks!
fourmolu is a formatter forked from ormolu, but with the option to load its configuration from a file. If one chooses to do so (by adding a
fourmolu.yaml
to the project root), it outputs a message likeLoaded config from fourmolu.yaml
tostderr
.Now
haskell-buffer-apply-command
- which is called byhaskell-mode-stylish-buffer
- never checks the error code (which is0
here in my case, as the buffer can successfully be formatted), but only the contents of the error file, containing the above message.I've created an issue with fourmolu (fourmolu/fourmolu#110) to maybe suppress this message altogether, but I feel like disregarding the error code is not the optimal choice in this case.
I'd have created some PR for this, but I'm actually not really sure how to best handle the branches. Replacing the first check for
err-file-empty-p
with(= errcode 0)
worked for me, but it leaves the case unhandled where:0
The text was updated successfully, but these errors were encountered: