checkPlatformNames function

List<ReleaseProblem> checkPlatformNames(
  1. String markdown, {
  2. String name = 'CHANGELOG.md',
})

Entries that would reach an Apple store naming Android.

An entry with no scope prefix reaches every store, so "Drag files in on Android" written without [android] is App Store copy — which is how it reached two uploaded builds of one consumer on 29 September 2026 before a reader caught it. Checked on the text each Apple platform would actually get, after filtering: an [android] entry is fine, and a [macos] one is reported against macOS alone.

Every section, including ones the fallback walk can no longer reach — stricter than the fallback strictly needs, deliberately: which sections are reachable depends on which versions will ever be released again, and an old section is fixed with the same prefix as a new one. One problem per entry, naming each Apple platform it reaches and quoting the line with the name in it. name is what the problems call the file.

Implementation

List<ReleaseProblem> checkPlatformNames(
  String markdown, {
  String name = 'CHANGELOG.md',
}) {
  final problems = <ReleaseProblem>[];
  for (final section in _sections(markdown)) {
    for (final entry in section.entries) {
      final reaches = <String>[];
      ({String line, String name})? named;
      for (final platform in const ['ios', 'macos']) {
        final kept = _forPlatform([entry], platform);
        final found = kept.isEmpty ? null : otherStoreNamed(kept.single);
        if (found != null) {
          reaches.add(platform);
          named = found;
        }
      }
      if (named == null) {
        continue;
      }
      problems.add(
        ReleaseProblem(
          '$name § ${section.version} → ${reaches.join(', ')}',
          '"${named.line}" names ${named.name} and reaches the App Store — '
              'App Review '
              'Guideline 2.3.10 rejects metadata naming other mobile platforms. '
              'Prefix it [android], or reword it',
        ),
      );
    }
  }
  return problems;
}