Skip to content

Commit b3e8ab5

Browse files
committed
docs: correct line length
Signed-off-by: Charlie Egan <[email protected]>
1 parent 7d97f96 commit b3e8ab5

File tree

1 file changed

+52
-39
lines changed

1 file changed

+52
-39
lines changed

README.md

+52-39
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ See the [adopters](/docs/adopters.md) file for more Regal users.
5555
### Download Regal
5656

5757
**MacOS and Linux**
58+
5859
```shell
5960
brew install styrainc/packages/regal
6061
```
@@ -68,40 +69,47 @@ for a list of package repositories which distribute Regal.
6869
Manual installation commands:
6970

7071
**MacOS (Apple Silicon)**
72+
7173
```shell
7274
curl -L -o regal "https://github.com/StyraInc/regal/releases/latest/download/regal_Darwin_arm64"
7375
```
7476

7577
**MacOS (x86_64)**
78+
7679
```shell
7780
curl -L -o regal "https://github.com/StyraInc/regal/releases/latest/download/regal_Darwin_x86_64"
7881
```
7982

8083
**Linux (x86_64)**
84+
8185
```shell
8286
curl -L -o regal "https://github.com/StyraInc/regal/releases/latest/download/regal_Linux_x86_64"
8387
chmod +x regal
8488
```
8589

8690
**Windows**
91+
8792
```shell
8893
curl.exe -L -o regal.exe "https://github.com/StyraInc/regal/releases/latest/download/regal_Windows_x86_64.exe"
8994
```
9095

9196
**Docker**
97+
9298
```shell
9399
docker pull ghcr.io/styrainc/regal:latest
94100
```
95101

