Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format code using Dart 3.7 formatter #3161

Merged
merged 6 commits into from
Feb 28, 2025
Merged

Conversation

johnpryan
Copy link
Contributor

No description provided.

@johnpryan johnpryan requested a review from parlough February 26, 2025 18:24
Copy link

@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.

Hello @johnpryan, 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!

Summary of Changes

This pull request focuses on reformatting the code in the dart-services repository using the Dart 3.7 formatter. The changes primarily involve adjusting indentation and line breaks to adhere to the updated formatting rules, enhancing code readability and consistency across the project. No functional code changes are included in this pull request.

Highlights

  • Code Formatting: The primary change is the application of the Dart 3.7 formatter across the codebase.
  • Readability: The reformatting aims to improve the readability and maintainability of the code.
  • Consistency: Ensuring consistent code style throughout the project.

Changelog

Click here to see the changelog
  • pkgs/dart_services/lib/server.dart
    • Reformatted ArgParser configuration for better readability.
    • Adjusted indentation in the main function.
    • Reformatted the _logger.info call for better alignment.
    • Adjusted formatting for EndpointsServer.serve call.
  • pkgs/dart_services/lib/src/analysis.dart
    • Reformatted the analysisServer.onExit.then call.
    • Adjusted formatting in AnalysisServerWrapper constructor.
    • Reformatted _logger.info call in AnalysisServerWrapper.init.
    • Adjusted formatting for analysisServer.server.onError.listen call.
    • Reformatted the suggestions filtering logic in AnalysisServerWrapper.complete.
    • Reformatted fixChanges.removeWhere and assistsChanges.removeWhere calls.
    • Adjusted formatting in SourceChangeExtension.toApiSourceChange.
    • Reformatted the format method to improve readability.
    • Adjusted formatting in AnalysisServerWrapper.analyzeErrors to improve readability.
  • pkgs/dart_services/lib/src/caching.dart
    • Reformatted the RedisCache constructor.
    • Adjusted formatting in newConnection.outputSink.done.then and catchError blocks.
    • Reformatted timeout blocks in get, remove, and set methods.
  • pkgs/dart_services/lib/src/common_server.dart
    • Reformatted router post calls for better alignment.
    • Adjusted formatting for api.SourceRequest.fromJson calls.
    • Reformatted _handleCompileDDC method.
    • Adjusted formatting in serialize method.
  • pkgs/dart_services/lib/src/compiling.dart
    • Reformatted the Compiler constructor.
    • Adjusted formatting in Process.run calls.
    • Reformatted the _compileDDC method.
    • Adjusted formatting for DDCCompilationResults constructor.
    • Reformatted the _rewritePaths method.
  • pkgs/dart_services/lib/src/oauth_handler.dart
    • Reformatted router.get calls for better alignment.
    • Adjusted formatting in initFromEnvironmentalVars to improve readability.
    • Reformatted _initiateHandler and _returnAuthorizeHandler methods.
    • Adjusted formatting in _encryptAndBase64EncodeAuthToken method.
  • pkgs/dart_services/lib/src/project_creator.dart
    • Reformatted the ProjectCreator constructor.
    • Adjusted formatting in createBasicDartProject and createFlutterProject methods.
    • Reformatted the _dependencyVersions method.
  • pkgs/dart_services/lib/src/project_templates.dart
    • Adjusted formatting in ProjectTemplates factory constructor.
  • pkgs/dart_services/lib/src/pub.dart
    • Adjusted formatting in packageVersionsFromPubspecLock method.
  • pkgs/dart_services/lib/src/sdk.dart
    • Adjusted formatting in Sdk constructor.
  • pkgs/dart_services/lib/src/shelf_cors.dart
    • Adjusted formatting in createCorsHeadersMiddleware method.
  • pkgs/dart_services/lib/src/utils.dart
    • Adjusted formatting in runWithLogging method.
  • pkgs/dart_services/pubspec.yaml
    • Updated the SDK version constraint to ^3.7.0.
  • pkgs/dart_services/test/analysis_test.dart
    • Reformatted various test methods for better readability.
  • pkgs/dart_services/test/caching_test.dart
    • Reformatted various test methods for better readability.
  • pkgs/dart_services/test/compiling_test.dart
    • Reformatted various test methods for better readability.
  • pkgs/dart_services/test/flutter_web_test.dart
    • Reformatted various test methods for better readability.
  • pkgs/dart_services/test/project_creator_test.dart
    • Reformatted various test methods for better readability.
  • pkgs/dart_services/test/pub_test.dart
    • Reformatted various test methods for better readability.
  • pkgs/dart_services/test/server_test.dart
    • Reformatted various test methods for better readability.
  • pkgs/dart_services/test/shelf_cors_test.dart
    • Reformatted various test methods for better readability.
  • pkgs/dart_services/test/utils_test.dart
    • Reformatted various test methods for better readability.
  • pkgs/dartpad_shared/lib/model.dart
    • Reformatted various class definitions and factory methods to adhere to Dart 3.7 formatting standards.
  • pkgs/dartpad_shared/lib/model.g.dart
    • Reformatted generated code to align with Dart 3.7 formatting standards.
  • pkgs/dartpad_shared/lib/services.dart
    • Reformatted method calls and code blocks for improved readability.
  • pkgs/dartpad_shared/pubspec.yaml
    • Updated the SDK version constraint to ^3.7.0.
  • pkgs/dartpad_ui/lib/console.dart
    • Reformatted the _ConsoleWidgetState build method for better alignment and readability.
  • pkgs/dartpad_ui/lib/editor/codemirror.dart
    • Reformatted extension types and anonymous types to adhere to Dart 3.7 formatting standards.
  • pkgs/dartpad_ui/lib/editor/editor.dart
    • Reformatted the _codeMirrorFactory method.
    • Adjusted formatting in EditorWidget constructor.
    • Reformatted the _EditorWidgetState build method.
    • Adjusted formatting in _platformViewCreated method.
    • Reformatted various methods and listeners for better readability.
  • pkgs/dartpad_ui/lib/embed.dart
    • Reformatted the handleEmbedMessage method to improve readability.
  • pkgs/dartpad_ui/lib/execution/execution.dart
    • Reformatted the _iFrameFactory method.
    • Adjusted formatting in _ExecutionWidgetState build method.
  • pkgs/dartpad_ui/lib/execution/frame.dart
    • Reformatted the generateFrameSource method to improve readability.
    • Adjusted formatting in _initListener method.
  • pkgs/dartpad_ui/lib/flutter_samples.dart
    • Reformatted the loadFlutterSample method to improve readability.
  • pkgs/dartpad_ui/lib/gists.dart
    • Reformatted the load method to improve readability.
    • Adjusted formatting in Gist class to improve readability.
  • pkgs/dartpad_ui/lib/keys.dart
    • Reformatted the SingleActivatorExtension to improve readability.
  • pkgs/dartpad_ui/lib/main.dart
    • Reformatted various methods and class definitions to adhere to Dart 3.7 formatting standards.
  • pkgs/dartpad_ui/lib/model.dart
    • Reformatted various class definitions and methods to adhere to Dart 3.7 formatting standards.
  • pkgs/dartpad_ui/lib/problems.dart
    • Reformatted the ProblemsTableWidget and ProblemWidget build methods for better alignment and readability.
  • pkgs/dartpad_ui/lib/samples.g.dart
    • Reformatted generated code to align with Dart 3.7 formatting standards.
  • pkgs/dartpad_ui/lib/split.dart
    • Reformatted various methods and class definitions to adhere to Dart 3.7 formatting standards.
  • pkgs/dartpad_ui/lib/utils.dart
    • Reformatted various methods and class definitions to adhere to Dart 3.7 formatting standards.
  • pkgs/dartpad_ui/lib/versions.dart
    • Reformatted the VersionTable build method for better alignment and readability.
  • pkgs/dartpad_ui/lib/widgets.dart
    • Reformatted various methods and class definitions to adhere to Dart 3.7 formatting standards.
  • pkgs/samples/lib/brick_breaker.dart
    • Reformatted various methods and class definitions to adhere to Dart 3.7 formatting standards.
  • pkgs/samples/lib/default_flutter.dart
    • Reformatted various methods and class definitions to adhere to Dart 3.7 formatting standards.
  • pkgs/samples/lib/google_ai.dart
    • Reformatted various methods and class definitions to adhere to Dart 3.7 formatting standards.
  • pkgs/samples/lib/main.dart
    • Reformatted various methods and class definitions to adhere to Dart 3.7 formatting standards.
  • pkgs/samples/lib/sunflower.dart
    • Reformatted various methods and class definitions to adhere to Dart 3.7 formatting standards.
  • pkgs/samples/pubspec.yaml
    • Updated the SDK version constraint to ^3.7.0.
  • pkgs/samples/tool/samples.dart
    • Reformatted various methods and class definitions to adhere to Dart 3.7 formatting standards.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 is currently in preview and 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 to provide feedback.

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.


