From 34d1e6fa278846dd8eb6ea82c936818d4610d3c2 Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Sat, 15 Feb 2025 19:51:10 +0600 Subject: [PATCH] Add more editor configs and move ktlint config to it (#1731) --- .editorconfig | 26 ++++++++++++++++--- .../main/kotlin/mihon.code.lint.gradle.kts | 7 ----- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.editorconfig b/.editorconfig index fc6b3c0c8..1b1fadfbc 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,8 +1,28 @@ -[*.{kt,kts}] -max_line_length = 120 -indent_size = 4 +root = true + +[*] +charset = utf-8 +indent_size = 2 +indent_style = space insert_final_newline = true +trim_trailing_whitespace = true + +[*.xml] +indent_size = 4 + +# noinspection EditorConfigKeyCorrectness +[*.{kt,kts}] +indent_size = 4 +max_line_length = 120 + ij_kotlin_allow_trailing_comma = true ij_kotlin_allow_trailing_comma_on_call_site = true ij_kotlin_name_count_to_use_star_import = 2147483647 ij_kotlin_name_count_to_use_star_import_for_members = 2147483647 + +ktlint_code_style = intellij_idea +ktlint_function_naming_ignore_when_annotated_with = Composable +ktlint_standard_class-signature = disabled +ktlint_standard_discouraged-comment-location = disabled +ktlint_standard_function-expression-body = disabled +ktlint_standard_function-signature = disabled diff --git a/buildSrc/src/main/kotlin/mihon.code.lint.gradle.kts b/buildSrc/src/main/kotlin/mihon.code.lint.gradle.kts index 3e604c8c0..99c3e99a1 100644 --- a/buildSrc/src/main/kotlin/mihon.code.lint.gradle.kts +++ b/buildSrc/src/main/kotlin/mihon.code.lint.gradle.kts @@ -23,13 +23,6 @@ spotless { target("**/*.kt", "**/*.kts") targetExclude("**/build/**/*.kt") ktlint(libs.ktlint.core.get().version) - .editorConfigOverride(mapOf( - "ktlint_function_naming_ignore_when_annotated_with" to "Composable", - "ktlint_standard_class-signature" to "disabled", - "ktlint_standard_discouraged-comment-location" to "disabled", - "ktlint_standard_function-expression-body" to "disabled", - "ktlint_standard_function-signature" to "disabled", - )) trimTrailingWhitespace() endWithNewline() }