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
This commit is contained in:
@@ -42,7 +42,7 @@ fi
|
||||
|
||||
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,c'
|
||||
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 @@ fi
|
||||
echo "Testing disable_negated_services()"
|
||||
|
||||
|
||||
function test_disable_negated_services() {
|
||||
function test_disable_negated_services {
|
||||
local start="$1"
|
||||
local finish="$2"
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ source $TOP/lib/config
|
||||
|
||||
# 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 @@ TEST_1C_ADD="[eee]
|
||||
type=new
|
||||
multi = foo2"
|
||||
|
||||
function create_test1c() {
|
||||
function create_test1c {
|
||||
cat >test1c.conf <<EOF
|
||||
[eee]
|
||||
# original comment
|
||||
@@ -34,7 +34,7 @@ type=original
|
||||
EOF
|
||||
}
|
||||
|
||||
function create_test2a() {
|
||||
function create_test2a {
|
||||
cat >test2a.conf <<EOF
|
||||
[ddd]
|
||||
# original comment
|
||||
|
||||
Reference in New Issue
Block a user