check method
void
check(
- DcqRegistry registry
)
Implementation
@override
void check(
DcqRegistry registry,
) {
final entries = (configMapList(ruleConfig, 'entries') ?? [])
.map(
(e) => (
annotations: e['annotations'] as String? ?? '',
message: e['message'] as String? ?? '',
),
)
.where((e) => e.annotations.isNotEmpty)
.toList();
registry.addAnnotation((node) {
final name = node.name.name;
for (final entry in entries) {
if (RegExp(entry.annotations).hasMatch(name)) {
reportAtNode(node);
return;
}
}
});
}