From 6c16f339224a4736f4ed57d15bb3e5f968a635ab Mon Sep 17 00:00:00 2001 From: 0scar Date: Tue, 29 Sep 2020 08:51:02 +0200 Subject: Initial independent commit --- tools/scripts/lint | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 tools/scripts/lint (limited to 'tools/scripts/lint') diff --git a/tools/scripts/lint b/tools/scripts/lint new file mode 100755 index 0000000..0c0c352 --- /dev/null +++ b/tools/scripts/lint @@ -0,0 +1,28 @@ +#!/usr/bin/env sh + +SRCDIR="${SRCDIR:-src}" + +echo "Running bear..." +if which bear >/dev/null ; then + make clean + bear -- make 2>&1>/dev/null +else + echo -e "\e[31mnot found. Without compile_commands.json results might be bad or outright wrong.\e[0m" +fi + +echo "Running cppcheck..." +if which cppcheck >/dev/null ; then + echo "" + if [ -e 'compile_commands.json' ] ; then + cppcheck --language=c --std=c99 --enable=all \ + --suppress={missingIncludeSystem,unusedFunction} \ + --project=compile_commands.json \ + -q "${SRCDIR}" + else + cppcheck --language=c --std=c99 --enable=all \ + --suppress={missingIncludeSystem,unusedFunction} \ + -q "${SRCDIR}" + fi +else + echo -e "\e[31mnot found\e[0m" +fi -- cgit v1.3