Skip to content

Commit d8cc799

Browse files
fjahrbrunoerg
andcommitted
lint: Skip and warn in case of old bash version
co-authored-by: brunoerg <[email protected]>
1 parent 117a5ab commit d8cc799

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

test/lint/lint-python-dead-code.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ export LC_ALL=C
1111
if ! command -v vulture > /dev/null; then
1212
echo "Skipping Python dead code linting since vulture is not installed. Install by running \"pip3 install vulture\""
1313
exit 0
14+
elif [ "${BASH_VERSINFO:-0}" -lt 4 ]; then
15+
echo "Skipping Python dead code linting since your bash version is less than 4."
16+
exit 0
1417
fi
1518

1619
# --min-confidence 100 will only report code that is guaranteed to be unused within the analyzed files.

test/lint/lint-python.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ if ! command -v flake8 > /dev/null; then
8888
elif PYTHONWARNINGS="ignore" flake8 --version | grep -q "Python 2"; then
8989
echo "Skipping Python linting since flake8 is running under Python 2. Install the Python 3 version of flake8."
9090
exit 0
91+
elif [ "${BASH_VERSINFO:-0}" -lt 4 ]; then
92+
echo "Skipping Python linting since your bash version is less than 4."
93+
exit 0
9194
fi
9295

9396
EXIT_CODE=0

test/lint/lint-shell.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ EXIT_CODE=0
1818
if ! command -v shellcheck > /dev/null; then
1919
echo "Skipping shell linting since shellcheck is not installed."
2020
exit $EXIT_CODE
21+
elif [ "${BASH_VERSINFO:-0}" -lt 4 ]; then
22+
echo "Skipping shell linting since your bash version is less than 4."
23+
exit $EXIT_CODE
2124
fi
2225

2326
SHELLCHECK_CMD=(shellcheck --external-sources --check-sourced --source-path=SCRIPTDIR)

test/lint/lint-spelling.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ export LC_ALL=C
1212
if ! command -v codespell > /dev/null; then
1313
echo "Skipping spell check linting since codespell is not installed."
1414
exit 0
15+
elif [ "${BASH_VERSINFO:-0}" -lt 4 ]; then
16+
echo "Skipping spell check linting since your bash version is less than 4."
17+
exit 0
1518
fi
1619

1720
IGNORE_WORDS_FILE=test/lint/lint-spelling.ignore-words.txt

0 commit comments

Comments
 (0)