Skip to content

Commit 13e1617

Browse files
committed
deps: Upgrade github.com/olekukonko/tablewriter v0.0.5 => v1.0.7
1 parent 463e440 commit 13e1617

File tree

4 files changed

+37
-30
lines changed

4 files changed

+37
-30
lines changed

‎go.mod

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ require (
5555
github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c
5656
github.com/muesli/smartcrop v0.3.0
5757
github.com/niklasfasching/go-org v1.7.0
58-
github.com/olekukonko/tablewriter v0.0.5
58+
github.com/olekukonko/tablewriter v1.0.7
5959
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58
6060
github.com/pelletier/go-toml/v2 v2.2.4
6161
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
@@ -141,13 +141,16 @@ require (
141141
github.com/kylelemons/godebug v1.1.0 // indirect
142142
github.com/mailru/easyjson v0.7.7 // indirect
143143
github.com/mattn/go-colorable v0.1.13 // indirect
144-
github.com/mattn/go-runewidth v0.0.9 // indirect
144+
github.com/mattn/go-runewidth v0.0.16 // indirect
145145
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
146146
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
147147
github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 // indirect
148148
github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 // indirect
149+
github.com/olekukonko/errors v0.0.0-20250405072817-4e6d85265da6 // indirect
150+
github.com/olekukonko/ll v0.0.8 // indirect
149151
github.com/perimeterx/marshmallow v1.1.5 // indirect
150152
github.com/pkg/errors v0.9.1 // indirect
153+
github.com/rivo/uniseg v0.2.0 // indirect
151154
github.com/russross/blackfriday/v2 v2.1.0 // indirect
152155
go.opencensus.io v0.24.0 // indirect
153156
go.opentelemetry.io/auto/sdk v1.1.0 // indirect

‎go.sum

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE
378378
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
379379
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
380380
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
381+
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
382+
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
381383
github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE=
382384
github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
383385
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
@@ -394,8 +396,14 @@ github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 h1:G7ERwszslrBzRxj//J
394396
github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037/go.mod h1:2bpvgLBZEtENV5scfDFEtB/5+1M4hkQhDQrccEJ/qGw=
395397
github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 h1:bQx3WeLcUWy+RletIKwUIt4x3t8n2SxavmoclizMb8c=
396398
github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90/go.mod h1:y5+oSEHCPT/DGrS++Wc/479ERge0zTFxaF8PbGKcg2o=
399+
github.com/olekukonko/errors v0.0.0-20250405072817-4e6d85265da6 h1:r3FaAI0NZK3hSmtTDrBVREhKULp8oUeqLT5Eyl2mSPo=
400+
github.com/olekukonko/errors v0.0.0-20250405072817-4e6d85265da6/go.mod h1:ppzxA5jBKcO1vIpCXQ9ZqgDh8iwODz6OXIGKU8r5m4Y=
401+
github.com/olekukonko/ll v0.0.8 h1:sbGZ1Fx4QxJXEqL/6IG8GEFnYojUSQ45dJVwN2FH2fc=
402+
github.com/olekukonko/ll v0.0.8/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
397403
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
398404
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
405+
github.com/olekukonko/tablewriter v1.0.7 h1:HCC2e3MM+2g72M81ZcJU11uciw6z/p82aEnm4/ySDGw=
406+
github.com/olekukonko/tablewriter v1.0.7/go.mod h1:H428M+HzoUXC6JU2Abj9IT9ooRmdq9CxuDmKMtrOCMs=
399407
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0=
400408
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y=
401409
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
@@ -414,6 +422,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
414422
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
415423
github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
416424
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
425+
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
426+
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
417427
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
418428
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
419429
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=

‎helpers/processing_stats.go

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import (
1919
"sync/atomic"
2020

2121
"github.com/olekukonko/tablewriter"
22+
"github.com/olekukonko/tablewriter/renderer"
23+
"github.com/olekukonko/tablewriter/tw"
2224
)
2325

2426
// ProcessingStats represents statistics about a site build.
@@ -66,23 +68,6 @@ func (s *ProcessingStats) Add(counter *uint64, amount int) {
6668
atomic.AddUint64(counter, uint64(amount))
6769
}
6870

69-
// Table writes a table-formatted representation of the stats in a
70-
// ProcessingStats instance to w.
71-
func (s *ProcessingStats) Table(w io.Writer) {
72-
titleVals := s.toVals()
73-
data := make([][]string, len(titleVals))
74-
for i, tv := range titleVals {
75-
data[i] = []string{tv.name, strconv.Itoa(int(tv.val))}
76-
}
77-
78-
table := tablewriter.NewWriter(w)
79-
80-
table.AppendBulk(data)
81-
table.SetHeader([]string{"", s.Name})
82-
table.SetBorder(false)
83-
table.Render()
84-
}
85-
8671
// ProcessingStatsTable writes a table-formatted representation of stats to w.
8772
func ProcessingStatsTable(w io.Writer, stats ...*ProcessingStats) {
8873
names := make([]string, len(stats)+1)
@@ -106,13 +91,26 @@ func ProcessingStatsTable(w io.Writer, stats ...*ProcessingStats) {
10691
data[j] = append(data[j], strconv.Itoa(int(tv.val)))
10792
}
10893
}
109-
11094
}
11195

112-
table := tablewriter.NewWriter(w)
113-
114-
table.AppendBulk(data)
115-
table.SetHeader(names)
116-
table.SetBorder(false)
96+
table := tablewriter.NewTable(
97+
w,
98+
tablewriter.WithRenderer(renderer.NewBlueprint(tw.Rendition{
99+
Borders: tw.BorderNone,
100+
Symbols: tw.NewSymbols(tw.StyleLight),
101+
Settings: tw.Settings{
102+
Separators: tw.Separators{BetweenRows: tw.Off},
103+
Lines: tw.Lines{ShowFooterLine: tw.On},
104+
},
105+
})),
106+
tablewriter.WithConfig(
107+
tablewriter.Config{
108+
MaxWidth: 70,
109+
Row: tw.CellConfig{Alignment: tw.CellAlignment{Global: tw.AlignRight, PerColumn: []tw.Align{tw.AlignLeft}}},
110+
}),
111+
)
112+
113+
table.Bulk(data)
114+
table.Header(names)
117115
table.Render()
118116
}

‎hugolib/site_stats_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ package hugolib
1616
import (
1717
"bytes"
1818
"fmt"
19-
"io"
2019
"testing"
2120

2221
"github.com/gohugoio/hugo/helpers"
@@ -89,14 +88,11 @@ aliases: [/Ali%d]
8988
h.Sites[1].PathSpec.ProcessingStats,
9089
}
9190

92-
stats[0].Table(io.Discard)
93-
stats[1].Table(io.Discard)
94-
9591
var buff bytes.Buffer
9692

9793
helpers.ProcessingStatsTable(&buff, stats...)
9894

99-
c.Assert(buff.String(), qt.Contains, "Pages | 21 | 7")
95+
c.Assert(buff.String(), qt.Contains, "Pages 21 7")
10096
}
10197

10298
func TestSiteLastmod(t *testing.T) {

0 commit comments

Comments
 (0)