Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
harendra-kumar committed Nov 28, 2023
1 parent 27ca17d commit ca50083
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions cli/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ mainSingle args = do
let apiInternal =
Map.filterWithKey (\k _ -> isInternal k) api1

step "Printing Released API"
step "Released API"
putStrLn $ prettyAPI elems apiReleased
step "Printing Internal API"
step "Internal API"
putStrLn $ prettyAPI elems apiInternal

mainDiff :: [String] -> IO ()
Expand Down Expand Up @@ -155,12 +155,11 @@ mainDiff args = do
step "API Annotations"
putStrLn "[A] : Added"
putStrLn "[R] : Removed"
putStrLn "[C] : Signature changed"
putStrLn "[O] : Old signature"
putStrLn "[N] : New signature"
putStrLn "[C] : Changed"
putStrLn "[O] : Old definition"
putStrLn "[N] : New definition"
putStrLn "[D] : Deprecated"

step "API diff"
let elems =
[ ELClasses
, ELDataTypes True
Expand All @@ -180,12 +179,18 @@ mainDiff args = do
isDeprecatedInLeft (Tagged (Attach (DBoth anns _) _) _) =
isDeprecated anns
isDeprecatedInLeft _ = False
let diff =
let diffRel =
let filt k v =
not (isInternal k)
&& not (isDeprecatedInBoth v || isDeprecatedInLeft v)
in Map.filterWithKey filt (diffAPI api1 api2)
putStrLn $ prettyAPI elems diff
let diffInt =
let filt k _ = isInternal k
in Map.filterWithKey filt (diffAPI api1 api2)
step "API diff"
putStrLn $ prettyAPI elems diffRel
step "Internal API diff"
putStrLn $ prettyAPI elems diffInt

main :: IO ()
main = do
Expand Down

0 comments on commit ca50083

Please sign in to comment.