Set up Kotlin linting step in ci with ktlint (#143478)
Adds a kotlin linting step to the linux analyze check, using a version of [ktlint](https://github.com/pinterest/ktlint) hosted on [CIPD](https://chrome-infra-packages.appspot.com/p/flutter/ktlint/linux-amd64/+/version_1_1_1). Configured to disallow trailing commas, because of (and now acting as a test for) https://github.com/flutter/flutter/pull/145718. Because of this configuration the PR also removes some trailing commas in some kotlin files. Also checks in a baseline file.
This commit is contained in:
@@ -23,7 +23,7 @@ class MainActivity : FragmentActivity() {
|
||||
root.layoutParams =
|
||||
LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
LinearLayout.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
root.orientation = LinearLayout.VERTICAL
|
||||
root.weightSum = numberOfFlutters.toFloat()
|
||||
@@ -36,7 +36,7 @@ class MainActivity : FragmentActivity() {
|
||||
val dartEntrypoint =
|
||||
DartExecutor.DartEntrypoint(
|
||||
FlutterInjector.instance().flutterLoader().findAppBundlePath(),
|
||||
"main",
|
||||
"main"
|
||||
)
|
||||
val engines =
|
||||
generateSequence(0) { it + 1 }
|
||||
@@ -51,7 +51,7 @@ class MainActivity : FragmentActivity() {
|
||||
LinearLayout.LayoutParams(
|
||||
FrameLayout.LayoutParams.MATCH_PARENT,
|
||||
FrameLayout.LayoutParams.MATCH_PARENT,
|
||||
1.0f,
|
||||
1.0f
|
||||
)
|
||||
val engine = engines[i]
|
||||
FlutterEngineCache.getInstance().put(i.toString(), engine)
|
||||
@@ -61,7 +61,7 @@ class MainActivity : FragmentActivity() {
|
||||
.beginTransaction()
|
||||
.add(
|
||||
12345 + i,
|
||||
flutterFragment,
|
||||
flutterFragment
|
||||
)
|
||||
.commit()
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ class MainActivity : FlutterActivity() {
|
||||
flutterEngine.dartExecutor,
|
||||
"dev.flutter.echo.background.standard",
|
||||
StandardMessageCodec.INSTANCE,
|
||||
taskQueue,
|
||||
taskQueue
|
||||
)
|
||||
backgroundStandard.setMessageHandler { message, reply -> reply.reply(message) }
|
||||
super.configureFlutterEngine(flutterEngine)
|
||||
|
||||
Reference in New Issue
Block a user