jyp / dante

389 stars 52 forks source link

hlint-enabling snippet adds haskell-hlint many times #150

Closed tomjaguarpaw closed 4 years ago

tomjaguarpaw commented 4 years ago

In the README the snippet to enable haskell-hlint is

(add-hook 'dante-mode-hook
   '(lambda () (flycheck-add-next-checker 'haskell-dante
                '(warning . haskell-hlint))))

However, this adds haskell-hlint to the dante next-checker list every time dante-mode is enabled. Thus once you have opened ten Haskell files, the next checkers entry for haskell-dante contains haskell-hlint ten times! Instead I discovered that by using the following in the use-package dante stanza haskell-hlint is added only once

  :config
  (flycheck-add-next-checker 'haskell-dante '(info . haskell-hlint))

Overall this is not a serious issue because the functionality still works, but the behaviour of the documented solution is a bit odd.