run method
void
run(
- CustomLintResolver resolver,
- ErrorReporter reporter,
- CustomLintContext context
Emits lints for a given file.
run will only be invoked with files respecting filesToAnalyze
Implementation
@override
void run(
CustomLintResolver resolver,
ErrorReporter reporter,
CustomLintContext context,
) {
context.registry.addClassDeclaration(
(node) {
final isCubitClass = _isCubitClass(node);
if (!isCubitClass) {
return;
}
final nameEndsWithCubit = _hasCubitSuffix(node.name.lexeme);
if (nameEndsWithCubit) {
return;
}
reporter.reportErrorForToken(
_getLintCode(node.name.lexeme),
node.name,
);
},
);
}