diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/ci/branches/ci_main1/.gitlab-ci.yml | 28 | ||||
-rwxr-xr-x | tools/ci/jobs/cpplint.sh | 17 | ||||
-rwxr-xr-x | tools/ci/scripts/init.sh | 2 | ||||
-rwxr-xr-x | tools/update-copyright.sh | 28 |
4 files changed, 22 insertions, 53 deletions
diff --git a/tools/ci/branches/ci_main1/.gitlab-ci.yml b/tools/ci/branches/ci_main1/.gitlab-ci.yml index 27ecc3655..021934447 100644 --- a/tools/ci/branches/ci_main1/.gitlab-ci.yml +++ b/tools/ci/branches/ci_main1/.gitlab-ci.yml @@ -253,31 +253,3 @@ gcc-8_unsigned_char_sdl2: libsdl2-gfx-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-net-dev libsdl2-ttf-dev git gdb valgrind netcat-openbsd procps POST_CXXFLAGS: "-funsigned-char" - -gcc-8_password: - stage: build - script: - - ./tools/ci/scripts/patchsdl1.sh - - ./tools/ci/jobs/gcc8.sh --enable-commandlinepassword - - ./tools/ci/scripts/runtests.sh - <<: *job-push - variables: - PACKAGES: gcc-8 g++-8 - make autoconf automake autopoint gettext - libxml2-dev libcurl4-gnutls-dev libpng-dev - libsdl-gfx1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libsdl-ttf2.0-dev - git gdb valgrind netcat-openbsd procps - -gcc-8_password_sdl2: - stage: build - script: - - ./tools/ci/jobs/gcc8.sh --enable-commandlinepassword --with-sdl2 - - ./tools/ci/scripts/runtests.sh - <<: *job-push - variables: - ABOUTYOFFSET: 380 - PACKAGES: gcc-8 g++-8 - make autoconf automake autopoint gettext - libxml2-dev libcurl4-gnutls-dev libpng-dev - libsdl2-gfx-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-net-dev libsdl2-ttf-dev - git gdb valgrind netcat-openbsd procps diff --git a/tools/ci/jobs/cpplint.sh b/tools/ci/jobs/cpplint.sh index d9ccf92c8..b8331ff29 100755 --- a/tools/ci/jobs/cpplint.sh +++ b/tools/ci/jobs/cpplint.sh @@ -50,21 +50,16 @@ args+=("--filter=\ # Cannot find a good way to handle execution errors # (such cpplint.py demanding a version of Python that does not exist) # So use || true here and assume any other problems will be exposed -# by the grep below. +# by the grep below. Addendum: no more grep. YMMV. find src \ -type f \ \( -name "*.cc" \ - -o -name "*.cpp"\ - -o -name "*.h" \ - -o -name "*.hpp" \ - \) -exec ./cpplint.py --verbose=5 "${args[@]}" {} \+ 2>"$ERRFILE_UNFILTERED" \ - || true + -o \( -name "*.cpp" -a \! -path src/debug/nvwa/debug_new.cpp \) \ + -o \( -name "*.h" -a \! -path src/unittests/doctest.h \) \ + -o \( -name "*.hpp" -a \! -path src/unittests/catch.hpp \) \ + \) -exec ./cpplint.py --verbose=5 "${args[@]}" {} \+ 2>"$ERRFILE" + #|| true -# If grep does not find any messages, it exits non-zero. Therefore, use ||true -grep -v -e "^src/debug/nvwa/debug_new.cpp" \ - -e "^src/unittests/doctest.h" \ - -e "^src/unittests/catch.hpp" \ - < "$ERRFILE_UNFILTERED" > "$ERRFILE" || true run_check_warnings diff --git a/tools/ci/scripts/init.sh b/tools/ci/scripts/init.sh index cd716cf94..396dae182 100755 --- a/tools/ci/scripts/init.sh +++ b/tools/ci/scripts/init.sh @@ -223,7 +223,7 @@ function run_check_warnings { fi if [[ -s "$ERRFILE_UNFILTERED" ]]; then - printf "Warnings detected in %s. The maintainer might want take a peek, sometimes.\n" \ + printf "Warnings detected in %s. The maintainer might want to take a peek, sometimes.\n" \ "$ERRFILE_UNFILTERED" fi } diff --git a/tools/update-copyright.sh b/tools/update-copyright.sh index 4df05c030..3eb813b6f 100755 --- a/tools/update-copyright.sh +++ b/tools/update-copyright.sh @@ -2,7 +2,7 @@ # Copyright (C) 2001-2010 Wormux Team. # Copyright (C) 2010 The ManaWorld Development Team. # Copyright (C) 2012-2016 The ManaPlus Developers. -# Copyright (C) 2021-2023 The ManaVerse Developers. +# Copyright (C) 2021-2025 The ManaVerse Developers. cd .. if [[ $1 != "" ]]; then @@ -13,18 +13,20 @@ fi [[ ! -e src ]] && echo "This script should be ran from the top manaverse dirs ./tools/ path." && exit 2 -tmp_file="w$RANDOM$RANDOM$RANDOM$RANDOM" -[[ -e $tmp_file ]] && tmp_file="w$RANDOM$RANDOM$RANDOM$RANDOM" - # update the dates, creating the interval if it doesn't exist yet -find -iname "*.cpp" -or -iname "*.h" -or -iname "*.hpp" -or -iname "*.inc" -or -iname "*.cc" | - xargs sed -i "/Copyright.*The ManaVerse Developers/ s,\(20[0-9]*\) \|\(20[0-9]*\)-20[0-9]* ,\1\2-$new_year ," +# N.B: without the type f check, sed replaces symlinks with regular files +find -type f -a \ + \( -iname "*.cpp" \ + -or -iname "*.cc" \ + -or -iname "*.h" \ + -or -iname "*.hpp" \ + -or -iname "*.in" \ + -or -iname "*.inc" \ + -or -iname "*.sh" \ + -or -iname "*.txt" \ + \) -execdir sed -i "/Copyright.*The ManaVerse Developers/ s,\(20[0-9]*\) \|\(20[0-9]*\)-20[0-9]* ,\1\2-$new_year ," {} \+ +printf "The next +/- counts mentioning copyright lines should match:\n" +printf "If they do not, then try finding the offending files with grep -rl <\$bad_line>\n" # do a semi-automated commit check -git diff > $tmp_file -echo "The next +/- counts mentioning copyrights should match:" -grep "^[-+][^-+]" $tmp_file | sort | uniq -c -echo "If they don't, try finding the offending files with grep -rl <\$bad_line>" - -# Remove temp file -[[ -e $tmp_file ]] && rm $tmp_file +git diff | grep "^[-+][^-+]" | sort | uniq -c |