Open anderseknert opened 1 year ago
Happy to be a resource for this!
I think I have some work to do to expose rq as a Go library. I have created rq #4 to track this work. I have another personal project I also want this for, so this will probably be the next major update to rq.
Thanks @charlesdaniels! I'm not sure but we probably don't need rq integrated as a library in order to lint its files, we'll just need to be aware of that parsing quirk where the package can be implied. After that it's all AST nodes to Regal.
What would be good though is if the rq project exposed a capabilities file where all its built-in functions and their definitions were included. Some linter rules uses the built-in function definitions to determine violations, and these would also be useful if we want rq-specific linter rules further down the line.
Makes sense. Adding a capabilities file is now tracked by rq #8. I do still plan to make rq usable as a library, but good to know it is not a blocker for Regal.
Regal should be able to lint rq files "out of the box", meaning that if:
regal lint script.rq
, we should recognize it as Rego with rq additions.regal lint script
we should recognize it as Rego if the file contents looks like Rego.regal lint my_dir/
we should be able to recognize rq files pointed out in config.I've probably missed some things as I've still more to learn about rq. Note that the scope of this issue is intentionally limited to "support". Once that's in place we can consider rq-specific linter rules.
Related:
Tagging @charlesdaniels as a stakeholder :)