Skip to content

Commit 8ca6b4e

Browse files
committed
ci: add ktlint check
Fixes #21
1 parent a289fc7 commit 8ca6b4e

File tree

46 files changed

+137
-136
lines changed

Some content is hidden

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

46 files changed

+137
-136
lines changed

.editorconfig

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
[*.{kt,kts}]
2-
ktlint_code_style = intellij_idea
3-
ktlint_standard_final-newline = disabled
2+
max_line_length = 120
3+
ktlint_code_style = android_studio
4+
ktlint_standard_final-newline = disabled
5+
ktlint_standard_no-empty-first-line-in-class-body = disabled
6+
ij_kotlin_allow_trailing_comma_on_call_site=true
7+
ij_kotlin_allow_trailing_comma=true
8+
ktlint_function_naming_ignore_when_annotated_with = Composable
9+
ktlint_class_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = 1
10+
ktlint_function_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = 2
11+
ktlint_standard_import-ordering = disabled
12+
ktlint_standard_function-signature = disabled

app/build.gradle.kts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ android {
2222
buildTypes {
2323
release {
2424
isMinifyEnabled = false
25-
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
25+
proguardFiles(
26+
getDefaultProguardFile("proguard-android-optimize.txt"),
27+
"proguard-rules.pro",
28+
)
2629
}
2730
}
2831

app/src/androidTest/java/org/mrlem/composesample/ExampleInstrumentedTest.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
package org.mrlem.composesample
22

3-
import androidx.test.platform.app.InstrumentationRegistry
43
import androidx.test.ext.junit.runners.AndroidJUnit4
5-
4+
import androidx.test.platform.app.InstrumentationRegistry
5+
import org.junit.Assert.assertEquals
66
import org.junit.Test
77
import org.junit.runner.RunWith
88

9-
import org.junit.Assert.*
10-
119
/**
1210
* Instrumented test, which will execute on an Android device.
1311
*
1412
* See [testing documentation](http://d.android.com/tools/testing).
1513
*/
1614
@RunWith(AndroidJUnit4::class)
1715
class ExampleInstrumentedTest {
16+
1817
@Test
1918
fun useAppContext() {
2019
// Context of the app under test.

app/src/main/java/org/mrlem/composesample/Application.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ import timber.log.Timber
1111
import javax.inject.Inject
1212

1313
@HiltAndroidApp
14-
class Application : Application(), SingletonImageLoader.Factory {
14+
class Application :
15+
Application(),
16+
SingletonImageLoader.Factory {
1517

1618
@Inject
1719
lateinit var httpClient: OkHttpClient
@@ -30,5 +32,4 @@ class Application : Application(), SingletonImageLoader.Factory {
3032
add(OkHttpNetworkFetcherFactory(callFactory = { httpClient }))
3133
}
3234
.build()
33-
3435
}

app/src/main/java/org/mrlem/composesample/MainActivity.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,4 @@ class MainActivity : ComponentActivity() {
3939
}
4040
}
4141
}
42-
4342
}

app/src/main/java/org/mrlem/composesample/MainNavBar.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fun MainNavBar(
3131
popUpTo(0)
3232
launchSingleTop = true
3333
}
34-
}
34+
},
3535
)
3636
}
3737
}

app/src/main/java/org/mrlem/composesample/di/MainModule.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,4 @@ class MainModule {
2525
@Provides
2626
@ApplicationScope
2727
fun provideApplicationScope() = applicationScope
28-
2928
}

app/src/main/java/org/mrlem/composesample/di/NetworkModule.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,4 @@ class NetworkModule {
2424
chain.proceed(requestWithUserAgent)
2525
}
2626
.build()
27-
2827
}

app/src/test/java/org/mrlem/composesample/ExampleUnitTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package org.mrlem.composesample
22

3+
import org.junit.Assert.assertEquals
34
import org.junit.Test
45

5-
import org.junit.Assert.*
6-
76
/**
87
* Example local unit test, which will execute on the development machine (host).
98
*
109
* See [testing documentation](http://d.android.com/tools/testing).
1110
*/
1211
class ExampleUnitTest {
12+
1313
@Test
1414
fun addition_isCorrect() {
1515
assertEquals(4, 2 + 2)

core/feature/nav/src/main/java/org/mrlem/android/core/feature/nav/Destination.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ interface Destination {
1010
companion object {
1111

1212
val DEFAULT = object : Target {}
13-
1413
}
15-
1614
}
17-
1815
}

0 commit comments

Comments
 (0)