aboutsummaryrefslogtreecommitdiffstats
path: root/tox.ini
diff options
context:
space:
mode:
authorguillaume.lambert <guillaume.lambert@orange.com>2021-12-07 20:21:17 +0100
committerguillaume.lambert <guillaume.lambert@orange.com>2021-12-08 13:59:00 +0100
commitf657a816b9074f5bf2b3d300d93266269c1f05a5 (patch)
treef639250c0375d2e8a7017e694342e38809155530 /tox.ini
parent370c6dc33e55bfee7b3b79bcc21481b02a3f1e24 (diff)
[COMMON] Fix "local var=XX" bashisms
Variable attribute 'local' is not POSIX but is LSB supported. It is available in other shells such as ash or dash. And in ksh, local is the default scope of functions vaiables. Though, the syntax "local var=XX" is only supported and found in bash. Sadly, this is not detected by checkbashims. - fix "local var=XX" bashisms - add a manual command in tox.ini to detect them in the CI https://wiki.ubuntu.com/DashAsBinSh#local https://wiki.ubuntu.com/DashAsBinSh#declare_or_typeset https://stackoverflow.com/questions/12000949/scope-of-variables-in-ksh Issue-ID: OOM-2643 Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com> Change-Id: Iff26e50cd352eeb760d923a4740a6f92184fe0f2
Diffstat (limited to 'tox.ini')
-rw-r--r--tox.ini1
1 files changed, 1 insertions, 0 deletions
diff --git a/tox.ini b/tox.ini
index bbd00f85c4..61acbbba2a 100644
--- a/tox.ini
+++ b/tox.ini
@@ -65,6 +65,7 @@ commands =
|| (echo "checkbashisms command not found - please install it (e.g. sudo apt-get install devscripts | \
yum install devscripts-minimal )" >&2 && exit 1)'
find . -not -path '*/\.*' -name *.sh -exec checkbashisms \{\} +
+ sh -c "! find . -not -path '*/\.*' -name *.sh -exec grep 'local .*=' \{\} + || exit 2"
[testenv:autopep8]
deps =