From b7146da2edf6e57592cc02dd0d58c85071042244 Mon Sep 17 00:00:00 2001 From: Filip Bucek Date: Tue, 5 Nov 2019 10:03:02 +0100 Subject: [PATCH] CI: adding quality of code ( cppcheck ) --- .gitlab-ci.yml | 17 ++++++++++++++--- src/core/databasemanager.cpp | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1c923e9..0c54578 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,7 @@ stages: - build - test +- quality # ######## # Build @@ -9,7 +10,7 @@ stages: build: # name of task stage: build # in what stage it will run ( 1. build then test etc ) tags: # Tags are used to choose correct gitlab-runner - - hw # spaceti-runner server has running runners and one has tag 'hw' + - linux # spaceti-runner server has running runners and one has tag 'hw' script: # run in bash - mkdir -p build - cd build @@ -26,7 +27,7 @@ cache: test: # name of task stage: test # in what stage it will run ( 1. build then test etc ) tags: # Tags are used to choose correct gitlab-runner - - hw # spaceti-runner server has running runners and one has tag 'hw' + - linux # spaceti-runner server has running runners and one has tag 'hw' script: # run in bash - cd build - make check test @@ -34,7 +35,17 @@ test: # name of task valgrind: # name of task stage: test # in what stage it will run ( 1. build then test etc ) tags: # Tags are used to choose correct gitlab-runner - - hw # spaceti-runner server has running runners and one has tag 'hw' + - linux # spaceti-runner server has running runners and one has tag 'hw' script: # run in bash - cd build - valgrind make check test + + +# Quality of code +cppcheck: + stage: test # in what stage it will run ( 1. build then test etc ) + tags: # Tags are used to choose correct gitlab-runner + - linux # spaceti-runner server has running runners and one has tag 'hw' + allow_failure: true + script: # run in bash + - cppcheck src --suppress=unusedFunction --enable=all -i build --error-exitcode=1 diff --git a/src/core/databasemanager.cpp b/src/core/databasemanager.cpp index bf891cb..3454d10 100644 --- a/src/core/databasemanager.cpp +++ b/src/core/databasemanager.cpp @@ -50,7 +50,7 @@ QString DatabaseManager::getLastQuery(const QSqlQuery& query) const void DatabaseManager::log(const QString &msg) const { - qDebug("database logger implement logger"); + qDebug() << "database logger implement logger"; } } // core