Skip to content

Commit ea4fddf

Browse files
committed
Making linters happy
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
1 parent aae7b57 commit ea4fddf

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

docs/docs/policy-language.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,15 +1403,15 @@ Have a look at the other examples for
14031403
about using this keyword.
14041404
:::
14051405

1406-
#### Improved Negation Semantics
1406+
### Improved Negation Semantics
14071407

14081408
The `future.keywords.not` import fixes a long-standing semantic issue with
14091409
negation in Rego.
14101410

1411-
##### The problem with legacy negation
1411+
#### The problem with legacy negation
14121412

14131413
Without the import, the compiler expands a negated composite expression like
1414-
`not f(g(input.x))` into a series of sub-expressions evaluated *before* the
1414+
`not f(g(input.x))` into a series of sub-expressions evaluated _before_ the
14151415
`not`:
14161416

14171417
```
@@ -1426,7 +1426,7 @@ This is unintuitive: the user's intent is "the condition does not hold," but
14261426
an undefined intermediate value causes a silent failure instead of the expected
14271427
`not` result.
14281428

1429-
##### Implicit body wrapping
1429+
#### Implicit body wrapping
14301430

14311431
With `import future.keywords.not`, composite-expression negation wraps the full
14321432
compiler expansion in an implicit body:
@@ -1435,7 +1435,7 @@ compiler expansion in an implicit body:
14351435
not { __local0__ = input.x; g(__local0__, __local1__); f(__local1__) }
14361436
```
14371437

1438-
Now, if *any* sub-expression is undefined or fails, the body is unsatisfiable
1438+
Now, if _any_ sub-expression is undefined or fails, the body is unsatisfiable
14391439
and the `not` expression succeeds; matching the intuition that "the condition does not hold."
14401440

14411441
```json
@@ -1476,7 +1476,7 @@ Notice how if we remove the `future.keywords.not` import in the above policy, th
14761476
This is a consequence of the `lookup()` function failing with an `undefined` value.
14771477
:::
14781478

1479-
##### Explicit negation bodies
1479+
#### Explicit negation bodies
14801480

14811481
The import also enables a `not` expression to take a curly-brace-enclosed body
14821482
instead of a single expression:

docs/docs/policy-reference/keywords/_examples/not/negation/policy.rego

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package play
22

3-
import future.keywords.not
3+
#import future.keywords.not
44

55
deny contains "must be staff" if {
66
not "staff" in input.roles

0 commit comments

Comments
 (0)