Skip to content

Commit

Permalink
docs: add note about roots in directory-package-mismatch rule (#1303)
Browse files Browse the repository at this point in the history
Fixes #1300

Signed-off-by: Charlie Egan <charlie@styra.com>
  • Loading branch information
charlieegan3 authored Dec 17, 2024
1 parent 00e5341 commit 8d0d888
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion docs/rules/idiomatic/directory-package-mismatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,17 @@ While directory structure doesn't matter to OPA when parsing _policies_, directo
to the bundle root. Having policies structured in the same manner provides a uniform experience, and makes it
easier to understand where both policies and data come from.

### Editor Support
### `regal fix` & Editor Support

Regal's [`fix` command](https://docs.styra.com/regal/fixing) can automatically
rename files in a project to ensure compliance with this rule. This is
particularly useful when refactoring a project with many files.

:::info
Note that files will be renamed relative to their nearest root, see the
[documentation on roots](https://docs.styra.com/regal#project-roots) when using
this rule with policy roots different from the project root.
:::

Editors integrating Regal's [language server](https://docs.styra.com/regal/language-server) will automatically display
suggestions for idiomatic package paths based on the directory structure in which a policy resides. The image below
Expand Down

0 comments on commit 8d0d888

Please # to comment.