Skip to main content

rule-shadows-builtin

Summary: Rule name shadows built-in

Category: Bugs

Avoid

package policy

# `or` is an operator
or := 1 + 1

# `startswith` is a built-in function
startswith := indexof("rego", "r")

Rationale

Using the name of built-in functions or operators as rule and variable names can lead to confusion and unexpected behavior.

Configuration Options

This linter rule provides the following configuration options:

rules: 
bugs:
rule-shadows-builtin:
# one of "error", "warning", "ignore"
level: error

Community

If you think you've found a problem with this rule or its documentation, would like to suggest improvements, new rules, or just talk about Regal in general, please join us in the #regal channel in the Styra Community Slack!