Add clang-tidy, create Linux build script

clang-tidy is currently set up with errors for all checks that do not
warn. This is to prevent regressing the repo.

Gradually these warnings should be removed in order to prevent further
regresssions in warnings that do not have many occurences.
This commit is contained in:
Vasily
2019-02-28 21:16:53 +01:00
committed by username223
parent dbb1ab70e5
commit da25e58cbb
6 changed files with 405 additions and 4 deletions
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
set -e
if [[ -z $QMAKE_SPEC ]]; then
QMAKE_SPEC='linux-g++'
fi
if [[ -z $USE_TIDY ]]; then
MAKE_COMMAND='make --jobs'
CLANG_TIDY=
else
# Bear replaces the compile database, it does not update it.
# If you run 'bear make' and there is nothing to compile, you
# will get an empty database.
# Clean up the artifacts and run everything together in that case.
MAKE_COMMAND='bear make --jobs'
QMAKE_SPEC='linux-clang'
CLANG_TIDY='../build_scripts/linux/run-clang-tidy.sh'
fi
echo $MAKE_COMMAND
mkdir -p build
cd build
qmake --version
qmake -spec $QMAKE_SPEC ..
$MAKE_COMMAND
$CLANG_TIDY
Regular → Executable
+1
View File
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -e
clang-format --version
+15
View File
@@ -0,0 +1,15 @@
set +e
clang-tidy --version
ERROR=0
for file in $(find ../src -name "*.cpp"); do
echo $file
clang-tidy $file
EXIT=$?
if [[ $EXIT != 0 ]]; then
ERROR=1
fi
done
set -e
exit $ERROR
+1
View File
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -e
clang-format --version;