Skip to content

Commit 47c70f0

Browse files
authored
OPA v1.5.0, improved report formatting (#1569)
- OPA v1.5.0 - 10% faster linting! - tablewriter v1.0.7 - new API and somewhat prettier output - Go version bumped to 1.23.9 - Some other minor version bumps Performance difference `regal lint bundle`: ``` 968805333 ns/op 2970674744 B/op 56876788 allocs/op 906316730 ns/op 2762815940 B/op 50799464 allocs/op ``` The `compact` format now has a style better suited for the terminal: **Previously:** ```shell regal lint -f compact p.rego +------------+-------------------------------------------+ | Location | Description | +------------+-------------------------------------------+ | p.rego:1:9 | Directory structure should mirror package | | p.rego:1:1 | File should be formatted with `opa fmt` | | p.rego:3:5 | Prefer := over = for assignment | +------------+-------------------------------------------+ 1 file linted , 3 violations found. ``` **Now:** ```shell regal lint -f compact p.rego ┌────────────┬───────────────────────────────────────────┐ │ LOCATION │ DESCRIPTION │ ├────────────┼───────────────────────────────────────────┤ │ p.rego:1:9 │ Directory structure should mirror package │ │ p.rego:1:1 │ File should be formatted with `opa fmt` │ │ p.rego:3:5 │ Prefer := over = for assignment │ └────────────┴───────────────────────────────────────────┘ 1 file linted , 3 violations found. ``` The default `pretty` format looks the same, but uses spaces instead of tabs in some places. Tests that rely on the exact formatting of the output may need to be updated. Signed-off-by: Anders Eknert <anders@styra.com>
1 parent eee47fb commit 47c70f0

8 files changed

Lines changed: 137 additions & 117 deletions

File tree

.golangci.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ linters:
3131
deny:
3232
- pkg: gopkg.in/yaml.v2
3333
desc: use yaml.v3 only
34+
errcheck:
35+
exclude-functions:
36+
- (*github.com/olekukonko/tablewriter.Table).Append
37+
- (*github.com/olekukonko/tablewriter.Table).Render
3438
gocritic:
3539
disabled-checks:
3640
- hugeParam

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Regal
22

3-
[![Build Status](https://github.com/styrainc/regal/workflows/Build/badge.svg?branch=main)](https://github.com/styrainc/regal/actions)
4-
![OPA v1.4.2](https://openpolicyagent.org/badge/v1.4.2)
3+
[![Build Status](https://github.com/styrainc/regal/workflows/Build/badge.svg)](https://github.com/styrainc/regal/actions)
4+
![OPA v1.5.0](https://openpolicyagent.org/badge/v1.5.0)
55
[![codecov](https://codecov.io/github/StyraInc/regal/graph/badge.svg?token=EQK01YF3X3)](https://codecov.io/github/StyraInc/regal)
66
[![Downloads](https://img.shields.io/github/downloads/styrainc/regal/total.svg)](https://github.com/StyraInc/regal/releases)
77

go.mod

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module github.com/styrainc/regal
22

3-
go 1.23.8
3+
go 1.23.9
44

5-
toolchain go1.24.2
5+
toolchain go1.24.3
66

77
require (
8-
dario.cat/mergo v1.0.1
8+
dario.cat/mergo v1.0.2
99
github.com/arl/statsviz v0.6.0
1010
github.com/coreos/go-semver v0.3.1
1111
github.com/fatih/color v1.18.0
@@ -16,27 +16,27 @@ require (
1616
github.com/google/go-cmp v0.7.0
1717
github.com/google/go-dap v0.12.0
1818
github.com/jstemmer/go-junit-report/v2 v2.1.0
19-
github.com/olekukonko/tablewriter v0.0.5
20-
github.com/open-policy-agent/opa v1.4.2
19+
github.com/olekukonko/tablewriter v1.0.7
20+
github.com/open-policy-agent/opa v1.5.0
2121
github.com/owenrumney/go-sarif/v2 v2.3.3
2222
github.com/pdevine/go-asciisprite v0.1.6
2323
github.com/pkg/profile v1.7.0
24-
github.com/sourcegraph/jsonrpc2 v0.2.0
24+
github.com/sourcegraph/jsonrpc2 v0.2.1
2525
github.com/spf13/cobra v1.9.1
2626
github.com/spf13/pflag v1.0.6
27-
github.com/styrainc/roast v0.9.0
27+
github.com/styrainc/roast v0.10.0
2828
gopkg.in/yaml.v3 v3.0.1
2929
)
3030

3131
require (
32-
git.sr.ht/~charles/rq v0.0.13 // indirect
32+
git.sr.ht/~charles/rq v0.0.14 // indirect
3333
github.com/Knetic/govaluate v3.0.0+incompatible // indirect
3434
github.com/Microsoft/go-winio v0.6.2 // indirect
3535
github.com/ProtonMail/go-crypto v1.1.6 // indirect
3636
github.com/agext/levenshtein v1.2.3 // indirect
3737
github.com/agnivade/levenshtein v1.2.1 // indirect
38-
github.com/alecthomas/chroma/v2 v2.15.0 // indirect
39-
github.com/alecthomas/kong v1.7.0 // indirect
38+
github.com/alecthomas/chroma/v2 v2.17.0 // indirect
39+
github.com/alecthomas/kong v1.10.0 // indirect
4040
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
4141
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de // indirect
4242
github.com/bcicen/bfstree v1.0.0 // indirect
@@ -46,10 +46,10 @@ require (
4646
github.com/clbanning/mxj/v2 v2.7.0 // indirect
4747
github.com/cloudflare/circl v1.6.1 // indirect
4848
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
49-
github.com/dlclark/regexp2 v1.11.4 // indirect
49+
github.com/dlclark/regexp2 v1.11.5 // indirect
5050
github.com/emirpasic/gods v1.18.1 // indirect
5151
github.com/felixge/fgprof v0.9.5 // indirect
52-
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
52+
github.com/fxamacker/cbor/v2 v2.8.0 // indirect
5353
github.com/gdamore/encoding v1.0.0 // indirect
5454
github.com/gdamore/tcell v1.1.4 // indirect
5555
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
@@ -58,10 +58,11 @@ require (
5858
github.com/go-logr/logr v1.4.2 // indirect
5959
github.com/go-logr/stdr v1.2.2 // indirect
6060
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
61-
github.com/google/pprof v0.0.0-20250128161936-077ca0a936bf // indirect
61+
github.com/google/pprof v0.0.0-20250422154841-e1f9c1950416 // indirect
6262
github.com/google/uuid v1.6.0 // indirect
6363
github.com/gorilla/mux v1.8.1 // indirect
6464
github.com/gorilla/websocket v1.5.0 // indirect
65+
github.com/gowebpki/jcs v1.0.1 // indirect
6566
github.com/hashicorp/hcl/v2 v2.23.0 // indirect
6667
github.com/hjson/hjson-go v3.3.0+incompatible // indirect
6768
github.com/inconshreveable/mousetrap v1.1.0 // indirect
@@ -80,23 +81,26 @@ require (
8081
github.com/mozillazg/go-slugify v0.2.0 // indirect
8182
github.com/mozillazg/go-unidecode v0.2.0 // indirect
8283
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
84+
github.com/olekukonko/errors v0.0.0-20250405072817-4e6d85265da6 // indirect
85+
github.com/olekukonko/ll v0.0.8 // indirect
8386
github.com/pelletier/go-toml v1.9.5 // indirect
8487
github.com/philandstuff/dhall-golang/v6 v6.0.2 // indirect
8588
github.com/pjbgf/sha1cd v0.3.2 // indirect
8689
github.com/pkg/errors v0.9.1 // indirect
87-
github.com/prometheus/client_golang v1.21.1 // indirect
88-
github.com/prometheus/client_model v0.6.1 // indirect
89-
github.com/prometheus/common v0.62.0 // indirect
90-
github.com/prometheus/procfs v0.15.1 // indirect
91-
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
90+
github.com/prometheus/client_golang v1.22.0 // indirect
91+
github.com/prometheus/client_model v0.6.2 // indirect
92+
github.com/prometheus/common v0.63.0 // indirect
93+
github.com/prometheus/procfs v0.16.1 // indirect
94+
github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9 // indirect
9295
github.com/rivo/uniseg v0.4.7 // indirect
9396
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
9497
github.com/sirupsen/logrus v1.9.3 // indirect
9598
github.com/skeema/knownhosts v1.3.1 // indirect
9699
github.com/spkg/bom v1.0.1 // indirect
97100
github.com/subosito/gotenv v1.6.0 // indirect
98101
github.com/tchap/go-patricia/v2 v2.3.2 // indirect
99-
github.com/tmccombs/hcl2json v0.6.5 // indirect
102+
github.com/tmccombs/hcl2json v0.6.7 // indirect
103+
github.com/vektah/gqlparser/v2 v2.5.26 // indirect
100104
github.com/x448/float16 v0.8.4 // indirect
101105
github.com/xanzy/ssh-agent v0.3.3 // indirect
102106
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
@@ -109,12 +113,12 @@ require (
109113
go.opentelemetry.io/otel/sdk v1.35.0 // indirect
110114
go.opentelemetry.io/otel/trace v1.35.0 // indirect
111115
golang.org/x/crypto v0.37.0 // indirect
112-
golang.org/x/mod v0.22.0 // indirect
116+
golang.org/x/mod v0.24.0 // indirect
113117
golang.org/x/net v0.39.0 // indirect
114-
golang.org/x/sync v0.13.0 // indirect
115-
golang.org/x/sys v0.32.0 // indirect
118+
golang.org/x/sync v0.14.0 // indirect
119+
golang.org/x/sys v0.33.0 // indirect
116120
golang.org/x/text v0.24.0 // indirect
117-
golang.org/x/tools v0.29.0 // indirect
121+
golang.org/x/tools v0.32.0 // indirect
118122
google.golang.org/protobuf v1.36.6 // indirect
119123
gopkg.in/warnings.v0 v0.1.2 // indirect
120124
sigs.k8s.io/yaml v1.4.0 // indirect

0 commit comments

Comments
 (0)