Skip to content

Commit 04a5e65

Browse files
committed
🧹 Bump tablewriter to latest
This unblocks our automatic deps updates: #5971 Signed-off-by: Christian Zunker <christian@mondoo.com>
1 parent e27cc63 commit 04a5e65

31 files changed

Lines changed: 308 additions & 265 deletions

File tree

go.mod

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ require (
7272
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6
7373
github.com/muesli/reflow v0.3.0
7474
github.com/muesli/termenv v0.16.0
75-
// pin v0.0.5
76-
github.com/olekukonko/tablewriter v0.0.5
75+
github.com/olekukonko/tablewriter v1.1.0
7776
github.com/opencontainers/image-spec v1.1.1
7877
github.com/package-url/packageurl-go v0.1.3
7978
github.com/pierrec/lz4/v4 v4.1.22
@@ -321,6 +320,8 @@ require (
321320
github.com/mitchellh/mapstructure v1.5.0 // indirect
322321
github.com/moby/sys/mountinfo v0.7.2 // indirect
323322
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
323+
github.com/olekukonko/errors v1.1.0 // indirect
324+
github.com/olekukonko/ll v0.0.9 // indirect
324325
github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect
325326
github.com/sasha-s/go-deadlock v0.3.5 // indirect
326327
github.com/smarty/assertions v1.15.1 // indirect

go.sum

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,8 +737,12 @@ github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJm
737737
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
738738
github.com/oklog/run v1.2.0 h1:O8x3yXwah4A73hJdlrwo/2X6J62gE5qTMusH0dvz60E=
739739
github.com/oklog/run v1.2.0/go.mod h1:mgDbKRSwPhJfesJ4PntqFUbKQRZ50NgmZTSPlFA0YFk=
740-
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
741-
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
740+
github.com/olekukonko/errors v1.1.0 h1:RNuGIh15QdDenh+hNvKrJkmxxjV4hcS50Db478Ou5sM=
741+
github.com/olekukonko/errors v1.1.0/go.mod h1:ppzxA5jBKcO1vIpCXQ9ZqgDh8iwODz6OXIGKU8r5m4Y=
742+
github.com/olekukonko/ll v0.0.9 h1:Y+1YqDfVkqMWuEQMclsF9HUR5+a82+dxJuL1HHSRpxI=
743+
github.com/olekukonko/ll v0.0.9/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
744+
github.com/olekukonko/tablewriter v1.1.0 h1:N0LHrshF4T39KvI96fn6GT8HEjXRXYNDrDjKFDB7RIY=
745+
github.com/olekukonko/tablewriter v1.1.0/go.mod h1:5c+EBPeSqvXnLLgkm9isDdzR3wjfBkHR9Nhfp3NWrzo=
742746
github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4=
743747
github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
744748
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=

providers-sdk/v1/lr/cli/cmd/markdown.go

Lines changed: 66 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import (
1515
"text/template"
1616

1717
"github.com/olekukonko/tablewriter"
18+
"github.com/olekukonko/tablewriter/renderer"
19+
"github.com/olekukonko/tablewriter/tw"
1820
"github.com/rs/zerolog/log"
1921
"github.com/spf13/cobra"
2022
"go.mondoo.com/cnquery/v12/providers-sdk/v1/lr"
@@ -181,15 +183,38 @@ func (l *lrSchemaRenderer) renderToc(packName string, description string, resour
181183
rows = append(rows, []string{"[" + resource.ID + "](" + mdRef(resource.ID) + ")", strings.Join(sanitizeComments([]string{schema.Resources[resource.ID].Title}), " ")})
182184
}
183185

184-
table := tablewriter.NewWriter(builder)
185-
table.SetHeader([]string{"ID", "Description"})
186-
table.SetHeaderAlignment(tablewriter.ALIGN_LEFT)
187-
table.SetAlignment(tablewriter.ALIGN_LEFT)
188-
table.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false})
189-
table.SetCenterSeparator("|")
190-
table.SetAutoWrapText(false)
191-
table.AppendBulk(rows)
192-
table.Render()
186+
table := tablewriter.NewTable(builder,
187+
tablewriter.WithRenderer(renderer.NewBlueprint(tw.Rendition{
188+
Borders: tw.Border{Left: tw.On, Top: tw.Off, Right: tw.On, Bottom: tw.Off},
189+
Symbols: tw.NewSymbolCustom("cnquery").
190+
WithCenter("|").
191+
WithMidLeft("|").
192+
WithMidRight("|"),
193+
})),
194+
tablewriter.WithConfig(tablewriter.Config{
195+
Header: tw.CellConfig{
196+
Alignment: tw.CellAlignment{Global: tw.AlignLeft}, // Left-align rows
197+
},
198+
Row: tw.CellConfig{
199+
Alignment: tw.CellAlignment{Global: tw.AlignLeft}, // Left-align rows
200+
Formatting: tw.CellFormatting{
201+
AutoWrap: tw.WrapNone,
202+
},
203+
},
204+
Footer: tw.CellConfig{
205+
Alignment: tw.CellAlignment{Global: tw.AlignRight},
206+
},
207+
}),
208+
)
209+
table.Header([]string{"ID", "Description"})
210+
err = table.Bulk(rows)
211+
if err != nil {
212+
panic(err)
213+
}
214+
err = table.Render()
215+
if err != nil {
216+
panic(err)
217+
}
193218
builder.WriteString("\n")
194219

195220
return builder.String()
@@ -294,15 +319,38 @@ func (l *lrSchemaRenderer) renderResourcePage(resource *lr.Resource, schema *res
294319
})
295320
}
296321

