mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-09-20 18:59:23 +08:00
Add warnings for empty then clauses
This commit is contained in:
@@ -1063,6 +1063,12 @@ readIfPart = do
|
|||||||
|
|
||||||
acceptButWarn g_Semi ErrorC "No semicolons directly after 'then'."
|
acceptButWarn g_Semi ErrorC "No semicolons directly after 'then'."
|
||||||
allspacing
|
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
|
action <- readTerm
|
||||||
return (condition, action)
|
return (condition, action)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user