-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Initialization Scripts for spotless
- Loading branch information
Showing
5 changed files
with
51 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# https://editorconfig.org/ | ||
# This configuration is used by ktlint when spotless invokes it | ||
|
||
[*.{kt,kts}] | ||
ij_kotlin_allow_trailing_comma=true | ||
ij_kotlin_allow_trailing_comma_on_call_site=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
val ktlintVersion = "0.49.0" | ||
|
||
initscript { | ||
val spotlessVersion = "6.22.0" | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
classpath("com.diffplug.spotless:spotless-plugin-gradle:$spotlessVersion") | ||
} | ||
} | ||
|
||
allprojects { | ||
if (this == rootProject) { | ||
return@allprojects | ||
} | ||
apply<com.diffplug.gradle.spotless.SpotlessPlugin>() | ||
extensions.configure<com.diffplug.gradle.spotless.SpotlessExtension> { | ||
kotlin { | ||
target("**/*.kt") | ||
targetExclude("**/build/**/*.kt") | ||
ktlint(ktlintVersion).userData(mapOf("android" to "true")) | ||
licenseHeaderFile(rootProject.file("spotless/copyright.kt")) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters