mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-07 15:55:24 +08:00
Added better message for SC1007, for 'var= value'
This commit is contained in:
@@ -1734,7 +1734,8 @@ readAssignmentWord = try $ do
|
|||||||
if space == "" && space2 /= ""
|
if space == "" && space2 /= ""
|
||||||
then do
|
then do
|
||||||
when (variable /= "IFS") $
|
when (variable /= "IFS") $
|
||||||
parseNoteAt pos InfoC 1007 $ "Note that 'var= value' (with space after equals sign) is similar to 'var=\"\"; value'."
|
parseNoteAt pos WarningC 1007
|
||||||
|
"Remove space after = if trying to assign a value (for empty string, use var='' ... )."
|
||||||
value <- readEmptyLiteral
|
value <- readEmptyLiteral
|
||||||
return $ T_Assignment id op variable index value
|
return $ T_Assignment id op variable index value
|
||||||
else do
|
else do
|
||||||
|
Reference in New Issue
Block a user