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,
) {
final isTestFile = BaseAnalyzer.isTestFile(resolver.path);
if (!_bothFiles) {
if (_testOnly && !isTestFile) return;
if (!_testOnly && isTestFile) return;
}
context.registry.addCompilationUnit((node) {
final issues = analyzer.analyzeWithResolver(node, resolver);
for (final issue in issues) {
reporter.atOffset(
offset: issue.offset,
length: issue.length,
errorCode: code,
);
}
});
}