|
| 1 | +# EditorConfig helps maintain consistent coding styles across various editors and IDEs |
| 2 | +# See https://editorconfig.org for more details |
| 3 | + |
| 4 | +# top-most EditorConfig file |
| 5 | +root = true |
| 6 | + |
| 7 | +# All files |
| 8 | +[*] |
| 9 | +charset = utf-8 |
| 10 | +end_of_line = lf |
| 11 | +indent_style = space |
| 12 | +indent_size = 2 |
| 13 | +tab_width = 2 |
| 14 | +insert_final_newline = true |
| 15 | +trim_trailing_whitespace = true |
| 16 | +max_line_length = 120 |
| 17 | + |
| 18 | +# Kotlin files - Official Kotlin Style Guide with 2-space tabs |
| 19 | +[{*.kt,*.kts}] |
| 20 | +indent_size = 2 |
| 21 | +tab_width = 2 |
| 22 | +ij_continuation_indent_size = 4 |
| 23 | +max_line_length = 120 |
| 24 | +ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL |
| 25 | + |
| 26 | +# Basic formatting |
| 27 | +ij_kotlin_keep_blank_lines_in_code = 2 |
| 28 | +ij_kotlin_keep_blank_lines_in_declarations = 2 |
| 29 | +ij_kotlin_keep_blank_lines_before_right_brace = 2 |
| 30 | +ij_kotlin_blank_lines_after_class_header = 0 |
| 31 | +ij_kotlin_blank_lines_around_block_when_branches = 0 |
| 32 | +ij_kotlin_blank_lines_before_declaration_with_comment_or_annotation_on_separate_line = 1 |
| 33 | + |
| 34 | +# Imports - No star imports for better consistency and performance |
| 35 | +ij_kotlin_imports_layout = *, java.**, javax.**, kotlin.**, ^ |
| 36 | +ij_kotlin_name_count_to_use_star_import = 999 |
| 37 | +ij_kotlin_name_count_to_use_star_import_for_members = 999 |
| 38 | +ij_kotlin_packages_to_use_import_on_demand = |
| 39 | + |
| 40 | +# Alignment and wrapping |
| 41 | +ij_kotlin_align_multiline_parameters = true |
| 42 | +ij_kotlin_align_multiline_parameters_in_calls = false |
| 43 | +ij_kotlin_continuation_indent_for_chained_calls = true |
| 44 | +ij_kotlin_continuation_indent_for_expression_bodies = true |
| 45 | +ij_kotlin_wrap_first_method_in_call_chain = false |
| 46 | + |
| 47 | +# Method parameters |
| 48 | +ij_kotlin_method_parameters_wrap = on_every_item |
| 49 | +ij_kotlin_method_parameters_new_line_after_left_paren = false |
| 50 | +ij_kotlin_method_parameters_right_paren_on_new_line = false |
| 51 | + |
| 52 | +# Call parameters |
| 53 | +ij_kotlin_call_parameters_wrap = on_every_item |
| 54 | +ij_kotlin_call_parameters_new_line_after_left_paren = false |
| 55 | +ij_kotlin_call_parameters_right_paren_on_new_line = false |
| 56 | + |
| 57 | +# Annotations |
| 58 | +ij_kotlin_class_annotation_wrap = split_into_lines |
| 59 | +ij_kotlin_method_annotation_wrap = split_into_lines |
| 60 | +ij_kotlin_field_annotation_wrap = split_into_lines |
| 61 | +ij_kotlin_parameter_annotation_wrap = off |
| 62 | +ij_kotlin_variable_annotation_wrap = off |
| 63 | + |
| 64 | +# Spaces |
| 65 | +ij_kotlin_space_after_comma = true |
| 66 | +ij_kotlin_space_after_extend_colon = true |
| 67 | +ij_kotlin_space_after_type_colon = true |
| 68 | +ij_kotlin_space_before_comma = false |
| 69 | +ij_kotlin_space_before_extend_colon = true |
| 70 | +ij_kotlin_space_before_type_colon = false |
| 71 | +ij_kotlin_space_before_lambda_arrow = true |
| 72 | +ij_kotlin_spaces_around_additive_operators = true |
| 73 | +ij_kotlin_spaces_around_assignment_operators = true |
| 74 | +ij_kotlin_spaces_around_equality_operators = true |
| 75 | +ij_kotlin_spaces_around_function_type_arrow = true |
| 76 | +ij_kotlin_spaces_around_logical_operators = true |
| 77 | +ij_kotlin_spaces_around_multiplicative_operators = true |
| 78 | +ij_kotlin_spaces_around_relational_operators = true |
| 79 | +ij_kotlin_spaces_around_unary_operator = false |
| 80 | +ij_kotlin_spaces_around_when_arrow = true |
| 81 | + |
| 82 | +# Control flow |
| 83 | +ij_kotlin_space_before_if_parentheses = true |
| 84 | +ij_kotlin_space_before_for_parentheses = true |
| 85 | +ij_kotlin_space_before_while_parentheses = true |
| 86 | +ij_kotlin_space_before_catch_parentheses = true |
| 87 | +ij_kotlin_space_before_when_parentheses = true |
| 88 | + |
| 89 | +# Other formatting |
| 90 | +ij_kotlin_allow_trailing_comma = true |
| 91 | +ij_kotlin_allow_trailing_comma_on_call_site = true |
| 92 | +ij_kotlin_insert_whitespaces_in_simple_one_line_method = true |
| 93 | +ij_kotlin_keep_line_breaks = true |
| 94 | +ij_kotlin_lbrace_on_next_line = false |
| 95 | + |
| 96 | +# Java files |
| 97 | +[*.java] |
| 98 | +indent_size = 2 |
| 99 | +tab_width = 2 |
| 100 | +ij_continuation_indent_size = 4 |
| 101 | +max_line_length = 120 |
| 102 | +# Java imports - No star imports |
| 103 | +ij_java_class_count_to_use_import_on_demand = 999 |
| 104 | +ij_java_names_count_to_use_import_on_demand = 999 |
| 105 | +ij_java_packages_to_use_import_on_demand = |
| 106 | + |
| 107 | +# Gradle files |
| 108 | +[{*.gradle,*.gradle.kts}] |
| 109 | +indent_size = 2 |
| 110 | +tab_width = 2 |
| 111 | + |
| 112 | +# YAML files |
| 113 | +[*.{yml,yaml}] |
| 114 | +indent_size = 2 |
| 115 | +tab_width = 2 |
| 116 | + |
| 117 | +# JSON files |
| 118 | +[{*.json,*.jsonc}] |
| 119 | +indent_size = 2 |
| 120 | +tab_width = 2 |
| 121 | + |
| 122 | +# XML files |
| 123 | +[*.xml] |
| 124 | +indent_size = 2 |
| 125 | +tab_width = 2 |
| 126 | + |
| 127 | +# Properties files |
| 128 | +[*.properties] |
| 129 | +indent_size = 2 |
| 130 | +tab_width = 2 |
| 131 | + |
| 132 | +# Markdown files |
| 133 | +[*.md] |
| 134 | +trim_trailing_whitespace = false |
| 135 | +insert_final_newline = true |
| 136 | +indent_size = 2 |
| 137 | +tab_width = 2 |
| 138 | + |
| 139 | +# Shell scripts |
| 140 | +[{*.sh,*.bash}] |
| 141 | +indent_size = 2 |
| 142 | +tab_width = 2 |
| 143 | +end_of_line = lf |
0 commit comments