Open pbnj opened 5 years ago
Looks like there's support for rego now with opa check
and opa fmt
. Although I'm seeing an issue where if if I run opa check .
there are no issues but checking an individual file shows issues (e.g. a variable defined in another file).
Seems like ALE would need to check a file in the context of surrounding files somehow?
e.g. instead of opa check % --format json
it could open check . --format json
and then only report errors that match that filename. or better than .
might be to somehow find the root
I made a quick fix to use .
, which is working for me. afaict ALE sets the cwd to that of the buffer before running the command.
I'm not super familiar with rego, so this may still not be ideal if rego supports referencing things defined in parent directories.
Name: Rego URL: https://www.openpolicyagent.org/docs/latest/how-do-i-write-policies/
Rego is a declarative language, inspired by Datalog, used in Open-Policy-Agent Kubernetes project.
The vim syntax is provided via vim-rego. The
opa
CLI itself provides afmt
command for formatting Rego source files