Skip to content

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

Open
srawlins wants to merge 1 commit into
flutter:masterfrom
srawlins:formatting
Open

Check Dart formatting in all packages and in tool/#9873
srawlins wants to merge 1 commit 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
Comment on lines +19 to 20
# 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/package_tests.sh
Comment on lines +18 to +19
# 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/package_tests.sh
Comment on lines +30 to +31
# 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/package_tests.sh
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
Comment on lines +16 to +17
# Here, we use the dart instance from the flutter SDK.
$(dirname $(which flutter))/dart format --output=none --set-exit-if-changed lib/ test/

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 lib/ test/
dart format --output=none --set-exit-if-changed lib/ test/

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.

1 participant