Skip to content

Commit

Permalink
Automatic optimize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
kunyavskiy committed Aug 4, 2023
1 parent bda822b commit 5d9faf6
Show file tree
Hide file tree
Showing 33 changed files with 55 additions and 117 deletions.
5 changes: 1 addition & 4 deletions src/cds/src/main/kotlin/org/icpclive/api/ContestInfo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ import kotlinx.datetime.Clock
import kotlinx.datetime.Instant
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import org.icpclive.util.ColorSerializer
import org.icpclive.util.DurationInMillisecondsSerializer
import org.icpclive.util.UnixMillisecondsSerializer
import org.icpclive.util.getLogger
import org.icpclive.util.*
import java.awt.Color
import kotlin.time.Duration
import kotlin.time.Duration.Companion.minutes
Expand Down
4 changes: 1 addition & 3 deletions src/cds/src/main/kotlin/org/icpclive/api/RunInfo.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package org.icpclive.api

import kotlinx.serialization.KSerializer
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.*
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
import org.icpclive.util.DurationInMillisecondsSerializer
Expand Down
4 changes: 1 addition & 3 deletions src/cds/src/main/kotlin/org/icpclive/cds/ContestUpdate.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package org.icpclive.cds

import org.icpclive.api.AnalyticsMessage
import org.icpclive.api.ContestInfo
import org.icpclive.api.RunInfo
import org.icpclive.api.*

sealed interface ContestUpdate
data class InfoUpdate(val newInfo: ContestInfo) : ContestUpdate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ import kotlinx.coroutines.flow.*
import kotlinx.datetime.Clock
import kotlinx.datetime.Instant
import org.icpclive.api.*
import org.icpclive.api.tunning.*
import org.icpclive.cds.ContestUpdate
import org.icpclive.cds.InfoUpdate
import org.icpclive.cds.RunUpdate
import org.icpclive.util.*
import kotlin.time.Duration
import org.icpclive.api.tunning.AdvancedProperties
import org.icpclive.api.tunning.TeamInfoOverride
import org.icpclive.cds.*
import org.icpclive.util.getLogger
import org.icpclive.util.humanReadable

private sealed interface AdvancedAdapterEvent
private class Update(val update: ContestUpdate) : AdvancedAdapterEvent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.icpclive.cds.adapters

import kotlinx.coroutines.flow.*
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
import org.icpclive.api.*
import org.icpclive.cds.ContestUpdate

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.icpclive.cds.adapters

import kotlinx.coroutines.flow.*
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
import org.icpclive.api.*
import org.icpclive.cds.*
import kotlin.time.Duration.Companion.minutes
import org.icpclive.cds.ContestUpdate

private fun RunInfo.setICPC(value: Boolean) = copy(result = (result as? ICPCRunResult)?.copy(isFirstToSolveRun = value))
private fun RunInfo.setIOI(value: Boolean) = copy(result = (result as? IOIRunResult)?.copy(isFirstBestRun = value))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package org.icpclive.cds.adapters

import kotlinx.coroutines.flow.*
import org.icpclive.cds.AnalyticsUpdate
import org.icpclive.cds.ContestUpdate
import org.icpclive.cds.InfoUpdate
import org.icpclive.cds.RunUpdate
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.transform
import org.icpclive.cds.*
import kotlin.time.Duration


Expand Down
10 changes: 2 additions & 8 deletions src/cds/src/main/kotlin/org/icpclive/cds/adapters/Utils.kt
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
package org.icpclive.cds.adapters

import kotlinx.collections.immutable.PersistentList
import kotlinx.collections.immutable.PersistentMap
import kotlinx.collections.immutable.persistentListOf
import kotlinx.collections.immutable.persistentMapOf
import kotlinx.collections.immutable.*
import kotlinx.coroutines.flow.*
import org.icpclive.api.ContestInfo
import org.icpclive.api.RunInfo
import org.icpclive.cds.AnalyticsUpdate
import org.icpclive.cds.ContestUpdate
import org.icpclive.cds.InfoUpdate
import org.icpclive.cds.RunUpdate
import org.icpclive.cds.*