A formatter's touch, so neat and grand,
Aligns the code across the land.
With spaces right, and lines so true,
A clearer view for me and you.

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

@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

The pull request successfully applies the Dart 3.7 formatter to the codebase, resulting in improved code formatting and consistency. The changes are primarily focused on whitespace and line breaks, enhancing readability. No major issues were identified, and the code is generally in good shape to be merged after addressing the comments.

Summary of Findings

Assessment

The pull request focuses on formatting the code using the Dart 3.7 formatter. The changes primarily involve adjusting whitespace and line breaks to adhere to the formatter's output. Overall, the changes improve code readability and consistency. There are a few minor suggestions for improvement, but the code is generally in good shape to be merged after addressing the comments. Users should have others review and approve this code before merging.

Copy link

github-actions bot commented Feb 26, 2025

PR Health

Breaking changes ✔️
Package Change Current Version New Version Needed Version Looking good?
Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

Coverage ✔️
File Coverage

This check for test coverage is informational (issues shown here will not fail the PR).

API leaks ✔️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbols
License Headers ⚠️
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
Files
pkgs/samples/lib/brick_breaker.dart
pkgs/samples/lib/google_ai.dart
pkgs/samples/lib/main.dart
pkgs/samples/lib/sunflower.dart

All source files should start with a license header.

Unrelated files missing license headers
Files
pkgs/dartpad_ui/lib/enable_gen_ai.dart
pkgs/samples/lib/fibonacci.dart
pkgs/samples/lib/hello_world.dart

This check can be disabled by tagging the PR with skip-license-check.

@johnpryan johnpryan marked this pull request as ready for review February 27, 2025 18:37
@johnpryan johnpryan requested a review from devoncarew February 27, 2025 20:16
Copy link
Member

@devoncarew devoncarew left a comment

Choose a reason for hiding this comment

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

I'd actually back the pkgs/dartpad_ui/ changes out, or delay this PR, just because all the diffs will make it harder to merge in #3135.

@johnpryan
Copy link
Contributor Author

We can merge #3135 first.

@johnpryan johnpryan merged commit 27d6200 into dart-lang:main Feb 28, 2025
18 checks passed
@johnpryan johnpryan deleted the format-3.7 branch February 28, 2025 21:56
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.

3 participants