fix: add newline at end of firebase_options.dart#438
Conversation
|
I've opened a PR to fix this issue. |
There was a problem hiding this comment.
Code Review
This pull request modifies the Firebase configuration writer to ensure generated files end with a trailing newline. While the change to the file configuration lines is correct, a review comment points out that the change in _buildConfigurationFile likely introduces a redundant double newline because the underlying string buffer already contains a trailing newline character.
…uration_write.dart revert: remove double newline in _buildConfigurationFile as _stringBuffer already includes trailing newline via writeln() Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
Hi @russellwheatley! Applied the suggested fix from Gemini Could you please take a look when |
|
Hello 👋, this PR has been opened for more than 2 months with no activity on it. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 15 days until this gets closed automatically |
Description
flutterfire configure generates firebase_options.dart
without a newline at the end of the file.
This causes dart format to modify the generated file
every time it is run, resulting in:
##How I Found It
Searched for writeAsStringSync across the codebase to
find where firebase_options.dart content is written.
This led to:
packages/flutterfire_cli/lib/src/firebase/firebase_dart_configuration_write.dart
Inside this file, two functions build and return the
content of firebase_options.dart as a string using
.join('\n') — which joins lines with newlines BETWEEN
them but does NOT add a newline at the END of the file.
##What I Changed
File:
packages/flutterfire_cli/lib/src/firebase/firebase_dart_configuration_write.dart
Line 180 — inside
_updateExistingConfigurationFile():Line 187 — inside
_buildConfigurationFile():The \n appended at the end ensures the generated
firebase_options.dartalways ends with a newline,satisfying dart format requirements.
feat-- New feature (non-breaking change which adds functionality)fix-- Bug fix (non-breaking change which fixes an issue)!-- Breaking change (fix or feature that would cause existing functionality to change)refactor-- Code refactorci-- Build configuration changedocs-- Documentationchore-- Chore