/flycheck-clangcheck

A Flycheck checker difinition for ClangCheck.

Primary LanguageEmacs Lisp

flycheck-clangcheck

http://melpa.org/packages/flycheck-clangcheck-badge.svg

A Flycheck checker difinition for ClangCheck.

Installation

Prerequisites

  • clang-check (this is part of clang.)

Setup

  1. Install:

    MELPA:

    http://melpa.org/packages/flycheck-clangcheck-badge.svg

    or clone this repository:

    $ git clone https://github.com/kumar8600/flycheck-clangcheck
        
  2. Add settings for ~/.emacs.d/init.el:
    (add-to-list 'load-path "/path/to/flycheck-clangcheck") ;; if you installed manually
    (require 'flycheck-clangcheck)
    
    (defun my-select-clangcheck-for-checker ()
      "Select clang-check for flycheck's checker."
      (flycheck-set-checker-executable 'c/c++-clangcheck
                                       "/path/to/clang-check")
      (flycheck-select-checker 'c/c++-clangcheck))
    
    (add-hook 'c-mode-hook #'my-select-clangcheck-for-checker)
    (add-hook 'c++-mode-hook #'my-select-clangcheck-for-checker)
    
    ;; enable static analysis
    (setq flycheck-clangcheck-analyze t)
        

Customizable variables

flycheck-clangcheck-analyze
Whether to enable Static Analysis to C/C++ in ClangCheck.
flycheck-clangcheck-extra-arg
Additional argument to append to the compiler command line for ClangCheck.
flycheck-clangcheck-extra-arg-before
Additional argument to prepend to the compiler command line for ClangCheck.
flycheck-clangcheck-fatal-assembler-warnings
Whether to enable Considering warning as error to C/C++ in ClangCheck.
flycheck-clangcheck-dbname
The name of the JSON Compilation Database (default compile_commands.json).
flycheck-clangcheck-build-path
Build directory for ClangCheck. If this is defined, a JSON Compilation Database (flycheck-clangcheck-dbname) must be placed to there.