Skip to content

Commit

Permalink
Allow trailing comma in exclude flag
Browse files Browse the repository at this point in the history
  • Loading branch information
ngzhian committed Jun 14, 2018
1 parent 32a53f2 commit 963b39b
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions shellcheck.hs
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,6 @@ split char str =
else split' rest (a:element)
split' [] element = [reverse element]

getExclusions options =
let elements = concatMap (split ',') $ getOptions options "exclude"
clean = dropWhile (not . isDigit)
in
map (Prelude.read . clean) elements :: [Int]

toStatus = fmap (either id id) . runExceptT

getEnvArgs = do
Expand Down Expand Up @@ -241,7 +235,7 @@ parseOption flag options =
}

Flag "exclude" str -> do
new <- mapM parseNum $ split ',' str
new <- mapM parseNum $ filter (not . null) $ split ',' str
let old = csExcludedWarnings . checkSpec $ options
return options {
checkSpec = (checkSpec options) {
Expand Down

0 comments on commit 963b39b

Please sign in to comment.