-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Haskell layer] HLint.hs in project root seems to be ignored #753
Comments
There are no options available at the flycheck level (https://flycheck.readthedocs.org/en/latest/guide/languages.html#el.flycheck-checker.haskell-hlint). |
If flycheck is ignoring it then a PR may be required to add options for the checker. |
What I'm doing is pretty much as described in the second link you've posted (section above the on. Normally hlint detects the file HLint.hs in the current directory automatically when you run the http://community.haskell.org/~ndm/darcs/hlint/hlint.htm#customization You can see my HLint.hs file here. Hence you can see it ignoring the camel-case warning when executed from the command line above, and in my vi setup, the warning is also hidden in the editor. I think it's most likely because the hlint command isn't being run from the root directory, but from the subdirectory where the source file is (emacs seems to change directory based on which file you're looking at, unlike vi), since if I copy the HLint.hs to the subdirectory, the warning in the editor disappears. Ideally I'd prefer not to have an HLint.hs file in every submodule in my project though :). I don't really know enough yet to work out whether this is anything to do with the spacemacs Haskell code or with some of the stuff it pulls in. Feel free to close this is it's not relevant. |
This sounds like it requires some looking-into. I'll see if it has something to do with spacemacs. |
I looked into this and it is the expected behavior from flycheck, the checker is defined with |
Thanks for taking the time to look into this. I discovered a
in my .spacemaces. This command works as expected on the command line, but unfortunately not in emacs, where it seems to break hlint checking. Flycheck stops showing other errors which I know are there. |
Cool ! So I think it is possible to add an option to the checker to pass the additional arguments. You can then use emacs local variables mechanism. In the meantime, can you provide a mini haskell file which highlights the issue ? I'll use it to populate the functional tests of flycheck. |
I'm quite confused now :/. I just did an update from spacemacs and I can't find any references to A Haskell file with any non camel-case variables should show the warning, but I don't want it as I use underscores a lot in JSON data types so that they translate directly to the correct JSON format. So the following source file would show the warning, for
|
Ok, I see now that the
and setting
|
@tekul could you let me know where you set up |
Hi. I have it in my
It still seems to be working OK. To be honest I'd forgotten about it :). |
Thanks for the tip. |
For reference, the latest version of flycheck now has several variables which allow you to pass ignore rules to hlint directly, which should get round these issues: It also claims to read the HLint.hs file from the project root, but that doesn't seem to be working for me. |
In any case this is a flycheck problem, so I will close this issue now. |
@tekul just tested - it's working for me. Is it still the case? |
I just checked again, and yes, it does seem to be working. Thanks! |
I just started using emacs/spacemacs, so apologies if I've missed something obvious.
I have an HLint.hs file in my project root folder containing
So, for example, I get
However, when viewing the file in emacs, I get a "Use camelCase" flycheck warning for the data type in that file.
Is there a way I can configure options for hlint or get the file picked up?
The text was updated successfully, but these errors were encountered: