Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace kotlinter with ktlint-gradle #45

Merged
merged 2 commits into from
Jul 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ jobs:
commit_message: Update dependencies from dependabot
commit_options: '--no-verify --signoff'

# formats all src files
# formats all kotlin files
- name: KtLint format
run: ./gradlew formatKotlin
run: ./gradlew ktlintformat -q

# If KtLint generated changes, commit and push those changes.
- name: commit changes
Expand Down
32 changes: 18 additions & 14 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask
import io.gitlab.arturbosch.detekt.detekt
import org.jlleitschuh.gradle.ktlint.KtlintExtension
import org.jlleitschuh.gradle.ktlint.tasks.BaseKtLintCheckTask

buildscript {
repositories {
Expand All @@ -31,7 +33,7 @@ buildscript {
classpath("com.google.devtools.ksp:symbol-processing-gradle-plugin:1.5.10-1.0.0-beta02")
classpath("com.vanniktech:gradle-maven-publish-plugin:0.17.0")
classpath("org.jetbrains.kotlinx:kotlinx-knit:0.3.0")
classpath("org.jmailen.gradle:kotlinter-gradle:3.4.5")
classpath("org.jlleitschuh.gradle:ktlint-gradle:10.1.0")
}
}

Expand Down Expand Up @@ -118,21 +120,23 @@ tasks.named(
}

allprojects {
apply(plugin = "org.jmailen.kotlinter")

extensions.configure<org.jmailen.gradle.kotlinter.KotlinterExtension> {

ignoreFailures = false
reporters = arrayOf("checkstyle", "plain")
experimentalRules = true
disabledRules = arrayOf(
"no-multi-spaces",
"no-wildcard-imports",
"max-line-length", // manually formatting still does this, and KTLint will still wrap long chains when possible
"filename", // same as Detekt's MatchingDeclarationName, except Detekt's version can be suppressed and this can't
"experimental:argument-list-wrapping" // doesn't work half the time
apply(plugin = "org.jlleitschuh.gradle.ktlint")

configure<KtlintExtension> {
debug.set(false)

disabledRules.set(
setOf(
"no-wildcard-imports",
"max-line-length", // manually formatting still does this, and KTLint will still wrap long chains when possible
"filename", // same as Detekt's MatchingDeclarationName, but Detekt's version can be suppressed and this can't
"experimental:argument-list-wrapping" // doesn't work half the time
)
)
}
tasks.withType<BaseKtLintCheckTask> {
workerMaxHeapSize.set("512m")
}
}

apiValidation {
Expand Down
1 change: 0 additions & 1 deletion dependabot-bridge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,4 @@ dependencies {
dependencySync("org.junit.jupiter:junit-jupiter:5.7.2")
dependencySync("org.junit.vintage:junit-vintage-engine:5.7.2")
dependencySync("org.robolectric:robolectric:4.6.1")

}
1 change: 0 additions & 1 deletion tangle-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ dependencies {
api(libs.androidx.fragment.ktx)
api(libs.androidx.lifecycle.viewModel.savedstate)
implementation(libs.androidx.lifecycle.viewModel.core)

}

kotlin {
Expand Down
1 change: 0 additions & 1 deletion tangle-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,3 @@ dependencies {
implementation(libs.androidx.savedstate)
implementation(projects.tangleApi)
}

2 changes: 0 additions & 2 deletions tangle-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>()
}
}



tasks.withType<Test> {
useJUnitPlatform()

Expand Down