3 export SCRIPT_BASE
=$
(dirname `readlink -f $0`)
4 export BASE
=${SCRIPT_BASE}/..
6 # search for a suitable clang-tidy version
7 CLANG_TIDY_BIN
=`which clang-tidy-3.9`
8 if [ ! -x ${CLANG_TIDY_BIN} ] ; then
9 echo "error: clang-tidy not found. abort."
16 printf '%*s\n' $
((`tput cols` - 10 - ${#1})) "" |
tr ' ' '-'
17 ${CLANG_TIDY_BIN} $1 \
18 -checks=cppcoreguidelines-
*,modernize-
*,readability-
*,misc-
*,clang-analyzer-
*,-readability-braces-around-statements \
20 -- -I${BASE}/src
-std=c
++11
23 function exec_directory
()
25 for fn
in $
(find $1 -name "*.[ch]pp" |
sort) ; do
30 if [ ! -x ${CLANG_TIDY_BIN} ] ; then
31 echo "error: clang tidy not found. abort."
35 if [ $# -gt 1 ] ; then
36 echo "error: invalid number of parameters: $#"
38 echo "usage: $0 [directory|filename]"
40 echo " if no direcory of filename is specified, the directory 'src' with all files"
41 echo " matching '*.[ch]pp' is assumed."
46 if [ $# -eq 0 ] ; then
47 exec_directory
${BASE}/src
54 echo "error: argument not existing directory or filename: '$1'"