Skip to content

Commit

Permalink
Fix HLint hints
Browse files Browse the repository at this point in the history
  • Loading branch information
ndmitchell committed Aug 28, 2021
1 parent 9db3e03 commit b2691a1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Config/Yaml.hs
Original file line number Diff line number Diff line change
Expand Up @@ -304,16 +304,15 @@ parseRestrict restrictType v = do
case (restrictBadIdents, restrictOnlyAllowedIdents) of
(Just badIdents, Nothing) -> ForbidIdents <$> parseArrayString badIdents
(Nothing, Just onlyIdents) -> OnlyIdents <$> parseArrayString onlyIdents
(Nothing, Nothing) -> return NoRestrictIdents
(Nothing, Nothing) -> pure NoRestrictIdents
_ -> parseFail v "The following options are mutually exclusive: badidents, only"

restrictMessage <- parseFieldOpt "message" v >>= maybeParse parseString
allowFields v $ concat
[ ["name", "within", "message"]
, if restrictType == RestrictModule
allowFields v $
["name", "within", "message"] ++
if restrictType == RestrictModule
then ["as", "badidents", "only"]
else []
]
pure Restrict{restrictDefault=True,..}

parseWithin :: Val -> Parser [(String, String)] -- (module, decl)
Expand Down

0 comments on commit b2691a1

Please sign in to comment.