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,
) async {
final annotation = await getFirebaseRulesAnnotation(resolver);
// This isn't a rules file
if (annotation == null) return;
context.registry.addSetOrMapLiteral((node) {
final type = node.staticType;
if (type == null) return;
final isSet = _setChecker.isAssignableFromType(type);
if (!isSet) return;
final elements = node.elements.join(', ');
reporter.atNode(node, _code, data: '[$elements]');
});
}