From 27e1b90637e9d11c9404d8a8b86015fcd681d9d6 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sat, 6 Aug 2016 20:36:08 +0200 Subject: [PATCH] Add flycheck configuration --- emacs/.emacs.d/init.org | 51 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 6a7e5f1..7f0122f 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -350,6 +350,51 @@ To start off, first I need to enable lexical binding. (add-hook 'electric-indent-local-mode-hook #'oni:switch-newline-keys) #+END_SRC +** Flycheck + + Flycheck lets me see (compiler) errors, warnings and info messages + while writing code. + + #+BEGIN_SRC emacs-lisp + (ensure-library flycheck) + #+END_SRC + + When developing packages with Cask, some special care needs to be + taken to ensure the checkers work correctly. + + #+BEGIN_SRC emacs-lisp + (ensure-library flycheck-cask) + (add-hook 'flycheck-mode-hook 'flycheck-cask-setup) + #+END_SRC + + I disable the pylint and pyflakes checkers because they don't seem + to add much except noise when used together with flake8. Also + pylint seems hell-bent on making Python written like a + statically-typed langauge. + + #+BEGIN_SRC emacs-lisp + (with-eval-after-load 'flycheck + (mapc (lambda (c) (delq c flycheck-checkers)) + '(python-pylint python-pyflakes))) + #+END_SRC + + Also show which columns messages appear in. + + #+BEGIN_SRC emacs-lisp + (with-eval-after-load 'flycheck + (setq flycheck-highlighting-mode 'columns)) + #+END_SRC + + Show the error message at point in a tooltip. + + #+BEGIN_SRC emacs-lisp + (ensure-library flycheck-pos-tip) + + (with-eval-after-load 'flycheck + (require 'flycheck-pos-tip) + (flycheck-pos-tip-mode)) + #+END_SRC + * Major modes ** Emacs lisp mode @@ -455,6 +500,12 @@ To start off, first I need to enable lexical binding. (add-hook 'python-mode-hook 'electric-pair-local-mode) #+END_SRC + Enable syntax and style checking with flycheck. + + #+BEGIN_SRC emacs-lisp + (add-hook 'python-mode-hook 'flycheck-mode) + #+END_SRC + * Applications ** Magit