Summary: Avoid functions without args
first_user() := input.users
first_user := input.users
Zero-arity functions, or functions without arguments, aren't treated as functions by Rego, but as regular rules. For that reason, they should also be expressed as such. One potential benefit of using functions over rules is that functions don't contribute to the document when a package is evaluated, and as such sometimes used to "hide" information from the result of evaluation. Whether this is a good practice or not, it importantly doesn't work with zero-arity functions, as they are treated as rules and do contribute to the document.
There is an open issue in the OPA project to try and address this in the future, and allow zero-arity functions to be treated as other functions. Until then, the recommendation is to avoid them and just use rules in their place.
Note that if you're using the opa fmt command to format your code, it will remove the parentheses from a zero-arity function definition for you.
This linter rule provides the following configuration options:
# one of "error", "warning", "ignore"
OPA Docs: The OPA Document Model OPA Issues: Allow user-defined zero-argument functions in Rego
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