297-
table := tablewriter.NewWriter(builder)
298-
table.SetHeader([]string{"ID", "Type", "Description"})
299-
table.SetHeaderAlignment(tablewriter.ALIGN_LEFT)
300-
table.SetAlignment(tablewriter.ALIGN_LEFT)
301-
table.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false})
302-
table.SetCenterSeparator("|")
303-
table.SetAutoWrapText(false)
304-
table.AppendBulk(rows)
305-
table.Render()
322+
table := tablewriter.NewTable(builder,
323+
tablewriter.WithRenderer(renderer.NewBlueprint(tw.Rendition{
324+
Borders: tw.Border{Left: tw.On, Top: tw.Off, Right: tw.On, Bottom: tw.Off},
325+
Symbols: tw.NewSymbolCustom("cnquery").
326+
WithCenter("|").
327+
WithMidLeft("|").
328+
WithMidRight("|"),
329+
})),
330+
tablewriter.WithConfig(tablewriter.Config{
331+
Header: tw.CellConfig{
332+
Alignment: tw.CellAlignment{Global: tw.AlignLeft}, // Left-align rows
333+
},
334+
Row: tw.CellConfig{
335+
Alignment: tw.CellAlignment{Global: tw.AlignLeft}, // Left-align rows
336+
Formatting: tw.CellFormatting{
337+
AutoWrap: tw.WrapNone,
338+
},
339+
},
340+
Footer: tw.CellConfig{
341+
Alignment: tw.CellAlignment{Global: tw.AlignRight},
342+
},
343+
}),
344+
)
345+
table.Header([]string{"ID", "Type", "Description"})
346+
err := table.Bulk(rows)
347+
if err != nil {
348+
panic(err)
349+
}
350+
err = table.Render()
351+
if err != nil {
352+
panic(err)
353+
}
306354
builder.WriteString("\n")
307355
}
308356

