flycheck / flycheck-haskell

Improved Haskell support for Flycheck
GNU General Public License v3.0
67 stars 25 forks source link

Add the possibility of passing custom flags to stack per project #75

Closed dnadales closed 6 years ago

dnadales commented 7 years ago

flycheck-haskell work greats on all but one of my Haskell projects. The problem is that I have two stack configuration files:

So each stack command I run on Linux for this particular project must include the flags

--stack-yaml stack_linux.yaml

I don't know if there is a way of customizing this (I could not find it), but if not it'd be useful to have it in these circumstances.

sergv commented 7 years ago

Yes, after digging around for a bit I realized that flycheck does not have a handle to point stack to a custom stack.yaml file. I'll add that to the flycheck project.

In the meantime you can take advantage of the following workaround: define STACK_YAML environment variable to point to your stack_linux.yaml file before invoking your emacs. This will affect all calls to stack within emacs though, so you'll likely will not be able to work on other haskell projects using this emacs instance (that depends, actually, on how dissimilar other project's stack yamls will be from stack_linux.yaml you'll point to).

dnadales commented 7 years ago

Thanks @sergv! My case is a pathological one, since most project use the default stack file, so I guess I can use the workaround you mention for the time being.