Skip to content

Commit 2120789

Browse files
authored
New convention plugins for lint tasks (#641)
Added new task `lintAll`. This task dependsOn spotless and detekt executions.
1 parent 4e0cff4 commit 2120789

File tree

196 files changed

+1259
-1528
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+1259
-1528
lines changed

app-common/designsystem/build.gradle.kts

+15-25
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
alias(libs.plugins.kotlinMultiplatform)
44
alias(libs.plugins.composeCompiler)
55
alias(libs.plugins.composeMultiplatform)
6-
id("dev.sergiobelda.gradle.base")
6+
id("dev.sergiobelda.gradle.lint")
77
id("dev.sergiobelda.gradle.common.library.android")
88
id("dev.sergiobelda.gradle.dependency-graph-generator")
99
}
@@ -16,35 +16,25 @@ kotlin {
1616
iosSimulatorArm64()
1717

1818
sourceSets {
19-
val commonMain by getting {
20-
dependencies {
21-
api(projects.common.designsystemResources)
19+
commonMain.dependencies {
20+
api(projects.common.designsystemResources)
2221

23-
implementation(compose.runtime)
24-
implementation(compose.foundation)
25-
implementation(compose.material3)
26-
implementation(compose.ui)
27-
}
22+
implementation(compose.runtime)
23+
implementation(compose.foundation)
24+
implementation(compose.material3)
25+
implementation(compose.ui)
2826
}
29-
val commonTest by getting
30-
val androidMain by getting {
31-
dependencies {
32-
implementation(compose.uiTooling)
33-
}
27+
28+
androidMain.dependencies {
29+
implementation(compose.uiTooling)
3430
}
35-
val androidUnitTest by getting {
36-
dependencies {
37-
implementation(libs.junit)
38-
}
31+
androidUnitTest.dependencies {
32+
implementation(libs.junit)
3933
}
40-
val desktopMain by getting {
41-
dependencies {
42-
implementation(compose.uiTooling)
43-
}
34+
val desktopMain by getting
35+
desktopMain.dependencies {
36+
implementation(compose.uiTooling)
4437
}
45-
val desktopTest by getting
46-
val iosMain by creating
47-
val iosTest by creating
4838

4939
all {
5040
languageSettings.optIn("kotlin.RequiresOptIn")

app-common/designsystem/src/commonMain/kotlin/dev/sergiobelda/todometer/app/common/designsystem/components/TodometerCheckbox.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ fun TodometerCheckbox(
3030
onCheckedChange: ((Boolean) -> Unit)?,
3131
modifier: Modifier = Modifier,
3232
enabled: Boolean = true,
33-
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }
33+
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
3434
) {
3535
Checkbox(
3636
checked = checked,
3737
onCheckedChange = onCheckedChange,
3838
modifier = modifier,
3939
enabled = enabled,
4040
interactionSource = interactionSource,
41-
colors = CheckboxDefaults.colors(checkedColor = MaterialTheme.colorScheme.primary)
41+
colors = CheckboxDefaults.colors(checkedColor = MaterialTheme.colorScheme.primary),
4242
)
4343
}

app-common/designsystem/src/commonMain/kotlin/dev/sergiobelda/todometer/app/common/designsystem/components/TodometerChip.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ fun TodometerChip(
3636
modifier: Modifier = Modifier,
3737
border: BorderStroke = TodometerChipDefaults.borderStroke,
3838
color: Color = TodometerChipDefaults.color,
39-
content: @Composable RowScope.() -> Unit
39+
content: @Composable RowScope.() -> Unit,
4040
) {
4141
Surface(
4242
modifier = modifier,
4343
border = border,
4444
shape = RoundedCornerShape(TodometerChipCornerRadius),
45-
color = color
45+
color = color,
4646
) {
4747
Row(
4848
modifier = Modifier.padding(TodometerChipContentPadding),
49-
verticalAlignment = Alignment.CenterVertically
49+
verticalAlignment = Alignment.CenterVertically,
5050
) {
5151
content()
5252
}
@@ -57,7 +57,7 @@ private object TodometerChipDefaults {
5757
val borderStroke: BorderStroke
5858
@Composable get() = BorderStroke(
5959
1.dp,
60-
MaterialTheme.colorScheme.outline
60+
MaterialTheme.colorScheme.outline,
6161
)
6262

6363
val color: Color @Composable get() = MaterialTheme.colorScheme.surface

app-common/designsystem/src/commonMain/kotlin/dev/sergiobelda/todometer/app/common/designsystem/components/TodometerDivider.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ import androidx.compose.ui.unit.dp
2828
fun TodometerDivider(
2929
modifier: Modifier = Modifier,
3030
thickness: Dp = TodometerDividerDefaults.thickness,
31-
color: Color = TodometerDividerDefaults.color
31+
color: Color = TodometerDividerDefaults.color,
3232
) {
3333
HorizontalDivider(
3434
modifier = modifier,
3535
thickness = thickness,
36-
color = color
36+
color = color,
3737
)
3838
}
3939

app-common/designsystem/src/commonMain/kotlin/dev/sergiobelda/todometer/app/common/designsystem/components/TodometerTitledTextField.kt

+14-14
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,17 @@ fun TodometerTitledTextField(
4949
colors: TextFieldColors = OutlinedTextFieldDefaults.colors(
5050
focusedBorderColor = Color.Transparent,
5151
unfocusedBorderColor = Color.Transparent,
52-
errorBorderColor = Color.Transparent
53-
)
52+
errorBorderColor = Color.Transparent,
53+
),
5454
) {
5555
Column(
56-
modifier = modifier
56+
modifier = modifier,
5757
) {
5858
Text(
5959
title,
6060
color = MaterialTheme.colorScheme.primary,
6161
style = MaterialTheme.typography.labelLarge,
62-
modifier = Modifier.padding(start = TodometerTitledTextFieldTitlePaddingStart)
62+
modifier = Modifier.padding(start = TodometerTitledTextFieldTitlePaddingStart),
6363
)
6464
TextField(
6565
value = value,
@@ -71,7 +71,7 @@ fun TodometerTitledTextField(
7171
keyboardOptions = keyboardOptions,
7272
singleLine = singleLine,
7373
maxLines = maxLines,
74-
colors = colors
74+
colors = colors,
7575
)
7676
}
7777
}
@@ -92,17 +92,17 @@ fun TodometerTitledTextField(
9292
colors: TextFieldColors = OutlinedTextFieldDefaults.colors(
9393
focusedBorderColor = Color.Transparent,
9494
unfocusedBorderColor = Color.Transparent,
95-
errorBorderColor = Color.Transparent
96-
)
95+
errorBorderColor = Color.Transparent,
96+
),
9797
) {
9898
Column(
99-
modifier = modifier
99+
modifier = modifier,
100100
) {
101101
Text(
102102
title,
103103
color = MaterialTheme.colorScheme.primary,
104104
style = MaterialTheme.typography.labelLarge,
105-
modifier = Modifier.padding(start = TodometerTitledTextFieldTitlePaddingStart)
105+
modifier = Modifier.padding(start = TodometerTitledTextFieldTitlePaddingStart),
106106
)
107107
TextField(
108108
value = value,
@@ -114,7 +114,7 @@ fun TodometerTitledTextField(
114114
keyboardOptions = keyboardOptions,
115115
singleLine = singleLine,
116116
maxLines = maxLines,
117-
colors = colors
117+
colors = colors,
118118
)
119119
}
120120
}
@@ -133,8 +133,8 @@ private fun TextField(
133133
colors: TextFieldColors = OutlinedTextFieldDefaults.colors(
134134
focusedBorderColor = Color.Transparent,
135135
unfocusedBorderColor = Color.Transparent,
136-
errorBorderColor = Color.Transparent
137-
)
136+
errorBorderColor = Color.Transparent,
137+
),
138138
) {
139139
OutlinedTextField(
140140
value = value,
@@ -146,14 +146,14 @@ private fun TextField(
146146
isError = isError,
147147
singleLine = singleLine,
148148
maxLines = maxLines,
149-
colors = colors
149+
colors = colors,
150150
)
151151
if (isError) {
152152
Text(
153153
errorMessage,
154154
color = MaterialTheme.colorScheme.error,
155155
style = MaterialTheme.typography.labelLarge,
156-
modifier = Modifier.padding(start = 16.dp)
156+
modifier = Modifier.padding(start = 16.dp),
157157
)
158158
}
159159
}

app-common/designsystem/src/commonMain/kotlin/dev/sergiobelda/todometer/app/common/designsystem/theme/ColorScheme.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ val LightColorScheme = lightColorScheme(
126126
inverseOnSurface = todometer_light_inverseOnSurface,
127127
inverseSurface = todometer_light_inverseSurface,
128128
inversePrimary = todometer_light_inversePrimary,
129-
surfaceTint = todometer_light_surfaceTint
129+
surfaceTint = todometer_light_surfaceTint,
130130
)
131131

132132
val TodometerLightColors = todometerLightColors(
@@ -142,7 +142,7 @@ val TodometerLightColors = todometerLightColors(
142142
red = redLight,
143143
pink = pinkLight,
144144
teal = tealLight,
145-
yellow = yellowLight
145+
yellow = yellowLight,
146146
)
147147

148148
val DarkColorScheme = darkColorScheme(
@@ -172,7 +172,7 @@ val DarkColorScheme = darkColorScheme(
172172
inverseOnSurface = todometer_dark_inverseOnSurface,
173173
inverseSurface = todometer_dark_inverseSurface,
174174
inversePrimary = todometer_dark_inversePrimary,
175-
surfaceTint = todometer_dark_surfaceTint
175+
surfaceTint = todometer_dark_surfaceTint,
176176
)
177177

178178
val TodometerDarkColors = todometerDarkColors(
@@ -188,5 +188,5 @@ val TodometerDarkColors = todometerDarkColors(
188188
red = redDark,
189189
pink = pinkDark,
190190
teal = tealDark,
191-
yellow = yellowDark
191+
yellow = yellowDark,
192192
)

app-common/designsystem/src/commonMain/kotlin/dev/sergiobelda/todometer/app/common/designsystem/theme/Shapes.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import androidx.compose.ui.unit.dp
2323
internal val shapes = Shapes(
2424
small = RoundedCornerShape(24.dp),
2525
medium = RoundedCornerShape(8.dp),
26-
large = RoundedCornerShape(12.dp)
26+
large = RoundedCornerShape(12.dp),
2727
)
2828

2929
val drawerShape =

app-common/designsystem/src/commonMain/kotlin/dev/sergiobelda/todometer/app/common/designsystem/theme/TodometerColors.kt

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class TodometerColors(
3131
val red: Color,
3232
val pink: Color,
3333
val teal: Color,
34-
val yellow: Color
34+
val yellow: Color,
3535
)
3636

3737
fun todometerLightColors(
@@ -47,7 +47,7 @@ fun todometerLightColors(
4747
red: Color = Color.Unspecified,
4848
pink: Color = Color.Unspecified,
4949
teal: Color = Color.Unspecified,
50-
yellow: Color = Color.Unspecified
50+
yellow: Color = Color.Unspecified,
5151
): TodometerColors =
5252
TodometerColors(
5353
check = check,
@@ -62,7 +62,7 @@ fun todometerLightColors(
6262
red = red,
6363
pink = pink,
6464
teal = teal,
65-
yellow = yellow
65+
yellow = yellow,
6666
)
6767

6868
fun todometerDarkColors(
@@ -78,7 +78,7 @@ fun todometerDarkColors(
7878
red: Color = Color.Unspecified,
7979
pink: Color = Color.Unspecified,
8080
teal: Color = Color.Unspecified,
81-
yellow: Color = Color.Unspecified
81+
yellow: Color = Color.Unspecified,
8282
): TodometerColors =
8383
TodometerColors(
8484
check = check,
@@ -93,5 +93,5 @@ fun todometerDarkColors(
9393
red = red,
9494
pink = pink,
9595
teal = teal,
96-
yellow = yellow
96+
yellow = yellow,
9797
)

app-common/designsystem/src/commonMain/kotlin/dev/sergiobelda/todometer/app/common/designsystem/theme/TodometerTheme.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ object TodometerTheme {
3636
fun TodometerTheme(
3737
todometerColors: TodometerColors = TodometerTheme.todometerColors,
3838
colorScheme: ColorScheme = MaterialTheme.colorScheme,
39-
content: @Composable () -> Unit
39+
content: @Composable () -> Unit,
4040
) {
4141
CompositionLocalProvider(
42-
LocalTodometerColors provides todometerColors
42+
LocalTodometerColors provides todometerColors,
4343
) {
4444
MaterialTheme(
4545
colorScheme = colorScheme,
4646
shapes = shapes,
4747
typography = typography,
48-
content = content
48+
content = content,
4949
)
5050
}
5151
}

app-common/designsystem/src/commonMain/kotlin/dev/sergiobelda/todometer/app/common/designsystem/theme/Typography.kt

+13-13
Original file line numberDiff line numberDiff line change
@@ -27,65 +27,65 @@ val typography = Typography(
2727
headlineLarge = TextStyle(
2828
fontFamily = quickSandFontFamily,
2929
fontWeight = FontWeight.Medium,
30-
fontSize = 32.sp
30+
fontSize = 32.sp,
3131
),
3232
headlineMedium = TextStyle(
3333
fontFamily = quickSandFontFamily,
3434
fontWeight = FontWeight.Medium,
35-
fontSize = 28.sp
35+
fontSize = 28.sp,
3636
),
3737
headlineSmall = TextStyle(
3838
fontFamily = quickSandFontFamily,
3939
fontWeight = FontWeight.Medium,
4040
fontSize = 22.sp,
41-
letterSpacing = 0.15.sp
41+
letterSpacing = 0.15.sp,
4242
),
4343
titleLarge = TextStyle(
4444
fontFamily = quickSandFontFamily,
4545
fontWeight = FontWeight.Medium,
46-
fontSize = 20.sp
46+
fontSize = 20.sp,
4747
),
4848
titleMedium = TextStyle(
4949
fontFamily = quickSandFontFamily,
5050
fontWeight = FontWeight.Medium,
51-
fontSize = 16.sp
51+
fontSize = 16.sp,
5252
),
5353
titleSmall = TextStyle(
5454
fontFamily = quickSandFontFamily,
5555
fontWeight = FontWeight.Medium,
56-
fontSize = 14.sp
56+
fontSize = 14.sp,
5757
),
5858
bodyLarge = TextStyle(
5959
fontFamily = quickSandFontFamily,
6060
fontWeight = FontWeight.Medium,
6161
fontSize = 16.sp,
62-
baselineShift = BaselineShift(+0.1f)
62+
baselineShift = BaselineShift(+0.1f),
6363
),
6464
bodyMedium = TextStyle(
6565
fontFamily = quickSandFontFamily,
6666
fontWeight = FontWeight.Medium,
6767
fontSize = 14.sp,
68-
baselineShift = BaselineShift(+0.3f)
68+
baselineShift = BaselineShift(+0.3f),
6969
),
7070
bodySmall = TextStyle(
7171
fontFamily = quickSandFontFamily,
7272
fontWeight = FontWeight.Medium,
73-
fontSize = 12.sp
73+
fontSize = 12.sp,
7474
),
7575
labelLarge = TextStyle(
7676
fontFamily = quickSandFontFamily,
7777
fontWeight = FontWeight.SemiBold,
78-
fontSize = 12.sp
78+
fontSize = 12.sp,
7979
),
8080
labelMedium = TextStyle(
8181
fontFamily = quickSandFontFamily,
8282
fontWeight = FontWeight.Medium,
83-
fontSize = 12.sp
83+
fontSize = 12.sp,
8484
),
8585
labelSmall = TextStyle(
8686
fontFamily = quickSandFontFamily,
8787
fontWeight = FontWeight.Medium,
8888
fontSize = 10.sp,
89-
letterSpacing = 1.5.sp
90-
)
89+
letterSpacing = 1.5.sp,
90+
),
9191
)

0 commit comments

Comments
 (0)