| 1 |
[cppcheck] |
| 2 |
apt = cppcheck |
| 3 |
# see Path::acceptFile etc in lib/path.cpp in cppcheck |
| 4 |
# TODO: update it before releases: |
| 5 |
# curl -s https://sources.debian.net/data/main/c/cppcheck/latest/lib/path.cpp | |
| 6 |
# grep 'ext.* == "' | |
| 7 |
# sed 's/.*"\([^"]*\)".*/\1/;s/^/ */' |
| 8 |
files = |
| 9 |
*.c |
| 10 |
*.cpp |
| 11 |
*.cxx |
| 12 |
*.cc |
| 13 |
*.c++ |
| 14 |
*.hpp |
| 15 |
*.hxx |
| 16 |
*.hh |
| 17 |
*.tpp |
| 18 |
*.txx |
| 19 |
types = text/x-c text/x-c++ |
| 20 |
command = cppcheck -j{njobs} --quiet -f . |
| 21 |
|
| 22 |
[deheader] |
| 23 |
flags = manual |
| 24 |
apt = deheader |
| 25 |
files = *.c *.cc *.cxx *.cpp |
| 26 |
types = text/x-c text/x-c++ |
| 27 |
comment = |
| 28 |
Check if your C/C++ code contains any unnecessary headers. |
| 29 |
Dangerous because it executes Makefiles |
| 30 |
command = deheader |
| 31 |
|
| 32 |
[include-what-you-use] |
| 33 |
apt = iwyu |
| 34 |
files = |
| 35 |
*.c *.cc *.cxx *.cpp |
| 36 |
*.h *.hh *.hxx *.hpp |
| 37 |
types = text/x-c text/x-c++ |
| 38 |
command = include-what-you-use {file} |
| 39 |
|
| 40 |
[flawfinder] |
| 41 |
apt = flawfinder |
| 42 |
# see maybe_process_file and c_extensions in the flawfinder script in flawfinder |
| 43 |
# TODO: update it before releases: |
| 44 |
# sed -n '/^c_extensions/,/ *}$/p' /usr/bin/flawfinder | sed "s/ *: *1 *,*/ /g;s/#.*//;s/'//g;s/\./*./g;s/ \+/ /g;s/.*[{}]//;s/\(.*\)/\L\1/;s/ *$//" |
| 45 |
files = |
| 46 |
*.c *.h |
| 47 |
*.ec *.ecp |
| 48 |
*.pgc |
| 49 |
*.cpp *.cxx *.cc |
| 50 |
*.cc *.c++ |
| 51 |
*.pcc |
| 52 |
*.hpp |
| 53 |
command = flawfinder -Q -c . |
| 54 |
flags = fixme fixme-silent |
| 55 |
|
| 56 |
[pmccabe] |
| 57 |
flags = complexity |
| 58 |
apt = pmccabe |
| 59 |
files = |
| 60 |
*.c *.cc *.cxx *.cpp |
| 61 |
*.h *.hh *.hxx *.hpp |
| 62 |
types = text/x-c text/x-c++ |
| 63 |
command = pmccabe {files} | sort -nr |
| 64 |
|
| 65 |
[clang-check] |
| 66 |
flags = manual |
| 67 |
apt = clang |
| 68 |
files = |
| 69 |
*.c *.cc *.cxx *.cpp |
| 70 |
*.h *.hh *.hxx *.hpp |
| 71 |
types = text/x-c text/x-c++ |
| 72 |
comment = |
| 73 |
because it can't be automatically run from `find -exec` due to the requirement for -- |
| 74 |
Please consider checking your code with clang-check: |
| 75 |
http://clang.llvm.org/docs/ClangCheck.html |
| 76 |
command = clang-check <files> -- |
| 77 |
|
| 78 |
[clang-tidy] |
| 79 |
flags = manual |
| 80 |
apt = clang-tidy |
| 81 |
files = |
| 82 |
*.c *.cc *.cxx *.cpp |
| 83 |
*.h *.hh *.hxx *.hpp |
| 84 |
types = text/x-c text/x-c++ |
| 85 |
command = clang-tidy '-checks=*' <files> -- |
| 86 |
comment = because it can't be automatically run from `find -exec` due to the requirement for -- |
| 87 |
|
| 88 |
[m64-m32] |
| 89 |
files = |
| 90 |
*.c *.cc *.cxx *.cpp |
| 91 |
*.h *.hh *.hxx *.hpp |
| 92 |
types = text/x-c text/x-c++ |
| 93 |
comment = You should almost never use -m64 and -m32 when compiling. |
| 94 |
command = grep -nHrwE -- '-m64|-m32' . |
| 95 |
|
| 96 |
[cbmc] |
| 97 |
flags = todo |
| 98 |
apt = cbmc |
| 99 |
comment = needs to be a suggestion as it runs during a build |
| 100 |
|
| 101 |
[vera] |
| 102 |
flags = todo |
| 103 |
comment = https://bitbucket.org/verateam/vera/overview |
| 104 |
|
| 105 |
[nsiqcppstyle] |
| 106 |
flags = todo |
| 107 |
comment = https://code.google.com/p/nsiqcppstyle/ |
| 108 |
|
| 109 |
[cppclean] |
| 110 |
flags = todo |
| 111 |
comment = https://github.com/myint/cppclean/ |
| 112 |
|
| 113 |
[complexity] |
| 114 |
flags = complexity |
| 115 |
apt = complexity |
| 116 |
files = *.c |
| 117 |
types = text/x-c |
| 118 |
command = complexity --no-load-opts {files} |
| 119 |
|
| 120 |
[kwstyle] |
| 121 |
flags = manual |
| 122 |
apt = kwstyle |
| 123 |
files = |
| 124 |
*.c *.cc *.cxx *.cpp |
| 125 |
*.h *.hh *.hxx *.hpp |
| 126 |
comment = |
| 127 |
Please consider checking your code with KWStyle: |
| 128 |
https://kitware.github.io/KWStyle/resources/documentation.html |
| 129 |
command = KWStyle -R -d . |
| 130 |
|
| 131 |
[path-max] |
| 132 |
files = |
| 133 |
*.c *.cc *.cxx *.cpp |
| 134 |
*.h *.hh *.hxx *.hpp |
| 135 |
types = text/x-c text/x-c++ |
| 136 |
command = grep -nHwE 'PATH_MAX|MAXPATHLEN' {files} |
| 137 |
comment = |
| 138 |
You should not assume that paths are at most PATH_MAX characters long. |
| 139 |
Some operating systems (e.g. Hurd) don't define PATH_MAX at all. |
| 140 |
Others (e.g. Linux, OS X) define it, but don't enforce the limit. |
| 141 |
|
| 142 |
[pscan] |
| 143 |
apt = pscan |
| 144 |
files = |
| 145 |
*.c *.cc *.cxx *.cpp |
| 146 |
*.h *.hh *.hxx *.hpp |
| 147 |
types = text/x-c text/x-c++ |
| 148 |
command = pscan {files} |
| 149 |
|
| 150 |
# TODO: adlint |
| 151 |
# TODO: sparse |
| 152 |
# TODO: http://repo.or.cz/w/smatch.git |
| 153 |
# TODO: splint |
| 154 |
# TODO: frama-c |
| 155 |
# TODO: scan-build |
| 156 |
# TODO: abi-compliance-checker |
| 157 |
# TODO: http://oclint.org/ |
| 158 |
# TODO: http://saturn.stanford.edu/ |
| 159 |
# TODO: https://scan.coverity.com/ |
| 160 |
# TODO: https://github.com/facebookarchive/flint |
| 161 |
# TODO: https://github.com/Krazy-collection/krazy |
| 162 |
# TODO: https://css.csail.mit.edu/stack/ |
| 163 |
# TODO: https://github.com/kframework/c-semantics |
| 164 |
# TODO: https://code.google.com/p/checkheaders/ https://github.com/cristeab/checkheaders |
| 165 |
# TODO: https://github.com/danmar/ublinter |
| 166 |
# TODO: https://cgit.kde.org/clazy.git/ |
| 167 |
# TODO: http://trust-in-soft.com/tis-interpreter/ |
| 168 |
# TODO: shell metacharacter injection: g_spawn_command_line* system popen |
| 169 |
|
| 170 |
# vim:ft=dosini |