Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jyp/attrap
ATtempt To Repair At Point (emacs flycheck extension)
https://github.com/jyp/attrap
Last synced: 3 months ago
JSON representation
ATtempt To Repair At Point (emacs flycheck extension)
- Host: GitHub
- URL: https://github.com/jyp/attrap
- Owner: jyp
- License: gpl-3.0
- Created: 2018-02-04T21:59:55.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-04-22T02:54:05.000Z (10 months ago)
- Last Synced: 2024-08-02T01:26:01.578Z (6 months ago)
- Language: Emacs Lisp
- Size: 94.7 KB
- Stars: 43
- Watchers: 4
- Forks: 7
- Open Issues: 4
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
* Attrap: ATtempt To Repair At Point
This is an Emacs minor mode which automates the application of
hints in messages reported through flymake or flycheck.[[https://melpa.org/packages/attrap-badge.svg]]
[[https://stable.melpa.org/#/dante][https://stable.melpa.org/packages/attrap-badge.svg]]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~, [[https://github.com/jyp/dante/][~dante~]] and ~hlint~. Support for other
checkers can be added dynamically (See ~M-x customize-group attrap~ for the documentation).* Installation with ~use-package~:
#+BEGIN_SRC elisp
(use-package attrap
:ensure t
:bind (("C-x /" . attrap-attrap))) ;; use any binding of your choice
#+END_SRC* Configuration of the ~hlint~ checker
Attrap requires a flymake checker for hlint. It should be setup by
adding the appropriate hook to the haskell mode:#+begin_src elisp
(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)))
#+end_srcUnfortunately there is no direct support for flycheck at the moment.
# , you can chain activate the hlint
# checker in addition to the dante checker by calling
# ~flycheck-add-next-checker~ as follows:# #+BEGIN_SRC elisp
# (flycheck-add-next-checker 'haskell-dante '(info . haskell-hlint))
# #+END_SRC* Note for GHC users
Attrap assumes that GHC outputs unicode symbols in error messages,
which will happen only if $LANG is set to a proper value, such as#+BEGIN_SRC shell
export LANG=en_US.UTF-8
#+END_SRC