Skip to content

Commit

Permalink
Merge pull request #2938 from larryv/reword-SC2324
Browse files Browse the repository at this point in the history
Recommend `typeset` instead of `declare` in SC2324
  • Loading branch information
koalaman authored Apr 7, 2024
2 parents 5241878 + 9cb21c8 commit 79491db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ShellCheck/Analytics.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5017,7 +5017,8 @@ checkPlusEqualsNumber params t =
state <- CF.getIncomingState cfga id
guard $ isNumber state word
guard . not $ fromMaybe False $ CF.variableMayBeDeclaredInteger state var
return $ warn id 2324 "var+=1 will append, not increment. Use (( var += 1 )), declare -i var, or quote number to silence."
-- Recommend "typeset" because ksh does not have "declare".
return $ warn id 2324 "var+=1 will append, not increment. Use (( var += 1 )), typeset -i var, or quote number to silence."
_ -> return ()

where
Expand Down

0 comments on commit 79491db

Please sign in to comment.