You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make generated Dart and Flutter method examples analyze cleanly #2091
Goal: Generated Dart and Flutter method examples should pass dart analyze, and CI should keep them that way.
What changes:
templates/dart/docs/example.md.twig and templates/flutter/docs/example.md.twig: drop the permission.dart / role.dart imports (they are part of the main library, so analyze reports import_of_non_library), import dart:typed_data for Dart location examples, drop the unused dart:io import from upload examples (Flutter keeps it for location examples), and stop rendering models. result = / models.Any result = for methods with no response model or an any response (await without a typed result, or use dynamic).
New scripts/validate-dart-examples.sh: pulls the code block out of every generated docs example, wraps it in main(), and runs dart analyze --fatal-warnings inside the generated package.
.github/workflows/validation.yml: the dart and flutter validation jobs run that script after analyzing the SDK, like validate-go-examples.sh does for Go.
Remaining steps: None. The linked PR is the full change.
Activity