-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from cyberagent-zemi/atsushi/ktlint
Ktlintの設定
- Loading branch information
Showing
10 changed files
with
104 additions
and
1 deletion.
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,7 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
indent_style = space |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,3 @@ | ||
object Deps { | ||
const val ktlint = "com.pinterest:ktlint:${Versions.ktlint}" | ||
} |
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,3 @@ | ||
object Versions { | ||
const val ktlint = "0.41.0" | ||
} |
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,32 @@ | ||
val ktlint by configurations.creating | ||
|
||
dependencies { | ||
ktlint(Deps.ktlint) { | ||
attributes { | ||
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling.EXTERNAL)) | ||
} | ||
} | ||
} | ||
|
||
val outputDir = "${project.buildDir}/reports/ktlint/" | ||
val inputFiles = project.fileTree(mapOf("dir" to "src", "include" to "**/*.kt")) | ||
|
||
val ktlintCheck by tasks.creating(JavaExec::class) { | ||
inputs.files(inputFiles) | ||
outputs.dir(outputDir) | ||
|
||
description = "Check Kotlin code style." | ||
classpath = ktlint | ||
main = "com.pinterest.ktlint.Main" | ||
args = listOf("src/**/*.kt") | ||
} | ||
|
||
val ktlintFormat by tasks.creating(JavaExec::class) { | ||
inputs.files(inputFiles) | ||
outputs.dir(outputDir) | ||
|
||
description = "Fix Kotlin code style deviations." | ||
classpath = ktlint | ||
main = "com.pinterest.ktlint.Main" | ||
args = listOf("-F", "src/**/*.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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,4 +42,4 @@ dependencies { | |
implementation(kotlin("stdlib")) | ||
|
||
implementation(project(":katalog")) | ||
} | ||
} |