Summary: File should be formatted with
Inconsistent style across policy files and repositories.
opa fmt tool ensures consistent formatting across teams and projects. Unified formatting is a big win, and saves a
lot of time in code reviews arguing over details around style.
A good idea could be to run
opa fmt --write on save, which can be configured in most editors.
opa fmt uses tabs for indentation. By default, GitHub uses 8 spaces to display tabs, which is arguably a bit
much. You can change this preference for your account in
github.com/settings/appearance, or provide an
file in your policy repository, which will be used by GitHub (and other tools) to properly display your Rego files:
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = tab
indent_size = 4
This linter rule provides the following configuration options:
# one of "error", "warning", "ignore"
- OPA Docs CLI Reference
If you think you've found a problem with this rule or its documentation, would like to suggest improvements, new rules,
or just talk about Regal in general, please join us in the
#regal channel in the Styra Community