Skip to content

Commit 5b80ae4

Browse files
committed
Switch to kotlinter instead of (directly) ktlint
1 parent d2b2b65 commit 5b80ae4

File tree

4 files changed

+4
-35
lines changed

4 files changed

+4
-35
lines changed

build.gradle

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ buildscript {
3030
plugins {
3131
id "com.jfrog.bintray" version "1.8.0"
3232
id 'net.researchgate.release' version "2.6.0"
33+
id 'org.jmailen.kotlinter' version '1.7.0'
3334
}
3435

3536
apply plugin: 'maven'
@@ -68,35 +69,6 @@ sourceSets {
6869
main.java.srcDirs += 'src/main/kotlin'
6970
}
7071

71-
//////////////////////////////////////////////////////////////////////////////
72-
// ktlint config
73-
//////////////////////////////////////////////////////////////////////////////
74-
75-
// Based on https://github.com/shyiko/ktlint
76-
77-
configurations {
78-
ktlint
79-
}
80-
81-
dependencies {
82-
ktlint "com.github.shyiko:ktlint:$ktlint_version"
83-
}
84-
85-
task ktlint(type: JavaExec) {
86-
main = "com.github.shyiko.ktlint.Main"
87-
classpath = configurations.ktlint
88-
args "src/**/*.kt"
89-
}
90-
91-
check.dependsOn ktlint
92-
93-
task ktlintFormat(type: JavaExec) {
94-
main = "com.github.shyiko.ktlint.Main"
95-
classpath = configurations.ktlint
96-
args "-F", "src/**/*.kt"
97-
}
98-
99-
10072
//////////////////////////////////////////////////////////////////////////////
10173
// Dokka config
10274
//////////////////////////////////////////////////////////////////////////////

gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ version=2.0.5-SNAPSHOT
44
dokka_version = 0.9.15
55
kotlintest_version = 2.0.7
66
kotlin_version = 1.2.20
7-
ktlint_version = 0.14.0
87
xenocom_version = 0.0.5

src/main/kotlin/com/xenomachina/argparser/ArgParser.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,10 +386,8 @@ class ArgParser(args: Array<out String>,
386386
) {
387387
operator fun provideDelegate(thisRef: Any?, prop: KProperty<*>): Delegate<T> {
388388
val delegate = ctor(prop.name)
389-
return (if (default == null)
390-
delegate
391-
else
392-
delegate.default(default)).provideDelegate(thisRef, prop)
389+
return (if (default == null) delegate
390+
else delegate.default(default)).provideDelegate(thisRef, prop)
393391
}
394392
}
395393

src/main/kotlin/com/xenomachina/argparser/Default.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ fun <T> ArgParser.Delegate<T>.default(defaultValue: () -> T): ArgParser.Delegate
8484
get() = inner.help
8585

8686
override fun addValidator(validator: ArgParser.Delegate<T>.() -> Unit): ArgParser.Delegate<T> =
87-
apply { inner.addValidator { validator(this@apply) } }
87+
apply { inner.addValidator { validator(this@apply) } }
8888

8989
override fun registerLeaf(root: ArgParser.Delegate<*>) {
9090
inner.registerLeaf(root)

0 commit comments

Comments
 (0)