Skip to content

Commit dae6342

Browse files
authored
Check Dart formatting in all packages and in tool/ (#9873)
* Check formatting in all packages and in tool/ * feedback * format
1 parent 489028a commit dae6342

4 files changed

Lines changed: 27 additions & 5 deletions

File tree

packages/devtools_shared/lib/src/server/handlers/_devtools_extensions.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ extension _ExtensionsApiHandler on Never {
9090
// separators, so the check holds for Windows file URIs as well. Requiring
9191
// an empty host rejects UNC paths (e.g. `file://server/share/...`) and
9292
// keeps `toFilePath()` from throwing on a non-local authority.
93-
final isFileUri = devtoolsOptionsFileUri.scheme == 'file' &&
93+
final isFileUri =
94+
devtoolsOptionsFileUri.scheme == 'file' &&
9495
devtoolsOptionsFileUri.host.isEmpty;
9596
final fileName = isFileUri
9697
? p.basename(devtoolsOptionsFileUri.toFilePath())

tool/ci/bots.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ echo `pwd`
1515

1616
if [ "$BOT" = "main" ]; then
1717

18-
# Verify that dart format has been run.
1918
echo "Checking formatting..."
20-
# Here, we use the dart instance from the flutter sdk.
21-
$(dirname $(which flutter))/dart format --output=none --set-exit-if-changed .
19+
# Here, we use the dart instance from the flutter SDK.
20+
dart format --output=none --set-exit-if-changed .
2221

2322
# Make sure the app versions are in sync.
2423
dt repo-check

tool/ci/package_tests.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,25 @@ if [ "$PACKAGE" = "devtools_app_shared" ]; then
1313

1414
pushd $DEVTOOLS_DIR/packages/devtools_app_shared
1515
echo `pwd`
16+
17+
echo "Checking formatting..."
18+
# Here, we use the dart instance from the flutter SDK.
19+
dart format --output=none --set-exit-if-changed .
20+
1621
flutter test test/
1722
popd
1823

1924
elif [ "$PACKAGE" = "devtools_extensions" ]; then
2025

2126
pushd $DEVTOOLS_DIR/packages/devtools_extensions
2227
echo `pwd`
28+
29+
echo "Checking formatting..."
30+
# Here, we use the dart instance from the flutter SDK.
31+
dart format --output=none --set-exit-if-changed .
32+
33+
# Note that this will _not_ test any tests in nested directories, if we add
34+
# any.
2335
flutter test test/*_test.dart
2436
# Skip this on Windows because `flutter test --platform chrome`
2537
# appears to hang there.
@@ -33,6 +45,11 @@ elif [ "$PACKAGE" = "devtools_shared" ]; then
3345

3446
pushd $DEVTOOLS_DIR/packages/devtools_shared
3547
echo `pwd`
48+
49+
echo "Checking formatting..."
50+
# Here, we use the dart instance from the flutter SDK.
51+
dart format --output=none --set-exit-if-changed .
52+
3653
dart test test/
3754
popd
3855

tool/ci/tool_tests.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,10 @@ source ./tool/ci/setup.sh
1111

1212
pushd $DEVTOOLS_DIR/tool
1313
echo `pwd`
14+
15+
echo "Checking formatting..."
16+
# Here, we use the dart instance from the flutter SDK.
17+
dart format --output=none --set-exit-if-changed lib/ test/
18+
1419
flutter test test/
15-
popd
20+
popd

0 commit comments

Comments
 (0)