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