diff options
-rw-r--r-- | .gitlab-ci.yml | 16 | ||||
-rw-r--r-- | src/gui/windows/ministatuswindow.cpp | 4 | ||||
-rwxr-xr-x | tools/ci/jobs/mplint.sh | 25 | ||||
-rwxr-xr-x | tools/ci/scripts/exit.sh | 2 | ||||
-rwxr-xr-x | tools/ci/scripts/init.sh | 39 |
5 files changed, 37 insertions, 49 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 116bceed0..f7b8e107c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -327,30 +327,26 @@ gcc-8_unittestsbin: tags: - docker -mplint: - stage: lint - script: - - ./tools/ci/jobs/mplint.sh src po data - <<: *job-push - variables: - PACKAGES: gcc g++ git - make autoconf automake autopoint gettext tags: - docker + linters: stage: lint image: debian:buster script: + - ./tools/ci/jobs/mplint.sh src po data - ./tools/ci/jobs/pngcheck.sh - ./tools/ci/jobs/imagemagiccheck.sh - ./tools/ci/jobs/cpplint.sh - ./tools/ci/jobs/nsiqcppstyle.sh <<: *job-push variables: - PACKAGES: python wget pngcheck imagemagick git grep + MPLINT_PACKAGE_URL: "$CI_API_V4_URL/projects/mana%2Fmplint/jobs/artifacts/master/download?job=package_debian10_buster" + PACKAGES: git grep imagemagick pngcheck python unzip wget tags: - - lightweight + - docker + gcc-5_h_all: stage: prebuild diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp index 956721c47..e52a1a8d7 100644 --- a/src/gui/windows/ministatuswindow.cpp +++ b/src/gui/windows/ministatuswindow.cpp @@ -303,8 +303,8 @@ void MiniStatusWindow::attributeChanged(const AttributesT id, case Attributes::PLAYER_JOB_LEVEL: case Attributes::PLAYER_JOB_EXP: case Attributes::PLAYER_JOB_EXP_NEEDED: - StatusWindow::updateJobBar(mJobBar, true); - break; + StatusWindow::updateJobBar(mJobBar, true); + break; case Attributes::TOTAL_WEIGHT: case Attributes::MAX_WEIGHT: StatusWindow::updateWeightBar(mWeightBar); diff --git a/tools/ci/jobs/mplint.sh b/tools/ci/jobs/mplint.sh index 573cd1c85..60422e5f6 100755 --- a/tools/ci/jobs/mplint.sh +++ b/tools/ci/jobs/mplint.sh @@ -1,29 +1,18 @@ #!/usr/bin/env bash -export CC=gcc -export CXX=g++ - -if [ "$NEWCC" != "" ]; then - export CC="$NEWCC" -fi -if [ "$NEWCXX" != "" ]; then - export CXX="$NEWCXX" -fi +set -e # Fail if any command fails +set -u # Fail if any variable is unset when used export LOGFILE=mplint_po.log - source ./tools/ci/scripts/init.sh -export CXXFLAGS="-std=gnu++11" +rm -rf mplint || true +tools/ci/scripts/retry.sh wget -O mplint-release.zip "$MPLINT_PACKAGE_URL" +unzip mplint-release.zip -do_init +read mplint_commit < mplint-version.txt +printf "Using mplint: %s\n" "$mplint_commit" -rm -rf mplint || true -gitclone https://git.themanaworld.org/mana mplint.git -cd mplint -run_configure_simple -run_make -cd .. echo " " >config.h for task in "$@"; do run_mplint $task diff --git a/tools/ci/scripts/exit.sh b/tools/ci/scripts/exit.sh index 1f13618c1..5c63a1d1b 100755 --- a/tools/ci/scripts/exit.sh +++ b/tools/ci/scripts/exit.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -rm $ERRFILE +rm -f "$ERRFILE" diff --git a/tools/ci/scripts/init.sh b/tools/ci/scripts/init.sh index 9512e9b66..ed25a59e8 100755 --- a/tools/ci/scripts/init.sh +++ b/tools/ci/scripts/init.sh @@ -3,7 +3,7 @@ export dir=$(pwd) export ERRFILE=${dir}/logs/${LOGFILE} -rm ${ERRFILE} +rm -f "$ERRFILE" function do_init { $CC --version @@ -104,11 +104,11 @@ function check_error { } function run_configure_simple { - rm $ERRFILE + rm -f "$ERRFILE" echo "autoreconf -i" autoreconf -i 2>$ERRFILE check_error $? - rm $ERRFILE + rm -f "$ERRFILE" echo "./configure $*" ./configure $* 2>$ERRFILE check_error $? @@ -117,14 +117,14 @@ function run_configure_simple { function run_configure { run_configure_simple $* - rm $ERRFILE + rm -f "$ERRFILE" cd po echo "make update-gmo" make update-gmo 2>$ERRFILE check_error $? cd .. - rm $ERRFILE + rm -f "$ERRFILE" cd po echo "make update-po" make update-po 2>$ERRFILE @@ -133,14 +133,14 @@ function run_configure { } function run_cmake { - rm $ERRFILE + rm -f "$ERRFILE" echo "cmake ." cmake . 2>$ERRFILE check_error $? } function run_make { - rm $ERRFILE + rm -f "$ERRFILE" if [ "$JOBS" == "" ]; then export JOBS=2 echo "No JOBS defined" @@ -153,7 +153,7 @@ function run_make { } function run_make_check { - rm $ERRFILE + rm -f "$ERRFILE" if [ "$JOBS" == "" ]; then export JOBS=2 echo "No JOBS defined" @@ -211,7 +211,7 @@ function run_check_warnings { } function run_h { - rm $ERRFILE + rm -f "$ERRFILE" echo "$CC -c -x c++ $* $includes */*/*/*/*.h */*/*/*.h */*/*.h */*.h *.h" $CC -c -x c++ $* $includes */*/*/*/*.h */*/*/*.h */*/*.h */*.h *.h 2>$ERRFILE if [[ -s "$ERRFILE" ]]; then @@ -221,7 +221,7 @@ function run_h { } function run_tarball { - rm $ERRFILE + rm -f "$ERRFILE" echo "make dist-xz" make dist-xz 2>$ERRFILE check_error $? @@ -234,14 +234,17 @@ function run_tarball { } function run_mplint { - rm $ERRFILE - echo "mplint/src/mplint $*" - mplint/src/mplint "$@" \ - | grep -v \ - -e "src/unittests/doctest.h" \ - -e "src/unittests/catch.hpp" \ - -e "src/debug/" \ - > "$ERRFILE" + rm -f "$ERRFILE" + echo "\$ ./mplint $*" + + ./mplint "$@" > "$ERRFILE.unfiltered" + + # if grep does not find any messages, it exits non-zero + grep -v \ + -e "src/unittests/doctest.h" \ + -e "src/unittests/catch.hpp" \ + -e "src/debug/" \ + < "$ERRFILE.unfiltered" > "$ERRFILE" || true run_check_warnings } |