Search code examples
emacsflycheckcpplint

Flycheck-Google-Cpplint is not Configured Correctly


I am trying to install flycheck-google-cpplint in my emacs. But I get this error:

(flycheck-mode 1)
(eval-after-load 'flycheck
  '(progn
     (require 'flycheck-google-cpplint)
     (flycheck-add-next-checker 'c/c++-cppcheck
                              'c/c++-googlelint 'append)))
(custom-set-variables
   '(flycheck-googlelint-verbose "3")
   '(flycheck-googlelint-filter "-whitespace,+whitespace/braces"))

But this does not work. I get the following error:

Error: (user-error "Configured syntax checker c/c++-googlelint cannot be used") 

I don't know why. I installed cpplint and it works fine if I used it from the command line. Any suggestion?


Solution

  • flycheck-google-lint uses cpplint. You have to tell emacs where to find the cpplint.py executable in order to run the syntax check.

    You can find the cpplint file here.

    Then, you need to add this to your init emacs file:

    (custom-set-variables
     '(flycheck-c/c++-googlelint-executable "/path/to/cpplint.py"))