mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-21 13:41:19 -05:00
fix: configure ruff with a temp cache (#5548)
- Configure Ruff to store its cache in a temporary directory inside the container by default. Users can still override this by providing a configuration file for Ruff. - Add tests to ensure that super-linter deletes temporary files and directories. Close #5543
This commit is contained in:
parent
49001a2405
commit
56e675bd33
2 changed files with 21 additions and 0 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
# Store the cache in a temporary location
|
||||||
|
cache-dir = "/tmp/.ruff_cache"
|
||||||
|
|
||||||
# Same as .flake8
|
# Same as .flake8
|
||||||
line-length = 120
|
line-length = 120
|
||||||
|
|
||||||
|
|
|
@ -127,3 +127,21 @@ if [ ${SUPER_LINTER_EXIT_CODE} -ne ${EXPECTED_EXIT_CODE} ]; then
|
||||||
else
|
else
|
||||||
echo "Super-linter exited with the expected code: ${SUPER_LINTER_EXIT_CODE}"
|
echo "Super-linter exited with the expected code: ${SUPER_LINTER_EXIT_CODE}"
|
||||||
fi
|
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
|
||||||
|
|
Loading…
Reference in a new issue