Check Dart formatting in all packages and in tool/ (#9873)
* Check formatting in all packages and in tool/
* feedback
* format
diff --git a/packages/devtools_shared/lib/src/server/handlers/_devtools_extensions.dart b/packages/devtools_shared/lib/src/server/handlers/_devtools_extensions.dart
index 0ee24d9..22dded4 100644
--- a/packages/devtools_shared/lib/src/server/handlers/_devtools_extensions.dart
+++ b/packages/devtools_shared/lib/src/server/handlers/_devtools_extensions.dart
@@ -90,7 +90,8 @@
// separators, so the check holds for Windows file URIs as well. Requiring
// an empty host rejects UNC paths (e.g. `file://server/share/...`) and
// keeps `toFilePath()` from throwing on a non-local authority.
- final isFileUri = devtoolsOptionsFileUri.scheme == 'file' &&
+ final isFileUri =
+ devtoolsOptionsFileUri.scheme == 'file' &&
devtoolsOptionsFileUri.host.isEmpty;
final fileName = isFileUri
? p.basename(devtoolsOptionsFileUri.toFilePath())
diff --git a/tool/ci/bots.sh b/tool/ci/bots.sh
index bd4a4b6..7137175 100755
--- a/tool/ci/bots.sh
+++ b/tool/ci/bots.sh
@@ -15,10 +15,9 @@
if [ "$BOT" = "main" ]; then
- # Verify that dart format has been run.
echo "Checking formatting..."
- # Here, we use the dart instance from the flutter sdk.
- $(dirname $(which flutter))/dart format --output=none --set-exit-if-changed .
+ # Here, we use the dart instance from the flutter SDK.
+ dart format --output=none --set-exit-if-changed .
# Make sure the app versions are in sync.
dt repo-check
diff --git a/tool/ci/package_tests.sh b/tool/ci/package_tests.sh
index 29e4567..6e08683 100755
--- a/tool/ci/package_tests.sh
+++ b/tool/ci/package_tests.sh
@@ -13,6 +13,11 @@
pushd $DEVTOOLS_DIR/packages/devtools_app_shared
echo `pwd`
+
+ echo "Checking formatting..."
+ # Here, we use the dart instance from the flutter SDK.
+ dart format --output=none --set-exit-if-changed .
+
flutter test test/
popd
@@ -20,6 +25,13 @@
pushd $DEVTOOLS_DIR/packages/devtools_extensions
echo `pwd`
+
+ echo "Checking formatting..."
+ # Here, we use the dart instance from the flutter SDK.
+ dart format --output=none --set-exit-if-changed .
+
+ # Note that this will _not_ test any tests in nested directories, if we add
+ # any.
flutter test test/*_test.dart
# Skip this on Windows because `flutter test --platform chrome`
# appears to hang there.
@@ -33,6 +45,11 @@
pushd $DEVTOOLS_DIR/packages/devtools_shared
echo `pwd`
+
+ echo "Checking formatting..."
+ # Here, we use the dart instance from the flutter SDK.
+ dart format --output=none --set-exit-if-changed .
+
dart test test/
popd
diff --git a/tool/ci/tool_tests.sh b/tool/ci/tool_tests.sh
index 58feb6e..29aa5dd 100755
--- a/tool/ci/tool_tests.sh
+++ b/tool/ci/tool_tests.sh
@@ -11,5 +11,10 @@
pushd $DEVTOOLS_DIR/tool
echo `pwd`
+
+echo "Checking formatting..."
+# Here, we use the dart instance from the flutter SDK.
+dart format --output=none --set-exit-if-changed lib/ test/
+
flutter test test/
-popd
\ No newline at end of file
+popd