opa icon indicating copy to clipboard operation
opa copied to clipboard

Formatter rewrites quoted reference containing keyword to non-quoted one which fails to parse

Open anderseknert opened this issue 2 months ago • 1 comments

package p

import rego.v1

foo := data.foo.bar["contains"]("baz")

running opa fmt on this file rewrites the ref:

package p

import rego.v1

foo := data.foo.bar.contains("baz")

which doesn't parse, as contains is of course a keyword

(although, a keyword that is also a built-in function, and shouldn't be considered a keyword at this location, but that's another issue)

anderseknert avatar May 28 '24 14:05 anderseknert