mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Created SC1051 (markdown)
22
SC1051.md
Normal file
22
SC1051.md
Normal file
@@ -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
|
Reference in New Issue
Block a user