Skip to content

Commit

Permalink
Make SC2002 optional (useless-use-of-cat)
Browse files Browse the repository at this point in the history
  • Loading branch information
koalaman committed Sep 1, 2024
1 parent 1487e57 commit 88e4414
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/ShellCheck/Analytics.hs
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ nodeChecksToTreeCheck checkList =

nodeChecks :: [Parameters -> Token -> Writer [TokenComment] ()]
nodeChecks = [
checkUuoc
,checkPipePitfalls
checkPipePitfalls
,checkForInQuoted
,checkForInLs
,checkShorthandIf
Expand Down Expand Up @@ -273,6 +272,13 @@ optionalTreeChecks = [
cdPositive = "rm -r \"$(get_chroot_dir)/home\"",
cdNegative = "set -e; dir=\"$(get_chroot_dir)\"; rm -r \"$dir/home\""
}, checkExtraMaskedReturns)

,(newCheckDescription {
cdName = "useless-use-of-cat",
cdDescription = "Check for Useless Use Of Cat (UUOC)",
cdPositive = "cat foo | grep bar",
cdNegative = "grep bar foo"
}, nodeChecksToTreeCheck [checkUuoc])
]

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

0 comments on commit 88e4414

Please sign in to comment.