File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed
Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change 88- SC2264: Warn about wrapper functions that blatantly recurse
99- SC2265/SC2266: Warn when using & or | with test statements
1010- SC2267: Warn when using xargs -i instead of -I
11- - Optional avoid-x-comparisons: Style warning SC2268 for ` [ x$var = xval ] `
11+ - SC2268: Warn about unnecessary x-comparisons like ` [ x$var = xval ] `
1212
1313### Fixed
1414- SC1072/SC1073 now respond to disable annotations, though ignoring parse errors
Original file line number Diff line number Diff line change @@ -196,6 +196,7 @@ nodeChecks = [
196196 ,checkAssignToSelf
197197 ,checkEqualsInCommand
198198 ,checkSecondArgIsComparison
199+ ,checkComparisonWithLeadingX
199200 ]
200201
201202optionalChecks = map fst optionalTreeChecks
@@ -243,13 +244,6 @@ optionalTreeChecks = [
243244 cdPositive = " echo $VAR" ,
244245 cdNegative = " VAR=hello; echo $VAR"
245246 }, checkUnassignedReferences' True )
246-
247- ,(newCheckDescription {
248- cdName = " avoid-x-comparisons" ,
249- cdDescription = " Warn about 'x'-prefix in comparisons" ,
250- cdPositive = " [ \" x$var\" = xval ]" ,
251- cdNegative = " [ \" $var\" = val ]"
252- }, nodeChecksToTreeCheck [checkComparisonWithLeadingX])
253247 ]
254248
255249optionalCheckMap :: Map. Map String (Parameters -> Token -> [TokenComment ])
@@ -4006,7 +4000,7 @@ checkComparisonWithLeadingX params t =
40064000 check lhs rhs
40074001 _ -> return ()
40084002 where
4009- msg = " Avoid outdated x-prefix in comparisons as it no longer serves a purpose."
4003+ msg = " Avoid x-prefix in comparisons as it no longer serves a purpose."
40104004 check lhs rhs = sequence_ $ do
40114005 l <- fixLeadingX lhs
40124006 r <- fixLeadingX rhs
You can’t perform that action at this time.
0 commit comments