Skip to content

Commit 2b190f2

Browse files
Nivaldo Bondançafacebook-github-bot
authored andcommitted
Codemod format for trailing commas incoming change [300/n] (#53338)
Summary: X-link: react/yoga#1848 Pull Request resolved: #53338 Adding trailing commas to folders: - xplat/js/react-native-github/packages/react-native - xplat/kotlin/ast_tools/core/src - xplat/kotlin_compiler_plugins/template/src/main - xplat/kotlin/kotlin_multiplatform_template/src/commonMain - xplat/libraries/bloks/bloks-debugging/src - xplat/libraries/bloks/bloks-lispy/src - xplat/libraries/bloks/bloks-step-debugger/src - xplat/mdv/uifiddle-prototype/android-server/playground - xplat/mdv/uifiddle-prototype/android-server/server - xplat/oxygen/common/src/test - xplat/oxygen/mpts/src/main - xplat/oxygen/mpts/src/test - xplat/prototypes/smartglasses/AndroidStudioProjects/MetaAccessoryTest - xplat/prototypes/smartglasses/AndroidStudioProjects/MetaWearableSDKSampleApp - xplat/prototypes/smartglasses/AndroidStudioProjects/MetaWearableSDK - xplat/prototypes/smartglasses/AndroidStudioProjects/Voice - xplat/ReactNative/react-native-cxx/react/renderer - xplat/rtc/media/tools/audio - xplat/security/prodsec/android/codetransparency - xplat/security/prodsec/siggy/java - xplat/simplesql/codegen/java/com - xplat/sonar/android/plugins/jetpack-compose - xplat/sonar/android/plugins/leakcanary2 - xplat/sonar/android/plugins/litho - xplat/sonar/android/plugins/retrofit2-protobuf - xplat/sonar/android/sample/src - xplat/sonar/android/src/facebook Reviewed By: dtolnay Differential Revision: D80452590 fbshipit-source-id: 2bc79edba21e913f6121a25a269c1a4258f5f31c
1 parent 775daf5 commit 2b190f2

7 files changed

Lines changed: 59 additions & 38 deletions

File tree

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/DebugServerException.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ internal class DebugServerException : RuntimeException {
5252
|\u2022 If you're on a physical device connected to the same machine, run 'adb reverse tcp:<PORT> tcp:<PORT> to forward requests from your device
5353
|\u2022 If your device is on the same Wi-Fi network, set 'Debug server host & port for device' in 'Dev settings' to your machine's IP address and the port of the local dev server - e.g. 10.0.1.1:<PORT>
5454
|
55-
|
56-
"""
55+
|"""
5756
.trimMargin()
5857

5958
@JvmStatic

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/PerfMonitorOverlayViewManager.kt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import java.util.Locale
3030

3131
internal class PerfMonitorOverlayViewManager(
3232
private val contextSupplier: Supplier<Context?>,
33-
private val onRequestAnalyzeTrace: () -> Unit
33+
private val onRequestAnalyzeTrace: () -> Unit,
3434
) : PerfMonitorOverlayManager {
3535
private var initialized: Boolean = false
3636
private var enabled: Boolean = false
@@ -151,7 +151,11 @@ internal class PerfMonitorOverlayViewManager(
151151
LinearLayout(context).apply {
152152
orientation = LinearLayout.VERTICAL
153153
setPadding(
154-
dpToPx(8f).toInt(), dpToPx(16f).toInt(), dpToPx(16f).toInt(), dpToPx(8f).toInt())
154+
dpToPx(8f).toInt(),
155+
dpToPx(16f).toInt(),
156+
dpToPx(16f).toInt(),
157+
dpToPx(8f).toInt(),
158+
)
155159
addView(buttonInner)
156160
setOnClickListener { onRequestAnalyzeTrace() }
157161
}
@@ -205,7 +209,9 @@ internal class PerfMonitorOverlayViewManager(
205209
setPadding(paddingHorizontal, paddingVertical, paddingHorizontal, paddingVertical)
206210
layoutParams =
207211
LinearLayout.LayoutParams(
208-
LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT)
212+
LinearLayout.LayoutParams.WRAP_CONTENT,
213+
LinearLayout.LayoutParams.WRAP_CONTENT,
214+
)
209215
background =
210216
GradientDrawable().apply {
211217
shape = GradientDrawable.RECTANGLE

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/internal/LegacyArchitectureShadowNodeLogger.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ public object LegacyArchitectureShadowNodeLogger {
3737
if (implementsYogaMeasureFunction && !annotatedWithCxxImpl) {
3838
val message =
3939
"""
40-
[Legacy Architecture] The ViewManager `$viewManagerName` is unlikely to work with the New Architecture.
41-
That's because the shadow node `${shadowNodeClass.simpleName}` implements the `YogaMeasureFunction.measure()` method.
42-
This is not supported in the New Architecture as shadow nodes with custom measurements should be implemented in C++.
43-
"""
40+
[Legacy Architecture] The ViewManager `$viewManagerName` is unlikely to work with the New Architecture.
41+
That's because the shadow node `${shadowNodeClass.simpleName}` implements the `YogaMeasureFunction.measure()` method.
42+
This is not supported in the New Architecture as shadow nodes with custom measurements should be implemented in C++.
43+
"""
4444
.trimIndent()
4545

4646
if (ReactBuildConfig.DEBUG) {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributes.kt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -114,20 +114,20 @@ public class TextAttributes {
114114

115115
override fun toString(): String =
116116
"""
117-
TextAttributes {
118-
getAllowFontScaling(): $allowFontScaling
119-
getFontSize(): $fontSize
120-
getEffectiveFontSize(): $effectiveFontSize
121-
getHeightOfTallestInlineViewOrImage(): $heightOfTallestInlineViewOrImage
122-
getLetterSpacing(): $letterSpacing
123-
getEffectiveLetterSpacing(): $effectiveLetterSpacing
124-
getLineHeight(): $lineHeight
125-
getEffectiveLineHeight(): $effectiveLineHeight
126-
getTextTransform(): $textTransform
127-
getMaxFontSizeMultiplier(): $maxFontSizeMultiplier
128-
getEffectiveMaxFontSizeMultiplier(): $effectiveMaxFontSizeMultiplier
129-
}
130-
"""
117+
TextAttributes {
118+
getAllowFontScaling(): $allowFontScaling
119+
getFontSize(): $fontSize
120+
getEffectiveFontSize(): $effectiveFontSize
121+
getHeightOfTallestInlineViewOrImage(): $heightOfTallestInlineViewOrImage
122+
getLetterSpacing(): $letterSpacing
123+
getEffectiveLetterSpacing(): $effectiveLetterSpacing
124+
getLineHeight(): $lineHeight
125+
getEffectiveLineHeight(): $effectiveLineHeight
126+
getTextTransform(): $textTransform
127+
getMaxFontSizeMultiplier(): $maxFontSizeMultiplier
128+
getEffectiveMaxFontSizeMultiplier(): $effectiveMaxFontSizeMultiplier
129+
}
130+
"""
131131
.trimIndent()
132132

133133
internal companion object {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/viewexperimental/ReactVirtualViewExperimental.kt

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public class ReactVirtualViewExperimental(context: Context) :
8484
oldLeft: Int,
8585
oldTop: Int,
8686
oldRight: Int,
87-
oldBottom: Int
87+
oldBottom: Int,
8888
) {
8989
if (oldLeft != left || oldTop != top) {
9090
updateParentOffset()
@@ -128,27 +128,43 @@ public class ReactVirtualViewExperimental(context: Context) :
128128
if (renderState == VirtualViewRenderState.Unknown) {
129129
// Feature flag is disabled, so use the former logic.
130130
modeChangeEmitter?.emitModeChange(
131-
VirtualViewMode.Visible, containerRelativeRect, thresholdRect, synchronous = true)
131+
VirtualViewMode.Visible,
132+
containerRelativeRect,
133+
thresholdRect,
134+
synchronous = true,
135+
)
132136
} else {
133137
// If the previous mode was prerender and the result of dispatching that event was
134138
// committed, we do not need to dispatch an event for visible.
135139
val wasPrerenderCommitted =
136140
oldMode == VirtualViewMode.Prerender && renderState == VirtualViewRenderState.Rendered
137141
if (!wasPrerenderCommitted) {
138142
modeChangeEmitter?.emitModeChange(
139-
VirtualViewMode.Visible, containerRelativeRect, thresholdRect, synchronous = true)
143+
VirtualViewMode.Visible,
144+
containerRelativeRect,
145+
thresholdRect,
146+
synchronous = true,
147+
)
140148
}
141149
}
142150
}
143151
VirtualViewMode.Prerender -> {
144152
if (oldMode != VirtualViewMode.Visible) {
145153
modeChangeEmitter?.emitModeChange(
146-
VirtualViewMode.Prerender, containerRelativeRect, thresholdRect, synchronous = false)
154+
VirtualViewMode.Prerender,
155+
containerRelativeRect,
156+
thresholdRect,
157+
synchronous = false,
158+
)
147159
}
148160
}
149161
VirtualViewMode.Hidden -> {
150162
modeChangeEmitter?.emitModeChange(
151-
VirtualViewMode.Hidden, containerRelativeRect, thresholdRect, synchronous = false)
163+
VirtualViewMode.Hidden,
164+
containerRelativeRect,
165+
thresholdRect,
166+
synchronous = false,
167+
)
152168
}
153169
}
154170
}

packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfig.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ package com.facebook.yoga
1010
public abstract class YogaConfig {
1111
public abstract fun setExperimentalFeatureEnabled(
1212
feature: YogaExperimentalFeature,
13-
enabled: Boolean
13+
enabled: Boolean,
1414
)
1515

1616
public abstract fun setUseWebDefaults(useWebDefaults: Boolean)

packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaNative.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public object YogaNative {
2626
public external fun jni_YGConfigSetExperimentalFeatureEnabledJNI(
2727
nativePointer: Long,
2828
feature: Int,
29-
enabled: Boolean
29+
enabled: Boolean,
3030
)
3131

3232
@JvmStatic
@@ -59,7 +59,7 @@ public object YogaNative {
5959
@JvmStatic
6060
public external fun jni_YGNodeSetIsReferenceBaselineJNI(
6161
nativePointer: Long,
62-
isReferenceBaseline: Boolean
62+
isReferenceBaseline: Boolean,
6363
)
6464

6565
@JvmStatic public external fun jni_YGNodeIsReferenceBaselineJNI(nativePointer: Long): Boolean
@@ -74,7 +74,7 @@ public object YogaNative {
7474
width: Float,
7575
height: Float,
7676
nativePointers: LongArray,
77-
nodes: Array<YogaNodeJNIBase>
77+
nodes: Array<YogaNodeJNIBase>,
7878
)
7979

8080
@JvmStatic public external fun jni_YGNodeMarkDirtyJNI(nativePointer: Long)
@@ -171,7 +171,7 @@ public object YogaNative {
171171
public external fun jni_YGNodeStyleSetMarginPercentJNI(
172172
nativePointer: Long,
173173
edge: Int,
174-
percent: Float
174+
percent: Float,
175175
)
176176

177177
@JvmStatic public external fun jni_YGNodeStyleSetMarginAutoJNI(nativePointer: Long, edge: Int)
@@ -185,7 +185,7 @@ public object YogaNative {
185185
public external fun jni_YGNodeStyleSetPaddingPercentJNI(
186186
nativePointer: Long,
187187
edge: Int,
188-
percent: Float
188+
percent: Float,
189189
)
190190

191191
@JvmStatic public external fun jni_YGNodeStyleGetBorderJNI(nativePointer: Long, edge: Int): Float
@@ -202,7 +202,7 @@ public object YogaNative {
202202
public external fun jni_YGNodeStyleSetPositionPercentJNI(
203203
nativePointer: Long,
204204
edge: Int,
205-
percent: Float
205+
percent: Float,
206206
)
207207

208208
@JvmStatic public external fun jni_YGNodeStyleSetPositionAutoJNI(nativePointer: Long, edge: Int)
@@ -305,7 +305,7 @@ public object YogaNative {
305305
public external fun jni_YGNodeStyleSetGapPercentJNI(
306306
nativePointer: Long,
307307
gutter: Int,
308-
gapLength: Float
308+
gapLength: Float,
309309
)
310310

311311
@JvmStatic
@@ -318,14 +318,14 @@ public object YogaNative {
318318
public external fun jni_YGNodeSetStyleInputsJNI(
319319
nativePointer: Long,
320320
styleInputsArray: FloatArray,
321-
size: Int
321+
size: Int,
322322
)
323323

324324
@JvmStatic public external fun jni_YGNodeCloneJNI(nativePointer: Long): Long
325325

326326
@JvmStatic
327327
public external fun jni_YGNodeSetAlwaysFormsContainingBlockJNI(
328328
nativePointer: Long,
329-
alwaysFormContainingBlock: Boolean
329+
alwaysFormContainingBlock: Boolean,
330330
)
331331
}

0 commit comments

Comments
 (0)