added cppcheck config and simple script to run it
Costa Tsaousis (ktsaou) committed
Dec 26, 2017 at 05:54 UTC
dbc69a0ece3998482b3a1b579a72893c17537f37
4 files changed
+47
-3
.gitignore
+2
-3
@@ -99,6 +99,7 @@ profile/benchmark-dictionary
99
profile/benchmark-registry
100
profile/test-eval
101
profile/benchmark-line-parsing
102
+profile/statsd-stress
103
104
*.pyc
105
*.run
@@ -108,12 +109,10 @@ diagrams/*.svg
109
diagrams/*.atxt
110
diagrams/plantuml.jar
111
111
-netdata.cppcheck
112
-
113
-profile/statsd-stress
112
src/cgroup-network
113
vgcore.*
114
115
src/cppcheck-build/
116
makeself/debug/
117
118
+
Makefile.am
+2
@@ -61,9 +61,11 @@ SUBDIRS = \
61
$(NULL)
62
63
dist_noinst_DATA= \
64
+ cppcheck.sh \
65
configs.signatures \
66
Dockerfile \
67
Dockerfile.armv7hf \
68
+ netdata.cppcheck \
69
netdata.spec \
70
package.json \
71
$(NULL)
cppcheck.sh
new
+30
@@ -0,0 +1,30 @@
1
+#!/usr/bin/env bash
2
+
3
+cppcheck=$(which cppcheck 2>/dev/null || command -v cppcheck 2>/dev/null)
4
+[ -z "${cppcheck}" ] && echo >&2 "install cppcheck." && exit 1
5
+
6
+[ -x "/home/costa/src/cppcheck.git/cppcheck" ] && \
7
+ cppcheck="/home/costa/src/cppcheck.git/cppcheck"
8
+
9
+processors=$(grep -c ^processor /proc/cpuinfo)
10
+[ $(( processors )) -lt 1 ] && processors=1
11
+
12
+base="$(dirname "${0}")"
13
+[ "${base}" = "." ] && base="${PWD}"
14
+
15
+cd "${base}/src" || exit 1
16
+
17
+[ ! -d "cppcheck-build" ] && mkdir "cppcheck-build"
18
+
19
+file="${1}"
20
+shift
21
+[ "${file}" = "${base}" -o -z "${file}" ] && file="${base}/src"
22
+
23
+"${cppcheck}" \
24
+ -j ${processors} \
25
+ --cppcheck-build-dir="cppcheck-build" \
26
+ -I .. \
27
+ --force \
28
+ --enable=warning,performance,portability,information \
29
+ --suppress="unusedFunction:*" \
30
+ "${file}" "${@}"
netdata.cppcheck
new
+13
@@ -0,0 +1,13 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="1">
3
+ <root name="/home/costa/src/netdata-ktsaou.git/src"/>
4
+ <builddir>cppcheck-build</builddir>
5
+ <includedir>
6
+ <dir name=".."/>
7
+ <dir name="/usr/include"/>
8
+ </includedir>
9
+ <libraries>
10
+ <library>gnu</library>
11
+ <library>posix</library>
12
+ </libraries>
13
+</project>