diff --git a/.gitignore b/.gitignore index dc59e4f..5ba5b58 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ codecept.phar /vendor/ /node_modules/ +.idea diff --git a/sample-config/.dev-lib b/sample-config/.dev-lib index d3bfa58..19378cb 100755 --- a/sample-config/.dev-lib +++ b/sample-config/.dev-lib @@ -1,7 +1,11 @@ #!/bin/bash function run_tests { - # Run your custom checks before the default linters, tests, etc. + # Run your custom tests before the default linters, tests, etc. +} + +function run_after_tests { + # Run your custom tests after the default linters, tests, etc. } function after_wp_install { diff --git a/scripts/pre-commit b/scripts/pre-commit index 3750750..272501b 100755 --- a/scripts/pre-commit +++ b/scripts/pre-commit @@ -43,7 +43,7 @@ install_tools echo "## Checking files, scope $CHECK_SCOPE:" cat "$TEMP_DIRECTORY/paths-scope" -# Run any custom checks by defining a run_tests function, see sample-scripts/.dev-lib +# Run any custom tests by defining a run_tests function, see sample-scripts/.dev-lib if [ "$( type -t run_tests )" != '' ]; then run_tests fi @@ -56,6 +56,11 @@ run_qunit run_phpunit_local run_codeception +# Run any custom tests after all other tests by defining a run_after_tests function, see sample-scripts/.dev-lib +if [ "$( type -t run_after_tests )" != '' ]; then + run_after_tests +fi + # Make sure the readme.md never gets out of sync with the readme.txt, if it is staged for commit. if [[ $SYNC_README_MD == 1 ]] && [ -e readme.txt ] && cat "$TEMP_DIRECTORY/paths-scope" | remove_diff_range | grep -sqE '^readme\.txt$'; then MARKDOWN_README_PATH=$($DEV_LIB_PATH/generate-markdown-readme) diff --git a/scripts/travis.script.sh b/scripts/travis.script.sh index 3e08203..661ea46 100755 --- a/scripts/travis.script.sh +++ b/scripts/travis.script.sh @@ -8,7 +8,7 @@ if [[ -z $SKIP_ECHO_PATHS_SCOPE ]] && [[ $CHECK_SCOPE != "all" ]]; then fi echo -# Run any custom checks by defining a run_tests function, see sample-scripts/.dev-lib +# Run any custom tests by defining a run_tests function, see sample-scripts/.dev-lib if [ "$( type -t run_tests )" != '' ]; then run_tests fi @@ -20,3 +20,8 @@ lint_xml_files run_qunit run_phpunit_travisci run_codeception + +# Run any custom tests after all other tests by defining a run_after_tests function, see sample-scripts/.dev-lib +if [ "$( type -t run_after_tests )" != '' ]; then + run_after_tests +fi