Skip to content

Commit

Permalink
Remove wildcard imports (#416)
Browse files Browse the repository at this point in the history
* Remove wildcard imports

* Remove wildcard imports

* Add missing import
  • Loading branch information
hfhbd authored Dec 8, 2024
1 parent e3585d0 commit dc2c2f5
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 50 deletions.
22 changes: 7 additions & 15 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,38 +24,30 @@ dokka {
}

detekt {
source.from(files(rootProject.rootDir))
source.from(fileTree(rootProject.rootDir) {
include("**/*.kt")
exclude("**/*.kts")
exclude("**/resources/**")
exclude("**/generated/**")
exclude("**/build/**")
})
parallel = true
autoCorrect = true
buildUponDefaultConfig = true
}

dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:${detekt.toolVersion}")
}

tasks {
fun SourceTask.config() {
include("**/*.kt")
exclude("**/*.kts")
exclude("**/resources/**")
exclude("**/generated/**")
exclude("**/build/**")
}
withType<DetektCreateBaselineTask>().configureEach {
config()
}
withType<Detekt>().configureEach {
config()

reports {
sarif.required.set(true)
}
}
}

apiValidation {
@OptIn(kotlinx.validation.ExperimentalBCVApi::class)
klib {
enabled = true
}
Expand Down
7 changes: 0 additions & 7 deletions config/detekt/detekt.yml

This file was deleted.

1 change: 0 additions & 1 deletion detekt-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<CurrentIssues>
<ID>FunctionNaming:Dsl.kt$public fun Uuidv7(timeStamp: Instant = Clock.System.now(), random: Random): Uuid</ID>
<ID>FunctionNaming:Uuidv7.kt$public fun Uuidv7(timeStamp: Long, random: Random): Uuid</ID>
<ID>MagicNumber:KotlinConfig.kt$8</ID>
<ID>MagicNumber:NameBasedGenerator.kt$0x3f</ID>
<ID>MagicNumber:NameBasedGenerator.kt$4</ID>
<ID>MagicNumber:NameBasedGenerator.kt$6</ID>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ package app.softwork.uuid.internal

import android.os.Parcel
import android.os.Parcelable
import app.softwork.uuid.*
import app.softwork.uuid.SOME_UUID_STRING
import app.softwork.uuid.UuidParceler
import kotlinx.parcelize.Parcelize
import kotlinx.parcelize.TypeParceler
import kotlinx.parcelize.parcelableCreator
import kotlin.test.*
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.uuid.Uuid

class ParcelableTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

package app.softwork.uuid

import kotlin.test.*
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.uuid.Uuid

class NsUUIDConvertingTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@

package app.softwork.uuid

import kotlinx.serialization.*
import kotlinx.serialization.builtins.*
import kotlinx.serialization.descriptors.*
import kotlinx.serialization.encoding.*
import kotlinx.serialization.KSerializer
import kotlinx.serialization.SerializationException
import kotlinx.serialization.builtins.LongArraySerializer
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
import kotlin.uuid.Uuid

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

package app.softwork.uuid

import app.softwork.uuid.internal.*
import kotlin.experimental.*
import app.softwork.uuid.internal.SHA1
import kotlin.experimental.and
import kotlin.experimental.or
import kotlin.uuid.Uuid

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

package app.softwork.uuid

import kotlin.random.*
import kotlin.random.Random
import kotlin.uuid.Uuid

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@

package app.softwork.uuid

import kotlinx.serialization.*
import kotlinx.serialization.cbor.*
import kotlinx.serialization.descriptors.*
import kotlinx.serialization.encoding.*
import kotlinx.serialization.json.*
import kotlinx.serialization.modules.*
import kotlin.test.*
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.SerializationException
import kotlinx.serialization.cbor.Cbor
import kotlinx.serialization.decodeFromHexString
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.descriptors.StructureKind
import kotlinx.serialization.encodeToHexString
import kotlinx.serialization.encoding.AbstractDecoder
import kotlinx.serialization.json.Json
import kotlinx.serialization.modules.EmptySerializersModule
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith
import kotlin.uuid.Uuid

@ExperimentalSerializationApi
Expand All @@ -27,8 +33,7 @@ class BinarySerializationTest {
@Test
fun testDeadDecoder() {
val decoder = object : AbstractDecoder() {
override val serializersModule: SerializersModule
get() = EmptySerializersModule()
override val serializersModule = EmptySerializersModule()

override fun decodeElementIndex(descriptor: SerialDescriptor): Int {
return 777
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@

package app.softwork.uuid

import kotlin.random.*
import kotlin.test.*
import kotlin.random.Random
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertNotEquals
import kotlin.test.assertTrue
import kotlin.uuid.Uuid

class GenerationTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

package app.softwork.uuid

import app.softwork.uuid.internal.*
import kotlin.test.*
import app.softwork.uuid.internal.SHA1
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertNotNull

class SHA1Test {
private val sha1 = SHA1()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
package app.softwork.uuid

import kotlin.random.Random
import kotlin.test.*
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith
import kotlin.test.assertFalse
import kotlin.test.assertNull
import kotlin.test.assertTrue
import kotlin.uuid.Uuid

private const val UUID_STRING_ALL_FF: String = "ffffffff-ffff-ffff-ffff-ffffffffffff"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package app.softwork.uuid

import kotlin.random.Random
import kotlin.test.*
import kotlin.test.Test
import kotlin.test.assertEquals

class Uuidv7Test {
@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package app.softwork.uuid.sqldelight

import app.cash.sqldelight.*
import app.cash.sqldelight.ColumnAdapter
import kotlin.uuid.Uuid

public data object UuidByteArrayAdapter : ColumnAdapter<Uuid, ByteArray> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package app.softwork.uuid.sqldelight

import app.cash.sqldelight.*
import app.cash.sqldelight.ColumnAdapter
import kotlin.uuid.Uuid

public data object UuidStringAdapter : ColumnAdapter<Uuid, String> {
Expand Down

0 comments on commit dc2c2f5

Please sign in to comment.