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
It seems that the first block with -Wall -Werror is used by hsdev even though the prod flag is not set.
This became apparent when redundant import warnings were being reported by hsdev and, because they were turned into errors, did not allow further error checking of other modules to proceed. In fact, what you'd generally want from hsdev, I'd imagine, is that everything to be interpreted as warnings so error checking can continue through the entire project. Otherwise, the file you are checking may not get error highlighting due to a warning produced in some imported source.
Is there a way to deal with this by supplying flags to hsdev? For instance, it would be quite valuable to be able to tell hsdev to use all of the defer flags (explicit is fine) from ghc, e.g.
Unfortunately hsdev now doesn't support project flags. As a workaround in this particular case you may try specifying --ghc option in hsdev check (and similar) command.
But, of course, general solution should allow passing project's flags to hsdev.
I'm just surprised that it's defaulting the prod flag to true in my case. I'd think by default, if it didn't support flags, it would just default everything to false. But I'm likely underappreciating the complexity here.
Let's imagine we have something like the following in our package.yaml -
It seems that the first block with
-Wall -Werror
is used by hsdev even though theprod
flag is not set.This became apparent when
redundant import
warnings were being reported by hsdev and, because they were turned into errors, did not allow further error checking of other modules to proceed. In fact, what you'd generally want from hsdev, I'd imagine, is that everything to be interpreted as warnings so error checking can continue through the entire project. Otherwise, the file you arecheck
ing may not get error highlighting due to a warning produced in some imported source.Is there a way to deal with this by supplying flags to hsdev? For instance, it would be quite valuable to be able to tell hsdev to use all of the
defer
flags (explicit is fine) from ghc, e.g.I've tried using
hsdev scan --project <path> --tool stack -g -Wwarn
but that doesn't seem to get around the-Werror
.The text was updated successfully, but these errors were encountered: