mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-07 01:59:27 +08:00
Added warning for empty do clauses
This commit is contained in:
@@ -1130,6 +1130,10 @@ readDoGroup loopPos = do
|
|||||||
acceptButWarn g_Semi ErrorC "No semicolons directly after 'do'."
|
acceptButWarn g_Semi ErrorC "No semicolons directly after 'do'."
|
||||||
allspacing
|
allspacing
|
||||||
|
|
||||||
|
optional (do
|
||||||
|
try . lookAhead $ g_Done
|
||||||
|
parseProblemAt loopPos ErrorC "Can't have empty do clauses (use 'true' as a no-op).")
|
||||||
|
|
||||||
commands <- readCompoundList
|
commands <- readCompoundList
|
||||||
g_Done `orFail` do
|
g_Done `orFail` do
|
||||||
parseProblemAt pos ErrorC "Couldn't find 'done' for this 'do'."
|
parseProblemAt pos ErrorC "Couldn't find 'done' for this 'do'."
|
||||||
|
Reference in New Issue
Block a user