Repository navigation
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
48 lines (47 loc) · 2.02 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
48 lines (47 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.hilt) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.spotless)
}
// Formatting/licensing guardrail: MPL license headers (templates in spotless/), ktlint
// formatting, and whitespace hygiene. Run `./gradlew spotlessCheck` to verify,
// `./gradlew spotlessApply` to fix.
spotless {
kotlin {
target(rootProject.fileTree("app/src") { include("**/*.kt") })
ktlint("1.5.0").editorConfigOverride(
mapOf(
// Composables are PascalCase functions by convention.
"ktlint_function_naming_ignore_when_annotated_with" to "Composable",
// Compose + Hilt code regularly exceeds strict line limits; keep the hard
// wrap generous and let reviewers judge readability.
"max_line_length" to "140",
),
)
licenseHeaderFile(rootProject.file("spotless/copyright.kt"))
trimTrailingWhitespace()
endWithNewline()
// OBTAINIUM_ADD_APP_URL is a 400+ char URL-encoded deep link that cannot be wrapped;
// @Suppress annotations are not honored by the spotless ktlint step, so scope the
// exemption here instead.
suppressLintsFor {
step = "ktlint"
shortCode = "standard:max-line-length"
path = "app/src/main/java/dev/tricked/solidverdant/ui/settings/ObtainiumLinks.kt"
}
}
kotlinGradle {
target(rootProject.files("build.gradle.kts", "app/build.gradle.kts"))
licenseHeaderFile(rootProject.file("spotless/copyright.kts"), "(^(?![\\/ ]\\*).*$)")
trimTrailingWhitespace()
endWithNewline()
}
}