Skip to content

Commit 88e4414

Browse files
committed
Make SC2002 optional (useless-use-of-cat)
1 parent 1487e57 commit 88e4414

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/ShellCheck/Analytics.hs

+8-2
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ nodeChecksToTreeCheck checkList =
103103

104104
nodeChecks :: [Parameters -> Token -> Writer [TokenComment] ()]
105105
nodeChecks = [
106-
checkUuoc
107-
,checkPipePitfalls
106+
checkPipePitfalls
108107
,checkForInQuoted
109108
,checkForInLs
110109
,checkShorthandIf
@@ -273,6 +272,13 @@ optionalTreeChecks = [
273272
cdPositive = "rm -r \"$(get_chroot_dir)/home\"",
274273
cdNegative = "set -e; dir=\"$(get_chroot_dir)\"; rm -r \"$dir/home\""
275274
}, checkExtraMaskedReturns)
275+
276+
,(newCheckDescription {
277+
cdName = "useless-use-of-cat",
278+
cdDescription = "Check for Useless Use Of Cat (UUOC)",
279+
cdPositive = "cat foo | grep bar",
280+
cdNegative = "grep bar foo"
281+
}, nodeChecksToTreeCheck [checkUuoc])
276282
]
277283

278284
optionalCheckMap :: Map.Map String (Parameters -> Token -> [TokenComment])

0 commit comments

Comments
 (0)