From e6299f16688035d2b87b19b28a81d7445af659bd Mon Sep 17 00:00:00 2001 From: koalaman Date: Sat, 5 Dec 2015 16:09:00 -0800 Subject: [PATCH] Created SC1095 (markdown) --- SC1095.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 SC1095.md diff --git a/SC1095.md b/SC1095.md new file mode 100644 index 0000000..f59b108 --- /dev/null +++ b/SC1095.md @@ -0,0 +1,33 @@ +## You need a space or linefeed between the function name and body. + +### Problematic code: + +```sh +function foo{ + echo "hello world" +} +``` + +### Correct code: + +Prefer POSIX syntax: +```sh +foo() { + echo "hello world" +} +``` + +Alternatively, add the missing space between function name and opening `{`: +```sh +# v-- Here +function foo { + echo "hello world" +} +``` +### Rationale: + +When using `function` keyword function definitions without `()`, a space is required between the function name and the opening `{`. + +### Exceptions: + +None. \ No newline at end of file