[cppcheck]
apt = cppcheck
# see Path::acceptFile etc in lib/path.cpp in cppcheck
# TODO: update it before releases:
# curl -s https://sources.debian.net/data/main/c/cppcheck/latest/lib/path.cpp |
# grep 'ext.* == "' |
# sed 's/.*"\([^"]*\)".*/\1/;s/^/ */'
files =
 *.c *.cc *.cxx *.cpp *.c++
 *.h *.hpp *.tpp *.txx
types = text/x-c text/x-c++
command = cppcheck -j{njobs} --quiet -f .

[deheader]
flags = manual
apt = deheader
files = *.c *.cc *.cxx *.cpp
types = text/x-c text/x-c++
comment =
 Check if your C/C++ code contains any unnecessary headers.
 Dangerous because it executes Makefiles
command = deheader

[include-what-you-use]
apt = iwyu
files =
 *.c *.cc *.cxx *.cpp
 *.h *.hh *.hxx *.hpp
types = text/x-c text/x-c++
command = include-what-you-use {file}

[flawfinder]
apt = flawfinder
# see maybe_process_file and c_extensions in the flawfinder script in flawfinder
# TODO: update it before releases:
# sed -n '/^c_extensions/,/ *}$/p' /usr/bin/flawfinder | sed "s/ *: *1 *,*/ /g;s/#.*//;s/'//g;s/\./*./g;s/ \+/ /g;s/.*[{}]//;s/\(.*\)/\L\1/;s/ *$//"
files =
 *.c *.h
 *.ec *.ecp
 *.pgc
 *.cpp *.cxx *.cc
 *.cc *.c++
 *.pcc
 *.hpp
command = flawfinder -Q -c .

[pmccabe]
flags = complexity
apt = pmccabe
files =
 *.c *.cc *.cxx *.cpp
 *.h *.hh *.hxx *.hpp
types = text/x-c text/x-c++
command = pmccabe {files} | sort -nr

[clang-check]
flags = manual
apt = clang
files =
 *.c *.cc *.cxx *.cpp
 *.h *.hh *.hxx *.hpp
types = text/x-c text/x-c++
comment =
 because it can't be automatically run from `find -exec` due to the requirement for --
 Please consider checking your code with clang-check:
 http://clang.llvm.org/docs/ClangCheck.html
command = clang-check <files> --

[clang-tidy]
flags = manual
apt = clang-tidy
files =
 *.c *.cc *.cxx *.cpp
 *.h *.hh *.hxx *.hpp
types = text/x-c text/x-c++
command = clang-tidy <files> --
comment = because it can't be automatically run from `find -exec` due to the requirement for --

[m64-m32]
files =
 *.c *.cc *.cxx *.cpp
 *.h *.hh *.hxx *.hpp
types = text/x-c text/x-c++
comment = You should almost never use -m64 and -m32 when compiling.
command = grep -rE -- '-m64|-m32' .

[cbmc]
flags = todo
apt = cbmc
comment = needs to be a suggestion as it runs during a build

[vera]
flags = todo
comment = https://bitbucket.org/verateam/vera/overview

[nsiqcppstyle]
flags = todo
comment = https://code.google.com/p/nsiqcppstyle/

[cppclean]
flags = todo
comment = https://github.com/myint/cppclean/

[complexity]
flags = complexity
apt = complexity
files = *.c
types = text/x-c
command = complexity {files}

[kwstyle]
flags = manual
apt = kwstyle
files =
 *.c *.cc *.cxx *.cpp
 *.h *.hh *.hxx *.hpp
comment =
 Please consider checking your code with KWStyle:
 https://kitware.github.io/KWStyle/resources/documentation.html
command = KWStyle -R -d .

# TODO: pscan
# TODO: adlint
# TODO: sparse
# TODO: http://repo.or.cz/w/smatch.git
# TODO: splint
# TODO: frama-c
# TODO: scan-build
# TODO: abi-compliance-checker
# TODO: http://oclint.org/
# TODO: http://saturn.stanford.edu/
# TODO: https://scan.coverity.com/
# TODO: https://github.com/facebook/flint
# TODO: https://github.com/Krazy-collection/krazy
# TODO: https://css.csail.mit.edu/stack/
# TODO: https://github.com/kframework/c-semantics
# TODO: https://code.google.com/p/checkheaders/ https://github.com/cristeab/checkheaders
# TODO: https://github.com/danmar/ublinter
# TODO: https://quickgit.kde.org/?p=clazy.git
# TODO: http://trust-in-soft.com/tis-interpreter/
# TODO: shell metacharacter injection: g_spawn_command_line* system popen

# vim:ft=dosini
