Skip to content

fix(cli): ensure generated firebase_options.dart is perfectly formatted#437

Merged
russellwheatley merged 1 commit intoinvertase:mainfrom
kevmoo:format_options
Apr 24, 2026
Merged

fix(cli): ensure generated firebase_options.dart is perfectly formatted#437
russellwheatley merged 1 commit intoinvertase:mainfrom
kevmoo:format_options

Conversation

@kevmoo
Copy link
Copy Markdown
Contributor

@kevmoo kevmoo commented Apr 16, 2026

  • Refine string generation in FirebaseDartConfigurationWrite to match dart format output by construction.

  • Fix extra newline before closing brace of DefaultFirebaseOptions.

  • Fix file update logic to remove trailing empty lines and insert content at the correct position.

  • Ensure the generated file ends with a trailing newline.

  • Add a golden test for web-only configuration and a test for update logic cleanup.

  • Refactor tests to reduce code duplication using a helper.

- Refine string generation in FirebaseDartConfigurationWrite to match dart format output by construction.

- Fix extra newline before closing brace of DefaultFirebaseOptions.

- Fix file update logic to remove trailing empty lines and insert content at the correct position.

- Ensure the generated file ends with a trailing newline.

- Add a golden test for web-only configuration and a test for update logic cleanup.

- Refactor tests to reduce code duplication using a helper.
Copy link
Copy Markdown

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

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 introduces a new --firebase-out flag to the flutterfire configure and reconfigure commands, allowing users to specify a custom path for the generated firebase.json file. It also refines the generation of firebase_options.dart by improving whitespace management and ensuring consistent trailing newlines. Comprehensive tests, including a new golden test, have been added to validate the custom output path and the improved file formatting. I have no feedback to provide.

@russellwheatley
Copy link
Copy Markdown
Member

russellwheatley commented Apr 23, 2026

@kevmoo

  1. Could you please provide a description of what the PR is doing? I'm wondering if you're trying to resolve something already fixed: fix: flutterfire configure command when existing firebase_options.dart has a wrong format #424?
  2. PR titles ought to use conventional commits (e.g. "fix: ...description") otherwise, CI will fail and it won't appear nicely in our changelogs.

@kevmoo
Copy link
Copy Markdown
Contributor Author

kevmoo commented Apr 23, 2026

Sorry, @russellwheatley – git commit weirdness. See 4af3db4

Will fix here now!

@github-actions github-actions Bot added the Needs Attention OP created or responded to issue and it needs attention. label Apr 23, 2026
@kevmoo kevmoo changed the title format options fix(cli): ensure generated firebase_options.dart is perfectly formatted Apr 23, 2026
@russellwheatley russellwheatley merged commit de2515f into invertase:main Apr 24, 2026
8 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Attention OP created or responded to issue and it needs attention.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants