Skip to content

Conversation

@jmun304
Copy link

@jmun304 jmun304 commented Dec 1, 2025

Explain advantages of string interpolation in prefer_interpolation_to_compose_strings

Thanks for your contribution! Please replace this text with a description of what this PR is changing or adding and why, list any relevant issues, and review the contribution guidelines below.

Fixes #7001


  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
  • This PR doesn't contain automatically generated corrections or text (Grammarly, LLMs, and similar).
  • This PR follows the Google Developer Documentation Style Guidelines — for example, it doesn't use i.e. or e.g., and it avoids I and we (first person).
  • This PR uses semantic line breaks of 80 characters or fewer.
Contribution guidelines:
  • See our contributor guide for general expectations for PRs.
  • Larger or significant changes should be discussed in an issue before creating a PR.
  • Code changes should generally follow the Dart style guide and use dart format.
  • Updates to code excerpts indicated by <?code-excerpt need to be updated in their source .dart file as well.

Explain advantages of string interpolation in prefer_interpolation_to_compose_strings
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jmun304, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request improves the clarity and completeness of the documentation for a Dart diagnostic by providing a more detailed explanation of why string interpolation is preferred. The changes aim to educate developers on the practical benefits and potential pitfalls associated with different string composition methods.

Highlights

  • Enhanced Documentation for String Interpolation: The documentation for the prefer_interpolation_to_compose_strings diagnostic has been updated to clearly explain the advantages of using string interpolation over string concatenation with the + operator.
  • Benefits of String Interpolation: Added specific points highlighting that string interpolation improves readability, reduces the chance of errors when combining values, and is easier to maintain.
  • Warning on Concatenation: A note was added to emphasize that using multiple + operators for string concatenation can be more error-prone, especially when dealing with several values.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@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 updates the documentation for the prefer_interpolation_to_compose_strings diagnostic to explain the benefits of using string interpolation. The changes are helpful and clarify the reasoning behind the lint. I have a couple of minor suggestions to improve the wording and ensure it aligns with the Google Developer Documentation Style Guidelines, focusing on grammar and tone.

antfitch and others added 2 commits December 2, 2025 14:52
…strings.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…strings.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@antfitch antfitch requested review from antfitch and parlough December 2, 2025 22:53
Copy link
Collaborator

@antfitch antfitch left a comment

Choose a reason for hiding this comment

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

LGTM, but let's have @parlough take one last look.

@parlough
Copy link
Member

parlough commented Dec 7, 2025

Thanks for working on this. However, the source of truth for this doc is in a different repository, in https://github.com/dart-lang/sdk/blob/e4fd90fc45a379570e965585e7f98b639264b616/pkg/linter/messages.yaml#L10212-L10247.

If you're still interested in making this change, could you open a PR against that file?

I'll follow up this PR to update this file with a comment that clarifies where it should be updated. Sorry about the misdirection and thanks again!

@parlough parlough closed this Dec 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Advantage of string interpolation

3 participants