Skip to content

Commit

Permalink
[docs] Added Missing Hints in policy-reference (#6139)
Browse files Browse the repository at this point in the history
* [docs] Missing hint "future.keywords.if" for "Ordered (Else)"

Signed-off-by: pushkarm029 <[email protected]>
  • Loading branch information
Pushkarm029 authored Aug 3, 2023
1 parent 01aaf64 commit 8fb297c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/content/policy-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ not any_not_match
```

```live:iteration/forall:module:read_only
# with `import future.keywords.in` and `import future.keywords.if`
any_match if {
some x in set
f(x)
Expand Down Expand Up @@ -222,6 +223,7 @@ c := a | b
p := true { ... }
# OR
# with `import future.keywords.if`
p if { ... }
# OR
Expand All @@ -231,6 +233,7 @@ p { ... }
### Conditionals

```live:rules/cond:module:read_only
# with `import future.keywords.if`
default a := 1
a := 5 if { ... }
a := 100 if { ... }
Expand All @@ -243,7 +246,7 @@ a := 100 if { ... }
a_set[x] { ... }
a_set[y] { ... }
# alternatively, with future.keywords.contains and future.keywords.if
# alternatively, with `import future.keywords.contains` and `import future.keywords.if`
a_set contains x if { ... }
a_set contains y if { ... }
Expand All @@ -264,6 +267,7 @@ else := 10 if { ... }
### Functions (Boolean)

```live:rules/funcs:module:read_only
# with `import future.keywords.if`
f(x, y) if {
...
}
Expand All @@ -278,6 +282,7 @@ f(x, y) := true if {
### Functions (Conditionals)

```live:rules/condfuncs:module:read_only
# with `import future.keywords.if`
f(x) := "A" if { x >= 90 }
f(x) := "B" if { x >= 80; x < 90 }
f(x) := "C" if { x >= 70; x < 80 }
Expand All @@ -286,6 +291,7 @@ f(x) := "C" if { x >= 70; x < 80 }
### Reference Heads

```live:rules/ref_heads:module:read_only
# with `import future.keywords.contains` and `import future.keywords.if`
fruit.apple.seeds = 12 if input == "apple" # complete document (single value rule)
fruit.pineapple.colors contains x if x := "yellow" # multi-value rule
Expand Down

0 comments on commit 8fb297c

Please sign in to comment.