blob: 42128fc671e8ca0f3763f36ee7551c9f2367844b [file] [log] [blame]
James E. King IIId907cc92018-01-12 10:43:25 -05001#!/bin/bash
James E. King, III0ad20bd2017-09-30 15:44:16 -07002set -ev
3
4#
James E. King, III350fe752017-10-25 09:57:18 -04005# 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
10if [[ -z "$NOBUILD" ]]; then
11 ./bootstrap.sh
12 ./configure --enable-tutorial=no
13 make -j3 precross
14fi
15
16#
James E. King, III0ad20bd2017-09-30 15:44:16 -070017# 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)
27cppcheck --force --quiet --inline-suppr --enable=all -j2 compiler/cpp/src
28
29# C++ cppcheck (All)
30cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
31
32# C Glib cppcheck (All)
33cppcheck --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
James E. King, III350fe752017-10-25 09:57:18 -040036# See THRIFT-4371 : flex generated code triggers "possible null pointer dereference" in yy_init_buffer
37cppcheck --force --quiet --inline-suppr --suppress="*:thrift/thriftl.cc" --error-exitcode=1 -j2 compiler/cpp/src
James E. King, III0ad20bd2017-09-30 15:44:16 -070038cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
39cppcheck --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
James E. King III3ec40312019-01-31 18:35:51 -050042flake8
James E. King, III0ad20bd2017-09-30 15:44:16 -070043
Robert Lub03ca012018-01-18 19:06:39 +080044# PHP code style
Robert Lu8de4bb92018-02-22 11:06:07 +080045composer install --quiet
46./vendor/bin/phpcs
Robert Lub03ca012018-01-18 19:06:39 +080047
James E. King, III0ad20bd2017-09-30 15:44:16 -070048# TODO etc
49echo FIXMEs: `grep -r FIXME * | wc -l`
50echo HACKs: `grep -r HACK * | wc -l`
51echo TODOs: `grep -r TODO * | wc -l`
52
53# LoC
54sloccount .
55
56# System Info
57dpkg -l
58uname -a