Merge pull request #1257 from ngzhian/trailing-comma-exclude

Allow trailing comma in exclude flag
This commit is contained in:
Vidar Holen 2018-06-24 11:46:26 -07:00 committed by GitHub
commit db33294838
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 7 deletions

View File

@ -137,12 +137,6 @@ split char str =
else split' rest (a:element) else split' rest (a:element)
split' [] element = [reverse 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 toStatus = fmap (either id id) . runExceptT
getEnvArgs = do getEnvArgs = do
@ -241,7 +235,7 @@ parseOption flag options =
} }
Flag "exclude" str -> do Flag "exclude" str -> do
new <- mapM parseNum $ split ',' str new <- mapM parseNum $ filter (not . null) $ split ',' str
let old = csExcludedWarnings . checkSpec $ options let old = csExcludedWarnings . checkSpec $ options
return options { return options {
checkSpec = (checkSpec options) { checkSpec = (checkSpec options) {