Skip to main content


Summary: Unnecessary use of some

Category: Style


package policy

import rego.v1

is_developer if some "developer" in input.user.roles


package policy

import rego.v1

is_developer if "developer" in input.user.roles


Use the some .. in construct when you want to loop over a collection and assign variables in the iteration. If you know the value you're looking for, just use the in keyword directly without using some.


Note that some .. in iteration can be used with a limited form of pattern matching where either the key or the value should match for the loop assignment to succeed. This is not commonly needed, but considered OK.

package policy

import rego.v1

developers contains name if {
# name will only be bound when the value is "developer"
some name, "developer" in {"alice": "developer", "bob": "developer", "charlie": "manager"}

Configuration Options

This linter rule provides the following configuration options:

# one of "error", "warning", "ignore"
level: error


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!