improve match explanations
Using == and != proved too hard to read, so went with [TRUE] and [FALSE] after the term. I would kind of liked to have used emojis for a green check and red X, but probably that is too fancy to be a good idea. Make --explain output be inside [ ] with whitespace around them, to avoid it ending with eg "[FALSE]]" and to make it easier to visually find the start of it. Sponsored-by: Dartmouth College's DANDI project
This commit is contained in:
parent
08071a1b90
commit
499d014123
4 changed files with 24 additions and 4 deletions
7
Limit.hs
7
Limit.hs
|
@ -625,8 +625,9 @@ checkKey a (MatchingFile fi) = lookupFileKey fi >>= maybe (return False) a
|
|||
checkKey a (MatchingInfo p) = maybe (return False) a (providedKey p)
|
||||
checkKey a (MatchingUserInfo p) = a =<< getUserInfo (userProvidedKey p)
|
||||
|
||||
matchDescSimple :: String -> Bool -> Utility.Matcher.MatchDesc
|
||||
matchDescSimple s b = Utility.Matcher.MatchDesc $ (if b then "" else "!") ++ s
|
||||
matchDescSimple :: String -> (Bool -> Utility.Matcher.MatchDesc)
|
||||
matchDescSimple s b = Utility.Matcher.MatchDesc $ s ++
|
||||
if b then "[TRUE]" else "[FALSE]"
|
||||
|
||||
(=?) :: String -> String -> (Bool -> Utility.Matcher.MatchDesc)
|
||||
k =? v = \b -> Utility.Matcher.MatchDesc $ k ++ (if b then "==" else "!=") ++ v
|
||||
k =? v = matchDescSimple (k ++ "=" ++ v)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue