Skip to content

Files

Latest commit

 

History

History
36 lines (26 loc) · 629 Bytes

SC1095.md

File metadata and controls

36 lines (26 loc) · 629 Bytes

Pattern: Missing space between function name and body

Issue: -

Description

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"
}

Further Reading