From eb7c699775c748d44b7437a4c70fac7170539f78 Mon Sep 17 00:00:00 2001 From: Rick Busarow Date: Thu, 20 Jan 2022 19:37:10 -0600 Subject: [PATCH] re-enable ignored ktlint rules and update .editorconfig fixes #429 --- .editorconfig | 9 ++++----- build.gradle.kts | 22 ---------------------- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/.editorconfig b/.editorconfig index a9533e7fc..ff62c9111 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,7 +9,7 @@ # # Some keys were manually changed: # * insert_final_newline (is false, changed to true, expected by KtLint) -# * kotlin_imports_layout (see comment below, needed for KtLint) +# * ktlint_ignore_back_ticked_identifier (enabled, see comment below) # * root (see comment below) # Tells tools to stop searching upwards. @@ -30,10 +30,9 @@ ij_formatter_tags_enabled = false ij_smart_tabs = false ij_wrap_on_typing = false -# This config is needed for KtLint. It configures the import rule order to use IntelliJ IDEA's -# default style, see also: -# https://github.com/pinterest/ktlint#custom-ktlint-specific-editorconfig-properties -kotlin_imports_layout = *,java.**,javax.**,kotlin.**,^ +# Back-ticked method names are allowed to exceed the line length. That's especially helpful for +# test methods with descriptive names. +ktlint_ignore_back_ticked_identifier = true [*.java] ij_java_align_consecutive_assignments = false diff --git a/build.gradle.kts b/build.gradle.kts index 73b7f258c..9ab9251d5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -65,28 +65,6 @@ subprojects { // Default "plain" reporter is actually harder to read. reporter(ReporterType.JSON) } - - disabledRules.set( - setOf( - // IntelliJ refuses to sort imports correctly. - // This is a known issue: https://github.com/pinterest/ktlint/issues/527 - "import-ordering", - - // We had to disable the indent and parameter-list-wrapping rules, because they lead to - // false positives even in the most recent KtLint version. We created tickets: - // - // https://github.com/pinterest/ktlint/issues/963 - // https://github.com/pinterest/ktlint/issues/964 - // https://github.com/pinterest/ktlint/issues/965 - // - // We can't revert the KtLint version, because they only work with Kotlin 1.3 and would - // block Kotlin 1.4. We rather have a newer Kotlin version than a proper indent. The - // indent rule needs to be disabled globally due to another bug: - // https://github.com/pinterest/ktlint/issues/967 - "indent", - "parameter-list-wrapping" - ) - ) } }