From 479e81a3f32c37b7bda92195eaf071824e6fc877 Mon Sep 17 00:00:00 2001 From: koalaman Date: Sat, 8 Jul 2017 17:18:31 -0700 Subject: [PATCH] Created SC1051 (markdown) --- SC1051.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 SC1051.md diff --git a/SC1051.md b/SC1051.md new file mode 100644 index 0000000..d55f21c --- /dev/null +++ b/SC1051.md @@ -0,0 +1,22 @@ +## Don't put semicolons directly after 'then'. + +### Problematic code: + +```sh +if true; then; echo "Hi"; fi +``` + +### Correct code: + +```sh +if true; then echo "Hi"; fi +``` +### Rationale: + +`then` 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