TestRelevance enum
Controls how a lint rule interacts with test files.
Most lint rules enforce production code patterns that are irrelevant or counterproductive in test files. For example, hardcoded strings, magic numbers, and missing documentation are expected in tests.
By default, rules skip test files entirely (never). Override SaropaLintRule.testRelevance to change this behavior.
Migration from skipTestFiles:
Values
- never → const TestRelevance
-
Rule does NOT run on test files.
This is the default. Use for production-focused rules: hardcoded config, magic numbers, security credentials, accessibility labels, documentation requirements, etc.
- always → const TestRelevance
-
Rule runs on ALL files including test files.
Use for universal code quality rules that matter everywhere: empty catch blocks, unused imports, missing dispose, naming conventions, async safety, etc.
- testOnly → const TestRelevance
-
Rule runs ONLY on test files.
Use for test-specific rules: test structure, mock usage, assertion patterns, test naming, etc.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
values
→ const List<
TestRelevance> - A constant List of the values in this enum, in order of their declaration.