Skip to content

Commit e31027a

Browse files
fix: Override ktlint rules for kits to avoid editorconfig conflicts (#642)
1 parent e5484a0 commit e31027a

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

build.gradle

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,22 @@ subprojects {
4343
androidVariant "release"
4444
}
4545
apply plugin: 'org.jlleitschuh.gradle.ktlint'
46+
47+
// Kits include their own `.editorconfig` files (some with `root = true`) which can
48+
// prevent the repository `.editorconfig` from being applied. To keep lint behavior
49+
// consistent without modifying kit repos, we override the relevant ktlint rules here.
50+
if (project.projectDir.toString().startsWith("${rootProject.projectDir}/kits/")) {
51+
project.plugins.withId("org.jlleitschuh.gradle.ktlint") {
52+
project.ktlint {
53+
additionalEditorconfig = [
54+
"ktlint_standard_indent": "disabled",
55+
"ktlint_standard_trailing-comma-on-call-site": "disabled",
56+
"ktlint_standard_trailing-comma-on-declaration-site": "disabled",
57+
"ktlint_standard_no-consecutive-blank-lines": "disabled",
58+
]
59+
}
60+
}
61+
}
4662
}
4763

4864
allprojects {

0 commit comments

Comments
 (0)