From 85d543a73942492885470e5598f30c7770e7694c Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Tue, 14 Apr 2020 09:39:56 +1000 Subject: [PATCH] Rename scripts to swap "-" for "_" for consistency We had a confusing and unpredictable mix of script names with - vs _, e.g. scripts/prepare-commit.sh vs scripts/sipify_all.sh This unifies with the preferred _ convention for script file names --- .github/CONTRIBUTING.md | 4 ++-- .github/PULL_REQUEST_TEMPLATE.md | 4 ++-- CMakeLists.txt | 2 +- cmake/PyQtMacros.cmake | 6 +++--- editors/link_precommit.sh | 2 +- rpm/sources/qgis-lib64.patch | 2 +- scripts/{astyle-all.sh => astyle_all.sh} | 0 scripts/{astyle-rollback.sh => astyle_rollback.sh} | 0 ...transifex-resources.sh => create_transifex_resources.sh} | 2 +- scripts/{jenkins-run.sh => jenkins_run.sh} | 0 scripts/{prepare-commit.sh => prepare_commit.sh} | 2 +- scripts/{pyuic-wrapper.bat => pyuic_wrapper.bat} | 2 +- scripts/{pyuic-wrapper.py => pyuic_wrapper.py} | 2 +- scripts/{pyuic-wrapper.sh => pyuic_wrapper.sh} | 4 ++-- scripts/release.pl | 2 +- .../{replace-console-i18n.pl => replace_console_i18n.pl} | 0 ...cal-travis-config.sh => runtests_local_travis_config.sh} | 0 scripts/{ts-clear.pl => ts_clear.pl} | 2 +- scripts/{update-indent.sh => update_indent.sh} | 2 +- scripts/{update-news.pl => update_news.pl} | 4 ++-- scripts/update_ts.sh | 2 +- scripts/{verify-indentation.sh => verify_indentation.sh} | 4 ++-- tests/code_layout/CMakeLists.txt | 2 +- 23 files changed, 25 insertions(+), 25 deletions(-) rename scripts/{astyle-all.sh => astyle_all.sh} (100%) rename scripts/{astyle-rollback.sh => astyle_rollback.sh} (100%) rename scripts/{create-transifex-resources.sh => create_transifex_resources.sh} (98%) rename scripts/{jenkins-run.sh => jenkins_run.sh} (100%) rename scripts/{prepare-commit.sh => prepare_commit.sh} (99%) rename scripts/{pyuic-wrapper.bat => pyuic_wrapper.bat} (64%) rename scripts/{pyuic-wrapper.py => pyuic_wrapper.py} (97%) rename scripts/{pyuic-wrapper.sh => pyuic_wrapper.sh} (93%) rename scripts/{replace-console-i18n.pl => replace_console_i18n.pl} (100%) rename scripts/{runtests-local-travis-config.sh => runtests_local_travis_config.sh} (100%) rename scripts/{ts-clear.pl => ts_clear.pl} (99%) rename scripts/{update-indent.sh => update_indent.sh} (99%) rename scripts/{update-news.pl => update_news.pl} (93%) rename scripts/{verify-indentation.sh => verify_indentation.sh} (92%) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index e10531e5ad4..be19672e24b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -9,11 +9,11 @@ Proper formatting Before making a pull request, please make sure your code is properly formatted by running the prepare commit script **before** issuing `git commit`. - ./scripts/prepare-commit.sh + ./scripts/prepare_commit.sh This can be automated by setting up the pre-commit hook properly. - ln -s ../../scripts/prepare-commit.sh .git/hooks/pre-commit + ln -s ../../scripts/prepare_commit.sh .git/hooks/pre-commit Getting your pull request merged -------------------------------- diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 5026516db80..2869dac5637 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -27,8 +27,8 @@ - New unit tests have been added for relevant changes - - You have run the `scripts/prepare-commit.sh` script (https://github.com/qgis/QGIS/blob/master/.github/CONTRIBUTING.md#contributing-to-qgis) before each commit. - If you didn't do this, you can also run `./scripts/astyle-all.sh` from your source folder. + - You have run the `scripts/prepare_commit.sh` script (https://github.com/qgis/QGIS/blob/master/.github/CONTRIBUTING.md#contributing-to-qgis) before each commit. + If you didn't do this, you can also run `./scripts/astyle_all.sh` from your source folder. - You have read the QGIS Coding Standards (https://docs.qgis.org/testing/en/docs/developers_guide/codingstandards.html) and this PR complies with them --> diff --git a/CMakeLists.txt b/CMakeLists.txt index ddfb1e454c4..e0b1524ad7a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -489,7 +489,7 @@ ENDIF(WITH_CORE) SET(CMAKE_AUTOMOC ON) # build our version of astyle -SET (WITH_ASTYLE FALSE CACHE BOOL "If you plan to contribute you should reindent with scripts/prepare-commit.sh (using 'our' astyle)") +SET (WITH_ASTYLE FALSE CACHE BOOL "If you plan to contribute you should reindent with scripts/prepare_commit.sh (using 'our' astyle)") # QML SET(QML_IMPORT_PATH "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" CACHE PATH "QML directory for QML autocomplete") diff --git a/cmake/PyQtMacros.cmake b/cmake/PyQtMacros.cmake index 918d5c137a2..774d0427861 100644 --- a/cmake/PyQtMacros.cmake +++ b/cmake/PyQtMacros.cmake @@ -27,15 +27,15 @@ ENDIF(NOT PYUIC_PROGRAM) MACRO(PYQT_WRAP_UI outfiles ) IF(CMAKE_HOST_WIN32) IF(USING_NINJA OR USING_NMAKE) - SET(PYUIC_WRAPPER "${CMAKE_SOURCE_DIR}/scripts/pyuic-wrapper.bat") + SET(PYUIC_WRAPPER "${CMAKE_SOURCE_DIR}/scripts/pyuic_wrapper.bat") SET(PYUIC_WRAPPER_PATH "${QGIS_OUTPUT_DIRECTORY}/bin") ELSE(USING_NINJA OR USING_NMAKE) - SET(PYUIC_WRAPPER "${CMAKE_SOURCE_DIR}/scripts/pyuic-wrapper.bat") + SET(PYUIC_WRAPPER "${CMAKE_SOURCE_DIR}/scripts/pyuic_wrapper.bat") SET(PYUIC_WRAPPER_PATH "${QGIS_OUTPUT_DIRECTORY}/bin/${CMAKE_BUILD_TYPE}") ENDIF(USING_NINJA OR USING_NMAKE) ELSE(CMAKE_HOST_WIN32) # TODO osx - SET(PYUIC_WRAPPER "${CMAKE_SOURCE_DIR}/scripts/pyuic-wrapper.sh") + SET(PYUIC_WRAPPER "${CMAKE_SOURCE_DIR}/scripts/pyuic_wrapper.sh") SET(PYUIC_WRAPPER_PATH "${QGIS_OUTPUT_DIRECTORY}/lib") ENDIF(CMAKE_HOST_WIN32) diff --git a/editors/link_precommit.sh b/editors/link_precommit.sh index 06dcef0dbc4..ce4719114a3 100755 --- a/editors/link_precommit.sh +++ b/editors/link_precommit.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -ln -sf ../../scripts/prepare-commit.sh .git/hooks/pre-commit +ln -sf ../../scripts/prepare_commit.sh .git/hooks/pre-commit diff --git a/rpm/sources/qgis-lib64.patch b/rpm/sources/qgis-lib64.patch index 73a7dd3a2d6..4901387ff98 100644 --- a/rpm/sources/qgis-lib64.patch +++ b/rpm/sources/qgis-lib64.patch @@ -4,7 +4,7 @@ diff -up cmake/PyQtMacros.cmake cmake/PyQtMacros.cmake.lib64 @@ -36,7 +36,7 @@ MACRO(PYQT_WRAP_UI outfiles ) ELSE(CMAKE_HOST_WIN32) # TODO osx - SET(PYUIC_WRAPPER "${CMAKE_SOURCE_DIR}/scripts/pyuic-wrapper.sh") + SET(PYUIC_WRAPPER "${CMAKE_SOURCE_DIR}/scripts/pyuic_wrapper.sh") - SET(PYUIC_WRAPPER_PATH "${QGIS_OUTPUT_DIRECTORY}/lib") + SET(PYUIC_WRAPPER_PATH "${QGIS_OUTPUT_DIRECTORY}/lib${LIB_SUFFIX}") ENDIF(CMAKE_HOST_WIN32) diff --git a/scripts/astyle-all.sh b/scripts/astyle_all.sh similarity index 100% rename from scripts/astyle-all.sh rename to scripts/astyle_all.sh diff --git a/scripts/astyle-rollback.sh b/scripts/astyle_rollback.sh similarity index 100% rename from scripts/astyle-rollback.sh rename to scripts/astyle_rollback.sh diff --git a/scripts/create-transifex-resources.sh b/scripts/create_transifex_resources.sh similarity index 98% rename from scripts/create-transifex-resources.sh rename to scripts/create_transifex_resources.sh index 978ecd762d5..4f35adea348 100755 --- a/scripts/create-transifex-resources.sh +++ b/scripts/create_transifex_resources.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash ########################################################################### -# create-transifex-resources.sh +# create_transifex_resources.sh # --------------------- # Date : March 2013 # Copyright : (C) 2013 by Tim Sutton diff --git a/scripts/jenkins-run.sh b/scripts/jenkins_run.sh similarity index 100% rename from scripts/jenkins-run.sh rename to scripts/jenkins_run.sh diff --git a/scripts/prepare-commit.sh b/scripts/prepare_commit.sh similarity index 99% rename from scripts/prepare-commit.sh rename to scripts/prepare_commit.sh index 13bcefc99bb..b67d1c0945c 100755 --- a/scripts/prepare-commit.sh +++ b/scripts/prepare_commit.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash ########################################################################### -# prepare-commit.sh +# prepare_commit.sh # --------------------- # Date : August 2008 # Copyright : (C) 2008 by Juergen E. Fischer diff --git a/scripts/pyuic-wrapper.bat b/scripts/pyuic_wrapper.bat similarity index 64% rename from scripts/pyuic-wrapper.bat rename to scripts/pyuic_wrapper.bat index ed3998822ce..554d9c83dcf 100644 --- a/scripts/pyuic-wrapper.bat +++ b/scripts/pyuic_wrapper.bat @@ -3,4 +3,4 @@ set PYUIC=%1 set PATH=%2;%PATH% set PYTHONPATH=%3;%PYTHONPATH% set PYTHON=%4 -%PYTHON% %~dp0\pyuic-wrapper.py %5 %6 %7 %8 %9 +%PYTHON% %~dp0\pyuic_wrapper.py %5 %6 %7 %8 %9 diff --git a/scripts/pyuic-wrapper.py b/scripts/pyuic_wrapper.py similarity index 97% rename from scripts/pyuic-wrapper.py rename to scripts/pyuic_wrapper.py index c55c3a294c9..aebdc7f1a9f 100644 --- a/scripts/pyuic-wrapper.py +++ b/scripts/pyuic_wrapper.py @@ -2,7 +2,7 @@ """ *************************************************************************** - pyuic-wrapper.py + pyuic_wrapper.py --------------------- Date : March 2016 Copyright : (C) 2016 by Juergen E. Fischer diff --git a/scripts/pyuic-wrapper.sh b/scripts/pyuic_wrapper.sh similarity index 93% rename from scripts/pyuic-wrapper.sh rename to scripts/pyuic_wrapper.sh index 14b4e615ed5..05b0dc91700 100755 --- a/scripts/pyuic-wrapper.sh +++ b/scripts/pyuic_wrapper.sh @@ -1,6 +1,6 @@ #!/bin/sh ########################################################################### -# pyuic-wrapper.sh +# pyuic_wrapper.sh # --------------------- # Date : March 2016 # Copyright : (C) 2016 by Juergen E. Fischer @@ -22,4 +22,4 @@ shift 4 export LD_LIBRARY_PATH PYTHONPATH -exec $PYTHON $(dirname $0)/pyuic-wrapper.py "$@" +exec $PYTHON $(dirname $0)/pyuic_wrapper.py "$@" diff --git a/scripts/release.pl b/scripts/release.pl index 09a2641273d..edbe9fb3c0b 100755 --- a/scripts/release.pl +++ b/scripts/release.pl @@ -164,7 +164,7 @@ run( "scripts/create_changelog.sh", "create_changelog.sh failed" ); run( "perl -i -pe 's##\n #' linux/org.qgis.qgis.appdata.xml.in", "appdata update failed" ); unless( $dopoint ) { - run( "scripts/update-news.pl $newmajor.$newminor '$newreleasename'", "could not update news" ) if $major>2 || ($major==2 && $minor>14); + run( "scripts/update_news.pl $newmajor.$newminor '$newreleasename'", "could not update news" ) if $major>2 || ($major==2 && $minor>14); run( "git commit -n -a -m \"changelog and news update for $release\"", "could not commit changelog and news update" ); diff --git a/scripts/replace-console-i18n.pl b/scripts/replace_console_i18n.pl similarity index 100% rename from scripts/replace-console-i18n.pl rename to scripts/replace_console_i18n.pl diff --git a/scripts/runtests-local-travis-config.sh b/scripts/runtests_local_travis_config.sh similarity index 100% rename from scripts/runtests-local-travis-config.sh rename to scripts/runtests_local_travis_config.sh diff --git a/scripts/ts-clear.pl b/scripts/ts_clear.pl similarity index 99% rename from scripts/ts-clear.pl rename to scripts/ts_clear.pl index f0f7e8f05e7..dc1170fae6f 100644 --- a/scripts/ts-clear.pl +++ b/scripts/ts_clear.pl @@ -1,6 +1,6 @@ #!/usr/bin/env perl ########################################################################### -# ts-clear.pl +# ts_clear.pl # --------------------- # begin : October 2018 # copyright : (C) 2018 by Juergen E. Fischer diff --git a/scripts/update-indent.sh b/scripts/update_indent.sh similarity index 99% rename from scripts/update-indent.sh rename to scripts/update_indent.sh index 8e24a7f44a9..f80824fd74f 100644 --- a/scripts/update-indent.sh +++ b/scripts/update_indent.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash ########################################################################### -# update-indent.sh +# update_indent.sh # --------------------- # Date : August 2008 # Copyright : (C) 2008 by Juergen E. Fischer diff --git a/scripts/update-news.pl b/scripts/update_news.pl similarity index 93% rename from scripts/update-news.pl rename to scripts/update_news.pl index aeeff3925a9..a3054887853 100755 --- a/scripts/update-news.pl +++ b/scripts/update_news.pl @@ -66,10 +66,10 @@ system "txt2tags -oNEWS -t txt doc/NEWS.t2t"; =head1 NAME -update-news.pl - updates the news file from changelog.qgis.org +update_news.pl - updates the news file from changelog.qgis.org =head1 SYNOPSIS -update-news.pl version releasename +update_news.pl version releasename =cut diff --git a/scripts/update_ts.sh b/scripts/update_ts.sh index f27d090e6e1..027b4ceccb8 100755 --- a/scripts/update_ts.sh +++ b/scripts/update_ts.sh @@ -126,7 +126,7 @@ if [ $action = push ]; then exit 1 fi cp i18n/qgis_en.ts /tmp/qgis_en.ts-downloaded - perl scripts/ts-clear.pl # reset English translations + perl scripts/ts_clear.pl # reset English translations elif [ $action = pull ]; then rm -f i18n/qgis_*.ts diff --git a/scripts/verify-indentation.sh b/scripts/verify_indentation.sh similarity index 92% rename from scripts/verify-indentation.sh rename to scripts/verify_indentation.sh index 70445ebc8ff..0e8317fc9e6 100755 --- a/scripts/verify-indentation.sh +++ b/scripts/verify_indentation.sh @@ -65,8 +65,8 @@ Tips to prevent and resolve: * Enable WITH_ASTYLE in your cmake configuration to format C++ code * Install autopep8 (>= 1.2.1) to format python code * Use "scripts/astyle.sh file" to fix the now badly indented files -* Consider using scripts/prepare-commit.sh as pre-commit hook to avoid this - in the future (ln -s ../../scripts/prepare-commit.sh .git/hooks/pre-commit) or +* Consider using scripts/prepare_commit.sh as pre-commit hook to avoid this + in the future (ln -s ../../scripts/prepare_commit.sh .git/hooks/pre-commit) or run it manually before each commit. EOF diff --git a/tests/code_layout/CMakeLists.txt b/tests/code_layout/CMakeLists.txt index 3c810a25a52..c915257aced 100644 --- a/tests/code_layout/CMakeLists.txt +++ b/tests/code_layout/CMakeLists.txt @@ -1,5 +1,5 @@ IF(WITH_ASTYLE) - ADD_TEST(qgis_indentation ${CMAKE_SOURCE_DIR}/scripts/verify-indentation.sh) + ADD_TEST(qgis_indentation ${CMAKE_SOURCE_DIR}/scripts/verify_indentation.sh) ENDIF(WITH_ASTYLE) ADD_TEST(qgis_banned_keywords ${CMAKE_SOURCE_DIR}/tests/code_layout/test_banned_keywords.sh)