Files
releases/v1
Sebastian Spaink d36655f5fb format: Don't group rules that aren't written on one line (#8981)
`opa fmt` isn't idempotent for rules it can't write on a single line:
the first pass runs the rule together with the one that follows, and
only a second pass inserts the missing blank line.

Given this policy:

```rego
package example

allow if { {"admin", "dev"} }
deny if input.blocked
```

`opa fmt` produces output that it doesn't consider formatted:

```rego
package example

allow if {
	{"admin", "dev"}
}deny if input.blocked
```

```console
$ opa fmt --fail example.rego; echo $?
2
```

Running it a second time inserts the blank line and settles:

```rego
package example

allow if {
	{"admin", "dev"}
}

deny if input.blocked
```

with this fix fmt goes to the second result immediately

Signed-off-by: Sebastian Spaink <sebastianspaink@gmail.com>
2026-08-10 17:08:45 +02:00
..
2026-07-24 10:15:07 +02:00