Skip to content

Commit 521eae9

Browse files
committed
chore: update spotless config
1 parent 3e36db2 commit 521eae9

3 files changed

Lines changed: 57 additions & 32 deletions

File tree

build.gradle.kts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,43 @@ allprojects {
3636
dependencies {
3737
kover(project(":sshlib"))
3838
}
39+
40+
spotless {
41+
ratchetFrom = "origin/main"
42+
43+
kotlin {
44+
target("**/src/**/*.kt")
45+
ktlint("1.8.0")
46+
licenseHeaderFile("spotless/license-header.txt")
47+
}
48+
49+
kotlinGradle {
50+
target("**/*.gradle.kts")
51+
ktlint("1.8.0")
52+
}
53+
54+
yaml {
55+
target(".github/**/*.yml", ".github/**/*.yaml")
56+
trimTrailingWhitespace()
57+
endWithNewline()
58+
}
59+
60+
format("xml") {
61+
target("**/*.xml")
62+
targetExclude("**/.idea/**/*.xml", "**/bin/**/*.xml", "**/build/**/*.xml", "**/.worktrees/**/*.xml")
63+
trimTrailingWhitespace()
64+
endWithNewline()
65+
}
66+
67+
format("toml") {
68+
target("**/*.toml")
69+
trimTrailingWhitespace()
70+
endWithNewline()
71+
}
72+
73+
format("misc") {
74+
target(listOf("**/*.md", "**/.gitignore", "**/.gitattributes", "**/.editorconfig"))
75+
trimTrailingWhitespace()
76+
endWithNewline()
77+
}
78+
}

spotless/license-header.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* ConnectBot SSH Library
3+
* Copyright $YEAR Kenny Root
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+

sshlib/build.gradle.kts

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
1919

2020
plugins {
2121
alias(libs.plugins.kotlin.jvm)
22-
alias(libs.plugins.spotless)
2322
alias(libs.plugins.publish)
2423
alias(libs.plugins.dokka)
2524
alias(libs.plugins.metalava)
@@ -81,37 +80,6 @@ kotlin {
8180
}
8281
}
8382

84-
spotless {
85-
kotlinGradle {
86-
target(
87-
fileTree(".") {
88-
include("**/*.gradle.kts")
89-
exclude("**/build", "**/out")
90-
},
91-
)
92-
ktlint()
93-
}
94-
95-
kotlin {
96-
ktlint("1.8.0")
97-
}
98-
99-
format("xml") {
100-
target(
101-
fileTree(".") {
102-
include("config/**/*.xml", "lib/**/*.xml", "test-app/**/*.xml")
103-
exclude("**/build", "**/out")
104-
},
105-
)
106-
}
107-
108-
format("misc") {
109-
target("**/.gitignore")
110-
trimTrailingWhitespace()
111-
endWithNewline()
112-
}
113-
}
114-
11583
val gitHubUrl = "https://github.com/kruton/ssh-proto"
11684

11785
dokka {

0 commit comments

Comments
 (0)