96102
See all versions, and checksum files, at the Regal [releases](https://github.com/StyraInc/regal/releases/) page, and
97103
published Docker images at the [packages](https://github.com/StyraInc/regal/pkgs/container/regal) page.
104+
98105
</details>
99106

100107
### Try it out!
101108

102109
First, author some Rego!
103110

104111
**policy/authz.rego**
112+
105113
```rego
106114
package authz
107115
@@ -122,8 +130,10 @@ Next, run `regal lint` pointed at one or more files or directories to have them
122130
```shell
123131
regal lint policy/
124132
```
133+
125134
<!-- markdownlint-capture -->
126135
<!-- markdownlint-disable MD010 -->
136+
127137
```text
128138
Rule: non-raw-regex-pattern
129139
Description: Use raw strings for regex patterns
@@ -148,6 +158,7 @@ Documentation: https://docs.styra.com/regal/rules/style/prefer-snake-case
148158
149159
1 file linted. 3 violations found.
150160
```
161+
151162
<!-- markdownlint-restore -->
152163
<br />
153164

@@ -198,8 +209,8 @@ The following rules are currently available:
198209

199210
<!-- RULES_TABLE_START -->
200211

201-
| Category | Title | Description |
202-
|-------------|---------------------------------------------------------------------------------------------------------|-----------------------------------------------------------|
212+
| Category | Title | Description |
213+
| ----------- | ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
203214
| bugs | [annotation-without-metadata](https://docs.styra.com/regal/rules/bugs/annotation-without-metadata) | Annotation without metadata |
204215
| bugs | [argument-always-wildcard](https://docs.styra.com/regal/rules/bugs/argument-always-wildcard) | Argument is always a wildcard |
205216
| bugs | [constant-condition](https://docs.styra.com/regal/rules/bugs/constant-condition) | Constant condition |
@@ -298,7 +309,7 @@ By default, all rules except for those in the `custom` category are currently **
298309

299310
Most Regal rules will use data only from a single file at a time, with no consideration for other files. A few rules
300311
however require data from multiple files, and will therefore collect, or aggregate, data from all files provided for
301-
linting. These rules are called *aggregate rules*, and will only be run when there is more than one file to lint, such
312+
linting. These rules are called _aggregate rules_, and will only be run when there is more than one file to lint, such
302313
as when linting a directory or a whole policy repository. One example of such a rule is the `prefer-package-imports`
303314
rule, which will aggregate package names and imports from all provided policies in order to determine if any imports
304315
are pointing to rules or functions rather than packages. You normally won't need to care about this distinction other
@@ -327,14 +338,15 @@ A custom configuration file may be used to override the [default configuration](
327338
options provided by Regal. The most common use case for this is to change the severity level of a rule. These three
328339
levels are available:
329340

330-
- `ignore` — disable the rule entirely
341+
- `ignore` — disable the rule entirely
331342
- `warning` — report the violation without changing the exit code of the lint command
332-
- `error` — report the violation and have the lint command exit with a non-zero exit code (default)
343+
- `error` — report the violation and have the lint command exit with a non-zero exit code (default)
333344

334345
Additionally, some rules may have configuration options of their own. See the documentation page for a rule to learn
335346
more about it.
336347

337348
**.regal/config.yaml**
349+
338350
```yaml
339351
rules:
340352
style:
@@ -354,16 +366,16 @@ rules:
354366
# in this example, test files are ignored
355367
ignore:
356368
files:
357-
- "*_test.rego"
369+
- "*_test.rego"
358370
custom:
359371
# custom rule configuration
360372
naming-convention:
361373
level: error
362374
conventions:
363-
# ensure all package names start with "acmecorp" or "system"
364-
- pattern: '^acmecorp\.[a-z_\.]+$|^system\.[a-z_\.]+$'
365-
targets:
366-
- package
375+
# ensure all package names start with "acmecorp" or "system"
376+
- pattern: '^acmecorp\.[a-z_\.]+$|^system\.[a-z_\.]+$'
377+
targets:
378+
- package
367379

368380
capabilities:
369381
from:
@@ -379,14 +391,14 @@ capabilities:
379391
ignore:
380392
# files can be excluded from all lint rules according to glob-patterns
381393
files:
382-
- file1.rego
383-
- "*_tmp.rego"
394+
- file1.rego
395+
- "*_tmp.rego"
384396

385397
project:
386398
roots:
387-
# declares the 'main' and 'lib/jwt' directories as project roots
388-
- main
389-
- lib/jwt
399+
# declares the 'main' and 'lib/jwt' directories as project roots
400+
- main
401+
- lib/jwt
390402
```
391403
392404
Regal will automatically search for a configuration file (`.regal/config.yaml`) in the current directory, and if not
@@ -477,10 +489,10 @@ rules:
477489
level: error
478490
ignore:
479491
files:
480-
# ignore line length in test files to accommodate messy test data
481-
- "*_test.rego"
482-
# specific file used only for testing
483-
- "scratch.rego"
492+
# ignore line length in test files to accommodate messy test data
493+
- "*_test.rego"
494+
# specific file used only for testing
495+
- "scratch.rego"
484496
```
485497

486498
### Ignoring Files Globally
@@ -495,8 +507,8 @@ If you want to ignore certain files for all rules, you can use the global ignore
495507
```yaml
496508
ignore:
497509
files:
498-
- file1.rego
499-
- "*_tmp.rego"
510+
- file1.rego
511+
- "*_tmp.rego"
500512
```
501513

502514
### Inline Ignore Directives
@@ -554,19 +566,19 @@ To provide an example, consider the
554566
that a file declaring a `package` path like `policy.permissions.users` should also be located in a directory structure
555567
that mirrors that package, i.e. `policy/permissions/users`. When a violation against this rule is reported, the
556568
`regal fix` command, or its equivalent [Code Action](#regal-language-server) in editors, may when invoked remediate the
557-
issue by moving the file to the correct location. But where should the `policy/permissions/users` directory *itself*
569+
issue by moving the file to the correct location. But where should the `policy/permissions/users` directory _itself_
558570
reside?
559571

560572
Normally, the answer to that question would be the **project**, or **workspace** root. But if the file was found
561-
in a subdirectory containing a **bundle**, the directory naturally belongs under that *bundle's root* instead. The
573+
in a subdirectory containing a **bundle**, the directory naturally belongs under that _bundle's root_ instead. The
562574
`roots` configuration option under the top-level `project` object allows you to tell Regal where these roots are,
563575
and have features like the `directory-package-mismatch` fixer work as you'd expect.
564576

565577
```yaml
566578
project:
567579
roots:
568-
- bundle1
569-
- bundle2
580+
- bundle1
581+
- bundle2
570582
```
571583

572584
The configuration file is not the only way Regal may determine project roots. Other ways include:
@@ -620,18 +632,18 @@ capabilities:
620632
version: v0.58.0
621633
minus:
622634
builtins:
623-
# exclude rules that depend on the http.send built-in function
624-
- name: http.send
635+
# exclude rules that depend on the http.send built-in function
636+
- name: http.send
625637
plus:
626638
builtins:
627-
# make Regal aware of a custom "ldap.query" function
628-
- name: ldap.query
629-
type: function
630-
decl:
631-
args:
632-
- type: string
633-
result:
634-
type: object
639+
# make Regal aware of a custom "ldap.query" function
640+
- name: ldap.query
641+
type: function
642+
decl:
643+
args:
644+
- type: string
645+
result:
646+
type: object
635647
```
636648

637649
### Loading Capabilities from URLs
@@ -650,9 +662,9 @@ capabilities:
650662

651663
Regal includes capabilities files for the following engines:
652664

653-
| Engine | Website | Description |
654-
|--------|---------|-------------|
655-
| `opa` | [OPA website](https://www.openpolicyagent.org/) | Open Policy Agent |
665+
| Engine | Website | Description |
666+
| ------ | --------------------------------------------------------------- | -------------------- |
667+
| `opa` | [OPA website](https://www.openpolicyagent.org/) | Open Policy Agent |
656668
| `eopa` | [Enterprise OPA website](https://www.styra.com/enterprise-opa/) | Styra Enterprise OPA |
657669

658670
## Exit Codes
@@ -775,7 +787,8 @@ See the [Editor Support](/docs/editor-support.md) page for information about Reg
775787
by Charlie Egan ([@charlieegan3](https://github.com/charlieegan3))
776788
- [Linting Rego with... Rego!](https://www.styra.com/blog/linting-rego-with-rego/) by Anders Eknert ([@anderseknert](https://github.com/anderseknert))
777789
- [Regal: Rego(OPA)用リンタの導入手順](https://zenn.dev/erueru_tech/articles/6cfb886d92858a) by Jun Fujita ([@erueru-tech](https://github.com/erueru-tech))
778-
- [Regal を使って Rego を Lint する](https://tech.dentsusoken.com/entry/2024/12/05/Regal_%E3%82%92%E4%BD%BF%E3%81%A3%E3%81%A6_Rego_%E3%82%92_Lint_%E3%81%99%E3%82%8B) by Shibata Takao ([@shibata.takao](https://shodo.ink/@shibata.takao/))
790+
- [Regal を使って Rego を Lint する](https://tech.dentsusoken.com/entry/2024/12/05/Regal_%E3%82%92%E4%BD%BF%E3%81%A3%E3%81%A6_Rego_%E3%82%92_Lint_%E3%81%99%E3%82%8B)
791+
by Shibata Takao ([@shibata.takao](https://shodo.ink/@shibata.takao/))
779792

780793
## Status
781794

0 commit comments

Comments
 (0)