elixir: add flycheck support for test results

This commit is contained in:
syl20bnr 2016-05-31 22:15:19 -04:00
parent 5b97df814e
commit 4996f5248c
3 changed files with 26 additions and 4 deletions

View File

@ -37,6 +37,7 @@ features like:
- Integration with [[http://company-mode.github.io/][company-mode]]
- Flycheck support for mix compile
- Flycheck support for [[https://github.com/rrrene/credo][credo]]
- Flycheck support for test results
* Install
To use this configuration layer, add it to your =~/.spacemacs=. You will need to

View File

@ -15,6 +15,10 @@
(forward-line -1)
(indent-according-to-mode)))
(defun spacemacs//elixir-flycheck-check-on-save-only ()
"Configure flycheck to check on save only since mix is slow."
(setq-local flycheck-check-syntax-automatically '(mode-enabled save)))
(defun spacemacs//elixir-enable-compilation-checking ()
"Enable compile checking if `elixir-enable-compilation-checking' is non nil."
(message "djeoifhwfwfjegweifh")

View File

@ -14,10 +14,17 @@
alchemist
company
(flycheck-elixir-credo
:location (recipe :fetcher github :repo "smeevil/flycheck-elixir-credo"))
:location (recipe :fetcher github
:repo "smeevil/flycheck-elixir-credo"))
(elixir-flycheck-mix-compile
:location local
:toggle (configuration-layer/package-usedp 'flycheck))
(flycheck-elixir-testresult
:location (recipe :fetcher github
:repo "smeevil/flycheck-elixir-testresult"
:files ("flycheck_formatter.exs"
"mix_test_helper"
"flycheck-elixir-testresult.el")))
elixir-mode
flycheck
popwin
@ -122,7 +129,7 @@
(defun elixir/init-flycheck-elixir-credo ()
(use-package flycheck-elixir-credo
:defer t
:init (add-hook 'elixir-mode-hook 'flycheck-elixir-credo-setup)))
:init (add-hook 'flycheck-mode-hook 'flycheck-elixir-credo-setup)))
(defun elixir/init-elixir-flycheck-mix-compile ()
(use-package elixir-flycheck-mix-compile
@ -133,7 +140,7 @@
(cons 'elixir-enable-compilation-checking nil))
(add-to-list 'safe-local-variable-values
(cons 'elixir-enable-compilation-checking t))
(add-hook 'elixir-mode-hook
(add-hook 'flycheck-mode-hook
'spacemacs//elixir-enable-compilation-checking t))
:config
;; enable mix_compile_helper executable
@ -142,12 +149,22 @@
(concat layer-path
"elixir/local/elixir-flycheck-mix-compile")))))
(defun elixir/init-flycheck-elixir-testresult ()
(use-package flycheck-elixir-testresult
:defer t
:init (add-hook 'flycheck-mode-hook 'flycheck-elixir-testresult-setup)
;; enable mix_test_helper executable
:config (add-to-list 'exec-path (spacemacs//get-package-directory
'flycheck-elixir-testresult))))
(defun elixir/init-elixir-mode ()
(use-package elixir-mode
:defer t))
(defun elixir/post-init-flycheck ()
(add-hook 'elixir-mode-hook 'flycheck-mode))
(spacemacs/add-flycheck-hook 'elixir-mode)
(add-hook 'flycheck-mode-hook
'spacemacs//elixir-flycheck-check-on-save-only))
(defun elixir/pre-init-popwin ()
(spacemacs|use-package-add-hook popwin