From 90ced90f1bd7311b0b3703013f00ea3d444e2cea Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Tue, 16 Jan 2024 10:07:21 -0800 Subject: [PATCH] Sort Swift imports in templates (#141487) `swift-format` alphabetizes imports. Alphabetize them in swift template files and integration tests. I found this as part of https://github.com/flutter/flutter/issues/41129 running `swift-import` on packages. --- dev/a11y_assessments/ios/Runner/AppDelegate.swift | 2 +- dev/a11y_assessments/macos/RunnerTests/RunnerTests.swift | 2 +- dev/benchmarks/complex_layout/ios/Runner/AppDelegate.swift | 2 +- .../ios_app_with_extensions/ios/Runner/AppDelegate.swift | 2 +- .../ios/watch Extension/HostingController.swift | 2 +- dev/integration_tests/non_nullable/ios/Runner/AppDelegate.swift | 2 +- dev/manual_tests/ios/Runner/AppDelegate.swift | 2 +- .../app_shared/ios-swift.tmpl/Runner/AppDelegate.swift | 2 +- .../app_shared/macos.tmpl/RunnerTests/RunnerTests.swift.tmpl | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dev/a11y_assessments/ios/Runner/AppDelegate.swift b/dev/a11y_assessments/ios/Runner/AppDelegate.swift index d815fed684..36e03f7fbb 100644 --- a/dev/a11y_assessments/ios/Runner/AppDelegate.swift +++ b/dev/a11y_assessments/ios/Runner/AppDelegate.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { diff --git a/dev/a11y_assessments/macos/RunnerTests/RunnerTests.swift b/dev/a11y_assessments/macos/RunnerTests/RunnerTests.swift index 102c761168..eeb5f29483 100644 --- a/dev/a11y_assessments/macos/RunnerTests/RunnerTests.swift +++ b/dev/a11y_assessments/macos/RunnerTests/RunnerTests.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import FlutterMacOS import Cocoa +import FlutterMacOS import XCTest class RunnerTests: XCTestCase { diff --git a/dev/benchmarks/complex_layout/ios/Runner/AppDelegate.swift b/dev/benchmarks/complex_layout/ios/Runner/AppDelegate.swift index d815fed684..36e03f7fbb 100644 --- a/dev/benchmarks/complex_layout/ios/Runner/AppDelegate.swift +++ b/dev/benchmarks/complex_layout/ios/Runner/AppDelegate.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { diff --git a/dev/integration_tests/ios_app_with_extensions/ios/Runner/AppDelegate.swift b/dev/integration_tests/ios_app_with_extensions/ios/Runner/AppDelegate.swift index d815fed684..36e03f7fbb 100644 --- a/dev/integration_tests/ios_app_with_extensions/ios/Runner/AppDelegate.swift +++ b/dev/integration_tests/ios_app_with_extensions/ios/Runner/AppDelegate.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { diff --git a/dev/integration_tests/ios_app_with_extensions/ios/watch Extension/HostingController.swift b/dev/integration_tests/ios_app_with_extensions/ios/watch Extension/HostingController.swift index aa3d624314..02e73381c9 100644 --- a/dev/integration_tests/ios_app_with_extensions/ios/watch Extension/HostingController.swift +++ b/dev/integration_tests/ios_app_with_extensions/ios/watch Extension/HostingController.swift @@ -9,9 +9,9 @@ // Created by Georg Wechslberger on 08.04.20. // -import WatchKit import Foundation import SwiftUI +import WatchKit class HostingController: WKHostingController { override var body: ContentView { diff --git a/dev/integration_tests/non_nullable/ios/Runner/AppDelegate.swift b/dev/integration_tests/non_nullable/ios/Runner/AppDelegate.swift index d815fed684..36e03f7fbb 100644 --- a/dev/integration_tests/non_nullable/ios/Runner/AppDelegate.swift +++ b/dev/integration_tests/non_nullable/ios/Runner/AppDelegate.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { diff --git a/dev/manual_tests/ios/Runner/AppDelegate.swift b/dev/manual_tests/ios/Runner/AppDelegate.swift index d815fed684..36e03f7fbb 100644 --- a/dev/manual_tests/ios/Runner/AppDelegate.swift +++ b/dev/manual_tests/ios/Runner/AppDelegate.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { diff --git a/packages/flutter_tools/templates/app_shared/ios-swift.tmpl/Runner/AppDelegate.swift b/packages/flutter_tools/templates/app_shared/ios-swift.tmpl/Runner/AppDelegate.swift index 70693e4a8c..9074fee929 100644 --- a/packages/flutter_tools/templates/app_shared/ios-swift.tmpl/Runner/AppDelegate.swift +++ b/packages/flutter_tools/templates/app_shared/ios-swift.tmpl/Runner/AppDelegate.swift @@ -1,5 +1,5 @@ -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { diff --git a/packages/flutter_tools/templates/app_shared/macos.tmpl/RunnerTests/RunnerTests.swift.tmpl b/packages/flutter_tools/templates/app_shared/macos.tmpl/RunnerTests/RunnerTests.swift.tmpl index f9bce9cc40..d0177b51eb 100644 --- a/packages/flutter_tools/templates/app_shared/macos.tmpl/RunnerTests/RunnerTests.swift.tmpl +++ b/packages/flutter_tools/templates/app_shared/macos.tmpl/RunnerTests/RunnerTests.swift.tmpl @@ -1,5 +1,5 @@ -import FlutterMacOS import Cocoa +import FlutterMacOS import XCTest {{#withPlatformChannelPluginHook}}