Integrate cstyle with flycheck to automatically check the style of your C/C++ code on the fly.
The preferred way to install flycheck-cstyle
is via
MELPA - then you can just M-x package-install RET
flycheck-cstyle RET
To enable then simply add the following to your init file:
(eval-after-load 'flycheck
'(progn
(require 'flycheck-cstyle)
(flycheck-cstyle-setup)
;; chain after cppcheck since this is the last checker in the upstream
;; configuration
(flycheck-add-next-checker 'c/c++-cppcheck '(warning . cstyle))))
If you do not use cppcheck
then chain after whichever checker you do use
(ie. clang / gcc / irony etc)
(flycheck-add-next-checker 'c/c++-clang '(warning . cstyle))
If you would like to install the package manually, download or clone it and
place within Emacs' load-path
, then you can require it in your init file like
this:
(require 'flycheck-cstyle)
(flycheck-cstyle-setup)
NOTE: This will also require the manual installation of flycheck
if you have
not done so already.
Copyright © 2015 Alex Murray
Distributed under GNU GPL, version 3.