Skip to content

Commit 244459c

Browse files
authored
docs: Remove some old references (#1689)
Signed-off-by: Anders Eknert <anders@eknert.com>
1 parent 1f1044f commit 244459c

7 files changed

Lines changed: 40 additions & 37 deletions

File tree

docs/configuration/capabilities.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@
33
By default, Regal will lint your policies using the
44
[capabilities](https://www.openpolicyagent.org/docs/deployments/#capabilities) of the latest version of OPA
55
known to Regal (i.e. the latest version of OPA at the time Regal was released). Sometimes you might want to tell Regal
6-
that some rules aren't applicable to your project (yet!). As an example, if you're running OPA v0.46.0, you likely won't
7-
be helped by the
8-
[custom-has-key](https://openpolicyagent.org/projects/regal/rules/idiomatic/custom-has-key-construct)
9-
rule, as it suggests using the `object.keys` built-in function introduced in OPA
10-
v0.47.0. The opposite could also be true —
11-
sometimes new versions of OPA will invalidate rules that applied to older versions. An example of this is the upcoming
12-
introduction of `import rego.v1`, which will make
13-
[implicit-future-keywords](https://openpolicyagent.org/projects/regal/rules/imports/implicit-future-keywords)
14-
obsolete, as importing
15-
`rego.v1` automatically imports all "future" functions.
6+
that some rules aren't applicable to your project (yet!). For example, recommending the use of the
7+
[strings.count](https://www.openpolicyagent.org/projects/regal/rules/idiomatic/use-strings-count) function doesn't make
8+
much sense for users who for some reason are targeting a version of OPA before v0.67.0, as that's when that function was
9+
introduced.
10+
11+
The opposite could also be true — new versions of OPA sometimes invalidate rules that were relevant in the past. For
12+
example, having Regal check for
13+
[implicit future keyword](https://www.openpolicyagent.org/projects/regal/rules/imports/implicit-future-keywords) imports
14+
makes no sense post OPA 1.0, as importing "future" keywords are no longer needed.
1615

1716
Capabilities help you tell Regal which features to take into account, and rules with dependencies to capabilities
1817
not available or not applicable in the given version will be skipped.

docs/rules/bugs/rule-named-if.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44

55
**Category**: Bugs
66

7-
## Notice: Rule made obsolete by OPA 1.0
7+
## Notice: Rule disabled by default since OPA 1.0
88

9-
Since Regal v0.30.0, this rule is only enabled for projects that have either been explicitly configured to target
10-
versions of OPA before 1.0, or if no configuration is provided — where Regal is able to determine that an older version
11-
of OPA/Rego is being targeted. Consult the documentation on Regal's
12-
[configuration](https://openpolicyagent.org/projects/regal#configuration) for information on how to best work with older versions of
13-
OPA and Rego.
9+
This rule is only enabled for projects that have either been explicitly configured to target versions of OPA before 1.0,
10+
or if no configuration is provided — where Regal is able to determine that an older version of OPA/Rego is being
11+
targeted. Consult the documentation on Regal's [configuration](https://openpolicyagent.org/projects/regal#configuration)
12+
for information on how to best work with older versions of OPA and Rego.
1413

1514
Since OPA v1.0, this rule is automatically disabled, as the parser itself will throw an error if a rule is named `if`,
1615
as that is made a keyword in Rego v1.0.

docs/rules/idiomatic/use-contains.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44

55
**Category**: Idiomatic
66

7-
## Notice: Rule made obsolete by OPA 1.0
7+
## Notice: Rule disabled by default since OPA 1.0
88

9-
Since Regal v0.30.0, this rule is only enabled for projects that have either been explicitly configured to target
10-
versions of OPA before 1.0, or if no configuration is provided — where Regal is able to determine that an older version
11-
of OPA/Rego is being targeted. Consult the documentation on Regal's
12-
[configuration](https://openpolicyagent.org/projects/regal#configuration) for information on how to best work with older versions of
13-
OPA and Rego.
9+
This rule is only enabled for projects that have either been explicitly configured to target versions of OPA before 1.0,
10+
or if no configuration is provided — where Regal is able to determine that an older version of OPA/Rego is being
11+
targeted. Consult the documentation on Regal's [configuration](https://openpolicyagent.org/projects/regal#configuration)
12+
for information on how to best work with older versions of OPA and Rego.
1413

1514
Since OPA v1.0, this rule is no longer needed as the Rego v1 syntax is now mandatory, and using `contains` is now the
1615
de-facto way to define multi-value rules.

docs/rules/idiomatic/use-if.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44

55
**Category**: Idiomatic
66

7-
## Notice: Rule made obsolete by OPA 1.0
7+
## Notice: Rule disabled by default since OPA 1.0
88

9-
Since Regal v0.30.0, this rule is only enabled for projects explicitly configured to target versions of OPA before 1.0.
10-
Consult the documentation on Regal's [configuration](https://openpolicyagent.org/projects/regal#configuration) for information on how
11-
to best work with older versions of OPA and Rego.
9+
This rule is only enabled for projects that have either been explicitly configured to target versions of OPA before 1.0,
10+
or if no configuration is provided — where Regal is able to determine that an older version of OPA/Rego is being
11+
targeted. Consult the documentation on Regal's [configuration](https://openpolicyagent.org/projects/regal#configuration)
12+
for information on how to best work with older versions of OPA and Rego.
1213

1314
Since OPA v1.0, this rule is no longer needed simply because the Rego v1 syntax is made mandatory, and the use of `if`
1415
is now enforced before all rule bodies.

docs/rules/imports/implicit-future-keywords.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55
**Category**: Imports
66

7+
## Notice: Rule disabled by default since OPA 1.0
8+
9+
This rule is only enabled for projects that have either been explicitly configured to target versions of OPA before 1.0,
10+
or if no configuration is provided — where Regal is able to determine that an older version of OPA/Rego is being
11+
targeted. Consult the documentation on Regal's [configuration](https://openpolicyagent.org/projects/regal#configuration)
12+
for information on how to best work with older versions of OPA and Rego.
13+
714
**Avoid**
815
```rego
916
package policy

docs/rules/imports/import-shadows-import.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44

55
**Category**: Imports
66

7-
## Notice: Rule made obsolete by OPA 1.0
7+
## Notice: Rule disabled by default since OPA 1.0
88

9-
Since Regal v0.30.0, this rule is only enabled for projects that have either been explicitly configured to target
10-
versions of OPA before 1.0, or if no configuration is provided — where Regal is able to determine that an older version
11-
of OPA/Rego is being targeted. Consult the documentation on Regal's
12-
[configuration](https://openpolicyagent.org/projects/regal#configuration) for information on how to best work with older versions of
13-
OPA and Rego.
9+
This rule is only enabled for projects that have either been explicitly configured to target versions of OPA before 1.0,
10+
or if no configuration is provided — where Regal is able to determine that an older version of OPA/Rego is being
11+
targeted. Consult the documentation on Regal's [configuration](https://openpolicyagent.org/projects/regal#configuration)
12+
for information on how to best work with older versions of OPA and Rego.
1413

1514
Since OPA v1.0, this rule is automatically disabled as OPA itself now forbids this, and shadowed imports will result in
1615
a parse error.

docs/rules/imports/use-rego-v1.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88

99
## Notice: Rule disabled by default since OPA 1.0
1010

11-
Since Regal v0.30.0, this rule is only enabled for projects that have either been explicitly configured to target
12-
versions of OPA before 1.0, or if no configuration is provided — where Regal is able to determine that an older version
13-
of OPA/Rego is being targeted. Consult the documentation on Regal's
14-
[configuration](https://openpolicyagent.org/projects/regal#configuration) for information on how to best work with older versions of
15-
OPA and Rego.
11+
This rule is only enabled for projects that have either been explicitly configured to target versions of OPA before 1.0,
12+
or if no configuration is provided — where Regal is able to determine that an older version of OPA/Rego is being
13+
targeted. Consult the documentation on Regal's [configuration](https://openpolicyagent.org/projects/regal#configuration)
14+
for information on how to best work with older versions of OPA and Rego.
1615

1716
Since OPA v1.0, the `rego.v1` import is effectively a no-op. Developers working on a **policy library**, or other
1817
Rego polices that are expected to be used with many different OPA versions, may however benefit from enabling this rule,

0 commit comments

Comments
 (0)