mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Created SC1050 (markdown)
27
SC1050.md
Normal file
27
SC1050.md
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
## Expected 'then'.
|
||||||
|
|
||||||
|
### Problematic code:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
if true
|
||||||
|
echo "True"
|
||||||
|
fi
|
||||||
|
```
|
||||||
|
|
||||||
|
### Correct code:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
if true
|
||||||
|
then
|
||||||
|
echo "True"
|
||||||
|
fi
|
||||||
|
```
|
||||||
|
### Rationale:
|
||||||
|
|
||||||
|
ShellCheck has found an `if` statement that appears to be missing a `then`.
|
||||||
|
|
||||||
|
Make sure the `then` exists, and that it is the first word of the line (or immediately preceded by a semicolon).
|
||||||
|
|
||||||
|
### Exceptions:
|
||||||
|
|
||||||
|
None
|
Reference in New Issue
Block a user