This is an Emacs minor mode which automates the application of hints in messages reported through flymake or flycheck.
Attrap! provides a single entry point to attempt to fix the error at
point.
Invoke the command attrap-attrap
when point is on a flymake or flycheck error,
and check the results. Attrap! currently comes with fixers for
emacs-lisp
, ~dante~ and hlint
. Support for other
checkers can be added dynamically (See M-x customize-group attrap
for the documentation).
(use-package attrap
:ensure t
:bind (("C-x /" . attrap-attrap))) ;; use any binding of your choice
Attrap requires a flymake checker for hlint. It should be setup by adding the appropriate hook to the haskell mode:
(add-hook 'haskell-mode-hook
(defun my/haskell-hook ()
(require 'attrap)
(require 'flymake-flycheck)
(flymake-mode)
(add-hook 'flymake-diagnostic-functions 'attrap-flymake-hlint nil t)))
Unfortunately there is no direct support for flycheck at the moment.
Attrap assumes that GHC outputs unicode symbols in error messages, which will happen only if $LANG is set to a proper value, such as
export LANG=en_US.UTF-8