Skip to content

Commit

Permalink
Add support for editing Regal in VS Code (#600)
Browse files Browse the repository at this point in the history
Options like `checkOnSave` would previously not work when hacking on
Regal, as a custom capabilities file would need to be provided. Using
the latest version of the OPA extension, this is now supported via
the `opa.env` option.

Signed-off-by: Anders Eknert <[email protected]>
  • Loading branch information
anderseknert authored Mar 14, 2024
1 parent b229e5f commit 2179066
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ dist/

/regal
/regal.exe

.vscode
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"opa.env": {
"OPA_CHECK_CAPABILITIES": "${workspacePath}/build/capabilities.json",
"OPA_EVAL_CAPABILITIES": "${workspacePath}/build/capabilities.json"
},
"opa.roots": [
"${workspaceFolder}/bundle"
],
"opa.strictMode": true
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Regal

[![Build Status](https://github.com/styrainc/regal/workflows/Build/badge.svg?branch=main)](https://github.com/styrainc/regal/actions)
![OPA v0.62.0](https://openpolicyagent.org/badge/v0.62.0)
![OPA v0.62.1](https://openpolicyagent.org/badge/v0.62.1)

Regal is a linter for [Rego](https://www.openpolicyagent.org/docs/latest/policy-language/), with the goal of making your
Rego magnificent!
Expand Down

0 comments on commit 2179066

Please sign in to comment.