Auto-disable SC2119 when disabling SC2120 (fixes #703)

This commit is contained in:
Vidar Holen 2019-04-27 15:20:07 -07:00
parent 301705edea
commit bf1003eae3
4 changed files with 29 additions and 11 deletions

View file

@ -501,3 +501,13 @@ isCommandSubstitution t = case t of
T_DollarBraceCommandExpansion {} -> True
T_Backticked {} -> True
_ -> False
-- Is this a T_Annotation that ignores a specific code?
isAnnotationIgnoringCode code t =
case t of
T_Annotation _ anns _ -> any hasNum anns
_ -> False
where
hasNum (DisableComment ts) = code == ts
hasNum _ = False