run method

  1. @override
List<Issue> run(
  1. DialectProject project
)
override

Inspect project and return findings. May return an empty list. Should NOT throw — turn unexpected conditions into Issues so the report surfaces them rather than crashing.

Implementation

@override
List<Issue> run(DialectProject project) {
  final issues = <Issue>[];

  for (final entry in project.source.entries) {
    final ns = entry.metadata?.namespace;
    if (ns != null && ns.isNotEmpty) continue;
    issues.add(
      Issue(
        severity: defaultSeverity,
        ruleName: name,
        message:
            'Source key `${entry.key}` is missing `@key.namespace` '
            'metadata.',
        key: entry.key,
        file: project.source.sourcePath,
        line: project.source.entryLines[entry.key],
        hint:
            'Add `"namespace": "<group>"` to the `@${entry.key}` block. '
            'The namespace drives per-platform sync filtering.',
      ),
    );
  }

  return issues;
}