Supress SC2015 about A && B || C when B is a test.

This commit is contained in:
Vidar Holen
2024-05-04 15:12:13 -07:00
parent 4f81dbe839
commit 76ff702e93
3 changed files with 15 additions and 11 deletions

View File

@@ -929,6 +929,14 @@ modifiesVariable params token name =
Assignment (_, _, n, source) -> isTrueAssignmentSource source && n == name
_ -> False
isTestCommand t =
case t of
T_Condition {} -> True
T_SimpleCommand {} -> t `isCommand` "test"
T_Redirecting _ _ t -> isTestCommand t
T_Annotation _ _ t -> isTestCommand t
T_Pipeline _ _ [t] -> isTestCommand t
_ -> False
return []
runTests = $( [| $(forAllProperties) (quickCheckWithResult (stdArgs { maxSuccess = 1 }) ) |])