File tree Expand file tree Collapse file tree 5 files changed +43
-11
lines changed Expand file tree Collapse file tree 5 files changed +43
-11
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ Other improvements:
13
13
- Fix output truncation with ` --json-errors ` , many warnings and build failure (#1199 )
14
14
- Update README with info about depending on a freshly added library
15
15
- Fixed globbing issue where ` /.spago ` behaves differently than ` .spago ` in ` .gitignore `
16
+ - Fixed empty output for ` --verbose-stats ` when there are no errors or warnings.
16
17
17
18
## [ 0.21.0] - 2023-05-04
18
19
Original file line number Diff line number Diff line change 1
1
-- A majority of this code was copied from
2
2
-- - https://github.com/natefaubion/purescript-psa-utils
3
- --
3
+ --
4
4
-- To fullfil license requirements
5
5
-- Copyright © Nathan Faubion
6
6
-- https://opensource.org/license/mit/
7
7
module Spago.Psa.Output
8
- ( buildOutput
9
- , Output
8
+ ( Output
10
9
, OutputStats
11
10
, annotatedError
12
- , trimPosition
11
+ , buildOutput
12
+ , initialStats
13
13
, trimMessage
14
+ , trimPosition
14
15
) where
15
16
16
17
import Prelude
Original file line number Diff line number Diff line change 1
1
-- A majority of this code was copied from
2
2
-- - https://github.com/natefaubion/purescript-psa-utils
3
- --
3
+ --
4
4
-- To fullfil license requirements
5
5
-- Copyright © Nathan Faubion
6
6
-- https://opensource.org/license/mit/
@@ -136,12 +136,15 @@ renderStats stats =
136
136
137
137
renderVerboseStats :: OutputStats -> D.Doc Ansi.GraphicsParam
138
138
renderVerboseStats stats =
139
- renderStatCols
140
- { col1: warningLabels <> errorLabels
141
- , col2: srcWarnings <> srcErrors
142
- , col3: libWarnings <> libErrors
143
- , col4: allWarnings <> allErrors
144
- }
139
+ if Array .null warnings && Array .null errors then
140
+ renderStats stats
141
+ else
142
+ renderStatCols
143
+ { col1: warningLabels <> errorLabels
144
+ , col2: srcWarnings <> srcErrors
145
+ , col3: libWarnings <> libErrors
146
+ , col4: allWarnings <> allErrors
147
+ }
145
148
where
146
149
warnings = Array .sort (FO .keys stats.allWarnings)
147
150
errors = Array .sort (FO .keys stats.allErrors)
Original file line number Diff line number Diff line change @@ -4,10 +4,12 @@ import Prelude
4
4
5
5
import Test.Spago.Unit.CheckInjectivity as CheckInjectivity
6
6
import Test.Spago.Unit.FindFlags as FindFlags
7
+ import Test.Spago.Unit.Printer as Printer
7
8
import Test.Spec (Spec )
8
9
import Test.Spec as Spec
9
10
10
11
spec :: Spec Unit
11
12
spec = Spec .describe " unit" do
12
13
FindFlags .spec
13
14
CheckInjectivity .spec
15
+ Printer .spec
Original file line number Diff line number Diff line change
1
+ module Test.Spago.Unit.Printer where
2
+
3
+ import Prelude
4
+
5
+ import Data.String (joinWith )
6
+ import Dodo as Dodo
7
+ import Spago.Psa.Output (initialStats )
8
+ import Spago.Psa.Printer (renderVerboseStats )
9
+ import Test.Prelude (shouldEqual )
10
+ import Test.Spec (Spec )
11
+ import Test.Spec as Spec
12
+
13
+ spec :: Spec Unit
14
+ spec = do
15
+ Spec .describe " renderVerboseStats" do
16
+ Spec .it " renders regular stats with all zeroes when there are no errors or warnings" do
17
+ printDoc (renderVerboseStats initialStats) `shouldEqual`
18
+ joinWith " \n "
19
+ [ " Src Lib All"
20
+ , " Warnings 0 0 0"
21
+ , " Errors 0 0 0"
22
+ ]
23
+
24
+ where
25
+ printDoc = Dodo .print Dodo .plainText Dodo .twoSpaces
You can’t perform that action at this time.
0 commit comments