Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/psibi/rego-mode
Emacs major mode for OPA's rego language
https://github.com/psibi/rego-mode
major-mode opa open-policy-agent rego
Last synced: 2 days ago
JSON representation
Emacs major mode for OPA's rego language
- Host: GitHub
- URL: https://github.com/psibi/rego-mode
- Owner: psibi
- License: gpl-3.0
- Created: 2020-03-28T07:45:42.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-07-22T14:58:18.000Z (over 3 years ago)
- Last Synced: 2024-10-11T23:59:54.579Z (28 days ago)
- Topics: major-mode, opa, open-policy-agent, rego
- Language: Emacs Lisp
- Homepage:
- Size: 44.9 KB
- Stars: 29
- Watchers: 3
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
- awesome-opa - Emacs - Emacs Major mode for working with Rego (IDE and Editor Integrations / Datasource Integrations Blogs and Articles)
README
# rego-mode
[![MELPA](https://melpa.org/packages/rego-mode-badge.svg)](https://melpa.org/#/rego-mode)
![check](https://github.com/psibi/rego-mode/workflows/check/badge.svg?branch=master)Emacs Major mode for working
with [Rego](https://www.openpolicyagent.org/docs/latest/policy-language/) configuration
language.## Features
* Syntax highlighting (Using font lock)
* Basic indentation, commenting
* Automatic formatting on save (Configurable via variable). Uses `opa fmt` for it.
* REPL support. The function `rego-repl-show` will load a plain
REPL. You can also use `rego-repl-with-data` to pass file or
directory which will be loaded to the REPL.## Demo
![Rego mode in Emacs](https://user-images.githubusercontent.com/737477/77818443-43ce1100-70f8-11ea-8bee-913824f24769.gif "Rego mode in Emacs")
## Prerequisites
* Make sure that you install
[opa](https://github.com/open-policy-agent/opa) and it's available
in your system.## Usage
It's available via [MELPA](https://melpa.org/#/rego-mode) and the
following `use-package` configuration can be used:``` emacs-lisp
(use-package rego-mode
:ensure t
:custom
(rego-repl-executable "/home/sibi/bin/opa")
(rego-opa-command "/home/sibi/bin/opa"))
```You would have to modify the above elisp code to have appropriate
paths.## License
Copyright © 2020 Sibi Prabakaran
Distributed under GNU GPL, version 3.