Rules
This page contains an index of all 103 Regal rules.
| Category | ID | Summary |
|---|---|---|
| Bugs | annotation-without-metadata | Annotation without metadata |
| Bugs | argument-always-wildcard | Argument is always a wildcard |
| Bugs | constant-condition | Constant condition |
| Bugs | deprecated-builtin | Constant condition |
| Bugs | duplicate-rule | Duplicate rule |
| Bugs | if-empty-object | Empty object following |
| Bugs | if-object-literal | Object literal following |
| Bugs | import-shadows-rule | Import shadows rule |
| Bugs | impossible-not | Impossible Type: Aggregate - runs both on single files as well as when more than one file is provided for linting |
| Bugs | inconsistent-args | Inconsistently named function arguments |
| Bugs | internal-entrypoint | Entrypoint can't be marked internal |
| Bugs | invalid-metadata-attribute | Invalid attribute in metadata annotation |
| Bugs | leaked-internal-reference | Outside reference to internal rule or function |
| Bugs | not-equals-in-loop | Use of != in loop |
| Bugs | redundant-existence-check | Redundant existence check |
| Bugs | redundant-loop-count | Redundant count before loop |
| Bugs | rule-assigns-default | Rule assigned its default value |
| Bugs | rule-named-if | Rule named |
| Bugs | rule-shadows-builtin | Rule name shadows built-in |
| Bugs | sprintf-arguments-mismatch | Mismatch in |
| Bugs | time-now-ns-twice | Repeated calls to |
| Bugs | top-level-iteration | Iteration in top-level assignment |
| Bugs | unassigned-return-value | Non-boolean return value unassigned |
| Bugs | unused-output-variable | Unused output variable |
| Bugs | var-shadows-builtin | Variable shadows built-in |
| Bugs | zero-arity-function | Avoid functions without args |
| Custom | forbidden-function-call | Forbidden function call |
| Custom | missing-metadata | Package or rule missing metadata |
| Custom | naming-convention | Naming convention violation |
| Custom | narrow-argument | Function argument can be narrowed |
| Custom | one-liner-rule | Rule body could be made a one-liner |
| Custom | prefer-value-in-head | Prefer value in rule head |
| Idiomatic | ambiguous-scope | Ambiguous metadata scope |
| Idiomatic | boolean-assignment | Prefer |
| Idiomatic | custom-has-key-construct | Custom function may be replaced by |
| Idiomatic | custom-in-construct | Custom function may be replaced by |
| Idiomatic | directory-package-mismatch | Directory structure should mirror package |
| Idiomatic | equals-pattern-matching | Prefer pattern matching in function arguments |
| Idiomatic | in-wildcard-key | Unnecessary wildcard key |
| Idiomatic | no-defined-entrypoint | Missing entrypoint annotation Type: Aggregate - only runs when more than one file is provided for linting |
| Idiomatic | non-raw-regex-pattern | Use raw strings for regex patterns Automatically fixable: Yes |
| Idiomatic | prefer-set-or-object-rule | Prefer set or object rule over comprehension |
| Idiomatic | single-item-in | Avoid |
| Idiomatic | use-contains | Use the |
| Idiomatic | use-if | Use the |
| Idiomatic | use-object-keys | Prefer to use |
| Idiomatic | use-some-for-output-vars | Use |
| Idiomatic | use-strings-count | Use |
| Imports | avoid-importing-input | Avoid importing |
| Imports | circular-import | Avoid circular imports |
| Imports | confusing-alias | Confusing alias of existing import |
| Imports | ignored-import | Reference ignores import |
| Imports | implicit-future-keywords | Implicit future keywords |
| Imports | import-after-rule | Import declared after rule |
| Imports | import-shadows-builtin | Import shadows built-in namespace |
| Imports | import-shadows-import | Import shadows import |
| Imports | pointless-import | Importing own package is pointless |
| Imports | prefer-package-imports | Prefer importing packages over rules Type: Aggregate - only runs when more than one file is provided for linting |
| Imports | redundant-alias | Redundant alias |
| Imports | redundant-data-import | Redundant import of data |
| Imports | unresolved-import | Unresolved import Type: Aggregate - only runs when more than one file is provided for linting |
| Imports | unresolved-reference | Unresolved Reference |
| Imports | use-rego-v1 | Use Automatically fixable: Yes |
| Performance | defer-assignment | Assignment can be deferred |
| Performance | non-loop-expression | Non loop expression in loop |
| Performance | walk-no-path | Call to |
| Performance | with-outside-test-context |
|
| Style | avoid-get-and-list-prefix | Avoid |
| Style | chained-rule-body | Avoid chaining rule bodies |
| Style | comprehension-term-assignment | Assignment can be moved to comprehension term |
| Style | default-over-else | Prefer default assignment over fallback |
| Style | default-over-not | Prefer default assignment over negated condition |
| Style | detached-metadata | Detached metadata annotation |
| Style | double-negative | Avoid double negatives |
| Style | external-reference | External reference in function |
| Style | file-length | Max file length exceeded |
| Style | function-arg-return | Return value assigned in function argument |
| Style | line-length | Line too long |
| Style | messy-rule | Messy incremental rule |
| Style | mixed-iteration | Mixed iteration style |
| Style | no-whitespace-comment | Comment should start with whitespace Automatically fixable: Yes |
| Style | opa-fmt | File should be formatted with Automatically fixable: Yes |
| Style | pointless-reassignment | Pointless reassignment of variable |
| Style | prefer-snake-case | Prefer snake_case for names |
| Style | prefer-some-in-iteration | Prefer |
| Style | rule-length | Max rule length exceeded |
| Style | rule-name-repeats-package | Avoid repeating package path in rule names |
| Style | todo-comment | Avoid TODO Comments |
| Style | trailing-default-rule | Default rule should be declared first |
| Style | unconditional-assignment | Unconditional assignment in rule body |
| Style | unnecessary-some | Unnecessary use of |
| Style | use-assignment-operator | Prefer Automatically fixable: Yes |
| Style | yoda-condition | Yoda condition, it is |
| Testing | dubious-print-sprintf | Dubious use of |
| Testing | file-missing-test-suffix | Files containing tests should have a |
| Testing | identically-named-tests | Multiple tests with same name |
| Testing | metasyntactic-variable | Metasyntactic variable name |
| Testing | print-or-trace-call | Call to |
| Testing | test-outside-test-package | Test outside of test package |
| Testing | todo-test | TODO test encountered |
Community
For questions, discussions and announcements related to Styra products, services and open source projects, please join the Styra community on Slack!