]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
1 | #!/bin/bash |
2 | set -ev | |
3 | ||
4 | # | |
5 | # Generate thrift files so the static code analysis includes an analysis | |
6 | # of the files the thrift compiler spits out. If running interactively | |
7 | # set the NOBUILD environment variable to skip the boot/config/make phase. | |
8 | # | |
9 | ||
10 | if [[ -z "$NOBUILD" ]]; then | |
11 | ./bootstrap.sh | |
12 | ./configure --enable-tutorial=no | |
13 | make -j3 precross | |
14 | fi | |
15 | ||
16 | # | |
17 | # C/C++ static code analysis with cppcheck | |
18 | # add --error-exitcode=1 to --enable=all as soon as everything is fixed | |
19 | # | |
20 | # Python code style check with flake8 | |
21 | # | |
22 | # search for TODO etc within source tree | |
23 | # some statistics about the code base | |
24 | # some info about the build machine | |
25 | ||
26 | # Compiler cppcheck (All) | |
27 | cppcheck --force --quiet --inline-suppr --enable=all -j2 compiler/cpp/src | |
28 | ||
29 | # C++ cppcheck (All) | |
30 | cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp | |
31 | ||
32 | # C Glib cppcheck (All) | |
33 | cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib | |
34 | ||
35 | # Silent error checks | |
36 | # See THRIFT-4371 : flex generated code triggers "possible null pointer dereference" in yy_init_buffer | |
37 | cppcheck --force --quiet --inline-suppr --suppress="*:thrift/thriftl.cc" --error-exitcode=1 -j2 compiler/cpp/src | |
38 | cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp | |
39 | cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib | |
40 | ||
41 | # Python code style | |
42 | flake8 | |
43 | ||
44 | # PHP code style | |
45 | composer install --quiet | |
46 | ./vendor/bin/phpcs | |
47 | ||
48 | # TODO etc | |
49 | echo FIXMEs: `grep -r FIXME * | wc -l` | |
50 | echo HACKs: `grep -r HACK * | wc -l` | |
51 | echo TODOs: `grep -r TODO * | wc -l` | |
52 | ||
53 | # LoC | |
54 | sloccount . | |
55 | ||
56 | # System Info | |
57 | dpkg -l | |
58 | uname -a |