mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-30 19:40:40 -07:00
Add warnings for empty then clauses
This commit is contained in:
parent
844a07afa0
commit
0c66cfb936
1 changed files with 6 additions and 0 deletions
|
@ -1063,6 +1063,12 @@ readIfPart = do
|
|||
|
||||
acceptButWarn g_Semi ErrorC "No semicolons directly after 'then'."
|
||||
allspacing
|
||||
|
||||
optional (do
|
||||
emptyPos <- getPosition
|
||||
try . lookAhead $ (g_Fi <|> g_Elif)
|
||||
parseProblemAt emptyPos ErrorC "Can't have empty then clauses (use 'true' as a no-op).")
|
||||
|
||||
action <- readTerm
|
||||
return (condition, action)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue