Skip to content

Commit

Permalink
trying to fix a lot of warnings by super linter
Browse files Browse the repository at this point in the history
  • Loading branch information
iNoles committed Dec 23, 2023
1 parent b49e3bd commit 27e84ef
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 28 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# These are supported funding model platforms

github: [kittinunf]
9 changes: 5 additions & 4 deletions .github/workflows/Main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Run Gradle on Main
on:
push:
Expand All @@ -19,10 +20,10 @@ jobs:
- name: Publish to MavenCentral
uses: gradle/gradle-build-action@v2
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
with:
arguments: publishAllPublicationsToSonatypeRepository --max-workers 1

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Run Gradle on PRs
on: pull_request

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
name: Release

on:
release:
types: [ released ]
types: [released]

jobs:
publish:
Expand Down
2 changes: 1 addition & 1 deletion plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ repositories {
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ inline operator fun <V, reified E : Throwable> Result<List<V>, E>.plus(result: R
is Result.Success -> Result.success(this.value + result.value)
is Result.Failure -> Result.failure(result.error)
}

is Result.Failure -> Result.failure(this.error)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ expect class Resource(name: String) {

fun exists(): Boolean
fun read(): String
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
package com.github.kittinunf.result

import kotlin.js.JsName
import kotlin.test.Test
import kotlin.test.assertContains
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertIs
import kotlin.test.assertNotNull
import kotlin.test.assertNull
import kotlin.test.assertSame
import kotlin.test.assertTrue
import kotlin.test.fail
import kotlin.test.*

class ResultTest {

Expand Down Expand Up @@ -488,7 +479,7 @@ class ResultTest {
@JsName("should_return_a_merged_list_given_two_Results_Success_containing_a_list")
fun `should return a merged list given two Results Success containing a list`() {
val result = Result.success(listOf("A", "B"))
val otherResult = Result.success(listOf("C","D"))
val otherResult = Result.success(listOf("C", "D"))

val mergedList = result + otherResult
assertIs<Result.Success<List<String>>>(mergedList)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ actual class Resource actual constructor(actual val name: String) {
actual fun exists(): Boolean = file.exists()

actual fun read(): String = file.readText()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ actual class Resource actual constructor(actual val name: String) {

actual fun read(): String {
return when {
name.contains("lorem_short") -> {
"""
name.contains("lorem_short") -> """
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
""".trimIndent()
}
name.contains("lorem_long") -> {
"""

name.contains("lorem_long") -> """
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus mollis eleifend libero, id elementum sem sagittis sit amet.
Donec lorem nulla, mollis eu diam eget, varius facilisis ipsum. Duis turpis lorem, iaculis quis venenatis nec, placerat eget est.
Nullam posuere leo sit amet diam laoreet finibus. Suspendisse at tempor nibh, sit amet maximus elit.
Expand All @@ -33,7 +31,7 @@ Vestibulum commodo nibh ex, at porttitor mi tristique in. Donec bibendum, sapien
Proin elementum libero in viverra dignissim. Morbi commodo eget tellus a congue. Suspendisse potenti. Interdum et malesuada fames ac ante ipsum primis in faucibus.
Praesent euismod aliquet ligula, et consequat tortor sodales feugiat. Praesent et dolor felis.
""".trimIndent()
}

else -> throw RuntimeException("src/commonTest/resources/$name (No such file or directory)")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ actual class Resource actual constructor(name: String) {
actual fun read(): String {
TODO("Not yet implemented")
}

}
}
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ rootProject.name = "Result"

includeBuild("plugins")

include(":result")
include(":result")

0 comments on commit 27e84ef

Please sign in to comment.