Skip to content

Conversation

@jh125486
Copy link
Contributor

Why the changes in this PR are needed?

My company uses the OPA tooling internally, and updating the tablewriter package resolves TLM.

What are the changes in this PR?

  • Upgrade to v1 tablewriter.
  • Updated test fixtures and various test fixes.
  • Packages bumped and vendored.
  • Added cases to fix staticcheck SA1019

Notes to assist PR review:

V1 tablewrite introduces a new syntax and also some differences in rendering, and I did my best to replicate the current outputs.

I worked with the tablewriter author to toggle some "features" for space merging, so that I could replicate the pretty output line by line.

I'm not sure why the max width of columns was being calculated in a few places... ideally we would let tablewriter itself do the work.

@netlify
Copy link

netlify bot commented Sep 25, 2025

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit 7a0eac8
🔍 Latest deploy log https://app.netlify.com/projects/openpolicyagent/deploys/68dbc3841b28ff00086ae511
😎 Deploy Preview https://deploy-preview-7937--openpolicyagent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jh125486 jh125486 force-pushed the update_tablewriter branch 3 times, most recently from f1e1df4 to 1aff7c5 Compare September 25, 2025 01:54
Copy link
Contributor

@srenatus srenatus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! That's quite an effort. I'll let @johanfylling and @sspaink have another look before merging, but I'm happy that this is resolved. 👏

@srenatus
Copy link
Contributor

Would you mind rebasing this? Github reports conflicts, probably due to go.sum/go.mod changes.

@anderseknert anderseknert linked an issue Sep 25, 2025 that may be closed by this pull request
@anderseknert
Copy link
Member

This is great. Thank you, Jacob! @jh125486 👍

Copy link
Contributor

@johanfylling johanfylling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for looking into this 😃. Since this wasn't on a perceived critical path, it would likely have taken some time before we got around to it. Much appreciated!

Changes LGTM 👍. Just some tests that don't report failures anymore and need amending.

t.SetAutoMergeCellsByColumnIndex([]int{0})
t = t.Options(tablewriter.WithConfig(tablewriter.NewConfigBuilder().
ForColumn(0).Build().Row().Formatting().WithMergeMode(tw.MergeVertical). // vertical merge column 0.
Build().Build().Build(), // build the table config.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go, go, go! (sorry, couldn't help it 😄)

- Updated test fixtures and various test fixes.

Signed-off-by: Jacob Hochstetler <[email protected]>
Signed-off-by: Jacob Hochstetler <[email protected]>
Signed-off-by: Jacob Hochstetler <[email protected]>
Signed-off-by: Jacob Hochstetler <[email protected]>
@jh125486
Copy link
Contributor Author

The out of sync branch was weird... when I updated my branch last night I think GH hadn't cached the latest :/

I rebased, bu then missed a commit on rebase, so it took me a bit to fix.

Should be good to go now.

@jh125486
Copy link
Contributor Author

@srenatus anything else I can do on this?

@srenatus srenatus merged commit 2cc948d into open-policy-agent:main Oct 1, 2025
31 checks passed
@srenatus
Copy link
Contributor

srenatus commented Oct 1, 2025

@jh125486 nothing left to do on this, except accept my gratitude 🎈 😉 Thanks for your contribution!

@jh125486 jh125486 deleted the update_tablewriter branch October 1, 2025 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bump github.com/olekukonko/tablewriter

4 participants