providers/atlassian/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ require (
6767
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
6868
github.com/fatih/color v1.18.0 // indirect
6969
github.com/felixge/httpsnoop v1.0.4 // indirect
70-
github.com/getsentry/sentry-go v0.35.2 // indirect
70+
github.com/getsentry/sentry-go v0.35.3 // indirect
7171
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
7272
github.com/go-git/go-billy/v5 v5.6.2 // indirect
7373
github.com/go-git/go-git/v5 v5.16.2 // indirect
@@ -156,7 +156,7 @@ require (
156156
google.golang.org/api v0.248.0 // indirect
157157
google.golang.org/genproto v0.0.0-20250826171959-ef028d996bc1 // indirect
158158
google.golang.org/genproto/googleapis/api v0.0.0-20250826171959-ef028d996bc1 // indirect
159-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250908214217-97024824d090 // indirect
159+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250922171735-9219d122eba9 // indirect
160160
google.golang.org/grpc v1.75.1 // indirect
161161
google.golang.org/protobuf v1.36.9 // indirect
162162
gopkg.in/warnings.v0 v0.1.2 // indirect

providers/atlassian/go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
131131
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
132132
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
133133
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
134-
github.com/getsentry/sentry-go v0.35.2 h1:jKuujpRwa8FFRYMIwwZpu83Xh0voll9bmvyc6310WBM=
135-
github.com/getsentry/sentry-go v0.35.2/go.mod h1:mdL49ixwT2yi57k5eh7mpnDyPybixPzlzEJFu0Z76QA=
134+
github.com/getsentry/sentry-go v0.35.3 h1:u5IJaEqZyPdWqe/hKlBKBBnMTSxB/HenCqF3QLabeds=
135+
github.com/getsentry/sentry-go v0.35.3/go.mod h1:mdL49ixwT2yi57k5eh7mpnDyPybixPzlzEJFu0Z76QA=
136136
github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c=
137137
github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU=
138138
github.com/go-errors/errors v1.5.1 h1:ZwEMSLRCapFLflTpT7NKaAc7ukJ8ZPEjzlxt8rPN8bk=
@@ -462,8 +462,8 @@ google.golang.org/genproto v0.0.0-20250826171959-ef028d996bc1 h1:Nm5SEGIguOIBDXs
462462
google.golang.org/genproto v0.0.0-20250826171959-ef028d996bc1/go.mod h1:Jz9LrroM7Mcm+a0QrLh4UpZ1B/WhjIbqwEcUf4y08nQ=
463463
google.golang.org/genproto/googleapis/api v0.0.0-20250826171959-ef028d996bc1 h1:APHvLLYBhtZvsbnpkfknDZ7NyH4z5+ub/I0u8L3Oz6g=
464464
google.golang.org/genproto/googleapis/api v0.0.0-20250826171959-ef028d996bc1/go.mod h1:xUjFWUnWDpZ/C0Gu0qloASKFb6f8/QXiiXhSPFsD668=
465-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250908214217-97024824d090 h1:/OQuEa4YWtDt7uQWHd3q3sUMb+QOLQUg1xa8CEsRv5w=
466-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250908214217-97024824d090/go.mod h1:GmFNa4BdJZ2a8G+wCe9Bg3wwThLrJun751XstdJt5Og=
465+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250922171735-9219d122eba9 h1:V1jCN2HBa8sySkR5vLcCSqJSTMv093Rw9EJefhQGP7M=
466+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250922171735-9219d122eba9/go.mod h1:HSkG/KdJWusxU1F6CNrwNDjBMgisKxGnc5dAZfT0mjQ=
467467
google.golang.org/grpc v1.75.1 h1:/ODCNEuf9VghjgO3rqLcfg8fiOP0nSluljWFlDxELLI=
468468
google.golang.org/grpc v1.75.1/go.mod h1:JtPAzKiq4v1xcAB2hydNlWI2RnF85XXcV0mhKXr2ecQ=
469469
google.golang.org/protobuf v1.36.9 h1:w2gp2mA27hUeUzj9Ex9FBjsBm40zfaDtEWow293U7Iw=

providers/aws/go.mod

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ go 1.24.0
77
toolchain go1.24.2
88

99
require (
10-
github.com/aws/aws-sdk-go-v2 v1.39.0
10+
github.com/aws/aws-sdk-go-v2 v1.39.2
1111
github.com/aws/aws-sdk-go-v2/config v1.31.8
1212
github.com/aws/aws-sdk-go-v2/credentials v1.18.12
1313
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.7
@@ -104,18 +104,18 @@ require (
104104
github.com/agext/levenshtein v1.2.3 // indirect
105105
github.com/anchore/go-struct-converter v0.0.0-20230627203149-c72ef8859ca9 // indirect
106106
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.1 // indirect
107-
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.7 // indirect
108-
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.7 // indirect
107+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.9 // indirect
108+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.9 // indirect
109109
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
110-
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.7 // indirect
110+
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.9 // indirect
111111
github.com/aws/aws-sdk-go-v2/service/ec2instanceconnect v1.32.3 // indirect
112112
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1 // indirect
113-
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.7 // indirect
114-
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.7 // indirect
115-
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.7 // indirect
116-
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.7 // indirect
117-
github.com/aws/aws-sdk-go-v2/service/sso v1.29.3 // indirect
118-
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.34.4 // indirect
113+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.9 // indirect
114+
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.9 // indirect
115+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.9 // indirect
116+
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.9 // indirect
117+
github.com/aws/aws-sdk-go-v2/service/sso v1.29.5 // indirect
118+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.1 // indirect
119119
github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.10.1 // indirect
120120
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
121121
github.com/beorn7/perks v1.0.1 // indirect
@@ -151,7 +151,7 @@ require (
151151
github.com/fatih/color v1.18.0 // indirect
152152
github.com/felixge/httpsnoop v1.0.4 // indirect
153153
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
154-
github.com/getsentry/sentry-go v0.35.2 // indirect
154+
github.com/getsentry/sentry-go v0.35.3 // indirect
155155
github.com/glebarez/go-sqlite v1.22.0 // indirect
156156
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
157157
github.com/go-git/go-billy/v5 v5.6.2 // indirect
@@ -219,7 +219,7 @@ require (
219219
github.com/oklog/run v1.2.0 // indirect
220220
github.com/olekukonko/errors v1.1.0 // indirect
221221
github.com/olekukonko/ll v0.0.9 // indirect
222-
github.com/olekukonko/tablewriter v1.0.9 // indirect
222+
github.com/olekukonko/tablewriter v1.1.0 // indirect
223223
github.com/opencontainers/go-digest v1.0.0 // indirect
224224
github.com/opencontainers/image-spec v1.1.1 // indirect
225225
github.com/package-url/packageurl-go v0.1.3 // indirect

0 commit comments

Comments
 (0)