mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-08 11:14:25 +08:00
Stop using head in isLeadingNumberVar
This commit is contained in:
@@ -4378,9 +4378,8 @@ checkEqualsInCommand params originalToken =
|
|||||||
return $ isVariableName str
|
return $ isVariableName str
|
||||||
|
|
||||||
isLeadingNumberVar s =
|
isLeadingNumberVar s =
|
||||||
let lead = takeWhile (/= '=') s
|
case takeWhile (/= '=') s of
|
||||||
in not (null lead) && isDigit (head lead)
|
lead@(x:_) -> isDigit x && all isVariableChar lead && not (all isDigit lead)
|
||||||
&& all isVariableChar lead && not (all isDigit lead)
|
|
||||||
|
|
||||||
msg cmd leading (T_Literal litId s) = do
|
msg cmd leading (T_Literal litId s) = do
|
||||||
-- There are many different cases, and the order of the branches matter.
|
-- There are many different cases, and the order of the branches matter.
|
||||||
|
Reference in New Issue
Block a user