Skip to content

Commit

Permalink
Ktlint version up (10.3.0 -> 11.6.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
junminpark817 authored and acktsap committed Oct 25, 2023
1 parent 56579a2 commit aa4dda9
Show file tree
Hide file tree
Showing 145 changed files with 501 additions and 486 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ end_of_line = crlf
[{*.kt, *.kts}]
# [indentation-tab]
indent_style = space
# [allow-trailing-comma]
ij_kotlin_allow_trailing_comma = true
ij_kotlin_allow_trailing_comma_on_call_site = true
# [disable-star-import]
ij_kotlin_name_count_to_use_star_import = 2147483647
ij_kotlin_name_count_to_use_star_import_for_members = 2147483647

# [4-spaces-tab]
indent_size = 4
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ repositories {

dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10")
implementation("org.jlleitschuh.gradle.ktlint:org.jlleitschuh.gradle.ktlint.gradle.plugin:10.3.0")
implementation("org.jlleitschuh.gradle.ktlint:org.jlleitschuh.gradle.ktlint.gradle.plugin:11.6.1")
implementation("org.jetbrains.kotlinx:kover:0.6.1")
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class BatchDsl internal constructor(
DslContext(
beanFactory,
jobRepository,
)
),
)

operator fun <T : Any> invoke(init: BatchDsl.() -> T): T = init()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import org.springframework.core.task.TaskExecutor
@BatchDslMarker
internal class ConcreteFlowBuilderDsl<T : Any> internal constructor(
private val dslContext: DslContext,
private var flowBuilder: FlowBuilder<T>
private var flowBuilder: FlowBuilder<T>,
) : FlowBuilderDsl<T> {
private var started = false

Expand Down Expand Up @@ -83,7 +83,7 @@ internal class ConcreteFlowBuilderDsl<T : Any> internal constructor(
override fun step(
name: String,
stepInit: StepBuilderDsl.() -> Step,
stepTransitionInit: StepTransitionBuilderDsl<T>.() -> Unit
stepTransitionInit: StepTransitionBuilderDsl<T>.() -> Unit,
) {
val stepBuilder = StepBuilder(name, this.dslContext.jobRepository)
val step = StepBuilderDsl(this.dslContext, stepBuilder).let(stepInit)
Expand Down Expand Up @@ -152,7 +152,7 @@ internal class ConcreteFlowBuilderDsl<T : Any> internal constructor(
override fun flow(
name: String,
flowInit: FlowBuilderDsl<Flow>.() -> Unit,
flowTransitionInit: FlowTransitionBuilderDsl<T>.() -> Unit
flowTransitionInit: FlowTransitionBuilderDsl<T>.() -> Unit,
) {
val flowBuilder = FlowBuilder<Flow>(name)
val flow = ConcreteFlowBuilderDsl(this.dslContext, flowBuilder).apply(flowInit)
Expand Down Expand Up @@ -181,7 +181,7 @@ internal class ConcreteFlowBuilderDsl<T : Any> internal constructor(
*/
override fun deciderBean(
name: String,
deciderTransitionInit: DeciderTransitionBuilderDsl<T>.() -> Unit
deciderTransitionInit: DeciderTransitionBuilderDsl<T>.() -> Unit,
) {
val decider = this.dslContext.beanFactory.getBean<JobExecutionDecider>(name)
decider(decider, deciderTransitionInit)
Expand All @@ -192,7 +192,7 @@ internal class ConcreteFlowBuilderDsl<T : Any> internal constructor(
*/
override fun decider(
decider: JobExecutionDecider,
deciderTransitionInit: DeciderTransitionBuilderDsl<T>.() -> Unit
deciderTransitionInit: DeciderTransitionBuilderDsl<T>.() -> Unit,
) {
val baseUnterminatedFlowBuilder = if (!started) {
this.started = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import org.springframework.batch.core.job.flow.JobExecutionDecider
class DeciderTransitionBuilderDsl<T : Any> internal constructor(
private val dslContext: DslContext,
private val decider: JobExecutionDecider,
private val baseUnterminatedFlowBuilder: FlowBuilder.UnterminatedFlowBuilder<T>
private val baseUnterminatedFlowBuilder: FlowBuilder.UnterminatedFlowBuilder<T>,
) {
private var flowBuilder: FlowBuilder<T>? = null

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ interface FlowBuilderDsl<T : Any> {
fun step(
name: String,
stepInit: StepBuilderDsl.() -> Step,
stepTransitionInit: StepTransitionBuilderDsl<T>.() -> Unit
stepTransitionInit: StepTransitionBuilderDsl<T>.() -> Unit,
)

/**
Expand Down Expand Up @@ -93,7 +93,7 @@ interface FlowBuilderDsl<T : Any> {
fun flow(
name: String,
flowInit: FlowBuilderDsl<Flow>.() -> Unit,
flowTransitionInit: FlowTransitionBuilderDsl<T>.() -> Unit
flowTransitionInit: FlowTransitionBuilderDsl<T>.() -> Unit,
)

/**
Expand All @@ -106,15 +106,15 @@ interface FlowBuilderDsl<T : Any> {
*/
fun deciderBean(
name: String,
deciderTransitionInit: DeciderTransitionBuilderDsl<T>.() -> Unit
deciderTransitionInit: DeciderTransitionBuilderDsl<T>.() -> Unit,
)

/**
* Add decider with transition.
*/
fun decider(
decider: JobExecutionDecider,
deciderTransitionInit: DeciderTransitionBuilderDsl<T>.() -> Unit
deciderTransitionInit: DeciderTransitionBuilderDsl<T>.() -> Unit,
)

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import org.springframework.batch.core.job.builder.FlowJobBuilder
internal class FlowJobBuilderDsl internal constructor(
@Suppress("unused")
private val dslContext: DslContext,
private val delegate: ConcreteFlowBuilderDsl<FlowJobBuilder>
private val delegate: ConcreteFlowBuilderDsl<FlowJobBuilder>,
) : FlowBuilderDsl<FlowJobBuilder> by delegate {

internal fun build(): Job = this.delegate.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import org.springframework.batch.core.job.flow.Flow
class FlowTransitionBuilderDsl<T : Any> internal constructor(
private val dslContext: DslContext,
private val flow: Flow,
private val baseFlowBuilder: FlowBuilder<T>
private val baseFlowBuilder: FlowBuilder<T>,
) {
private var flowBuilder: FlowBuilder<T>? = null

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import org.springframework.core.task.TaskExecutor
@BatchDslMarker
class JobBuilderDsl internal constructor(
private val dslContext: DslContext,
private val jobBuilder: JobBuilder
private val jobBuilder: JobBuilder,
) : FlowBuilderDsl<FlowJobBuilder> {

private var lazyConfigurer = LazyConfigurer<JobBuilderHelper<*>>()
Expand Down Expand Up @@ -172,7 +172,7 @@ class JobBuilderDsl internal constructor(
override fun step(
name: String,
stepInit: StepBuilderDsl.() -> Step,
stepTransitionInit: StepTransitionBuilderDsl<FlowJobBuilder>.() -> Unit
stepTransitionInit: StepTransitionBuilderDsl<FlowJobBuilder>.() -> Unit,
) {
this.lazyFlowConfigurer.add {
it.step(name, stepInit, stepTransitionInit)
Expand Down Expand Up @@ -218,7 +218,7 @@ class JobBuilderDsl internal constructor(
override fun flow(
name: String,
flowInit: FlowBuilderDsl<Flow>.() -> Unit,
flowTransitionInit: FlowTransitionBuilderDsl<FlowJobBuilder>.() -> Unit
flowTransitionInit: FlowTransitionBuilderDsl<FlowJobBuilder>.() -> Unit,
) {
this.lazyFlowConfigurer.add {
it.flow(name, flowInit, flowTransitionInit)
Expand All @@ -235,7 +235,7 @@ class JobBuilderDsl internal constructor(

override fun deciderBean(
name: String,
deciderTransitionInit: DeciderTransitionBuilderDsl<FlowJobBuilder>.() -> Unit
deciderTransitionInit: DeciderTransitionBuilderDsl<FlowJobBuilder>.() -> Unit,
) {
this.lazyFlowConfigurer.add {
it.deciderBean(name, deciderTransitionInit)
Expand All @@ -245,7 +245,7 @@ class JobBuilderDsl internal constructor(

override fun decider(
decider: JobExecutionDecider,
deciderTransitionInit: DeciderTransitionBuilderDsl<FlowJobBuilder>.() -> Unit
deciderTransitionInit: DeciderTransitionBuilderDsl<FlowJobBuilder>.() -> Unit,
) {
this.lazyFlowConfigurer.add {
it.decider(decider, deciderTransitionInit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import org.springframework.beans.factory.getBean
@BatchDslMarker
internal class SimpleJobBuilderDsl internal constructor(
private val dslContext: DslContext,
private val simpleJobBuilder: SimpleJobBuilder
private val simpleJobBuilder: SimpleJobBuilder,
) {

fun stepBean(name: String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import org.springframework.core.task.TaskExecutor
*/
@BatchDslMarker
internal class SimpleJobBuilderDslAdapter internal constructor(
private val simpleJobBuilderDsl: SimpleJobBuilderDsl
private val simpleJobBuilderDsl: SimpleJobBuilderDsl,
) : FlowBuilderDsl<FlowJobBuilder> {

override fun stepBean(name: String) {
Expand All @@ -53,7 +53,7 @@ internal class SimpleJobBuilderDslAdapter internal constructor(
override fun step(
name: String,
stepInit: StepBuilderDsl.() -> Step,
stepTransitionInit: StepTransitionBuilderDsl<FlowJobBuilder>.() -> Unit
stepTransitionInit: StepTransitionBuilderDsl<FlowJobBuilder>.() -> Unit,
) {
throw UnsupportedOperationException("SimpleJob can't process flow.")
}
Expand Down Expand Up @@ -81,7 +81,7 @@ internal class SimpleJobBuilderDslAdapter internal constructor(
override fun flow(
name: String,
flowInit: FlowBuilderDsl<Flow>.() -> Unit,
flowTransitionInit: FlowTransitionBuilderDsl<FlowJobBuilder>.() -> Unit
flowTransitionInit: FlowTransitionBuilderDsl<FlowJobBuilder>.() -> Unit,
) {
throw UnsupportedOperationException("SimpleJob can't process flow.")
}
Expand All @@ -92,14 +92,14 @@ internal class SimpleJobBuilderDslAdapter internal constructor(

override fun deciderBean(
name: String,
deciderTransitionInit: DeciderTransitionBuilderDsl<FlowJobBuilder>.() -> Unit
deciderTransitionInit: DeciderTransitionBuilderDsl<FlowJobBuilder>.() -> Unit,
) {
throw UnsupportedOperationException("SimpleJob can't process flow.")
}

override fun decider(
decider: JobExecutionDecider,
deciderTransitionInit: DeciderTransitionBuilderDsl<FlowJobBuilder>.() -> Unit
deciderTransitionInit: DeciderTransitionBuilderDsl<FlowJobBuilder>.() -> Unit,
) {
throw UnsupportedOperationException("SimpleJob can't process flow.")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import org.springframework.beans.factory.getBean
@BatchDslMarker
class SplitBuilderDsl<T : Any> internal constructor(
private val dslContext: DslContext,
private val splitBuilder: FlowBuilder.SplitBuilder<T>
private val splitBuilder: FlowBuilder.SplitBuilder<T>,
) {
private var flows = mutableListOf<Flow>()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import org.springframework.transaction.PlatformTransactionManager
@BatchDslMarker
class StepBuilderDsl internal constructor(
private val dslContext: DslContext,
private val stepBuilder: StepBuilder
private val stepBuilder: StepBuilder,
) {

/**
Expand Down Expand Up @@ -123,7 +123,7 @@ class StepBuilderDsl internal constructor(
@Suppress("DEPRECATION")
@Deprecated(
message = "spring batch 5.0.0 deprecates this",
replaceWith = ReplaceWith("taskletBean(name, transactionManager)")
replaceWith = ReplaceWith("taskletBean(name, transactionManager)"),
)
fun taskletBean(name: String): Step {
return taskletBean(name) {}
Expand All @@ -135,7 +135,7 @@ class StepBuilderDsl internal constructor(
@Suppress("DEPRECATION")
@Deprecated(
message = "spring batch 5.0.0 deprecates this",
replaceWith = ReplaceWith("taskletBean(name, transactionManager, taskletStepInit)")
replaceWith = ReplaceWith("taskletBean(name, transactionManager, taskletStepInit)"),
)
fun taskletBean(name: String, taskletStepInit: TaskletStepBuilderDsl.() -> Unit): Step {
val tasklet = this.dslContext.beanFactory.getBean<Tasklet>(name)
Expand All @@ -148,7 +148,7 @@ class StepBuilderDsl internal constructor(
@Suppress("DEPRECATION")
@Deprecated(
message = "spring batch 5.0.0 deprecates this",
replaceWith = ReplaceWith("tasklet(tasklet, transactionManager)")
replaceWith = ReplaceWith("tasklet(tasklet, transactionManager)"),
)
fun tasklet(tasklet: Tasklet): Step {
return tasklet(tasklet) {}
Expand All @@ -160,7 +160,7 @@ class StepBuilderDsl internal constructor(
@Suppress("DEPRECATION")
@Deprecated(
message = "spring batch 5.0.0 deprecates this",
replaceWith = ReplaceWith("tasklet(tasklet, transactionManager, taskletStepInit)")
replaceWith = ReplaceWith("tasklet(tasklet, transactionManager, taskletStepInit)"),
)
fun tasklet(tasklet: Tasklet, taskletStepInit: TaskletStepBuilderDsl.() -> Unit): Step {
val taskletStepBuilder = this.stepBuilder.tasklet(tasklet)
Expand All @@ -174,7 +174,7 @@ class StepBuilderDsl internal constructor(
@Suppress("DEPRECATION")
@Deprecated(
message = "spring batch 5.0.0 deprecates this",
replaceWith = ReplaceWith("chunk(chunkSize, transactionManager, simpleStepInit)")
replaceWith = ReplaceWith("chunk(chunkSize, transactionManager, simpleStepInit)"),
)
fun <I : Any, O : Any> chunk(chunkSize: Int, simpleStepInit: SimpleStepBuilderDsl<I, O>.() -> Unit): Step {
val simpleStepBuilder = this.stepBuilder.chunk<I, O>(chunkSize)
Expand All @@ -188,11 +188,11 @@ class StepBuilderDsl internal constructor(
@Suppress("DEPRECATION")
@Deprecated(
message = "spring batch 5.0.0 deprecates this",
replaceWith = ReplaceWith("chunk(completionPolicy, transactionManager, simpleStepInit)")
replaceWith = ReplaceWith("chunk(completionPolicy, transactionManager, simpleStepInit)"),
)
fun <I : Any, O : Any> chunk(
completionPolicy: CompletionPolicy,
simpleStepInit: SimpleStepBuilderDsl<I, O>.() -> Unit
simpleStepInit: SimpleStepBuilderDsl<I, O>.() -> Unit,
): Step {
val simpleStepBuilder = this.stepBuilder.chunk<I, O>(completionPolicy)
return SimpleStepBuilderDsl(this.dslContext, simpleStepBuilder).apply(simpleStepInit)
Expand All @@ -204,11 +204,11 @@ class StepBuilderDsl internal constructor(
*/
@Deprecated(
message = "spring batch 5.0.0 deprecates this",
replaceWith = ReplaceWith("chunk(repeatOperations, transactionManager, simpleStepInit)")
replaceWith = ReplaceWith("chunk(repeatOperations, transactionManager, simpleStepInit)"),
)
fun <I : Any, O : Any> chunk(
repeatOperations: RepeatOperations,
simpleStepInit: SimpleStepBuilderDsl<I, O>.() -> Unit
simpleStepInit: SimpleStepBuilderDsl<I, O>.() -> Unit,
): Step {
val simpleStepBuilder = SimpleStepBuilder<I, O>(this.stepBuilder).chunkOperations(repeatOperations)
return SimpleStepBuilderDsl(this.dslContext, simpleStepBuilder).apply(simpleStepInit)
Expand All @@ -231,7 +231,7 @@ class StepBuilderDsl internal constructor(
fun taskletBean(
name: String,
transactionManager: PlatformTransactionManager,
taskletStepInit: TaskletStepBuilderDsl.() -> Unit
taskletStepInit: TaskletStepBuilderDsl.() -> Unit,
): Step {
val tasklet = this.dslContext.beanFactory.getBean<Tasklet>(name)
return tasklet(tasklet, transactionManager, taskletStepInit)
Expand All @@ -253,7 +253,7 @@ class StepBuilderDsl internal constructor(
fun tasklet(
tasklet: Tasklet,
transactionManager: PlatformTransactionManager,
taskletStepInit: TaskletStepBuilderDsl.() -> Unit
taskletStepInit: TaskletStepBuilderDsl.() -> Unit,
): Step {
val taskletStepBuilder = this.stepBuilder.tasklet(tasklet, transactionManager)
return TaskletStepBuilderDsl(this.dslContext, taskletStepBuilder).apply(taskletStepInit)
Expand All @@ -266,7 +266,7 @@ class StepBuilderDsl internal constructor(
fun <I : Any, O : Any> chunk(
chunkSize: Int,
transactionManager: PlatformTransactionManager,
simpleStepInit: SimpleStepBuilderDsl<I, O>.() -> Unit
simpleStepInit: SimpleStepBuilderDsl<I, O>.() -> Unit,
): Step {
val simpleStepBuilder = this.stepBuilder.chunk<I, O>(chunkSize, transactionManager)
return SimpleStepBuilderDsl(this.dslContext, simpleStepBuilder).apply(simpleStepInit)
Expand All @@ -279,7 +279,7 @@ class StepBuilderDsl internal constructor(
fun <I : Any, O : Any> chunk(
completionPolicy: CompletionPolicy,
transactionManager: PlatformTransactionManager,
simpleStepInit: SimpleStepBuilderDsl<I, O>.() -> Unit
simpleStepInit: SimpleStepBuilderDsl<I, O>.() -> Unit,
): Step {
val simpleStepBuilder = this.stepBuilder.chunk<I, O>(completionPolicy, transactionManager)
return SimpleStepBuilderDsl(this.dslContext, simpleStepBuilder).apply(simpleStepInit)
Expand All @@ -292,7 +292,7 @@ class StepBuilderDsl internal constructor(
fun <I : Any, O : Any> chunk(
repeatOperations: RepeatOperations,
transactionManager: PlatformTransactionManager,
simpleStepInit: SimpleStepBuilderDsl<I, O>.() -> Unit
simpleStepInit: SimpleStepBuilderDsl<I, O>.() -> Unit,
): Step {
val simpleStepBuilder = SimpleStepBuilder<I, O>(this.stepBuilder).apply {
transactionManager(transactionManager)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import org.springframework.batch.core.job.builder.FlowBuilder
class StepTransitionBuilderDsl<T : Any> internal constructor(
private val dslContext: DslContext,
private val step: Step,
private val baseFlowBuilder: FlowBuilder<T>
private val baseFlowBuilder: FlowBuilder<T>,
) {
private var flowBuilder: FlowBuilder<T>? = null

Expand Down
Loading

0 comments on commit aa4dda9

Please sign in to comment.