DocumentFakeParameters class
A lint rule that ensures Fake classes and their non-private members have documentation.
This rule flags Fake classes (classes that extend Fake or have "Fake" in their name) that implement interfaces but lack proper documentation for their test helper methods and variables. It improves test maintainability and ensures test helpers are documented for team collaboration.
Example of code that triggers this rule:
class FakeAuthService extends Fake implements AuthService {
void setAuthDelay(Duration delay) { ... } // Missing documentation
void triggerAuthFailure() { ... } // Missing documentation
}
class FakeUserRepository implements UserRepository {
void setMockData(List<User> users) { ... } // Missing documentation
}
Example of code that doesn't trigger this rule:
/// Fake implementation of AuthService for testing.
class FakeAuthService extends Fake implements AuthService {
/// Sets authentication delay for testing timing scenarios.
void setAuthDelay(Duration delay) { ... }
/// Simulates authentication failure for error handling tests.
void triggerAuthFailure() { ... }
@override
Future<void> authenticate() async { ... } // Override - no documentation needed
}
Constructors
- DocumentFakeParameters()
-
const
Properties
- code → LintCode
-
The
LintCodethat thisLintRulemay emit.finalinherited - enabledByDefault → bool
-
Whether the lint rule is on or off by default in an empty analysis_options.yaml
no setterinherited
-
filesToAnalyze
→ List<
String> -
A list of glob patterns matching the files that run cares about.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getFixes(
) → List< Fix> -
Obtains the list of
Fixassociated with thisLintRule.inherited -
isEnabled(
CustomLintConfigs configs) → bool -
Checks whether this lint rule is enabled in a configuration file.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
run(
CustomLintResolver resolver, ErrorReporter reporter, CustomLintContext context) → void - Emits lints for a given file.
-
startUp(
CustomLintResolver resolver, CustomLintContext context) → Future< void> -
Emits lints for a given file.
inherited
-
testAnalyzeAndRun(
File file) → Future< List< AnalysisError> > -
Analyze a Dart file and runs this assist in test mode.
inherited
-
testRun(
ResolvedUnitResult result, {Pubspec? pubspec}) → Future< List< AnalysisError> > -
Runs this assist in test mode.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited