Skip to content

Commit

Permalink
Move Gradle plugins section above no-plugins section (#517)
Browse files Browse the repository at this point in the history
* Move Gradle plugins section above no-plugins section

* small updates so ktlint.github.io matches
  • Loading branch information
shashachu authored Jul 10, 2019
1 parent fd5ef5d commit 68069a8
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,18 @@ To run formatter - `mvn antrun:run@ktlint-format`.

#### ... with [Gradle](https://gradle.org/)

#### (with a plugin - Recommended)

Gradle plugins (in order of appearance):
- [jlleitschuh/ktlint-gradle](https://github.com/jlleitschuh/ktlint-gradle)
Gradle plugin that automatically creates check and format tasks for project Kotlin sources,
supports different kotlin plugins and Gradle build caching.

- [jeremymailen/kotlinter-gradle](https://github.com/jeremymailen/kotlinter-gradle)
Gradle plugin featuring incremental build support, file reports, and `*.kts` source support.

You might also want to take a look at [diffplug/spotless](https://github.com/diffplug/spotless/tree/master/plugin-gradle#applying-ktlint-to-kotlin-files) which has a built-in support for ktlint. In addition to linting/formatting kotlin code it allows you to keep license headers, markdown documentation, etc. in check.

#### (without a plugin)

> build.gradle
Expand All @@ -203,6 +215,8 @@ To run formatter - `mvn antrun:run@ktlint-format`.
// kotlin-gradle-plugin must be applied for configuration below to work
// (see https://kotlinlang.org/docs/reference/using-gradle.html)
apply plugin: "java"
repositories {
jcenter()
}
Expand Down Expand Up @@ -242,18 +256,6 @@ To run formatter - `gradle ktlintFormat`.

See [Making your Gradle tasks incremental](https://proandroiddev.com/making-your-gradle-tasks-incremental-7f26e4ef09c3) by [Niklas Baudy](https://github.com/vanniktech) on how to make tasks above incremental.

#### (with a plugin)

Gradle plugins (in order of appearance):
- [jlleitschuh/ktlint-gradle](https://github.com/jlleitschuh/ktlint-gradle)
Gradle plugin that automatically creates check and format tasks for project Kotlin sources,
supports different kotlin plugins and Gradle build caching.

- [jeremymailen/kotlinter-gradle](https://github.com/jeremymailen/kotlinter-gradle)
Gradle plugin featuring incremental build, `*.kts` support.

You might also want to take a look at [diffplug/spotless](https://github.com/diffplug/spotless/tree/master/plugin-gradle#applying-ktlint-to-kotlin-files) which has a built-in support for ktlint. In addition to linting/formatting kotlin code it allows you to keep license headers, markdown documentation, etc. in check.

#### ... with [IntelliJ IDEA](https://www.jetbrains.com/idea/)

> While this is not strictly necessary it makes Intellij IDEA's built-in formatter produce 100% ktlint-compatible
Expand Down

0 comments on commit 68069a8

Please # to comment.