Move ktlint config to project-level
This commit is contained in:
parent
ff7c3c934c
commit
b7e2d76f14
8 changed files with 21 additions and 36 deletions
18
build.gradle
18
build.gradle
|
@ -1,5 +1,7 @@
|
|||
plugins {
|
||||
id 'jacoco'
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.3.50' apply false
|
||||
id "org.jlleitschuh.gradle.ktlint" version "9.1.1"
|
||||
}
|
||||
|
||||
subprojects {
|
||||
|
@ -22,6 +24,16 @@ ext {
|
|||
allprojects {
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'kotlin'
|
||||
apply plugin: "org.jlleitschuh.gradle.ktlint"
|
||||
|
||||
ktlint {
|
||||
additionalEditorconfigFile = file(".editorconfig")
|
||||
disabledRules = [
|
||||
"no-wildcard-imports",
|
||||
"import-ordering",
|
||||
"max-line-length"
|
||||
]
|
||||
}
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
|
||||
|
@ -51,6 +63,12 @@ allprojects {
|
|||
testImplementation "junit:junit:4.12"
|
||||
}
|
||||
|
||||
jacocoTestReport {
|
||||
reports {
|
||||
xml.enabled true
|
||||
}
|
||||
}
|
||||
|
||||
task sourcesJar(type: Jar, dependsOn: classes) {
|
||||
classifier = 'sources'
|
||||
from sourceSets.main.allSource
|
||||
|
|
|
@ -2,7 +2,7 @@ package io.github.wulkanowy.sdk.mobile
|
|||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import java.time.Instant.now
|
||||
import java.util.*
|
||||
import java.util.UUID
|
||||
|
||||
@Suppress("unused")
|
||||
abstract class ApiRequest(
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package io.github.wulkanowy.sdk.mobile
|
||||
|
||||
|
||||
import java.util.LinkedList
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package io.github.wulkanowy.sdk.mobile.attendance
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import io.github.wulkanowy.sdk.mobile.attendance.Attendance
|
||||
|
||||
data class AttendanceResponse(
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package io.github.wulkanowy.sdk.mobile.register
|
|||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import io.github.wulkanowy.sdk.mobile.ApiRequest
|
||||
import java.util.*
|
||||
import java.util.UUID
|
||||
|
||||
data class CertificateRequest(
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package io.github.wulkanowy.sdk.mobile.school
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import io.github.wulkanowy.sdk.mobile.school.Teacher
|
||||
|
||||
data class TeachersResponse(
|
||||
|
||||
|
|
|
@ -6,10 +6,6 @@ plugins {
|
|||
// id 'com.jfrog.bintray' version '1.8.4'
|
||||
}
|
||||
|
||||
configurations {
|
||||
ktlint
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "pl.droidsonroids:jspoon:$jspoon"
|
||||
implementation "pl.droidsonroids.retrofit2:converter-jspoon:$jspoon"
|
||||
|
@ -25,32 +21,6 @@ dependencies {
|
|||
|
||||
implementation "org.slf4j:slf4j-api:$slf4j"
|
||||
testImplementation "org.slf4j:slf4j-simple:$slf4j"
|
||||
|
||||
ktlint "com.pinterest:ktlint:0.35.0"
|
||||
}
|
||||
|
||||
task ktlint(type: JavaExec, group: "verification") {
|
||||
description = "Check Kotlin code style."
|
||||
classpath = configurations.ktlint
|
||||
main = "com.pinterest.ktlint.Main"
|
||||
args "src/**/*.kt"
|
||||
// to generate report in checkstyle format prepend following args:
|
||||
// "--reporter=plain", "--reporter=checkstyle,output=${buildDir}/ktlint.xml"
|
||||
// see https://github.com/pinterest/ktlint#usage for more
|
||||
}
|
||||
check.dependsOn ktlint
|
||||
|
||||
task ktlintFormat(type: JavaExec, group: "formatting") {
|
||||
description = "Fix Kotlin code style deviations."
|
||||
classpath = configurations.ktlint
|
||||
main = "com.pinterest.ktlint.Main"
|
||||
args "-F", "src/**/*.kt"
|
||||
}
|
||||
|
||||
jacocoTestReport {
|
||||
reports {
|
||||
xml.enabled true
|
||||
}
|
||||
}
|
||||
|
||||
//bintray {
|
||||
|
|
|
@ -13,4 +13,4 @@ data class Semester(
|
|||
val end: LocalDate,
|
||||
val classId: Int,
|
||||
val unitId: Int
|
||||
)
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue