Skip to content

Commit

Permalink
Setup KtLint (#102)
Browse files Browse the repository at this point in the history
* Setup KtLint
* Run KtLint on the whole project
  • Loading branch information
cortinico committed Feb 19, 2020
1 parent 8bb02ba commit 36178e8
Show file tree
Hide file tree
Showing 6 changed files with 269 additions and 133 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "slidetoact/build.gradle" }}
- run:
name: Build
command: ./gradlew clean assemble lint test
command: ./gradlew clean assemble lint test ktlintCheck
- store_artifacts:
path: example/build/reports/
destination: example-app-reports
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ before_install:
- yes | sdkmanager "build-tools;28.0.3"

script:
- ./gradlew clean build lint test
- ./gradlew clean build lint test ktlintCheck
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

buildscript {
repositories {
gradlePluginPortal()
jcenter()
google()
}
Expand All @@ -10,6 +11,7 @@ buildscript {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'org.jlleitschuh.gradle:ktlint-gradle:9.1.1'
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
14 changes: 14 additions & 0 deletions slidetoact/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'org.jlleitschuh.gradle.ktlint'

version = "0.7.0"

Expand Down Expand Up @@ -115,3 +116,16 @@ bintray {
}
}
}

ktlint {
version = "0.36.0"
debug = false
verbose = true
android = true
outputToConsole = true
ignoreFailures = false
enableExperimentalRules = true
filter {
exclude("**/generated/**")
}
}
Loading

0 comments on commit 36178e8

Please sign in to comment.