Skip to content

Commit 8ce91f9

Browse files
committed
Use the latest packages for building and make truncation optional
1 parent cd68f52 commit 8ce91f9

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

cabal.project

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ packages: .
33
source-repository-package
44
type: git
55
location: https://github.com/composewell/streamly-process.git
6-
tag: master
6+
tag: e310c8a9c6e61515373a2f5f1fb82f6e15fe452b
77

88
source-repository-package
99
type: git
1010
location: https://github.com/composewell/streamly.git
11-
tag: master
11+
tag: ff1dd549c630803163f4d0a722e24cbb04961a14
1212

1313
source-repository-package
1414
type: git
1515
location: https://github.com/composewell/streamly.git
16-
tag: master
16+
tag: ff1dd549c630803163f4d0a722e24cbb04961a14
1717
subdir: core

cli/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,4 @@ main = do
7979
& Stream.fold (haddockParseFold Removed Removed Removed)
8080
api2 <- fileToLines file2 & Stream.fold (haddockParseFold Added Added Added)
8181
step "Printing diff"
82-
putStrLn $ prettyAPI False (diffAPI api1 api2)
82+
putStrLn $ prettyAPI False Nothing (diffAPI api1 api2)

src/Pretty.hs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,18 @@ prettyD0 = SMap.foldlWithKey step initial
3939

4040
initial = []
4141

42-
step a k (Tagged Added b) = unwords ["[A]", k, ":", take 50 (showECT b)] : a
42+
step a k (Tagged Added b) = unwords ["[A]", k, ":", showECT b] : a
4343
step a k (Tagged Removed b) =
44-
unwords ["[R]", k, ":", take 50 (showECT b)] : a
45-
-- step a k (Tagged Same b) = unwords ["[S]", k, ":", take 50 (showECT b)] : a
44+
unwords ["[R]", k, ":", showECT b] : a
45+
-- step a k (Tagged Same b) = unwords ["[S]", k, ":", showECT b] : a
4646
step a _ (Tagged Same _) = a
4747
step a k (Tagged (Changed b1) b) =
4848
concat
4949
[ [unwords ["[C]", k, ":"]]
5050
, indenter
5151
4
52-
[ unwords ["[OLD]", take 50 (showECT b)]
53-
, unwords ["[NEW]", take 50 (showECT b1)]
52+
[ unwords ["[OLD]", showECT b]
53+
, unwords ["[NEW]", showECT b1]
5454
]
5555
, a
5656
]
@@ -85,12 +85,19 @@ prettyMC ctx =
8585

8686
prettyAPI ::
8787
Bool
88+
-> Maybe Int
8889
-> API (StatusTag ()) (StatusTag ()) (StatusTag EntityContextType)
8990
-> String
90-
prettyAPI ignoreInternal = printer . SMap.foldlWithKey step initial
91+
prettyAPI ignoreInternal trunction =
92+
printer . truncator . SMap.foldlWithKey step initial
9193

9294
where
9395

96+
truncator =
97+
case trunction of
98+
Just t -> map (take t)
99+
Nothing -> id
100+
94101
initial = []
95102

96103
step a _ (Tagged Same _) = a

0 commit comments

Comments
 (0)