This repository has been archived by the owner on Feb 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
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 #126 from novoda/develop
Release 0.6
- Loading branch information
Showing
48 changed files
with
672 additions
and
195 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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
class GradlePlugins { | ||
final bintrayRelease = 'com.novoda:bintray-release:0.4.0' | ||
final buildProperties = 'com.novoda:gradle-build-properties-plugin:0.2' | ||
final buildProperties = 'com.novoda:gradle-build-properties-plugin:0.4.1' | ||
final gradleGit = 'org.ajoberstar:gradle-git:1.6.0' | ||
final gradlePublish = 'com.gradle.publish:plugin-publish-plugin:0.9.9' | ||
} |
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,58 @@ | ||
# ktlint | ||
[Ktlint](https://github.com/shyiko/ktlint) is a linter for Kotlin with a built-in formatter. It does not support Java. Adding | ||
this tool only makes sense when you have Kotlin sources in your project. In fact, it will fail to run if you have 0 Kotlin | ||
files. | ||
|
||
## Table of contents | ||
* [IMPORTANT: setup Ktlint](#important-setup-ktlint) | ||
* [Configure Ktlint](#configure-ktlint) | ||
--- | ||
|
||
## IMPORTANT: setup Ktlint | ||
|
||
Unlike the other tools, the plugin **won't automatically add Ktlint** to your project. If you forget to do it, the plugin will | ||
fail the build with an error. | ||
|
||
In order to integrate Ktlint easily we choose to use the [Ktlint Gradle plugin](https://github.com/JLLeitschuh/ktlint-gradle/). | ||
This plugin has a very good understanding of Android source sets and build flavors. You can refer to the | ||
[official documentation](https://github.com/JLLeitschuh/ktlint-gradle/#how-to-use) for further details. | ||
|
||
Note that you should _not_ add the `ktlint` closure to your `build.gradle`s, unlike what the official documentation says. The | ||
`ktlint` closure in the `staticAnalysis` configuration gets applied to all Kotlin modules automatically. | ||
|
||
In most common cases, adding Ktlint to a project boils down to these simple steps: | ||
|
||
1. Add this statement to your root `build.gradle` project (change the version according to your needs): | ||
```gradle | ||
plugins { | ||
id 'org.jlleitschuh.gradle.ktlint' version '5.0.0' | ||
// ... | ||
} | ||
``` | ||
2. Add this statement to each Kotlin project's `build.gradle`s: | ||
```gradle | ||
plugins { | ||
id 'org.jlleitschuh.gradle.ktlint' | ||
// ... | ||
} | ||
``` | ||
## Configure Ktlint | ||
Unlike other tools, Ktlint does not offer much configuration. By default, it applies | ||
[Kotlin style guide](https://kotlinlang.org/docs/reference/coding-conventions.html) or | ||
[Android Kotlin style guide](https://android.github.io/kotlin-guides/style.html). | ||
To use Android style guide: | ||
```gradle | ||
ktlint { | ||
android true | ||
} | ||
``` | ||
|
||
For other configuration options and adding custom rules, refer to the | ||
[official guide](https://github.com/JLLeitschuh/ktlint-gradle/#configuration). | ||
|
||
**Note:** Failures and threshold detection is handled by Static Analysis plugin. That is why `ignoreFailures = true` is set by | ||
the plugin. Please do not manually override `ignoreFailures` property. |
Oops, something went wrong.