class ContestEventWithRunsBefore(
val event: ContestUpdate,
Expand Down
12 changes: 3 additions & 9 deletions src/cds/src/main/kotlin/org/icpclive/cds/cats/CATSDataSource.kt
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
package org.icpclive.cds.cats

import kotlinx.datetime.*
import kotlinx.serialization.KSerializer
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.descriptors.PrimitiveKind
import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.*
import kotlinx.serialization.descriptors.*
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
import org.icpclive.api.*
import org.icpclive.cds.common.ContestParseResult
import org.icpclive.cds.common.FullReloadContestDataSource
import org.icpclive.cds.common.jsonLoader
import org.icpclive.cds.common.*
import org.icpclive.cds.settings.CatsSettings
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@ import kotlinx.coroutines.flow.*
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.SerializationException
import kotlinx.serialization.json.Json
import org.icpclive.api.AnalyticsCommentaryEvent
import org.icpclive.api.AnalyticsMessage
import org.icpclive.api.ContestInfo
import org.icpclive.api.RunInfo
import org.icpclive.api.*
import org.icpclive.cds.*
import org.icpclive.cds.clics.api.Event
import org.icpclive.cds.clics.api.Event.*
import org.icpclive.cds.common.*
import org.icpclive.cds.common.RawContestDataSource
import org.icpclive.cds.settings.ClicsLoaderSettings
import org.icpclive.cds.settings.ClicsSettings
import org.icpclive.util.*
import org.icpclive.util.getLogger
import org.icpclive.util.logAndRetryWithDelay
import kotlin.time.Duration.Companion.seconds

enum class FeedVersion {
Expand Down
4 changes: 1 addition & 3 deletions src/cds/src/main/kotlin/org/icpclive/cds/clics/ClicsModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ package org.icpclive.cds.clics
import kotlinx.datetime.Instant
import org.icpclive.api.*
import org.icpclive.cds.clics.api.*
import org.icpclive.cds.clics.model.ClicsJudgementTypeInfo
import org.icpclive.cds.clics.model.ClicsOrganisationInfo
import org.icpclive.cds.clics.model.ClicsRunInfo
import org.icpclive.cds.clics.model.*
import org.icpclive.util.Enumerator
import org.icpclive.util.getLogger
import java.awt.Color
Expand Down
6 changes: 2 additions & 4 deletions src/cds/src/main/kotlin/org/icpclive/cds/clics/ClicsTime.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ package org.icpclive.cds.clics

import kotlinx.datetime.*
import kotlinx.serialization.KSerializer
import kotlinx.serialization.descriptors.PrimitiveKind
import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.descriptors.*
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
import java.time.ZoneId
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
import java.util.regex.Pattern
import java.util.regex.*
import kotlin.math.round
import kotlin.time.Duration
import kotlin.time.Duration.Companion.hours
Expand Down
3 changes: 1 addition & 2 deletions src/cds/src/main/kotlin/org/icpclive/cds/clics/api/Events.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package org.icpclive.cds.clics.api

import org.icpclive.cds.clics.api.v1.Event as EventV1

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import org.icpclive.cds.clics.api.v1.Event as EventV1

@Serializable
sealed class Event {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.icpclive.cds.clics.model

import org.icpclive.api.ICPCRunResult
import org.icpclive.api.MediaType
import org.icpclive.api.Verdict
import org.icpclive.cds.clics.api.Problem
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package org.icpclive.cds.codedrills

import io.codedrills.proto.external.*
import io.grpc.*
import io.grpc.stub.*
import io.grpc.ManagedChannelBuilder
import io.grpc.Metadata
import io.grpc.stub.MetadataUtils
import kotlinx.datetime.Instant
import org.icpclive.api.*
import org.icpclive.cds.common.ContestParseResult
import org.icpclive.cds.common.FullReloadContestDataSource
import org.icpclive.cds.settings.CodeDrillsSettings
import org.icpclive.util.getLogger
import java.util.*
import java.util.concurrent.TimeUnit
import java.util.concurrent.*
import kotlin.time.Duration.Companion.seconds

internal class CodeDrillsClient(url: String, port: Int, authKey: String) : AutoCloseable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ package org.icpclive.cds.codeforces

import kotlinx.datetime.Clock
import org.icpclive.api.ContestStatus
import org.icpclive.cds.common.ContestParseResult
import org.icpclive.cds.common.FullReloadContestDataSource
import org.icpclive.cds.codeforces.api.data.*
import org.icpclive.cds.codeforces.api.data.CFHack
import org.icpclive.cds.codeforces.api.data.CFSubmission
import org.icpclive.cds.codeforces.api.results.CFStandings
import org.icpclive.cds.codeforces.api.results.CFStatusWrapper
import org.icpclive.cds.common.jsonLoader
import org.icpclive.cds.common.map
import org.icpclive.cds.common.*
import org.icpclive.cds.settings.CFSettings
import java.security.MessageDigest
import java.util.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package org.icpclive.cds.codeforces.api.results

import kotlinx.serialization.Serializable
import org.icpclive.cds.codeforces.api.data.CFContest
import org.icpclive.cds.codeforces.api.data.CFProblem
import org.icpclive.cds.codeforces.api.data.CFRankListRow
import org.icpclive.cds.codeforces.api.data.*

@Serializable
internal data class CFStandings(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package org.icpclive.cds.common

import kotlinx.serialization.Serializable
import org.icpclive.api.AnalyticsMessage
import org.icpclive.api.ContestInfo
import org.icpclive.api.RunInfo
import org.icpclive.api.*

@Serializable
internal data class ContestParseResult(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package org.icpclive.cds.common
import io.ktor.client.call.*
import io.ktor.client.request.*
import io.ktor.client.statement.*
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import org.w3c.dom.Document
import java.nio.file.Paths
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ package org.icpclive.cds.common
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOn
import org.icpclive.cds.AnalyticsUpdate
import org.icpclive.cds.InfoUpdate
import org.icpclive.cds.RunUpdate
import org.icpclive.cds.*
import org.icpclive.util.getLogger
import org.icpclive.util.loopFlow
import kotlin.time.Duration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import io.ktor.client.request.*
import io.ktor.client.statement.*
import io.ktor.http.*
import io.ktor.utils.io.*
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.*
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOn
import org.icpclive.util.getLogger
import java.nio.file.Paths

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ package org.icpclive.cds.ejudge

import kotlinx.datetime.Instant
import org.icpclive.api.*
import org.icpclive.cds.common.ContestParseResult
import org.icpclive.cds.common.FullReloadContestDataSource
import org.icpclive.cds.common.xmlLoader
import org.icpclive.cds.common.*
import org.icpclive.cds.settings.EjudgeSettings
import org.icpclive.util.child
import org.icpclive.util.children
import org.icpclive.util.guessDatetimeFormat
import org.icpclive.util.*
import org.w3c.dom.Element
import kotlin.time.Duration
import kotlin.time.Duration.Companion.hours
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package org.icpclive.cds.krsu

import kotlinx.datetime.*
import kotlinx.datetime.LocalDateTime
import kotlinx.datetime.toInstant
import kotlinx.serialization.Serializable
import org.icpclive.api.*
import org.icpclive.cds.common.ContestParseResult
import org.icpclive.cds.common.FullReloadContestDataSource
import org.icpclive.cds.common.jsonLoader
import org.icpclive.cds.common.*
import org.icpclive.cds.settings.KRSUSettings
import kotlin.time.Duration
import kotlin.time.Duration.Companion.hours
import kotlin.time.Duration.Companion.seconds

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package org.icpclive.cds.noop

import kotlinx.coroutines.flow.*
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.flowOf
import kotlinx.datetime.Instant
import org.icpclive.api.*
import org.icpclive.cds.*
import org.icpclive.cds.InfoUpdate
import org.icpclive.cds.common.ContestParseResult
import org.icpclive.cds.common.RawContestDataSource
import kotlin.time.Duration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ package org.icpclive.cds.pcms
import kotlinx.datetime.Clock
import kotlinx.datetime.Instant
import org.icpclive.api.*
import org.icpclive.cds.common.ContestParseResult
import org.icpclive.cds.common.FullReloadContestDataSource
import org.icpclive.cds.common.ClientAuth
import org.icpclive.cds.common.xmlLoader
import org.icpclive.cds.common.*
import org.icpclive.cds.settings.PCMSSettings
import org.icpclive.util.*
import org.w3c.dom.Element
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@ import org.icpclive.cds.noop.NoopDataSource
import org.icpclive.cds.pcms.PCMSDataSource
import org.icpclive.cds.testsys.TestSysDataSource
import org.icpclive.cds.yandex.YandexDataSource
import org.icpclive.util.HumanTimeSerializer
import org.icpclive.util.TimeZoneSerializer
import org.icpclive.util.getLogger
import org.icpclive.util.*
import java.nio.file.Path
import javax.swing.text.StyledEditorKit.BoldAction

// I'd like to have them in cds files, but then serializing would be much harder

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ package org.icpclive.cds.testsys
import kotlinx.datetime.toInstant
import kotlinx.datetime.toKotlinLocalDateTime
import org.icpclive.api.*
import org.icpclive.cds.common.ContestParseResult
import org.icpclive.cds.common.FullReloadContestDataSource
import org.icpclive.cds.common.ByteArrayLoader
import org.icpclive.cds.common.map
import org.icpclive.cds.common.*
import org.icpclive.cds.settings.TestSysSettings
import java.nio.charset.Charset
import java.time.format.DateTimeFormatter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.icpclive.cds.yandex

import kotlinx.datetime.Clock
import kotlinx.datetime.Instant
import org.icpclive.api.*
import org.icpclive.cds.yandex.api.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*
import kotlinx.serialization.json.Json
import org.icpclive.cds.*
import org.icpclive.cds.common.RawContestDataSource
import org.icpclive.cds.common.*
import org.icpclive.cds.settings.YandexSettings
import org.icpclive.cds.yandex.api.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.icpclive.cds.yandex.api

import kotlinx.serialization.Serializable
import org.icpclive.api.ProblemInfo

@Serializable
internal data class Problems(
Expand Down
Loading

0 comments on commit 5d9faf6

Please sign in to comment.