From 9d0174bd37cb7449e132c2b0e7ed6f1f300d9b4b Mon Sep 17 00:00:00 2001 From: Martin Sosic Date: Thu, 30 Jul 2020 18:13:49 +0200 Subject: [PATCH] Added FAQ about fixing HLint parse error. --- layers/+lang/haskell/README.org | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/layers/+lang/haskell/README.org b/layers/+lang/haskell/README.org index c1b3546d1..795e028a4 100644 --- a/layers/+lang/haskell/README.org +++ b/layers/+lang/haskell/README.org @@ -46,6 +46,7 @@ - [[#ghc-mod-doesnt-work][=ghc-mod= doesn't work]] - [[#indentation-doesnt-reset-when-pressing-return-after-an-empty-line][Indentation doesn't reset when pressing return after an empty line]] - [[#flycheck-displays-hlint-warnings-but-not-errors][Flycheck displays HLint warnings but not errors]] + - [[#hlint-fails-with-parse-error][HLint fails with parse error]] - [[#i-can-see-highlighted-errors-but-they-dont-appear-in-the-error-list][I can see highlighted errors but they don't appear in the error list]] - [[#flycheck-doesnt-work][Flycheck doesn't work]] - [[#flycheck-doesnt-work-with-stack][Flycheck doesn't work with =stack=]] @@ -397,10 +398,12 @@ Flycheck has different Haskell checkers: =haskell-ghc=, =haskell-stack-ghc= and if it doesn't work, then you can change it with ~SPC e s~. ** HLint -HLint is a linter for Haskell. It doesn't detect errors (as long as it can parse +[[https://github.com/ndmitchell/hlint][HLint]] is a linter for Haskell. It doesn't detect errors (as long as it can parse the file) but bad coding style and code smell. The HLint checker is called *after* the flycheck GHC checker. +HLint can be configured via .hlint.yaml. + ** ghc-mod Ghc-mod, when enabled, also does syntax checking. It doesn't highlight errors, but instead displays an exclamation point in the fringe. You can navigate @@ -511,6 +514,11 @@ following snippet into your =dotspacemacs/user-config= function. The HLint checker is called *after* the normal flycheck checker, even if the checker fails. Check the [[#flycheck-doesnt-work][Flycheck doesn't work]] section. +** HLint fails with parse error +If HLint is not correctly configured (e.g. does not load some extensions that you are using in your project) it might fail while parsing the file. + +Check [[https://github.com/ndmitchell/hlint][HLint]] docs for more details. + ** I can see highlighted errors but they don't appear in the error list The error list is only set by flycheck. You are probably seeing errors highlighted by either ghc-mode or haskell-mode. Check the [[#flycheck-doesnt-work][Flycheck doesn't work]]