diff --git a/TEMPLATES/.ruff.toml b/TEMPLATES/.ruff.toml index b22a41fa..a970189c 100644 --- a/TEMPLATES/.ruff.toml +++ b/TEMPLATES/.ruff.toml @@ -1,3 +1,6 @@ +# Store the cache in a temporary location +cache-dir = "/tmp/.ruff_cache" + # Same as .flake8 line-length = 120 diff --git a/test/run-super-linter-tests.sh b/test/run-super-linter-tests.sh index f13180d8..cdf5feb9 100755 --- a/test/run-super-linter-tests.sh +++ b/test/run-super-linter-tests.sh @@ -127,3 +127,21 @@ if [ ${SUPER_LINTER_EXIT_CODE} -ne ${EXPECTED_EXIT_CODE} ]; then else echo "Super-linter exited with the expected code: ${SUPER_LINTER_EXIT_CODE}" fi + +# Check if super-linter leaves leftovers behind +declare -a TEMP_ITEMS_TO_CLEAN +TEMP_ITEMS_TO_CLEAN=() +TEMP_ITEMS_TO_CLEAN+=("$(pwd)/.lintr") +TEMP_ITEMS_TO_CLEAN+=("$(pwd)/.mypy_cache") +TEMP_ITEMS_TO_CLEAN+=("$(pwd)/.ruff_cache") +TEMP_ITEMS_TO_CLEAN+=("$(pwd)/logback.log") + +for item in "${TEMP_ITEMS_TO_CLEAN[@]}"; do + echo "Check if ${item} exists" + if [[ -e "${item}" ]]; then + echo "Error: ${item} exists and it should have been deleted" + exit 1 + else + echo "${item} does not exist as expected" + fi +done