Skip to content

Commit

Permalink
Merge pull request #2 from jeremymailen/ktlint-upgrade
Browse files Browse the repository at this point in the history
Upgrade ktlint and document how to set a custom version
  • Loading branch information
jeremymailen authored May 23, 2017
2 parents e8c43fc + 992769f commit f60dd21
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ plugins {

If your project uses the JetBrains Kotlin JVM Gradle plugin, standard tasks will created:

`formatKotlin`: format Kotlin source code according to ktlint rules (when possible to auto-format).
`formatKotlin`: format Kotlin source code according to `ktlint` rules (when possible to auto-format).

`lintKotlin`: check Kotlin source code for lint formatting error and (by default) fail the build.

Expand Down Expand Up @@ -60,6 +60,16 @@ lintKotlinMain {
}
```

If you need to use a different version of `ktlint` you can override the dependency.

```groovy
buildscript {
configurations.classpath {
resolutionStrategy { force 'com.github.shyiko:ktlint:0.6.1' }
}
}
```

### Planned Features
- dependency configuration for adding ktlint [rulesets](https://github.com/shyiko/ktlint#creating-a-ruleset)
- additional configurability along the lines of [checkstyle](https://docs.gradle.org/current/userguide/checkstyle_plugin.html)
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.1.2'
id 'org.jetbrains.kotlin.jvm' version '1.1.2-2'
id 'com.gradle.plugin-publish' version '0.9.7'
id 'java-gradle-plugin'
id 'maven-publish'
Expand All @@ -11,12 +11,12 @@ repositories {
}

dependencies {
compile 'com.github.shyiko:ktlint:0.6.1'
compile 'com.github.shyiko:ktlint:0.6.2'
compileOnly 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.2-2'
testCompile 'junit:junit:4.12'
}

version = '0.7.0'
version = '0.8.0'
group = 'org.jmailen.gradle'
def pluginId = 'org.jmailen.kotlinter'

Expand Down

0 comments on commit f60dd21

Please sign in to comment.