Pattern: Missing space between function name and body
Issue: -
When using function
keyword function definitions without ()
, a space is required between the function name and the opening {
.
Example of incorrect code:
function foo{
echo "hello world"
}
Example of correct code:
Prefer POSIX syntax:
foo() {
echo "hello world"
}
Alternatively, add the missing space between function name and opening {
:
# v-- Here
function foo {
echo "hello world"
}