Google C++ Style checker for Flycheck
Switch branches/tags
Nothing to show
Clone or download
lunaryorn Merge pull request #9 from Claymore/master
Update the install guide
Latest commit 1d8a090 Mar 15, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore add .gitignore. update readme. Feb 26, 2014
COPYING Fix description Feb 28, 2014
README.md Update the install guide Mar 11, 2016
flycheck-google-cpplint.el Update dependency version Aug 6, 2014

README.md

flycheck-google-cpplint.el

Add Google C++ Style checker for Flycheck.

If you're want to write code according to the Google C++ Style Guide , this will help a great deal.

I recommend that the package google-c-style also installed with.

Installation

As usual, from MELPA.

In your Cask file:

(source gnu)
(source melpa)

(depends-on "flycheck-google-cpplint")

In your init.el:

(eval-after-load 'flycheck
  '(progn
     (require 'flycheck-google-cpplint)
     ;; Add Google C++ Style checker.
     ;; In default, syntax checked by Clang and Cppcheck.
     (flycheck-add-next-checker 'c/c++-cppcheck
                                '(warning . c/c++-googlelint))))

If you not use cppcheck. You have need to change flycheck-add-next-checker.

(flycheck-add-next-checker 'c/c++-clang
                           '(warning . c/c++-googlelint))

Usage

Install cpplint.py

$ wget http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py
$ sudo mv cpplint.py /usr/local/bin/cpplint.py
$ sudo chmod 755 /usr/local/bin/cpplint.py

You should be able to run the cpplint.py command in Emacs. If above location,

(executable-find "cpplint.py") ; => "/usr/local/bin/cpplint.py"

or

(custom-set-variables
 '(flycheck-c/c++-googlelint-executable "/usr/local/bin/cpplint.py"))

Configure for cpplint.py

(custom-set-variables
 '(flycheck-googlelint-verbose "3")
 '(flycheck-googlelint-filter "-whitespace,+whitespace/braces")
 '(flycheck-googlelint-root "project/src")
 '(flycheck-googlelint-linelength "120"))

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

See COPYING for details.