Skip to content

Commit

Permalink
re-enable ignored ktlint rules and update .editorconfig
Browse files Browse the repository at this point in the history
fixes #429
  • Loading branch information
RBusarow committed Jan 21, 2022
1 parent 90ec1e4 commit eb7c699
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 27 deletions.
9 changes: 4 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
22 changes: 0 additions & 22 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
)
}
}

Expand Down

0 comments on commit eb7c699

Please sign in to comment.