mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC1048 (markdown)
@@ -8,9 +8,7 @@ then
|
||||
# TODO: handle this
|
||||
fi
|
||||
```
|
||||
|
||||
### Correct code:
|
||||
|
||||
```sh
|
||||
if [ -e foo ]
|
||||
then
|
||||
@@ -19,14 +17,13 @@ then
|
||||
fi
|
||||
|
||||
# Or use the no-op colon operator ":"
|
||||
```sh
|
||||
if [ -e foo ]
|
||||
then
|
||||
# TODO: handle this
|
||||
:
|
||||
fi
|
||||
```
|
||||
```
|
||||
|
||||
### Rationale:
|
||||
|
||||
Shells do not allow empty `then` clauses. They need at least one command (and comments are not commands).
|
||||
|
Reference in New Issue
Block a user