mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Created SC1130 (markdown)
24
SC1130.md
Normal file
24
SC1130.md
Normal file
@@ -0,0 +1,24 @@
|
||||
## You need a space before the :.
|
||||
|
||||
### Problematic code:
|
||||
|
||||
```sh
|
||||
until make
|
||||
do:; done
|
||||
```
|
||||
|
||||
### Correct code:
|
||||
|
||||
```sh
|
||||
until make
|
||||
do :; done
|
||||
```
|
||||
### Rationale:
|
||||
|
||||
ShellCheck found a keyword immediately followed by a `:`. `:` is a synonym for `true`, the command that "does nothing, successfully", and as a command name it needs a space.
|
||||
|
||||
`do:` is as invalid as `dotrue`. Use `do :`, or preferably, `do true` for readability.
|
||||
|
||||
### Exceptions:
|
||||
|
||||
None
|
Reference in New Issue
Block a user