From e509ead680cc1c0bde35dfd467d18b8288cc1b86 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Thu, 29 Dec 2016 13:17:24 +0100 Subject: Buildbot: Update Gettext version (#4971) --- util/buildbot/buildwin32.sh | 9 ++++----- util/buildbot/buildwin64.sh | 3 +-- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'util') diff --git a/util/buildbot/buildwin32.sh b/util/buildbot/buildwin32.sh index e58c25ccc..d807003d2 100755 --- a/util/buildbot/buildwin32.sh +++ b/util/buildbot/buildwin32.sh @@ -17,7 +17,7 @@ irrlicht_version=1.8.4 ogg_version=1.3.2 vorbis_version=1.3.5 curl_version=7.50.3 -gettext_version=0.14.4 +gettext_version=0.19.8.1 freetype_version=2.7 sqlite3_version=3.14.2 luajit_version=2.1.0-beta2 @@ -40,7 +40,7 @@ cd $builddir -c -O $packagedir/libvorbis-$vorbis_version.zip [ -e $packagedir/curl-$curl_version.zip ] || wget http://minetest.kitsunemimi.pw/curl-$curl_version-win32.zip \ -c -O $packagedir/curl-$curl_version.zip -[ -e $packagedir/gettext-$gettext_version.zip ] || wget http://minetest.kitsunemimi.pw/gettext-$gettext_version.zip \ +[ -e $packagedir/gettext-$gettext_version.zip ] || wget http://minetest.kitsunemimi.pw/gettext-$gettext_version-win32.zip \ -c -O $packagedir/gettext-$gettext_version.zip [ -e $packagedir/freetype2-$freetype_version.zip ] || wget http://minetest.kitsunemimi.pw/freetype2-$freetype_version-win32.zip \ -c -O $packagedir/freetype2-$freetype_version.zip @@ -130,10 +130,9 @@ cmake .. \ -DCURL_INCLUDE_DIR=$libdir/libcurl/include \ -DCURL_LIBRARY=$libdir/libcurl/lib/libcurl.dll.a \ \ - -DCUSTOM_GETTEXT_PATH=$libdir/gettext \ -DGETTEXT_MSGFMT=`which msgfmt` \ - -DGETTEXT_DLL=$libdir/gettext/bin/libintl3.dll \ - -DGETTEXT_ICONV_DLL=$libdir/gettext/bin/libiconv2.dll \ + -DGETTEXT_DLL=$libdir/gettext/bin/libintl-8.dll \ + -DGETTEXT_ICONV_DLL=$libdir/gettext/bin/libiconv-2.dll \ -DGETTEXT_INCLUDE_DIR=$libdir/gettext/include \ -DGETTEXT_LIBRARY=$libdir/gettext/lib/libintl.dll.a \ \ diff --git a/util/buildbot/buildwin64.sh b/util/buildbot/buildwin64.sh index 1c31fe4bd..3d6965f1e 100755 --- a/util/buildbot/buildwin64.sh +++ b/util/buildbot/buildwin64.sh @@ -17,7 +17,7 @@ irrlicht_version=1.8.4 ogg_version=1.3.2 vorbis_version=1.3.5 curl_version=7.50.3 -gettext_version=0.18.2 +gettext_version=0.19.8.1 freetype_version=2.7 sqlite3_version=3.14.2 luajit_version=2.1.0-beta2 @@ -131,7 +131,6 @@ cmake .. \ -DCURL_INCLUDE_DIR=$libdir/libcurl/include \ -DCURL_LIBRARY=$libdir/libcurl/lib/libcurl.dll.a \ \ - -DCUSTOM_GETTEXT_PATH=$libdir/gettext \ -DGETTEXT_MSGFMT=`which msgfmt` \ -DGETTEXT_DLL=$libdir/gettext/bin/libintl-8.dll \ -DGETTEXT_ICONV_DLL=$libdir/gettext/bin/libiconv-2.dll \ -- cgit v1.2.3 From 8aadc62856cc3789ed345ddf3870e311af60afe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Wed, 4 Jan 2017 14:36:51 +0100 Subject: Travis: Build server too for UNIX --- util/travis/script.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'util') diff --git a/util/travis/script.sh b/util/travis/script.sh index 1bafb26cd..24a74d186 100755 --- a/util/travis/script.sh +++ b/util/travis/script.sh @@ -21,6 +21,7 @@ if [[ $PLATFORM == "Unix" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug \ -DRUN_IN_PLACE=TRUE \ -DENABLE_GETTEXT=TRUE \ + -DBUILD_SERVER=TRUE \ $CMAKE_FLAGS .. make -j2 echo "Running unit tests." -- cgit v1.2.3 From 9878ce05e75421820115b8eaaf3752ab4bd06e57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Mon, 6 Mar 2017 20:34:02 +0100 Subject: CI: Add memleak checking using valgrind (#5350) Add a new step to check memleaks on our current unit tests suite --- util/travis/before_install.sh | 3 +++ util/travis/script.sh | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'util') diff --git a/util/travis/before_install.sh b/util/travis/before_install.sh index 891371984..ea85b3db6 100755 --- a/util/travis/before_install.sh +++ b/util/travis/before_install.sh @@ -18,6 +18,9 @@ if [[ $PLATFORM == "Unix" ]]; then # Linking to LevelDB is broken, use a custom build wget http://minetest.kitsunemimi.pw/libleveldb-1.18-ubuntu12.04.7z sudo 7z x -o/usr libleveldb-1.18-ubuntu12.04.7z + if [[ "$VALGRIND" == "1" ]]; then + sudo apt-get install valgrind + fi else brew update brew install freetype gettext hiredis irrlicht jpeg leveldb libogg libvorbis luajit diff --git a/util/travis/script.sh b/util/travis/script.sh index 24a74d186..84ea578a5 100755 --- a/util/travis/script.sh +++ b/util/travis/script.sh @@ -24,8 +24,15 @@ if [[ $PLATFORM == "Unix" ]]; then -DBUILD_SERVER=TRUE \ $CMAKE_FLAGS .. make -j2 + echo "Running unit tests." - ../bin/minetest --run-unittests && exit 0 + CMD="../bin/minetest --run-unittests" + if [[ "$VALGRIND" == "1" ]]; then + valgrind --leak-check=full --leak-check-heuristics=all --undef-value-errors=no --error-exitcode=9 ${CMD} && exit 0 + else + ${CMD} && exit 0 + fi + elif [[ $PLATFORM == Win* ]]; then [[ $CC == "clang" ]] && exit 1 # Not supposed to happen # We need to have our build directory outside of the minetest directory because -- cgit v1.2.3 From 22567d107fffe7a6833b96cc99d531e5303b47dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Sat, 25 Mar 2017 19:12:18 +0100 Subject: Add clang format & skip build if no source file modified (#5433) * [BUILD] Add clang format + build skipping * Add clang-format tool to check codestyle. Warning: it check the whole modified file, not the diff part, it's why it's lazy. Please also look if rules are perfect, i take the Linux codestyle from LLVM site Fix issue #5415 * Skip building project if no file is modified * Fix a wrong brace to trigger LINT * Make lint step outside of unix build scope * Add AccessModifierOffset: -8 * Typo fix & needs compile fix * Fix header priorities --- util/travis/before_install.sh | 12 +++++++++++- util/travis/common.sh | 3 ++- util/travis/script.sh | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) (limited to 'util') diff --git a/util/travis/before_install.sh b/util/travis/before_install.sh index ea85b3db6..a4328fa46 100755 --- a/util/travis/before_install.sh +++ b/util/travis/before_install.sh @@ -1,7 +1,15 @@ #!/bin/bash -e echo "Preparing for $TRAVIS_COMMIT_RANGE" -. util/travis/common.sh +if [[ "$LINT" == "1" ]]; then + curl http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - + sudo add-apt-repository "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main" + sudo apt-get -yq update + sudo apt-get install clang-format-3.9 + exit 0 +fi + +. util/travis/common.sh needs_compile || exit 0 if [[ $TRAVIS_OS_NAME == "linux" ]]; then @@ -11,6 +19,7 @@ fi if [[ $PLATFORM == "Unix" ]]; then if [[ $TRAVIS_OS_NAME == "linux" ]]; then + sudo apt-get update sudo apt-get install libirrlicht-dev cmake libbz2-dev libpng12-dev \ libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev \ libhiredis-dev libogg-dev libgmp-dev libvorbis-dev libopenal-dev \ @@ -21,6 +30,7 @@ if [[ $PLATFORM == "Unix" ]]; then if [[ "$VALGRIND" == "1" ]]; then sudo apt-get install valgrind fi + else brew update brew install freetype gettext hiredis irrlicht jpeg leveldb libogg libvorbis luajit diff --git a/util/travis/common.sh b/util/travis/common.sh index 16c7db324..35ceec08d 100644 --- a/util/travis/common.sh +++ b/util/travis/common.sh @@ -1,8 +1,9 @@ #!/bin/bash -e # Relative to git-repository root: -TRIGGER_COMPILE_PATHS="src/|CMakeLists.txt|cmake/Modules/|util/travis/|util/buildbot/" +TRIGGER_COMPILE_PATHS="src/.*\.(c|cpp|h)|CMakeLists.txt|cmake/Modules/|util/travis/|util/buildbot/" needs_compile() { git diff --name-only $TRAVIS_COMMIT_RANGE | egrep -q "^($TRIGGER_COMPILE_PATHS)" } + diff --git a/util/travis/script.sh b/util/travis/script.sh index 84ea578a5..557822e1f 100755 --- a/util/travis/script.sh +++ b/util/travis/script.sh @@ -3,21 +3,57 @@ needs_compile || exit 0 +function perform_lint() { + CLANG_FORMAT=clang-format-3.9 + if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then + # Get list of every file modified in this pull request + files_to_lint="$(git diff --name-only --diff-filter=ACMRTUXB $TRAVIS_COMMIT_RANGE | grep '^src/[^.]*[.]\(cpp\|h\)$' | egrep -v '^src/(gmp|lua|jsoncpp)/' || true)" + else + # Check everything for branch pushes + files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h' | egrep -v '^src/(gmp|lua|jsoncpp)/')" + fi + + local fail=0 + for f in ${files_to_lint}; do + d=$(diff -u "$f" <(${CLANG_FORMAT} "$f") || true) + if ! [ -z "$d" ]; then + printf "The file %s is not compliant with the coding style:\n%s\n" "$f" "$d" + # Disable build failure at this moment as we need to have a complete MT source whitelist to check + fail=0 + fi + done + + if [ "$fail" = 1 ]; then + exit 1 + fi + + exit 0 +} + +if [[ "$LINT" == "1" ]]; then + # Lint with exit CI + perform_lint +fi + if [[ $PLATFORM == "Unix" ]]; then mkdir -p travisbuild cd travisbuild || exit 1 + CMAKE_FLAGS='' if [[ $COMPILER == "g++-6" ]]; then export CC=gcc-6 export CXX=g++-6 fi + # Clang builds with FreeType fail on Travis if [[ $CC == "clang" ]]; then CMAKE_FLAGS+=' -DENABLE_FREETYPE=FALSE' fi + if [[ $TRAVIS_OS_NAME == "osx" ]]; then CMAKE_FLAGS+=' -DCUSTOM_GETTEXT_PATH=/usr/local/opt/gettext' fi + cmake -DCMAKE_BUILD_TYPE=Debug \ -DRUN_IN_PLACE=TRUE \ -DENABLE_GETTEXT=TRUE \ -- cgit v1.2.3 From aa5549ecc33606f786c8cef433e0dbe9188f3ede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Sun, 26 Mar 2017 11:29:21 +0200 Subject: clang-format: limit diff to 50 files to prevent exceding the maximum travis output (4MB) (#5455) --- util/travis/script.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'util') diff --git a/util/travis/script.sh b/util/travis/script.sh index 557822e1f..ab524b4b4 100755 --- a/util/travis/script.sh +++ b/util/travis/script.sh @@ -13,11 +13,18 @@ function perform_lint() { files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h' | egrep -v '^src/(gmp|lua|jsoncpp)/')" fi + local errorcount=0 local fail=0 for f in ${files_to_lint}; do d=$(diff -u "$f" <(${CLANG_FORMAT} "$f") || true) if ! [ -z "$d" ]; then + ((errorcount++)) printf "The file %s is not compliant with the coding style:\n%s\n" "$f" "$d" + if [ ${errorcount} -gt 50 ]; then + printf "Too many errors encountered previously, this diff is hidden.\n" + else + printf "%s\n" "$d" + fi # Disable build failure at this moment as we need to have a complete MT source whitelist to check fail=0 fi -- cgit v1.2.3 From 72ce9d7a5d51f6308390748693e518632c1795e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Sun, 26 Mar 2017 14:07:07 +0200 Subject: clang-format: fix counter increment & output (#5456) clang-format: fix bash syntax on increment --- util/travis/script.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'util') diff --git a/util/travis/script.sh b/util/travis/script.sh index ab524b4b4..0e4f92eef 100755 --- a/util/travis/script.sh +++ b/util/travis/script.sh @@ -4,6 +4,7 @@ needs_compile || exit 0 function perform_lint() { + echo "Performing LINT..." CLANG_FORMAT=clang-format-3.9 if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then # Get list of every file modified in this pull request @@ -17,13 +18,15 @@ function perform_lint() { local fail=0 for f in ${files_to_lint}; do d=$(diff -u "$f" <(${CLANG_FORMAT} "$f") || true) + if ! [ -z "$d" ]; then - ((errorcount++)) - printf "The file %s is not compliant with the coding style:\n%s\n" "$f" "$d" + errorcount=$((errorcount+1)) + + printf "The file %s is not compliant with the coding style" "$f" if [ ${errorcount} -gt 50 ]; then - printf "Too many errors encountered previously, this diff is hidden.\n" + printf "\nToo many errors encountered previously, this diff is hidden.\n" else - printf "%s\n" "$d" + printf ":\n%s\n" "$d" fi # Disable build failure at this moment as we need to have a complete MT source whitelist to check fail=0 @@ -31,15 +34,15 @@ function perform_lint() { done if [ "$fail" = 1 ]; then + echo "LINT reports failure." exit 1 fi - - exit 0 } if [[ "$LINT" == "1" ]]; then # Lint with exit CI perform_lint + exit 0 fi if [[ $PLATFORM == "Unix" ]]; then -- cgit v1.2.3 From 4b05feaceb38a2ab2063b8ff6e92d96393ad384e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Mon, 27 Mar 2017 15:33:15 +0200 Subject: clang-format: add a whitelist (#5459) If file is in the whitelist, softfail, else hard failure Some files are not in whitelist and marked as normal: * src/content_mapnode.h * src/cguittfont/xCGUITTFont.cpp * src/gameparams.h * src/profiler.cpp --- util/travis/clang-format-whitelist.txt | 455 +++++++++++++++++++++++++++++++++ util/travis/script.sh | 13 +- 2 files changed, 466 insertions(+), 2 deletions(-) create mode 100644 util/travis/clang-format-whitelist.txt (limited to 'util') diff --git a/util/travis/clang-format-whitelist.txt b/util/travis/clang-format-whitelist.txt new file mode 100644 index 000000000..519e594f9 --- /dev/null +++ b/util/travis/clang-format-whitelist.txt @@ -0,0 +1,455 @@ +src/activeobject.h +src/ban.cpp +src/ban.h +src/camera.cpp +src/camera.h +src/cavegen.cpp +src/cavegen.h +src/cguittfont/CGUITTFont.cpp +src/cguittfont/CGUITTFont.h +src/cguittfont/irrUString.h +src/cguittfont/xCGUITTFont.h +src/chat.cpp +src/chat.h +src/chat_interface.h +src/client/clientlauncher.cpp +src/client/clientlauncher.h +src/client.cpp +src/clientenvironment.cpp +src/clientenvironment.h +src/client.h +src/clientiface.cpp +src/clientiface.h +src/client/inputhandler.h +src/client/joystick_controller.cpp +src/client/joystick_controller.h +src/client/keys.h +src/clientmap.cpp +src/clientmap.h +src/clientmedia.cpp +src/clientmedia.h +src/clientobject.cpp +src/clientobject.h +src/clientsimpleobject.h +src/client/tile.cpp +src/client/tile.h +src/clouds.cpp +src/clouds.h +src/collision.cpp +src/collision.h +src/config.h +src/constants.h +src/content_abm.cpp +src/content_abm.h +src/content_cao.cpp +src/content_cao.h +src/content_cso.cpp +src/content_cso.h +src/content_mapblock.cpp +src/content_mapblock.h +src/content_mapnode.cpp +src/content_nodemeta.cpp +src/content_nodemeta.h +src/content_sao.cpp +src/content_sao.h +src/convert_json.cpp +src/convert_json.h +src/craftdef.cpp +src/craftdef.h +src/database.cpp +src/database-dummy.cpp +src/database-dummy.h +src/database.h +src/database-leveldb.cpp +src/database-leveldb.h +src/database-postgresql.cpp +src/database-postgresql.h +src/database-redis.cpp +src/database-redis.h +src/database-sqlite3.cpp +src/database-sqlite3.h +src/daynightratio.h +src/debug.cpp +src/debug.h +src/defaultsettings.cpp +src/defaultsettings.h +src/drawscene.cpp +src/drawscene.h +src/dungeongen.cpp +src/dungeongen.h +src/emerge.cpp +src/emerge.h +src/environment.cpp +src/environment.h +src/event.h +src/event_manager.h +src/exceptions.h +src/filecache.cpp +src/filecache.h +src/filesys.cpp +src/filesys.h +src/fontengine.cpp +src/fontengine.h +src/game.cpp +src/gamedef.h +src/game.h +src/genericobject.cpp +src/genericobject.h +src/gettext.cpp +src/gettext.h +src/gettime.h +src/guiChatConsole.cpp +src/guiChatConsole.h +src/guiEngine.cpp +src/guiEngine.h +src/guiFileSelectMenu.cpp +src/guiFileSelectMenu.h +src/guiFormSpecMenu.cpp +src/guiFormSpecMenu.h +src/guiKeyChangeMenu.cpp +src/guiKeyChangeMenu.h +src/guiMainMenu.h +src/guiPasswordChange.cpp +src/guiPasswordChange.h +src/guiscalingfilter.cpp +src/guiscalingfilter.h +src/guiTable.cpp +src/guiTable.h +src/guiVolumeChange.cpp +src/guiVolumeChange.h +src/httpfetch.cpp +src/httpfetch.h +src/hud.cpp +src/hud.h +src/imagefilters.cpp +src/imagefilters.h +src/intlGUIEditBox.cpp +src/intlGUIEditBox.h +src/inventory.cpp +src/inventory.h +src/inventorymanager.cpp +src/inventorymanager.h +src/irr_aabb3d.h +src/irrlicht_changes/static_text.cpp +src/irrlicht_changes/static_text.h +src/irrlichttypes_bloated.h +src/irrlichttypes_extrabloated.h +src/irrlichttypes.h +src/irr_v2d.h +src/irr_v3d.h +src/itemdef.cpp +src/itemdef.h +src/itemgroup.h +src/itemstackmetadata.cpp +src/keycode.cpp +src/keycode.h +src/light.cpp +src/light.h +src/localplayer.cpp +src/localplayer.h +src/log.cpp +src/log.h +src/main.cpp +src/mainmenumanager.h +src/mapblock.cpp +src/mapblock.h +src/mapblock_mesh.cpp +src/mapblock_mesh.h +src/map.cpp +src/mapgen.cpp +src/mapgen_flat.cpp +src/mapgen_flat.h +src/mapgen_fractal.cpp +src/mapgen_fractal.h +src/mapgen.h +src/mapgen_singlenode.cpp +src/mapgen_singlenode.h +src/mapgen_v5.cpp +src/mapgen_v5.h +src/mapgen_v6.cpp +src/mapgen_v6.h +src/mapgen_v7.cpp +src/mapgen_v7.h +src/mapgen_valleys.cpp +src/mapgen_valleys.h +src/map.h +src/mapnode.cpp +src/mapnode.h +src/mapsector.cpp +src/mapsector.h +src/map_settings_manager.cpp +src/map_settings_manager.h +src/mesh.cpp +src/mesh.h +src/metadata.cpp +src/metadata.h +src/mg_biome.cpp +src/mg_biome.h +src/mg_decoration.cpp +src/mg_decoration.h +src/mg_ore.cpp +src/mg_ore.h +src/mg_schematic.cpp +src/mg_schematic.h +src/minimap.cpp +src/minimap.h +src/modalMenu.h +src/modifiedstate.h +src/mods.cpp +src/mods.h +src/nameidmapping.cpp +src/nameidmapping.h +src/network/clientopcodes.cpp +src/network/clientopcodes.h +src/network/clientpackethandler.cpp +src/network/connection.cpp +src/network/connection.h +src/network/networkpacket.cpp +src/network/networkpacket.h +src/network/networkprotocol.h +src/network/serveropcodes.cpp +src/network/serveropcodes.h +src/network/serverpackethandler.cpp +src/nodedef.cpp +src/nodedef.h +src/nodemetadata.cpp +src/nodemetadata.h +src/nodetimer.cpp +src/nodetimer.h +src/noise.cpp +src/noise.h +src/objdef.cpp +src/objdef.h +src/object_properties.cpp +src/object_properties.h +src/particles.cpp +src/particles.h +src/pathfinder.cpp +src/pathfinder.h +src/player.cpp +src/player.h +src/porting_android.cpp +src/porting_android.h +src/porting.cpp +src/porting.h +src/profiler.h +src/quicktune.cpp +src/quicktune.h +src/quicktune_shortcutter.h +src/raycast.cpp +src/raycast.h +src/reflowscan.cpp +src/reflowscan.h +src/remoteplayer.cpp +src/remoteplayer.h +src/rollback.cpp +src/rollback.h +src/rollback_interface.cpp +src/rollback_interface.h +src/script/clientscripting.cpp +src/script/clientscripting.h +src/script/common/c_content.cpp +src/script/common/c_content.h +src/script/common/c_converter.cpp +src/script/common/c_converter.h +src/script/common/c_internal.cpp +src/script/common/c_internal.h +src/script/common/c_types.cpp +src/script/common/c_types.h +src/script/cpp_api/s_async.cpp +src/script/cpp_api/s_async.h +src/script/cpp_api/s_base.cpp +src/script/cpp_api/s_base.h +src/script/cpp_api/s_client.cpp +src/script/cpp_api/s_client.h +src/script/cpp_api/s_entity.cpp +src/script/cpp_api/s_entity.h +src/script/cpp_api/s_env.cpp +src/script/cpp_api/s_env.h +src/script/cpp_api/s_internal.h +src/script/cpp_api/s_inventory.cpp +src/script/cpp_api/s_inventory.h +src/script/cpp_api/s_item.cpp +src/script/cpp_api/s_item.h +src/script/cpp_api/s_mainmenu.cpp +src/script/cpp_api/s_mainmenu.h +src/script/cpp_api/s_node.cpp +src/script/cpp_api/s_node.h +src/script/cpp_api/s_nodemeta.cpp +src/script/cpp_api/s_nodemeta.h +src/script/cpp_api/s_player.cpp +src/script/cpp_api/s_player.h +src/script/cpp_api/s_security.cpp +src/script/cpp_api/s_security.h +src/script/cpp_api/s_server.cpp +src/script/cpp_api/s_server.h +src/script/lua_api/l_areastore.cpp +src/script/lua_api/l_areastore.h +src/script/lua_api/l_base.cpp +src/script/lua_api/l_base.h +src/script/lua_api/l_client.cpp +src/script/lua_api/l_client.h +src/script/lua_api/l_craft.cpp +src/script/lua_api/l_craft.h +src/script/lua_api/l_env.cpp +src/script/lua_api/l_env.h +src/script/lua_api/l_http.cpp +src/script/lua_api/l_http.h +src/script/lua_api/l_internal.h +src/script/lua_api/l_inventory.cpp +src/script/lua_api/l_inventory.h +src/script/lua_api/l_item.cpp +src/script/lua_api/l_item.h +src/script/lua_api/l_itemstackmeta.cpp +src/script/lua_api/l_itemstackmeta.h +src/script/lua_api/l_mainmenu.cpp +src/script/lua_api/l_mainmenu.h +src/script/lua_api/l_mapgen.cpp +src/script/lua_api/l_mapgen.h +src/script/lua_api/l_metadata.cpp +src/script/lua_api/l_metadata.h +src/script/lua_api/l_minimap.cpp +src/script/lua_api/l_minimap.h +src/script/lua_api/l_nodemeta.cpp +src/script/lua_api/l_nodemeta.h +src/script/lua_api/l_nodetimer.cpp +src/script/lua_api/l_nodetimer.h +src/script/lua_api/l_noise.cpp +src/script/lua_api/l_noise.h +src/script/lua_api/l_object.cpp +src/script/lua_api/l_object.h +src/script/lua_api/l_particles.cpp +src/script/lua_api/l_particles.h +src/script/lua_api/l_rollback.cpp +src/script/lua_api/l_rollback.h +src/script/lua_api/l_server.cpp +src/script/lua_api/l_server.h +src/script/lua_api/l_settings.cpp +src/script/lua_api/l_settings.h +src/script/lua_api/l_sound.cpp +src/script/lua_api/l_sound.h +src/script/lua_api/l_storage.cpp +src/script/lua_api/l_storage.h +src/script/lua_api/l_util.cpp +src/script/lua_api/l_util.h +src/script/lua_api/l_vmanip.cpp +src/script/lua_api/l_vmanip.h +src/script/scripting_mainmenu.cpp +src/script/scripting_mainmenu.h +src/script/serverscripting.cpp +src/script/serverscripting.h +src/serialization.cpp +src/serialization.h +src/server.cpp +src/serverenvironment.cpp +src/serverenvironment.h +src/server.h +src/serverlist.cpp +src/serverlist.h +src/serverobject.cpp +src/serverobject.h +src/settings.cpp +src/settings.h +src/settings_translation_file.cpp +src/shader.cpp +src/shader.h +src/sky.cpp +src/sky.h +src/socket.cpp +src/socket.h +src/sound.cpp +src/sound.h +src/sound_openal.cpp +src/sound_openal.h +src/staticobject.cpp +src/staticobject.h +src/subgame.cpp +src/subgame.h +src/terminal_chat_console.cpp +src/terminal_chat_console.h +src/threading/atomic.h +src/threading/event.cpp +src/threading/event.h +src/threading/mutex_auto_lock.h +src/threading/mutex.cpp +src/threading/mutex.h +src/threading/semaphore.cpp +src/threading/semaphore.h +src/threading/thread.cpp +src/threading/thread.h +src/threads.h +src/tileanimation.cpp +src/tileanimation.h +src/tool.cpp +src/tool.h +src/touchscreengui.cpp +src/touchscreengui.h +src/treegen.cpp +src/treegen.h +src/unittest/test_areastore.cpp +src/unittest/test_collision.cpp +src/unittest/test_compression.cpp +src/unittest/test_connection.cpp +src/unittest/test.cpp +src/unittest/test_filepath.cpp +src/unittest/test.h +src/unittest/test_inventory.cpp +src/unittest/test_keycode.cpp +src/unittest/test_mapnode.cpp +src/unittest/test_map_settings_manager.cpp +src/unittest/test_nodedef.cpp +src/unittest/test_noderesolver.cpp +src/unittest/test_noise.cpp +src/unittest/test_objdef.cpp +src/unittest/test_player.cpp +src/unittest/test_profiler.cpp +src/unittest/test_random.cpp +src/unittest/test_schematic.cpp +src/unittest/test_serialization.cpp +src/unittest/test_settings.cpp +src/unittest/test_socket.cpp +src/unittest/test_threading.cpp +src/unittest/test_utilities.cpp +src/unittest/test_voxelalgorithms.cpp +src/unittest/test_voxelmanipulator.cpp +src/util/areastore.cpp +src/util/areastore.h +src/util/auth.cpp +src/util/auth.h +src/util/base64.cpp +src/util/base64.h +src/util/basic_macros.h +src/util/container.h +src/util/cpp11_container.h +src/util/directiontables.cpp +src/util/directiontables.h +src/util/enriched_string.cpp +src/util/enriched_string.h +src/util/hex.h +src/util/md32_common.h +src/util/numeric.cpp +src/util/numeric.h +src/util/pointedthing.cpp +src/util/pointedthing.h +src/util/pointer.h +src/util/serialize.cpp +src/util/serialize.h +src/util/sha1.cpp +src/util/sha1.h +src/util/sha2.h +src/util/srp.cpp +src/util/srp.h +src/util/strfnd.h +src/util/string.cpp +src/util/string.h +src/util/thread.h +src/util/timetaker.cpp +src/util/timetaker.h +src/version.cpp +src/version.h +src/voxelalgorithms.cpp +src/voxelalgorithms.h +src/voxel.cpp +src/voxel.h +src/wieldmesh.cpp +src/wieldmesh.h diff --git a/util/travis/script.sh b/util/travis/script.sh index 0e4f92eef..ef42916b0 100755 --- a/util/travis/script.sh +++ b/util/travis/script.sh @@ -6,6 +6,8 @@ needs_compile || exit 0 function perform_lint() { echo "Performing LINT..." CLANG_FORMAT=clang-format-3.9 + CLANG_FORMAT_WHITELIST="util/travis/clang-format-whitelist.txt" + if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then # Get list of every file modified in this pull request files_to_lint="$(git diff --name-only --diff-filter=ACMRTUXB $TRAVIS_COMMIT_RANGE | grep '^src/[^.]*[.]\(cpp\|h\)$' | egrep -v '^src/(gmp|lua|jsoncpp)/' || true)" @@ -28,8 +30,13 @@ function perform_lint() { else printf ":\n%s\n" "$d" fi - # Disable build failure at this moment as we need to have a complete MT source whitelist to check - fail=0 + + whitelisted=$(egrep -c "^${f}" "${CLANG_FORMAT_WHITELIST}") + + # If file is not whitelisted, mark a failure + if [ ${whitelisted} -eq 0 ]; then + fail=1 + fi fi done @@ -37,6 +44,8 @@ function perform_lint() { echo "LINT reports failure." exit 1 fi + + echo "LINT OK" } if [[ "$LINT" == "1" ]]; then -- cgit v1.2.3 From a4874270f791fae8745cac23e153c59bef81bd1e Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Fri, 31 Mar 2017 22:29:34 +0200 Subject: Fix clang-format Columns Width Also fix l_client.cpp/h and remove them from whitelist --- util/travis/clang-format-whitelist.txt | 2 -- 1 file changed, 2 deletions(-) (limited to 'util') diff --git a/util/travis/clang-format-whitelist.txt b/util/travis/clang-format-whitelist.txt index 519e594f9..0d99793b4 100644 --- a/util/travis/clang-format-whitelist.txt +++ b/util/travis/clang-format-whitelist.txt @@ -287,8 +287,6 @@ src/script/lua_api/l_areastore.cpp src/script/lua_api/l_areastore.h src/script/lua_api/l_base.cpp src/script/lua_api/l_base.h -src/script/lua_api/l_client.cpp -src/script/lua_api/l_client.h src/script/lua_api/l_craft.cpp src/script/lua_api/l_craft.h src/script/lua_api/l_env.cpp -- cgit v1.2.3 From 987eb2b7615104f3f70e56e51f1dd3df5b2a41eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Sat, 1 Apr 2017 14:48:16 +0200 Subject: Clang-format: trivial fix on some headers (#5495) Fix some headers style and remove them from whitelist --- util/travis/clang-format-whitelist.txt | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'util') diff --git a/util/travis/clang-format-whitelist.txt b/util/travis/clang-format-whitelist.txt index 0d99793b4..352fe2973 100644 --- a/util/travis/clang-format-whitelist.txt +++ b/util/travis/clang-format-whitelist.txt @@ -23,14 +23,12 @@ src/clientiface.h src/client/inputhandler.h src/client/joystick_controller.cpp src/client/joystick_controller.h -src/client/keys.h src/clientmap.cpp src/clientmap.h src/clientmedia.cpp src/clientmedia.h src/clientobject.cpp src/clientobject.h -src/clientsimpleobject.h src/client/tile.cpp src/client/tile.h src/clouds.cpp @@ -40,7 +38,6 @@ src/collision.h src/config.h src/constants.h src/content_abm.cpp -src/content_abm.h src/content_cao.cpp src/content_cao.h src/content_cso.cpp @@ -59,15 +56,11 @@ src/craftdef.h src/database.cpp src/database-dummy.cpp src/database-dummy.h -src/database.h src/database-leveldb.cpp -src/database-leveldb.h src/database-postgresql.cpp src/database-postgresql.h src/database-redis.cpp -src/database-redis.h src/database-sqlite3.cpp -src/database-sqlite3.h src/daynightratio.h src/debug.cpp src/debug.h @@ -85,7 +78,6 @@ src/event.h src/event_manager.h src/exceptions.h src/filecache.cpp -src/filecache.h src/filesys.cpp src/filesys.h src/fontengine.cpp @@ -97,7 +89,6 @@ src/genericobject.cpp src/genericobject.h src/gettext.cpp src/gettext.h -src/gettime.h src/guiChatConsole.cpp src/guiChatConsole.h src/guiEngine.cpp @@ -129,14 +120,11 @@ src/inventory.cpp src/inventory.h src/inventorymanager.cpp src/inventorymanager.h -src/irr_aabb3d.h src/irrlicht_changes/static_text.cpp src/irrlicht_changes/static_text.h src/irrlichttypes_bloated.h src/irrlichttypes_extrabloated.h src/irrlichttypes.h -src/irr_v2d.h -src/irr_v3d.h src/itemdef.cpp src/itemdef.h src/itemgroup.h -- cgit v1.2.3 From 86b1542181a92841d174e1caec94d084a34e5158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Sun, 2 Apr 2017 10:51:50 +0200 Subject: Update embedded jsoncpp from unk version to 0.10.6 + move libs to lib/ instead of src/ (#5473) * Update embedded jsoncpp from unk version to 0.10.6 0.10.6 is last release without c++11 * Make jsoncpp more compliant with its amalgamate Jsoncpp cpp file should be upper, make the library like it does in amalgamate * Reorganization: move minetest embedded libs outside of source tree to /lib * Fix a dead grep in LINT --- util/travis/script.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util') diff --git a/util/travis/script.sh b/util/travis/script.sh index ef42916b0..4a12df5f6 100755 --- a/util/travis/script.sh +++ b/util/travis/script.sh @@ -10,10 +10,10 @@ function perform_lint() { if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then # Get list of every file modified in this pull request - files_to_lint="$(git diff --name-only --diff-filter=ACMRTUXB $TRAVIS_COMMIT_RANGE | grep '^src/[^.]*[.]\(cpp\|h\)$' | egrep -v '^src/(gmp|lua|jsoncpp)/' || true)" + files_to_lint="$(git diff --name-only --diff-filter=ACMRTUXB $TRAVIS_COMMIT_RANGE | grep '^src/[^.]*[.]\(cpp\|h\)$' | true)" else # Check everything for branch pushes - files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h' | egrep -v '^src/(gmp|lua|jsoncpp)/')" + files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')" fi local errorcount=0 -- cgit v1.2.3 From 503e1d2b7c800a76a161541d90b799e9786adbd9 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Thu, 6 Apr 2017 08:42:52 +0200 Subject: Clang format: only show errors on non whitelisted files --- util/travis/script.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'util') diff --git a/util/travis/script.sh b/util/travis/script.sh index 4a12df5f6..44057352d 100755 --- a/util/travis/script.sh +++ b/util/travis/script.sh @@ -22,19 +22,19 @@ function perform_lint() { d=$(diff -u "$f" <(${CLANG_FORMAT} "$f") || true) if ! [ -z "$d" ]; then - errorcount=$((errorcount+1)) - - printf "The file %s is not compliant with the coding style" "$f" - if [ ${errorcount} -gt 50 ]; then - printf "\nToo many errors encountered previously, this diff is hidden.\n" - else - printf ":\n%s\n" "$d" - fi - whitelisted=$(egrep -c "^${f}" "${CLANG_FORMAT_WHITELIST}") # If file is not whitelisted, mark a failure if [ ${whitelisted} -eq 0 ]; then + errorcount=$((errorcount+1)) + + printf "The file %s is not compliant with the coding style" "$f" + if [ ${errorcount} -gt 50 ]; then + printf "\nToo many errors encountered previously, this diff is hidden.\n" + else + printf ":\n%s\n" "$d" + fi + fail=1 fi fi -- cgit v1.2.3 From 4b15f76ed163b1e0b95b50017bd39e73400601b4 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Thu, 6 Apr 2017 09:10:59 +0200 Subject: Move LINT process in dedicated shell & fix Move lint to dedicated shell permit to use it from your shell easily to check what is wrong Also fix recent regressions in code style --- util/travis/lint.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++ util/travis/script.sh | 46 +--------------------------------------------- 2 files changed, 47 insertions(+), 45 deletions(-) create mode 100644 util/travis/lint.sh (limited to 'util') diff --git a/util/travis/lint.sh b/util/travis/lint.sh new file mode 100644 index 000000000..96026b247 --- /dev/null +++ b/util/travis/lint.sh @@ -0,0 +1,46 @@ +#! /bin/bash +function perform_lint() { + echo "Performing LINT..." + CLANG_FORMAT=clang-format + CLANG_FORMAT_WHITELIST="util/travis/clang-format-whitelist.txt" + + if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then + # Get list of every file modified in this pull request + files_to_lint="$(git diff --name-only --diff-filter=ACMRTUXB $TRAVIS_COMMIT_RANGE | grep '^src/[^.]*[.]\(cpp\|h\)$' | true)" + else + # Check everything for branch pushes + files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')" + fi + + local errorcount=0 + local fail=0 + for f in ${files_to_lint}; do + d=$(diff -u "$f" <(${CLANG_FORMAT} "$f") || true) + + if ! [ -z "$d" ]; then + whitelisted=$(egrep -c "^${f}" "${CLANG_FORMAT_WHITELIST}") + + # If file is not whitelisted, mark a failure + if [ ${whitelisted} -eq 0 ]; then + errorcount=$((errorcount+1)) + + printf "The file %s is not compliant with the coding style" "$f" + if [ ${errorcount} -gt 50 ]; then + printf "\nToo many errors encountered previously, this diff is hidden.\n" + else + printf ":\n%s\n" "$d" + fi + + fail=1 + fi + fi + done + + if [ "$fail" = 1 ]; then + echo "LINT reports failure." + exit 1 + fi + + echo "LINT OK" +} + diff --git a/util/travis/script.sh b/util/travis/script.sh index 44057352d..14b8dfb73 100755 --- a/util/travis/script.sh +++ b/util/travis/script.sh @@ -1,53 +1,9 @@ #!/bin/bash -e . util/travis/common.sh +. util/travis/lint.sh needs_compile || exit 0 -function perform_lint() { - echo "Performing LINT..." - CLANG_FORMAT=clang-format-3.9 - CLANG_FORMAT_WHITELIST="util/travis/clang-format-whitelist.txt" - - if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then - # Get list of every file modified in this pull request - files_to_lint="$(git diff --name-only --diff-filter=ACMRTUXB $TRAVIS_COMMIT_RANGE | grep '^src/[^.]*[.]\(cpp\|h\)$' | true)" - else - # Check everything for branch pushes - files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')" - fi - - local errorcount=0 - local fail=0 - for f in ${files_to_lint}; do - d=$(diff -u "$f" <(${CLANG_FORMAT} "$f") || true) - - if ! [ -z "$d" ]; then - whitelisted=$(egrep -c "^${f}" "${CLANG_FORMAT_WHITELIST}") - - # If file is not whitelisted, mark a failure - if [ ${whitelisted} -eq 0 ]; then - errorcount=$((errorcount+1)) - - printf "The file %s is not compliant with the coding style" "$f" - if [ ${errorcount} -gt 50 ]; then - printf "\nToo many errors encountered previously, this diff is hidden.\n" - else - printf ":\n%s\n" "$d" - fi - - fail=1 - fi - fi - done - - if [ "$fail" = 1 ]; then - echo "LINT reports failure." - exit 1 - fi - - echo "LINT OK" -} - if [[ "$LINT" == "1" ]]; then # Lint with exit CI perform_lint -- cgit v1.2.3 From 48ce9c9b307ef340d21ecf00d623ac69cb841e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Thu, 6 Apr 2017 10:01:09 +0200 Subject: Fix clang-format binary selection Also fix spaces to tabs --- util/travis/lint.sh | 88 ++++++++++++++++++++++++++++------------------------- 1 file changed, 46 insertions(+), 42 deletions(-) (limited to 'util') diff --git a/util/travis/lint.sh b/util/travis/lint.sh index 96026b247..c1df2d5fa 100644 --- a/util/travis/lint.sh +++ b/util/travis/lint.sh @@ -1,46 +1,50 @@ #! /bin/bash function perform_lint() { - echo "Performing LINT..." - CLANG_FORMAT=clang-format - CLANG_FORMAT_WHITELIST="util/travis/clang-format-whitelist.txt" - - if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then - # Get list of every file modified in this pull request - files_to_lint="$(git diff --name-only --diff-filter=ACMRTUXB $TRAVIS_COMMIT_RANGE | grep '^src/[^.]*[.]\(cpp\|h\)$' | true)" - else - # Check everything for branch pushes - files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')" - fi - - local errorcount=0 - local fail=0 - for f in ${files_to_lint}; do - d=$(diff -u "$f" <(${CLANG_FORMAT} "$f") || true) - - if ! [ -z "$d" ]; then - whitelisted=$(egrep -c "^${f}" "${CLANG_FORMAT_WHITELIST}") - - # If file is not whitelisted, mark a failure - if [ ${whitelisted} -eq 0 ]; then - errorcount=$((errorcount+1)) - - printf "The file %s is not compliant with the coding style" "$f" - if [ ${errorcount} -gt 50 ]; then - printf "\nToo many errors encountered previously, this diff is hidden.\n" - else - printf ":\n%s\n" "$d" - fi - - fail=1 - fi - fi - done - - if [ "$fail" = 1 ]; then - echo "LINT reports failure." - exit 1 - fi - - echo "LINT OK" + echo "Performing LINT..." + if hash clang-format-3.9 2>/dev/null; then + CLANG_FORMAT=clang-format-3.9 + else + CLANG_FORMAT=clang-format + fi + CLANG_FORMAT_WHITELIST="util/travis/clang-format-whitelist.txt" + + if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then + # Get list of every file modified in this pull request + files_to_lint="$(git diff --name-only --diff-filter=ACMRTUXB $TRAVIS_COMMIT_RANGE | grep '^src/[^.]*[.]\(cpp\|h\)$' | true)" + else + # Check everything for branch pushes + files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')" + fi + + local errorcount=0 + local fail=0 + for f in ${files_to_lint}; do + d=$(diff -u "$f" <(${CLANG_FORMAT} "$f") || true) + + if ! [ -z "$d" ]; then + whitelisted=$(egrep -c "^${f}" "${CLANG_FORMAT_WHITELIST}") + + # If file is not whitelisted, mark a failure + if [ ${whitelisted} -eq 0 ]; then + errorcount=$((errorcount+1)) + + printf "The file %s is not compliant with the coding style" "$f" + if [ ${errorcount} -gt 50 ]; then + printf "\nToo many errors encountered previously, this diff is hidden.\n" + else + printf ":\n%s\n" "$d" + fi + + fail=1 + fi + fi + done + + if [ "$fail" = 1 ]; then + echo "LINT reports failure." + exit 1 + fi + + echo "LINT OK" } -- cgit v1.2.3 From be0663696514dd3d3525949be7c317c9eae9dbb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Thu, 6 Apr 2017 15:37:02 +0200 Subject: Clang-format continuation indent fixes + .gitignore additions * Proper support for continuation indents in clang format * make src/wieldmesh.h proper and remove it from whitelist * Add CLion default build directories in .gitignore --- util/travis/clang-format-whitelist.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'util') diff --git a/util/travis/clang-format-whitelist.txt b/util/travis/clang-format-whitelist.txt index 352fe2973..0dcc7713d 100644 --- a/util/travis/clang-format-whitelist.txt +++ b/util/travis/clang-format-whitelist.txt @@ -438,4 +438,3 @@ src/voxelalgorithms.h src/voxel.cpp src/voxel.h src/wieldmesh.cpp -src/wieldmesh.h -- cgit v1.2.3 From 3a90b78a037df3eb9098d4fddb1289ed8ee21329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Thu, 6 Apr 2017 16:03:29 +0200 Subject: LINT: Switch whitelist check from egrep to awk Bonus: make CI happy with the last rules fix --- util/travis/lint.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'util') diff --git a/util/travis/lint.sh b/util/travis/lint.sh index c1df2d5fa..4e816bd94 100644 --- a/util/travis/lint.sh +++ b/util/travis/lint.sh @@ -6,6 +6,7 @@ function perform_lint() { else CLANG_FORMAT=clang-format fi + echo "LINT: Using binary $CLANG_FORMAT" CLANG_FORMAT_WHITELIST="util/travis/clang-format-whitelist.txt" if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then @@ -22,10 +23,10 @@ function perform_lint() { d=$(diff -u "$f" <(${CLANG_FORMAT} "$f") || true) if ! [ -z "$d" ]; then - whitelisted=$(egrep -c "^${f}" "${CLANG_FORMAT_WHITELIST}") + whitelisted=$(awk '$1 == "'$f'" { print 1 }' "$CLANG_FORMAT_WHITELIST") # If file is not whitelisted, mark a failure - if [ ${whitelisted} -eq 0 ]; then + if [ -z ${whitelisted} ]; then errorcount=$((errorcount+1)) printf "The file %s is not compliant with the coding style" "$f" -- cgit v1.2.3 From f7088f69ab7406ea9fefa853fa7ce11f914e88cf Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Fri, 7 Apr 2017 08:50:17 +0200 Subject: Clang-format: fix some header files and remove them from whitelist --- util/travis/clang-format-whitelist.txt | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'util') diff --git a/util/travis/clang-format-whitelist.txt b/util/travis/clang-format-whitelist.txt index 0dcc7713d..fb3b21271 100644 --- a/util/travis/clang-format-whitelist.txt +++ b/util/travis/clang-format-whitelist.txt @@ -229,7 +229,6 @@ src/raycast.h src/reflowscan.cpp src/reflowscan.h src/remoteplayer.cpp -src/remoteplayer.h src/rollback.cpp src/rollback.h src/rollback_interface.cpp @@ -291,7 +290,6 @@ src/script/lua_api/l_itemstackmeta.h src/script/lua_api/l_mainmenu.cpp src/script/lua_api/l_mainmenu.h src/script/lua_api/l_mapgen.cpp -src/script/lua_api/l_mapgen.h src/script/lua_api/l_metadata.cpp src/script/lua_api/l_metadata.h src/script/lua_api/l_minimap.cpp @@ -313,13 +311,9 @@ src/script/lua_api/l_server.h src/script/lua_api/l_settings.cpp src/script/lua_api/l_settings.h src/script/lua_api/l_sound.cpp -src/script/lua_api/l_sound.h src/script/lua_api/l_storage.cpp -src/script/lua_api/l_storage.h src/script/lua_api/l_util.cpp -src/script/lua_api/l_util.h src/script/lua_api/l_vmanip.cpp -src/script/lua_api/l_vmanip.h src/script/scripting_mainmenu.cpp src/script/scripting_mainmenu.h src/script/serverscripting.cpp @@ -340,11 +334,9 @@ src/settings_translation_file.cpp src/shader.cpp src/shader.h src/sky.cpp -src/sky.h src/socket.cpp src/socket.h src/sound.cpp -src/sound.h src/sound_openal.cpp src/sound_openal.h src/staticobject.cpp @@ -411,7 +403,6 @@ src/util/directiontables.cpp src/util/directiontables.h src/util/enriched_string.cpp src/util/enriched_string.h -src/util/hex.h src/util/md32_common.h src/util/numeric.cpp src/util/numeric.h @@ -421,8 +412,6 @@ src/util/pointer.h src/util/serialize.cpp src/util/serialize.h src/util/sha1.cpp -src/util/sha1.h -src/util/sha2.h src/util/srp.cpp src/util/srp.h src/util/strfnd.h -- cgit v1.2.3 From 4af99b75cf3ae43c365a4c1e90e85f8ec764cf62 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Fri, 7 Apr 2017 23:22:00 +0200 Subject: Pass clang-format on 14 trivial header files fixes Also remove them from whitelist --- util/travis/clang-format-whitelist.txt | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'util') diff --git a/util/travis/clang-format-whitelist.txt b/util/travis/clang-format-whitelist.txt index fb3b21271..1f8c10ebb 100644 --- a/util/travis/clang-format-whitelist.txt +++ b/util/travis/clang-format-whitelist.txt @@ -248,7 +248,6 @@ src/script/cpp_api/s_async.h src/script/cpp_api/s_base.cpp src/script/cpp_api/s_base.h src/script/cpp_api/s_client.cpp -src/script/cpp_api/s_client.h src/script/cpp_api/s_entity.cpp src/script/cpp_api/s_entity.h src/script/cpp_api/s_env.cpp @@ -265,13 +264,11 @@ src/script/cpp_api/s_node.h src/script/cpp_api/s_nodemeta.cpp src/script/cpp_api/s_nodemeta.h src/script/cpp_api/s_player.cpp -src/script/cpp_api/s_player.h src/script/cpp_api/s_security.cpp src/script/cpp_api/s_security.h src/script/cpp_api/s_server.cpp src/script/cpp_api/s_server.h src/script/lua_api/l_areastore.cpp -src/script/lua_api/l_areastore.h src/script/lua_api/l_base.cpp src/script/lua_api/l_base.h src/script/lua_api/l_craft.cpp @@ -291,15 +288,11 @@ src/script/lua_api/l_mainmenu.cpp src/script/lua_api/l_mainmenu.h src/script/lua_api/l_mapgen.cpp src/script/lua_api/l_metadata.cpp -src/script/lua_api/l_metadata.h src/script/lua_api/l_minimap.cpp -src/script/lua_api/l_minimap.h src/script/lua_api/l_nodemeta.cpp src/script/lua_api/l_nodemeta.h src/script/lua_api/l_nodetimer.cpp -src/script/lua_api/l_nodetimer.h src/script/lua_api/l_noise.cpp -src/script/lua_api/l_noise.h src/script/lua_api/l_object.cpp src/script/lua_api/l_object.h src/script/lua_api/l_particles.cpp @@ -307,9 +300,7 @@ src/script/lua_api/l_particles.h src/script/lua_api/l_rollback.cpp src/script/lua_api/l_rollback.h src/script/lua_api/l_server.cpp -src/script/lua_api/l_server.h src/script/lua_api/l_settings.cpp -src/script/lua_api/l_settings.h src/script/lua_api/l_sound.cpp src/script/lua_api/l_storage.cpp src/script/lua_api/l_util.cpp @@ -347,21 +338,17 @@ src/terminal_chat_console.cpp src/terminal_chat_console.h src/threading/atomic.h src/threading/event.cpp -src/threading/event.h src/threading/mutex_auto_lock.h src/threading/mutex.cpp src/threading/mutex.h src/threading/semaphore.cpp -src/threading/semaphore.h src/threading/thread.cpp src/threading/thread.h src/threads.h src/tileanimation.cpp -src/tileanimation.h src/tool.cpp src/tool.h src/touchscreengui.cpp -src/touchscreengui.h src/treegen.cpp src/treegen.h src/unittest/test_areastore.cpp @@ -398,7 +385,6 @@ src/util/base64.cpp src/util/base64.h src/util/basic_macros.h src/util/container.h -src/util/cpp11_container.h src/util/directiontables.cpp src/util/directiontables.h src/util/enriched_string.cpp -- cgit v1.2.3 From b4106ca58f723a64bcaec619b7f5c686f5e4abb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Mon, 10 Apr 2017 09:17:53 +0200 Subject: Clang-format styles fixes since previous commit --- util/travis/clang-format-whitelist.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'util') diff --git a/util/travis/clang-format-whitelist.txt b/util/travis/clang-format-whitelist.txt index 1f8c10ebb..acb6d51e4 100644 --- a/util/travis/clang-format-whitelist.txt +++ b/util/travis/clang-format-whitelist.txt @@ -284,6 +284,7 @@ src/script/lua_api/l_item.cpp src/script/lua_api/l_item.h src/script/lua_api/l_itemstackmeta.cpp src/script/lua_api/l_itemstackmeta.h +src/script/lua_api/l_localplayer.cpp src/script/lua_api/l_mainmenu.cpp src/script/lua_api/l_mainmenu.h src/script/lua_api/l_mapgen.cpp -- cgit v1.2.3 From 5f2af7c4e80da1c646e5a19ceed5bd0871b56e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Tue, 18 Apr 2017 17:13:50 +0200 Subject: Fix broken lint since 04cc9de8f2fbcb11f133c88f02fc11504b3ea6f3 --- util/travis/clang-format-whitelist.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'util') diff --git a/util/travis/clang-format-whitelist.txt b/util/travis/clang-format-whitelist.txt index acb6d51e4..42ce6d781 100644 --- a/util/travis/clang-format-whitelist.txt +++ b/util/travis/clang-format-whitelist.txt @@ -169,6 +169,7 @@ src/map_settings_manager.cpp src/map_settings_manager.h src/mesh.cpp src/mesh.h +src/mesh_generator_thread.cpp src/metadata.cpp src/metadata.h src/mg_biome.cpp -- cgit v1.2.3 From 3e71c8f482131da59642b0175160eb2bc714d439 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Sat, 22 Apr 2017 00:51:13 +0200 Subject: Fixing warning pointed by @sfan5 and clang and cleanup guiFileSelectMenu * Also pass clang-format on guiFileSelectMenu.h and remove it from whitelist --- util/travis/clang-format-whitelist.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'util') diff --git a/util/travis/clang-format-whitelist.txt b/util/travis/clang-format-whitelist.txt index 42ce6d781..3e746e289 100644 --- a/util/travis/clang-format-whitelist.txt +++ b/util/travis/clang-format-whitelist.txt @@ -94,7 +94,6 @@ src/guiChatConsole.h src/guiEngine.cpp src/guiEngine.h src/guiFileSelectMenu.cpp -src/guiFileSelectMenu.h src/guiFormSpecMenu.cpp src/guiFormSpecMenu.h src/guiKeyChangeMenu.cpp -- cgit v1.2.3 From 91a9382c25328075d1a27593b22b0a75863951e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Sun, 23 Apr 2017 09:52:40 +0200 Subject: Pass clang-format on various cpp/header files (#5559) --- util/travis/clang-format-whitelist.txt | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'util') diff --git a/util/travis/clang-format-whitelist.txt b/util/travis/clang-format-whitelist.txt index 3e746e289..b42291552 100644 --- a/util/travis/clang-format-whitelist.txt +++ b/util/travis/clang-format-whitelist.txt @@ -1,10 +1,8 @@ src/activeobject.h src/ban.cpp -src/ban.h src/camera.cpp src/camera.h src/cavegen.cpp -src/cavegen.h src/cguittfont/CGUITTFont.cpp src/cguittfont/CGUITTFont.h src/cguittfont/irrUString.h @@ -36,14 +34,11 @@ src/clouds.h src/collision.cpp src/collision.h src/config.h -src/constants.h -src/content_abm.cpp src/content_cao.cpp src/content_cao.h src/content_cso.cpp src/content_cso.h src/content_mapblock.cpp -src/content_mapblock.h src/content_mapnode.cpp src/content_nodemeta.cpp src/content_nodemeta.h @@ -55,7 +50,6 @@ src/craftdef.cpp src/craftdef.h src/database.cpp src/database-dummy.cpp -src/database-dummy.h src/database-leveldb.cpp src/database-postgresql.cpp src/database-postgresql.h @@ -65,7 +59,6 @@ src/daynightratio.h src/debug.cpp src/debug.h src/defaultsettings.cpp -src/defaultsettings.h src/drawscene.cpp src/drawscene.h src/dungeongen.cpp @@ -73,7 +66,6 @@ src/dungeongen.h src/emerge.cpp src/emerge.h src/environment.cpp -src/environment.h src/event.h src/event_manager.h src/exceptions.h @@ -97,10 +89,8 @@ src/guiFileSelectMenu.cpp src/guiFormSpecMenu.cpp src/guiFormSpecMenu.h src/guiKeyChangeMenu.cpp -src/guiKeyChangeMenu.h src/guiMainMenu.h src/guiPasswordChange.cpp -src/guiPasswordChange.h src/guiscalingfilter.cpp src/guiscalingfilter.h src/guiTable.cpp @@ -108,7 +98,6 @@ src/guiTable.h src/guiVolumeChange.cpp src/guiVolumeChange.h src/httpfetch.cpp -src/httpfetch.h src/hud.cpp src/hud.h src/imagefilters.cpp @@ -121,19 +110,13 @@ src/inventorymanager.cpp src/inventorymanager.h src/irrlicht_changes/static_text.cpp src/irrlicht_changes/static_text.h -src/irrlichttypes_bloated.h -src/irrlichttypes_extrabloated.h src/irrlichttypes.h src/itemdef.cpp src/itemdef.h -src/itemgroup.h src/itemstackmetadata.cpp src/keycode.cpp -src/keycode.h src/light.cpp -src/light.h src/localplayer.cpp -src/localplayer.h src/log.cpp src/log.h src/main.cpp @@ -145,14 +128,10 @@ src/mapblock_mesh.h src/map.cpp src/mapgen.cpp src/mapgen_flat.cpp -src/mapgen_flat.h src/mapgen_fractal.cpp -src/mapgen_fractal.h src/mapgen.h src/mapgen_singlenode.cpp -src/mapgen_singlenode.h src/mapgen_v5.cpp -src/mapgen_v5.h src/mapgen_v6.cpp src/mapgen_v6.h src/mapgen_v7.cpp @@ -168,8 +147,6 @@ src/map_settings_manager.cpp src/map_settings_manager.h src/mesh.cpp src/mesh.h -src/mesh_generator_thread.cpp -src/metadata.cpp src/metadata.h src/mg_biome.cpp src/mg_biome.h @@ -182,11 +159,8 @@ src/mg_schematic.h src/minimap.cpp src/minimap.h src/modalMenu.h -src/modifiedstate.h src/mods.cpp src/mods.h -src/nameidmapping.cpp -src/nameidmapping.h src/network/clientopcodes.cpp src/network/clientopcodes.h src/network/clientpackethandler.cpp @@ -257,7 +231,6 @@ src/script/cpp_api/s_inventory.cpp src/script/cpp_api/s_inventory.h src/script/cpp_api/s_item.cpp src/script/cpp_api/s_item.h -src/script/cpp_api/s_mainmenu.cpp src/script/cpp_api/s_mainmenu.h src/script/cpp_api/s_node.cpp src/script/cpp_api/s_node.h @@ -361,14 +334,9 @@ src/unittest/test_filepath.cpp src/unittest/test.h src/unittest/test_inventory.cpp src/unittest/test_keycode.cpp -src/unittest/test_mapnode.cpp src/unittest/test_map_settings_manager.cpp -src/unittest/test_nodedef.cpp src/unittest/test_noderesolver.cpp src/unittest/test_noise.cpp -src/unittest/test_objdef.cpp -src/unittest/test_player.cpp -src/unittest/test_profiler.cpp src/unittest/test_random.cpp src/unittest/test_schematic.cpp src/unittest/test_serialization.cpp -- cgit v1.2.3 From dda171d2925e20efc00c78bcb45cf595fd986da9 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Sun, 23 Apr 2017 10:24:00 +0200 Subject: LINT fix --- util/travis/clang-format-whitelist.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'util') diff --git a/util/travis/clang-format-whitelist.txt b/util/travis/clang-format-whitelist.txt index b42291552..e9ff56cf5 100644 --- a/util/travis/clang-format-whitelist.txt +++ b/util/travis/clang-format-whitelist.txt @@ -39,6 +39,7 @@ src/content_cao.h src/content_cso.cpp src/content_cso.h src/content_mapblock.cpp +src/content_mapblock.h src/content_mapnode.cpp src/content_nodemeta.cpp src/content_nodemeta.h @@ -147,6 +148,7 @@ src/map_settings_manager.cpp src/map_settings_manager.h src/mesh.cpp src/mesh.h +src/mesh_generator_thread.cpp src/metadata.h src/mg_biome.cpp src/mg_biome.h -- cgit v1.2.3 From d7ddceac730393e7a66980ad21630a05b7e291c4 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Sun, 23 Apr 2017 16:22:53 +0200 Subject: Fix lint since recent player to db merge --- util/travis/clang-format-whitelist.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'util') diff --git a/util/travis/clang-format-whitelist.txt b/util/travis/clang-format-whitelist.txt index e9ff56cf5..9f5612b78 100644 --- a/util/travis/clang-format-whitelist.txt +++ b/util/travis/clang-format-whitelist.txt @@ -51,11 +51,13 @@ src/craftdef.cpp src/craftdef.h src/database.cpp src/database-dummy.cpp +src/database-files.cpp src/database-leveldb.cpp src/database-postgresql.cpp src/database-postgresql.h src/database-redis.cpp src/database-sqlite3.cpp +src/database-sqlite3.h src/daynightratio.h src/debug.cpp src/debug.h -- cgit v1.2.3 From c761717f11837828bfb57998273695419a28e6eb Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Thu, 27 Apr 2017 10:57:46 -0400 Subject: Fix Travis builds --- util/travis/clang-format-whitelist.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'util') diff --git a/util/travis/clang-format-whitelist.txt b/util/travis/clang-format-whitelist.txt index 9f5612b78..cac2faf2d 100644 --- a/util/travis/clang-format-whitelist.txt +++ b/util/travis/clang-format-whitelist.txt @@ -211,8 +211,6 @@ src/rollback.cpp src/rollback.h src/rollback_interface.cpp src/rollback_interface.h -src/script/clientscripting.cpp -src/script/clientscripting.h src/script/common/c_content.cpp src/script/common/c_content.h src/script/common/c_converter.cpp @@ -283,10 +281,12 @@ src/script/lua_api/l_sound.cpp src/script/lua_api/l_storage.cpp src/script/lua_api/l_util.cpp src/script/lua_api/l_vmanip.cpp +src/script/scripting_client.cpp +src/script/scripting_client.h src/script/scripting_mainmenu.cpp src/script/scripting_mainmenu.h -src/script/serverscripting.cpp -src/script/serverscripting.h +src/script/scripting_server.cpp +src/script/scripting_server.h src/serialization.cpp src/serialization.h src/server.cpp -- cgit v1.2.3 From 77597c4ff3b666cc37dd257952938df48d7e6f09 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Mon, 6 Jul 2015 12:53:30 -0400 Subject: Clean up numeric.h and split FacePositionCache from it I also optiized FacePositionCache a bit: I removed a map lookup and vector copy from both branches of getFacePosition. --- util/travis/clang-format-whitelist.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'util') diff --git a/util/travis/clang-format-whitelist.txt b/util/travis/clang-format-whitelist.txt index cac2faf2d..0b290ae87 100644 --- a/util/travis/clang-format-whitelist.txt +++ b/util/travis/clang-format-whitelist.txt @@ -72,6 +72,8 @@ src/environment.cpp src/event.h src/event_manager.h src/exceptions.h +src/face_position_cache.cpp +src/face_position_cache.h src/filecache.cpp src/filesys.cpp src/filesys.h -- cgit v1.2.3 From 9b8ca3a746cdb9478a46939d36c30484a97255e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Sat, 13 May 2017 11:05:16 +0200 Subject: Move KeyList & InputHandler from game.h to client/inputhandler.h (#5752) * Move KeyList & InputHandler from game.h to client/inputhandler.h We have a header for inputs, move inputhandler class & related keylist object to it Also introduce a cpp file for MyEventReceiver::OnEvent function in inputhandler.h because a so huge function doesn't needs to be inlined * Pass clang-format on inputhandler.{cpp,h} (compatible) --- util/travis/clang-format-whitelist.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'util') diff --git a/util/travis/clang-format-whitelist.txt b/util/travis/clang-format-whitelist.txt index 0b290ae87..932f59978 100644 --- a/util/travis/clang-format-whitelist.txt +++ b/util/travis/clang-format-whitelist.txt @@ -18,7 +18,6 @@ src/clientenvironment.h src/client.h src/clientiface.cpp src/clientiface.h -src/client/inputhandler.h src/client/joystick_controller.cpp src/client/joystick_controller.h src/clientmap.cpp -- cgit v1.2.3 From 05309229b847ea4f289328890176d22c4655348b Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Mon, 22 May 2017 07:28:35 +0200 Subject: LINT fix & check all files with clang-format Seems the diff mode doesn't work well, PR are detected as working whereas in master it's shown it's problematic (and really problematic). Use same check everywhere --- util/travis/lint.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'util') diff --git a/util/travis/lint.sh b/util/travis/lint.sh index 4e816bd94..cd5f41779 100644 --- a/util/travis/lint.sh +++ b/util/travis/lint.sh @@ -9,13 +9,7 @@ function perform_lint() { echo "LINT: Using binary $CLANG_FORMAT" CLANG_FORMAT_WHITELIST="util/travis/clang-format-whitelist.txt" - if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then - # Get list of every file modified in this pull request - files_to_lint="$(git diff --name-only --diff-filter=ACMRTUXB $TRAVIS_COMMIT_RANGE | grep '^src/[^.]*[.]\(cpp\|h\)$' | true)" - else - # Check everything for branch pushes - files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')" - fi + files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')" local errorcount=0 local fail=0 -- cgit v1.2.3