From 3f63e7841f63f26401cd0376713e17d31967538c Mon Sep 17 00:00:00 2001 From: koalaman Date: Sat, 8 Jul 2017 17:25:36 -0700 Subject: [PATCH] Created SC1053 (markdown) --- SC1053.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 SC1053.md diff --git a/SC1053.md b/SC1053.md new file mode 100644 index 0000000..72b7df5 --- /dev/null +++ b/SC1053.md @@ -0,0 +1,21 @@ +## Semicolons directly after 'else' are not allowed. Just remove it. + +### Problematic code: + +```sh +if mycommand; then echo "True"; else; echo "False"; fi +``` + +### Correct code: + +```sh +if mycommand; then echo "True"; else echo "False"; fi``` +### Rationale: + +`else` keywords should not be followed by semicolons. It's not valid shell syntax. + +You can follow them directly with a line break or another command. + +### Exceptions: + +None \ No newline at end of file