Enforce function declaration format in bash8
Check that function calls look like ^function foo {$ in bash8, and fix
all existing failures of that check. Add a note to HACKING.rst
Change-Id: Ic19eecb39e0b20273d1bcd551a42fe400d54e938
diff --git a/tests/functions.sh b/tests/functions.sh
index 06a4134..874d022 100755
--- a/tests/functions.sh
+++ b/tests/functions.sh
@@ -42,7 +42,7 @@
echo "Testing enable_service()"
-function test_enable_service() {
+function test_enable_service {
local start="$1"
local add="$2"
local finish="$3"
@@ -68,7 +68,7 @@
test_enable_service 'a,b,-c' c 'a,b'
test_enable_service 'a,b,c' -c 'a,b'
-function test_disable_service() {
+function test_disable_service {
local start="$1"
local del="$2"
local finish="$3"
@@ -109,7 +109,7 @@
echo "Testing disable_negated_services()"
-function test_disable_negated_services() {
+function test_disable_negated_services {
local start="$1"
local finish="$2"
diff --git a/tests/test_config.sh b/tests/test_config.sh
index 39603c9..5700f8d 100755
--- a/tests/test_config.sh
+++ b/tests/test_config.sh
@@ -12,7 +12,7 @@
# check_result() tests and reports the result values
# check_result "actual" "expected"
-function check_result() {
+function check_result {
local actual=$1
local expected=$2
if [[ "$actual" == "$expected" ]]; then
@@ -26,7 +26,7 @@
type=new
multi = foo2"
-function create_test1c() {
+function create_test1c {
cat >test1c.conf <<EOF
[eee]
# original comment
@@ -34,7 +34,7 @@
EOF
}
-function create_test2a() {
+function create_test2a {
cat >test2a.conf <<EOF
[ddd]
# original comment