Skip to content

Check Dart formatting in all packages and in tool/#9873

Merged
srawlins merged 4 commits into
flutter:masterfrom
srawlins:formatting
Jul 6, 2026
Merged

Check Dart formatting in all packages and in tool/#9873
srawlins merged 4 commits into
flutter:masterfrom
srawlins:formatting

Conversation

@srawlins

@srawlins srawlins commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@srawlins srawlins requested a review from kenzieschmoll as a code owner July 1, 2026 00:28

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

Copy link
Copy Markdown
Contributor

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 adds formatting checks using dart format to several CI test scripts (package_tests.sh and tool_tests.sh) before running tests. The reviewer recommends invoking dart format directly instead of using the Flutter wrapper script $(dirname $(which flutter))/dart to avoid potential wrapper script issues and simplify the code, since the direct Dart SDK binary is already prioritized in the PATH.

Comment thread tool/ci/bots.sh Outdated
Comment thread tool/ci/package_tests.sh Outdated
Comment thread tool/ci/package_tests.sh Outdated
Comment thread tool/ci/package_tests.sh Outdated
Comment on lines +50 to +51
# Here, we use the dart instance from the flutter SDK.
$(dirname $(which flutter))/dart format --output=none --set-exit-if-changed .

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

[CONCERN] Running $(dirname $(which flutter))/dart invokes the Dart wrapper script from flutter/bin, which can print "Waiting for another flutter command..." at inopportune times. As documented in setup.sh, the PATH is already configured to prioritize the direct Dart SDK binary. We should run dart format directly instead, which also makes the explanatory comment unnecessary.

Suggested change
# Here, we use the dart instance from the flutter SDK.
$(dirname $(which flutter))/dart format --output=none --set-exit-if-changed .
dart format --output=none --set-exit-if-changed .

Comment thread tool/ci/tool_tests.sh Outdated
Comment thread tool/ci/package_tests.sh
Comment on lines +33 to +34
# Note that this will _not_ test any tests in nested directories, if we add
# any.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

hmm this seems like a bug? why aren't we running flutter test test/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure. I can fix it in a separate PR.

@kenzieschmoll kenzieschmoll left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

a couple comments but generally lgtm

@srawlins srawlins merged commit dae6342 into flutter:master Jul 6, 2026
51 checks passed
@srawlins srawlins deleted the formatting branch July 6, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants