Skip to content

[flutter_goldens] Allow using print#185649

Merged
auto-submit[bot] merged 1 commit into
flutter:masterfrom
srawlins:print-goldens
Apr 29, 2026
Merged

[flutter_goldens] Allow using print#185649
auto-submit[bot] merged 1 commit into
flutter:masterfrom
srawlins:print-goldens

Conversation

@srawlins

Copy link
Copy Markdown
Contributor

Work towards dart-lang/sdk#60511

print is used in this script, and there's no need to ban that.

Pre-launch Checklist

@github-actions github-actions Bot added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. labels Apr 27, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a file-level suppression for the avoid_print lint in flutter_goldens.dart. The review feedback suggests that using ignore_for_file is too broad and recommends using line-level ignores or a proper logging mechanism to better align with the Effective Dart style guidelines.

Comment on lines +5 to +6
// We use `print` for logging here.
// ignore_for_file: avoid_print

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using ignore_for_file suppresses the avoid_print lint for the entire file. It is generally better to use line-level ignores (// ignore: avoid_print) only where necessary, or to use a proper logging mechanism like debugPrint or a Logger. This prevents accidental use of print in other parts of the file and adheres to the Effective Dart: Style guidelines. Additionally, note that this ignore only applies to this specific file; if the goal is to allow print throughout the package, it should be configured in analysis_options.yaml.

References
  1. Effective Dart: Style (referenced by the Repository Style Guide) recommends avoiding print() in library code. (link)

@srawlins srawlins added the CICD Run CI/CD label Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: tests "flutter test", flutter_test, or one of our tests CICD Run CI/CD framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants