Skip to content

Commit a01cf51

Browse files
committed
Updated to latest versions. Small fixes
1 parent ab2f0d6 commit a01cf51

File tree

8 files changed

+84
-58
lines changed

8 files changed

+84
-58
lines changed

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
root = true
2+
3+
[{*.kt,*.kts}]
4+
ij_kotlin_allow_trailing_comma = true
5+
ij_kotlin_allow_trailing_comma_on_call_site = true

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
# Result Monad
22

33
[![ci](https://github.com/erwin-kok/result-monad/actions/workflows/ci.yaml/badge.svg)](https://github.com/erwin-kok/result-monad/actions/workflows/ci.yaml)
4+
[![Maven Central](https://img.shields.io/maven-central/v/org.erwinkok.result/result-monad)](https://central.sonatype.com/artifact/org.erwinkok.result/result-monad)
5+
[![Kotlin](https://img.shields.io/badge/kotlin-1.8.22-blue.svg?logo=kotlin)](http://kotlinlang.org)
46
[![License](https://img.shields.io/github/license/erwin-kok/result-monad.svg)](https://github.com/erwin-kok/result-monad/blob/master/LICENSE)
57

8+
## Usage
9+
10+
Kotlin DSL:
11+
12+
```kotlin
13+
repositories {
14+
mavenCentral()
15+
}
16+
17+
dependencies {
18+
implementation("org.erwinkok.result:result-monad:1.3.0")
19+
}
20+
```
21+
622
## Introduction
723

824
Suppose you have the following method signature:

build.gradle.kts

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,12 @@
33

44
import com.adarshr.gradle.testlogger.theme.ThemeType
55
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
6-
import kotlinx.kover.gradle.plugin.dsl.AggregationType
7-
import kotlinx.kover.gradle.plugin.dsl.GroupingEntityType
8-
import kotlinx.kover.gradle.plugin.dsl.MetricType
96
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
107
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
118

129
@Suppress("DSL_SCOPE_VIOLATION")
1310
plugins {
14-
kotlin("jvm") version "1.8.21"
11+
kotlin("jvm") version "1.8.22"
1512
`java-library`
1613
`java-test-fixtures`
1714
signing
@@ -29,18 +26,19 @@ repositories {
2926
}
3027

3128
group = "org.erwinkok.result"
32-
version = "1.2.0"
29+
version = "1.3.0"
3330

3431
java {
3532
withSourcesJar()
3633
withJavadocJar()
3734
}
3835

3936
dependencies {
40-
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
41-
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
37+
implementation(platform(kotlin("bom")))
38+
implementation(kotlin("stdlib"))
4239

4340
implementation(libs.kotlin.logging)
41+
implementation(libs.slf4j.api)
4442

4543
testImplementation(libs.kotlinx.coroutines.test)
4644
testImplementation(libs.junit.jupiter.api)
@@ -87,20 +85,22 @@ fun isNonStable(version: String): Boolean {
8785
}
8886

8987
koverReport {
90-
html {
91-
onCheck = true
92-
}
88+
defaults {
89+
html {
90+
onCheck = true
91+
}
9392

94-
verify {
95-
onCheck = true
96-
rule {
97-
isEnabled = true
98-
entity = kotlinx.kover.gradle.plugin.dsl.GroupingEntityType.APPLICATION
99-
bound {
100-
minValue = 0
101-
maxValue = 99
102-
metric = kotlinx.kover.gradle.plugin.dsl.MetricType.LINE
103-
aggregation = kotlinx.kover.gradle.plugin.dsl.AggregationType.COVERED_PERCENTAGE
93+
verify {
94+
onCheck = true
95+
rule {
96+
isEnabled = true
97+
entity = kotlinx.kover.gradle.plugin.dsl.GroupingEntityType.APPLICATION
98+
bound {
99+
minValue = 0
100+
maxValue = 99
101+
metric = kotlinx.kover.gradle.plugin.dsl.MetricType.LINE
102+
aggregation = kotlinx.kover.gradle.plugin.dsl.AggregationType.COVERED_PERCENTAGE
103+
}
104104
}
105105
}
106106
}
@@ -123,8 +123,11 @@ publishing {
123123
}
124124
developers {
125125
developer {
126+
id.set("erwin-kok")
126127
name.set("Erwin Kok")
128+
email.set("github@erwinkok.org")
127129
url.set("https://github.com/erwin-kok/")
130+
roles.set(listOf("owner", "developer"))
128131
}
129132
}
130133
scm {

gradle/libs.versions.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@
22
kotlinx-coroutines = "1.7.1"
33
kotlin-logging = "3.0.5"
44
junit-jupiter = "5.9.3"
5+
kotlin = "1.8.22"
6+
slf4j-api = "2.0.7"
57

6-
kotlin = "1.8.10"
7-
kover-plugin = "0.7.0-Alpha"
8-
ktlint-plugin = "11.3.2"
8+
kover-plugin = "0.7.1"
9+
ktlint-plugin = "11.4.0"
910
nexus-plugin = "1.3.0"
10-
versions-plugin = "0.46.0"
11+
versions-plugin = "0.47.0"
1112
testlogger-plugin = "3.2.0"
1213

1314
[libraries]
1415
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx-coroutines" }
1516

1617
kotlin-logging = { module = "io.github.microutils:kotlin-logging-jvm", version.ref = "kotlin-logging" }
18+
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j-api" }
1719

1820
junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit-jupiter" }
1921
junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junit-jupiter" }

src/main/kotlin/org/erwinkok/result/Result.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ fun <V> Iterable<Result<V>>.combine(): Result<List<V>> {
264264
is Ok -> it.value
265265
is Err -> return it
266266
}
267-
}
267+
},
268268
)
269269
}
270270

src/test/kotlin/org/erwinkok/result/CombinedErrorTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ internal class CombinedErrorTest {
3030
"The following errors occurred: \n" +
3131
" * Error 1 message\n" +
3232
" * Error 2 message",
33-
combinedError.error().message
33+
combinedError.error().message,
3434
)
3535
}
3636

@@ -48,7 +48,7 @@ internal class CombinedErrorTest {
4848
" * Error 2 message\n" +
4949
" * Error 3 message\n" +
5050
" ... skipping 1 errors ...",
51-
combinedError.error().message
51+
combinedError.error().message,
5252
)
5353
}
5454

@@ -66,7 +66,7 @@ internal class CombinedErrorTest {
6666
" * Error 2 message\n" +
6767
" * Error 3 message\n" +
6868
" ... skipping 1 errors ...",
69-
combinedError.error("While doing the dishes, the following things happened: ").message
69+
combinedError.error("While doing the dishes, the following things happened: ").message,
7070
)
7171
}
7272
}

src/test/kotlin/org/erwinkok/result/CombinedResultTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ internal class CombinedResultTest {
3333
assertErrorResult(
3434
"The following errors occurred: \n" +
3535
" * Error 1 message\n" +
36-
" * Error 2 message"
36+
" * Error 2 message",
3737
) {
3838
combinedResult.result()
3939
}
@@ -52,7 +52,7 @@ internal class CombinedResultTest {
5252
" * Error 1 message\n" +
5353
" * Error 2 message\n" +
5454
" * Error 3 message\n" +
55-
" ... skipping 1 errors ..."
55+
" ... skipping 1 errors ...",
5656
) {
5757
combinedResult.result()
5858
}
@@ -77,7 +77,7 @@ internal class CombinedResultTest {
7777
assertTrue(combinedResult.hasErrors)
7878
assertErrorResult(
7979
"The following errors occurred: \n" +
80-
" * AnError"
80+
" * AnError",
8181
) {
8282
combinedResult.result()
8383
}
@@ -92,7 +92,7 @@ internal class CombinedResultTest {
9292
assertTrue(combinedResult.hasErrors)
9393
assertErrorResult(
9494
"The following errors occurred: \n" +
95-
" * AnError"
95+
" * AnError",
9696
) {
9797
combinedResult.result()
9898
}

0 commit comments

Comments
 (0)