Skip to content

Commit f2056bb

Browse files
committed
Update layer package convention naming
Accept camelCase regarding Kotlin guidelines. https://kotlinlang.org/docs/coding-conventions.html#naming-rules
1 parent 89662ce commit f2056bb

File tree

2 files changed

+4
-3
lines changed
  • lib/src
    • main/kotlin/com/lemonappdev/konsist/api/architecture
    • test/kotlin/com/lemonappdev/konsist/api/architecture

2 files changed

+4
-3
lines changed

lib/src/main/kotlin/com/lemonappdev/konsist/api/architecture/Layer.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ data class Layer(
100100
"Invalid package definition for layer '$name'. " +
101101
"Invalid package segment '$segment' at position ${index + 1}. " +
102102
"Package segments must start with a lowercase letter and contain only " +
103-
"lowercase letters, numbers, or underscores. Current definition: $rootPackage",
103+
"letters, numbers, or underscores. Current definition: $rootPackage",
104104
)
105105
}
106106
}
@@ -119,6 +119,6 @@ data class Layer(
119119
"the definition must end with '..'. Current definition: $rootPackage"
120120

121121
private companion object {
122-
private val REGEX_VALID_PACKAGE_SEGMENT = Regex("^[a-z][a-z0-9_]*$")
122+
private val REGEX_VALID_PACKAGE_SEGMENT = Regex("^[a-z][a-zA-Z0-9_]*$")
123123
}
124124
}

lib/src/test/kotlin/com/lemonappdev/konsist/api/architecture/LayerTest.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class LayerTest {
5656
}
5757

5858
@Test
59-
fun `create Layer with uppercase package segment should throw exception`() {
59+
fun `create Layer with Pascal case package segment should throw exception`() {
6060
// when
6161
val func = { Layer(name = "name", rootPackage = "Com.example..") }
6262

@@ -111,6 +111,7 @@ class LayerTest {
111111
"com.example.test..",
112112
"com.example1.test2..",
113113
"com.example_test..",
114+
"com.exampleTest..",
114115
)
115116

116117
// then

0 commit comments

Comments
 (0)