Make cppcheck print diagnostics only (#2456)

The progress messages of cppcheck produce a lengthy and verbose
log, making errors and warnings hard to find. This patch adds
`--quiet` to the invocation of `cppcheck`

Additionally, the patch relayouts the script to use a consistent
two-spaces indentation everywhere.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
Akos Kiss
2018-08-09 10:12:18 +02:00
committed by László Langó
parent f6b99b60d2
commit 3fd7e98d53
+13 -12
View File
@@ -15,11 +15,11 @@
# limitations under the License. # limitations under the License.
if [[ "$OSTYPE" == "linux"* ]]; then if [[ "$OSTYPE" == "linux"* ]]; then
CPPCHECK_JOBS=${CPPCHECK_JOBS:=$(nproc)} CPPCHECK_JOBS=${CPPCHECK_JOBS:=$(nproc)}
elif [[ "$OSTYPE" == "darwin"* ]]; then elif [[ "$OSTYPE" == "darwin"* ]]; then
CPPCHECK_JOBS=${CPPCHECK_JOBS:=$(sysctl -n hw.ncpu)} CPPCHECK_JOBS=${CPPCHECK_JOBS:=$(sysctl -n hw.ncpu)}
else else
CPPCHECK_JOBS=${CPPCHECK_JOBS:=1} CPPCHECK_JOBS=${CPPCHECK_JOBS:=1}
fi fi
JERRY_CORE_DIRS=`find jerry-core -type d` JERRY_CORE_DIRS=`find jerry-core -type d`
@@ -32,15 +32,16 @@ JERRY_LIBM_DIRS=`find jerry-libm -type d`
INCLUDE_DIRS=() INCLUDE_DIRS=()
for DIR in $JERRY_CORE_DIRS $JERRY_EXT_DIRS $JERRY_PORT_DIRS $JERRY_LIBC_DIRS $JERRY_LIBM_DIRS for DIR in $JERRY_CORE_DIRS $JERRY_EXT_DIRS $JERRY_PORT_DIRS $JERRY_LIBC_DIRS $JERRY_LIBM_DIRS
do do
INCLUDE_DIRS=("${INCLUDE_DIRS[@]}" "-I$DIR") INCLUDE_DIRS=("${INCLUDE_DIRS[@]}" "-I$DIR")
done done
cppcheck -j$CPPCHECK_JOBS --force \ cppcheck -j$CPPCHECK_JOBS --force \
--language=c --std=c99 \ --language=c --std=c99 \
--enable=warning,style,performance,portability,information \ --quiet \
--template="{file}:{line}: {severity}({id}): {message}" \ --enable=warning,style,performance,portability,information \
--error-exitcode=1 \ --template="{file}:{line}: {severity}({id}): {message}" \
--exitcode-suppressions=tools/cppcheck/suppressions-list \ --error-exitcode=1 \
--suppressions-list=tools/cppcheck/suppressions-list \ --exitcode-suppressions=tools/cppcheck/suppressions-list \
"${INCLUDE_DIRS[@]}" \ --suppressions-list=tools/cppcheck/suppressions-list \
jerry-core jerry-ext jerry-port jerry-libc jerry-libm jerry-main tests/unit-* "${INCLUDE_DIRS[@]}" \
jerry-core jerry-ext jerry-port jerry-libc jerry-libm jerry-main tests/unit-*