-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
40 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
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
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,33 @@ | ||
repositories { | ||
jcenter() | ||
} | ||
|
||
configurations { | ||
ktlint | ||
} | ||
|
||
dependencies { | ||
ktlint libraries.ktlint | ||
ktlint libraries.ktlintRules | ||
// additional 3rd party ruleset(s) can be specified here | ||
// just add them to the classpath (ktlint 'groupId:artifactId:version') and | ||
// ktlint will pick them up | ||
} | ||
|
||
task ktlint(type: JavaExec, group: "verification") { | ||
description = "Check Kotlin code style." | ||
main = "com.pinterest.ktlint.Main" | ||
classpath = configurations.ktlint | ||
args = ["--disabled_rules=no-multi-spaces,package-name,final-newline,import-ordering", "src/main/java/**/*.kt"] | ||
} | ||
check.dependsOn ktlint | ||
|
||
task ktlintFormat(type: JavaExec, group: "verification") { | ||
description = "Format Kotlin code style." | ||
main = "com.pinterest.ktlint.Main" | ||
classpath = configurations.ktlint | ||
args = ["-F", "--disabled_rules=no-multi-spaces,package-name,final-newline,import-ordering", "src/main/java/**/*.kt"] | ||
// to generate report in checkstyle format prepend following args: | ||
// "--reporter=plain", "--reporter=checkstyle,output=${buildDir}/ktlint.xml" | ||
// see https://github.com/shyiko/ktlint#usage for more | ||
} |