Closed alternateved closed 2 years ago
@alternateved
Hello. Thanks for contributing :-).
I'll setup a PR template for future so I don't have to ask manually but could you share an example haskell file where all 3 of the error, warning and note messages you've setup with the checker can be inspected.
As for the actual checker it looks good to me. Just one question does hlint
not support reading from stdin? Generally we prefer that since writing a buffer to a temporary file is slower than just piping the buffer to the process directly.
Of course! I think this would be enough to test all three messages can be tested:
module Test where
-- Suggestion
suggestion f g = (f . g)
-- Warning
warning f g = f (\x y -> g x y)
-- Error
-- error f = f (
Would that snippet be enough as an example? I've attached zipped version of this file here: test.zip
As far as I have checked, hlint works only with files or directories.
@alternateved
Hi, apologies for the late update. I've updated your checker implementation by adding a license header, and discovered hlint does support reading from STDIN instead of a local file :-). Thanks for the example file, I can see it does reproduce all 3 error types (although it's slightly annoying hlint doesn't register warnings and info when there's an error. Guess it makes sense since the error here is a parse/syntax error).
I'd just like to ask you to test out my changes yourself on a haskell project perhaps. Since hlint doesn't seem to take an optional path to the file being passed on STDIN I'm not sure whether it'll be able to resolve dependencies or imports properly.
Hello, no worries, there is no rush. Thank you for your help!
discovered hlint does support reading from STDIN instead of a local file :-)
Ah, even now I cannot find it in hlint readme or help, thank you for discovering it! I have tested your changes on some haskell project and everything seems to be working. I don't think that hlint will be able to resolve dependencies or imports - to be sure, I've checked it and it does not. Here is what is mostly capable of - really handy hints on how to improve the code.
@alternateved
Thanks for confirming. I've merged in the change. Have a nice day :-).
Have a nice day too and a great weekend.
Hello, I would like to add hlint checker for Haskell. Please let me know if there is anything I would need to fix or change.
Best wishes, alternateved