mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-12 16:13:19 -07:00
Auto-disable SC2119 when disabling SC2120 (fixes #703)
This commit is contained in:
parent
301705edea
commit
bf1003eae3
4 changed files with 29 additions and 11 deletions
|
@ -882,16 +882,15 @@ filterByAnnotation asSpec params =
|
|||
shouldIgnore note =
|
||||
any (shouldIgnoreFor (getCode note)) $
|
||||
getPath parents (T_Bang $ tcId note)
|
||||
shouldIgnoreFor num (T_Annotation _ anns _) =
|
||||
any hasNum anns
|
||||
where
|
||||
hasNum (DisableComment ts) = num == ts
|
||||
hasNum _ = False
|
||||
shouldIgnoreFor _ T_Include {} = not $ asCheckSourced asSpec
|
||||
shouldIgnoreFor _ _ = False
|
||||
shouldIgnoreFor code t = isAnnotationIgnoringCode code t
|
||||
parents = parentMap params
|
||||
getCode = cCode . tcComment
|
||||
|
||||
shouldIgnoreCode params code t =
|
||||
any (isAnnotationIgnoringCode code) $
|
||||
getPath (parentMap params) t
|
||||
|
||||
-- Is this a ${#anything}, to get string length or array count?
|
||||
isCountingReference (T_DollarBraced id token) =
|
||||
case concat $ oversimplify token of
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue