From 21790663aeda3fa2f584da921b4712281c1b4852 Mon Sep 17 00:00:00 2001 From: Anders Eknert Date: Thu, 14 Mar 2024 12:21:34 +0100 Subject: [PATCH] Add support for editing Regal in VS Code (#600) 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 --- .gitignore | 2 -- .vscode/settings.json | 10 ++++++++++ README.md | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index 9212bd59..d257c058 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,3 @@ dist/ /regal /regal.exe - -.vscode \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..0c934b11 --- /dev/null +++ b/.vscode/settings.json @@ -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 +} diff --git a/README.md b/README.md index da083042..26f7aecc 100644 --- a/README.md +++ b/README.md @@ -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!