Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Rego #2531

Open
pbnj opened this issue May 24, 2019 · 2 comments
Open

Support Rego #2531

pbnj opened this issue May 24, 2019 · 2 comments
Labels
new tool Support for new linters, fixers, etc.

Comments

@pbnj
Copy link
Contributor

pbnj commented May 24, 2019

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 a fmt command for formatting Rego source files

@w0rp w0rp added the new tool Support for new linters, fixers, etc. label Feb 22, 2020
pbnj added a commit to pbnj/ale that referenced this issue Dec 31, 2020
@redbmk
Copy link
Contributor

redbmk commented Jun 7, 2023

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

@redbmk
Copy link
Contributor

redbmk commented Jun 7, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new tool Support for new linters, fixers, etc.
Projects
None yet
3 participants