Skip to content

OPA v1.5.0, improved report formatting#1569

Merged
anderseknert merged 1 commit intomainfrom
bumpy-bump
May 30, 2025
Merged

OPA v1.5.0, improved report formatting#1569
anderseknert merged 1 commit intomainfrom
bumpy-bump

Conversation

@anderseknert
Copy link
Copy Markdown
Member

  • 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:

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:

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.

- 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>
@anderseknert anderseknert merged commit 47c70f0 into main May 30, 2025
5 checks passed
@anderseknert anderseknert deleted the bumpy-bump branch May 30, 2025 09:05
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.

2 participants