merge misra and cppcheck runs (#1790)

This commit is contained in:
Adeeb Shihadeh 2024-01-09 20:04:44 -08:00 committed by GitHub
parent 2a0536c631
commit 9270848da8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 11 deletions

View File

@ -9,15 +9,9 @@ NC='\033[0m'
GCC_INC="$(arm-none-eabi-gcc -print-file-name=include)"
: "${CPPCHECK_DIR:=$DIR/cppcheck/}"
CPPCHECK="$CPPCHECK_DIR/cppcheck --dump --enable=all --force --inline-suppr -I $PANDA_DIR/board/ -I $GCC_INC \
CPPCHECK="$CPPCHECK_DIR/cppcheck --enable=all --force --inline-suppr -I $PANDA_DIR/board/ -I $GCC_INC \
--suppressions-list=$DIR/suppressions.txt --suppress=*:*inc/* \
--suppress=*:*include/* --error-exitcode=2"
RULES="$DIR/MISRA_C_2012.txt"
MISRA="python $CPPCHECK_DIR/addons/misra.py"
if [ -f "$RULES" ]; then
MISRA="$MISRA --rule-texts $RULES"
fi
--suppress=*:*include/* --error-exitcode=2 --addon=misra"
# install cppcheck if missing
if [ ! -d $CPPCHECK_DIR ]; then
@ -38,14 +32,11 @@ scons -j8
printf "\n${GREEN}** PANDA F4 CODE **${NC}\n"
$CPPCHECK -DCAN3 -DPANDA -DSTM32F4 -UPEDAL -DUID_BASE board/main.c
$MISRA board/main.c.dump
printf "\n${GREEN}** PANDA H7 CODE **${NC}\n"
$CPPCHECK -DCAN3 -DPANDA -DSTM32H7 -UPEDAL -DUID_BASE board/main.c
$MISRA board/main.c.dump
printf "\n${GREEN}** PEDAL CODE **${NC}\n"
$CPPCHECK -UCAN3 -UPANDA -DSTM32F2 -DPEDAL -UUID_BASE board/pedal/main.c
$MISRA board/pedal/main.c.dump
printf "\n${GREEN}Success!${NC} took $SECONDS seconds\n"