fix: add newline at end of firebase_options.dart#438
Open
karnemanideep wants to merge 2 commits intoinvertase:mainfrom
Open
fix: add newline at end of firebase_options.dart#438karnemanideep wants to merge 2 commits intoinvertase:mainfrom
karnemanideep wants to merge 2 commits intoinvertase:mainfrom
Conversation
Author
|
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>
Author
|
Hi @russellwheatley! Applied the suggested fix from Gemini Could you please take a look when |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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