mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
docs: ignore deprecated built-ins in reference (#5697)
Fixes #5607 Signed-off-by: Anders Eknert <anders@styra.com>
This commit is contained in:
@@ -97,7 +97,6 @@
|
||||
"net.cidr_intersects",
|
||||
"net.cidr_is_valid",
|
||||
"net.cidr_merge",
|
||||
"net.cidr_overlap",
|
||||
"net.lookup_ip_addr"
|
||||
],
|
||||
"numbers": [
|
||||
|
||||
@@ -151,19 +151,22 @@ func sortedCaps() []versionedCaps {
|
||||
}
|
||||
|
||||
func builtinCategories(b *ast.Builtin) []string {
|
||||
if b.IsDeprecated() {
|
||||
return nil
|
||||
}
|
||||
if len(b.Categories) > 0 {
|
||||
return b.Categories
|
||||
}
|
||||
if s := strings.Split(b.Name, "."); len(s) > 1 {
|
||||
return []string{s[0]}
|
||||
}
|
||||
if !b.IsDeprecated() {
|
||||
switch b.Name {
|
||||
case "assign", "eq", "print":
|
||||
// Do nothing.
|
||||
default:
|
||||
log.Printf("WARN: not categorized: %s", b.Name)
|
||||
}
|
||||
|
||||
switch b.Name {
|
||||
case "assign", "eq", "print":
|
||||
// Do nothing.
|
||||
default:
|
||||
log.Printf("WARN: not categorized: %s", b.Name)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user