[flutter_goldens] Allow using print#185649
Conversation
There was a problem hiding this comment.
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.
| // We use `print` for logging here. | ||
| // ignore_for_file: avoid_print |
There was a problem hiding this comment.
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
- Effective Dart: Style (referenced by the Repository Style Guide) recommends avoiding print() in library code. (link)
Work towards dart-lang/sdk#60511
printis used in this script, and there's no need to ban that.Pre-launch Checklist
///).