Add flycheck configuration
This commit is contained in:
parent
ed329adacd
commit
27e1b90637
1 changed files with 51 additions and 0 deletions
|
@ -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)
|
(add-hook 'electric-indent-local-mode-hook #'oni:switch-newline-keys)
|
||||||
#+END_SRC
|
#+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
|
* Major modes
|
||||||
|
|
||||||
** Emacs lisp mode
|
** 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)
|
(add-hook 'python-mode-hook 'electric-pair-local-mode)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
Enable syntax and style checking with flycheck.
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(add-hook 'python-mode-hook 'flycheck-mode)
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
* Applications
|
* Applications
|
||||||
|
|
||||||
** Magit
|
** Magit
|
||||||
|
|
Loading…
Reference in a new issue