Skip to content
New issue

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

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

Already on GitHub? # to your account

IDE integration via .editorconfig #701

Closed
Tapchicoma opened this issue Feb 18, 2020 · 12 comments · Fixed by #1570
Closed

IDE integration via .editorconfig #701

Tapchicoma opened this issue Feb 18, 2020 · 12 comments · Fixed by #1570
Assignees
Milestone

Comments

@Tapchicoma
Copy link
Collaborator

I am proposing to deprecate current IntellijIDEA integration. Problem with it:

  • writes IDEA specific configuration xml files that could not be used by other editors
  • is detached from used rules and not configurable. Only generic style is written to configuration file.

Instead I am proposing to define IDE kotlin code style via .editorconfig file: https://blog.jetbrains.com/idea/2019/06/managing-code-style-on-a-directory-level-with-editorconfig/. This overrides styles defined in IDEA xml configuration.

Rules themselves should provide applicable .editorconfig options as a constructor parameter. Current constructor that takes only id as a parameter should be deprecated. Then ktlint will collect all active rules editorconfig options and either write it to provided file or print them to standard output.

Possibly other editors could pickup this editorconfig options and apply it to internal kotlin code style settings (needs further investigation).

Problems with such approach:

  • So far all kotlin specific style has ij_kotlin prefix, that may limit other editors integration. Editorconfig generated by IDEA based on current ktlint codestyle scheme:
[{*.gradle.kts,*.kts,*.kt}]
ij_continuation_indent_size = 4
ij_kotlin_align_in_columns_case_branch = false
ij_kotlin_align_multiline_binary_operation = false
ij_kotlin_align_multiline_extends_list = false
ij_kotlin_align_multiline_method_parentheses = false
ij_kotlin_align_multiline_parameters = false
ij_kotlin_align_multiline_parameters_in_calls = false
ij_kotlin_assignment_wrap = normal
ij_kotlin_blank_lines_after_class_header = 0
ij_kotlin_blank_lines_around_block_when_branches = 0
ij_kotlin_block_comment_at_first_column = true
ij_kotlin_call_parameters_new_line_after_left_paren = true
ij_kotlin_call_parameters_right_paren_on_new_line = true
ij_kotlin_call_parameters_wrap = on_every_item
ij_kotlin_catch_on_new_line = false
ij_kotlin_class_annotation_wrap = split_into_lines
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL
ij_kotlin_continuation_indent_for_chained_calls = false
ij_kotlin_continuation_indent_for_expression_bodies = false
ij_kotlin_continuation_indent_in_argument_lists = false
ij_kotlin_continuation_indent_in_elvis = false
ij_kotlin_continuation_indent_in_if_conditions = false
ij_kotlin_continuation_indent_in_parameter_lists = false
ij_kotlin_continuation_indent_in_supertype_lists = false
ij_kotlin_else_on_new_line = false
ij_kotlin_enum_constants_wrap = off
ij_kotlin_extends_list_wrap = normal
ij_kotlin_field_annotation_wrap = split_into_lines
ij_kotlin_finally_on_new_line = false
ij_kotlin_if_rparen_on_new_line = true
ij_kotlin_import_nested_classes = false
ij_kotlin_insert_whitespaces_in_simple_one_line_method = true
ij_kotlin_keep_blank_lines_before_right_brace = 0
ij_kotlin_keep_blank_lines_in_code = 1
ij_kotlin_keep_blank_lines_in_declarations = 1
ij_kotlin_keep_first_column_comment = true
ij_kotlin_keep_indents_on_empty_lines = false
ij_kotlin_keep_line_breaks = true
ij_kotlin_lbrace_on_next_line = false
ij_kotlin_line_comment_add_space = true
ij_kotlin_line_comment_at_first_column = false
ij_kotlin_method_annotation_wrap = split_into_lines
ij_kotlin_method_call_chain_wrap = normal
ij_kotlin_method_parameters_new_line_after_left_paren = true
ij_kotlin_method_parameters_right_paren_on_new_line = true
ij_kotlin_method_parameters_wrap = on_every_item
ij_kotlin_name_count_to_use_star_import = 2147483647
ij_kotlin_name_count_to_use_star_import_for_members = 2147483647
ij_kotlin_parameter_annotation_wrap = off
ij_kotlin_space_after_comma = true
ij_kotlin_space_after_extend_colon = true
ij_kotlin_space_after_type_colon = true
ij_kotlin_space_before_catch_parentheses = true
ij_kotlin_space_before_comma = false
ij_kotlin_space_before_extend_colon = true
ij_kotlin_space_before_for_parentheses = true
ij_kotlin_space_before_if_parentheses = true
ij_kotlin_space_before_lambda_arrow = true
ij_kotlin_space_before_type_colon = false
ij_kotlin_space_before_when_parentheses = true
ij_kotlin_space_before_while_parentheses = true
ij_kotlin_spaces_around_additive_operators = true
ij_kotlin_spaces_around_assignment_operators = true
ij_kotlin_spaces_around_equality_operators = true
ij_kotlin_spaces_around_function_type_arrow = true
ij_kotlin_spaces_around_logical_operators = true
ij_kotlin_spaces_around_multiplicative_operators = true
ij_kotlin_spaces_around_range = false
ij_kotlin_spaces_around_relational_operators = true
ij_kotlin_spaces_around_unary_operator = false
ij_kotlin_spaces_around_when_arrow = true
ij_kotlin_variable_annotation_wrap = off
ij_kotlin_while_on_new_line = false
ij_kotlin_wrap_elvis_expressions = 1
ij_kotlin_wrap_expression_body_functions = 1
ij_kotlin_wrap_first_method_in_call_chain = false
  • I could not find where all this possible editorconfig options are defined (needs further investigation)
@shashachu
Copy link
Contributor

Interesting idea! So you're saying that these custom .editorconfig rules are currently used by IntelliJ IDEA, and we'd simply write them out based on the set of enabled rules?

@Tapchicoma
Copy link
Collaborator Author

yes, this is one of the idea behind this proposal. Another one is to possible enable support for other IDE/editors.

@Tapchicoma
Copy link
Collaborator Author

@JLLeitschuh
Copy link
Contributor

is detached from used rules and not configurable. Only generic style is written to configuration file.

Isn't ktlint supposed to be anti-bikeshedding? Seems like this goes against this core mission statement of the project.

If we're looking to drop the anti-bikeshedding mentality thats fine, but I think that should be an intentional decision, not something that happens by accident.


Other than that, this plan seems solid.

@Tapchicoma
Copy link
Collaborator Author

Isn't ktlint supposed to be anti-bikeshedding? Seems like this goes against this core mission statement of the project.

IMHO, ktlint is not "anti-bikeshedding" tool already as it allows to disable some rules or add custom one.

@ColtonIdle
Copy link

@Tapchicoma

  • I could not find where all this possible editorconfig options are defined (needs further investigation)

I just saw in intellij that if you generate an editorconfig is allows you to view all of the settings in a commented out form.

Screen Shot 2020-04-29 at 2 55 23 AM

This generates a file such as:

root = true

[*]
# charset = utf-8
# end_of_line = lf
# indent_size = 4
# indent_style = space
# insert_final_newline = false
# max_line_length = 100
# tab_width = 4
# ij_continuation_indent_size = 8
# ij_formatter_off_tag = @formatter:off
# ij_formatter_on_tag = @formatter:on
# ij_formatter_tags_enabled = false
# ij_smart_tabs = false
# ij_wrap_on_typing = false

[{*.kt,*.kts,*.main.kts}]
# ij_kotlin_align_in_columns_case_branch = false
# ij_kotlin_align_multiline_binary_operation = false
# ij_kotlin_align_multiline_extends_list = false
# ij_kotlin_align_multiline_method_parentheses = false
# ij_kotlin_align_multiline_parameters = true
# ij_kotlin_align_multiline_parameters_in_calls = false
# ij_kotlin_allow_trailing_comma = false
# ij_kotlin_assignment_wrap = normal
# ij_kotlin_blank_lines_after_class_header = 0
# ij_kotlin_blank_lines_around_block_when_branches = 0
# ij_kotlin_block_comment_at_first_column = true
# ij_kotlin_call_parameters_new_line_after_left_paren = true
# ij_kotlin_call_parameters_right_paren_on_new_line = true
# ij_kotlin_call_parameters_wrap = on_every_item
# ij_kotlin_catch_on_new_line = false
# ij_kotlin_class_annotation_wrap = split_into_lines
# ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL
# ij_kotlin_continuation_indent_for_chained_calls = false
# ij_kotlin_continuation_indent_for_expression_bodies = false
# ij_kotlin_continuation_indent_in_argument_lists = false
# ij_kotlin_continuation_indent_in_elvis = false
# ij_kotlin_continuation_indent_in_if_conditions = false
# ij_kotlin_continuation_indent_in_parameter_lists = false
# ij_kotlin_continuation_indent_in_supertype_lists = false
# ij_kotlin_else_on_new_line = false
# ij_kotlin_enum_constants_wrap = off
# ij_kotlin_extends_list_wrap = normal
# ij_kotlin_field_annotation_wrap = split_into_lines
# ij_kotlin_finally_on_new_line = false
# ij_kotlin_if_rparen_on_new_line = true
# ij_kotlin_import_nested_classes = false
# ij_kotlin_insert_whitespaces_in_simple_one_line_method = true
# ij_kotlin_keep_blank_lines_before_right_brace = 2
# ij_kotlin_keep_blank_lines_in_code = 2
# ij_kotlin_keep_blank_lines_in_declarations = 2
# ij_kotlin_keep_first_column_comment = true
# ij_kotlin_keep_indents_on_empty_lines = false
# ij_kotlin_keep_line_breaks = true
# ij_kotlin_lbrace_on_next_line = false
# ij_kotlin_line_comment_add_space = false
# ij_kotlin_line_comment_at_first_column = true
# ij_kotlin_method_annotation_wrap = split_into_lines
# ij_kotlin_method_call_chain_wrap = normal
# ij_kotlin_method_parameters_new_line_after_left_paren = true
# ij_kotlin_method_parameters_right_paren_on_new_line = true
# ij_kotlin_method_parameters_wrap = on_every_item
# ij_kotlin_name_count_to_use_star_import = 99
# ij_kotlin_name_count_to_use_star_import_for_members = 99
# ij_kotlin_parameter_annotation_wrap = off
# ij_kotlin_space_after_comma = true
# ij_kotlin_space_after_extend_colon = true
# ij_kotlin_space_after_type_colon = true
# ij_kotlin_space_before_catch_parentheses = true
# ij_kotlin_space_before_comma = false
# ij_kotlin_space_before_extend_colon = true
# ij_kotlin_space_before_for_parentheses = true
# ij_kotlin_space_before_if_parentheses = true
# ij_kotlin_space_before_lambda_arrow = true
# ij_kotlin_space_before_type_colon = false
# ij_kotlin_space_before_when_parentheses = true
# ij_kotlin_space_before_while_parentheses = true
# ij_kotlin_spaces_around_additive_operators = true
# ij_kotlin_spaces_around_assignment_operators = true
# ij_kotlin_spaces_around_equality_operators = true
# ij_kotlin_spaces_around_function_type_arrow = true
# ij_kotlin_spaces_around_logical_operators = true
# ij_kotlin_spaces_around_multiplicative_operators = true
# ij_kotlin_spaces_around_range = false
# ij_kotlin_spaces_around_relational_operators = true
# ij_kotlin_spaces_around_unary_operator = false
# ij_kotlin_spaces_around_when_arrow = true
# ij_kotlin_variable_annotation_wrap = off
# ij_kotlin_while_on_new_line = false
# ij_kotlin_wrap_elvis_expressions = 1
# ij_kotlin_wrap_expression_body_functions = 1
# ij_kotlin_wrap_first_method_in_call_chain = false

@Tapchicoma Tapchicoma self-assigned this Aug 24, 2020
@Tapchicoma Tapchicoma added this to the 0.40.0 milestone Sep 18, 2020
@Tapchicoma Tapchicoma modified the milestones: 0.40.0, 0.41.0 Dec 5, 2020
@eygraber
Copy link
Contributor

eygraber commented Mar 1, 2021

Just to clarify because I confuse myself every few months when I try this thinking it will work, does ktlint currently support .editorconfig files with ij_kotlin_* (e.g. ij_kotlin_space_before_if_parentheses), and if doesn't, is this issue the request to add that support?

@Tapchicoma
Copy link
Collaborator Author

@eygraber initial foundation was added (few rules already supports it).

If you know which rule should support which ij_kotlin_* property - please open a new issue or PR (even better).

@huehnerlady
Copy link

@Tapchicoma is there a list of rules that are already supported as an overview and is there maybe a Pull Request we could use as a template to add a rule?

@gad2103
Copy link

gad2103 commented Jun 26, 2021

I am also very confused by this issue and not sure if i should open a new one. From what i can see, when i run ktlint --editorconfig=.editorconfig my ij_kotlin_* rules are just ignored. So I'm assuming there isn't support for them until proven otherwise.

[*.{kt,kts}]
ij_continuation_indent_size = 4
ij_kotlin_align_in_columns_case_branch = true
ij_kotlin_align_multiline_binary_operation = false
ij_kotlin_align_multiline_extends_list = false
ij_kotlin_align_multiline_method_parentheses = false
ij_kotlin_align_multiline_parameters = true
ij_kotlin_align_multiline_parameters_in_calls = false
ij_kotlin_allow_trailing_comma = false
ij_kotlin_allow_trailing_comma_on_call_site = false
ij_kotlin_assignment_wrap = off
ij_kotlin_blank_lines_after_class_header = 0
ij_kotlin_blank_lines_around_block_when_branches = 0
ij_kotlin_blank_lines_before_declaration_with_comment_or_annotation_on_separate_line = 1
ij_kotlin_block_comment_at_first_column = true
ij_kotlin_call_parameters_new_line_after_left_paren = false
ij_kotlin_call_parameters_right_paren_on_new_line = false
ij_kotlin_call_parameters_wrap = off
ij_kotlin_catch_on_new_line = false
ij_kotlin_class_annotation_wrap = split_into_lines
ij_kotlin_continuation_indent_for_chained_calls = true
ij_kotlin_continuation_indent_for_expression_bodies = true
ij_kotlin_continuation_indent_in_argument_lists = true
ij_kotlin_continuation_indent_in_elvis = true
ij_kotlin_continuation_indent_in_if_conditions = true
ij_kotlin_continuation_indent_in_parameter_lists = true
ij_kotlin_continuation_indent_in_supertype_lists = true
ij_kotlin_else_on_new_line = false
ij_kotlin_enum_constants_wrap = off
ij_kotlin_extends_list_wrap = off
ij_kotlin_field_annotation_wrap = split_into_lines
ij_kotlin_finally_on_new_line = false
ij_kotlin_if_rparen_on_new_line = false
ij_kotlin_import_nested_classes = false
ij_kotlin_insert_whitespaces_in_simple_one_line_method = true
ij_kotlin_keep_blank_lines_before_right_brace = 2
ij_kotlin_keep_blank_lines_in_code = 2
ij_kotlin_keep_blank_lines_in_declarations = 2
ij_kotlin_keep_first_column_comment = true
ij_kotlin_keep_indents_on_empty_lines = false
ij_kotlin_keep_line_breaks = true
ij_kotlin_lbrace_on_next_line = false
ij_kotlin_line_comment_add_space = false
ij_kotlin_line_comment_at_first_column = true
ij_kotlin_method_annotation_wrap = split_into_lines
ij_kotlin_method_call_chain_wrap = off
ij_kotlin_method_parameters_new_line_after_left_paren = false
ij_kotlin_method_parameters_right_paren_on_new_line = false
ij_kotlin_method_parameters_wrap = off
ij_kotlin_name_count_to_use_star_import = 5
ij_kotlin_name_count_to_use_star_import_for_members = 3
ij_kotlin_parameter_annotation_wrap = off
ij_kotlin_space_after_comma = true
ij_kotlin_space_after_extend_colon = true
ij_kotlin_space_after_type_colon = true
ij_kotlin_space_before_catch_parentheses = true
ij_kotlin_space_before_comma = false
ij_kotlin_space_before_extend_colon = false
ij_kotlin_space_before_for_parentheses = true
ij_kotlin_space_before_if_parentheses = true
ij_kotlin_space_before_lambda_arrow = true
ij_kotlin_space_before_type_colon = false
ij_kotlin_space_before_when_parentheses = true
ij_kotlin_space_before_while_parentheses = true
ij_kotlin_spaces_around_additive_operators = true
ij_kotlin_spaces_around_assignment_operators = true
ij_kotlin_spaces_around_equality_operators = true
ij_kotlin_spaces_around_function_type_arrow = true
ij_kotlin_spaces_around_logical_operators = true
ij_kotlin_spaces_around_multiplicative_operators = true
ij_kotlin_spaces_around_range = false
ij_kotlin_spaces_around_relational_operators = true
ij_kotlin_spaces_around_unary_operator = false
ij_kotlin_spaces_around_when_arrow = true
ij_kotlin_variable_annotation_wrap = off
ij_kotlin_while_on_new_line = false
ij_kotlin_wrap_elvis_expressions = 1
ij_kotlin_wrap_expression_body_functions = 0
ij_kotlin_wrap_first_method_in_call_chain = false

that's my ruleset. when i run i get conflicting messages like:

/path/to/Slice.kt:18:36: Missing spacing before ":"

which contradicts my rule ij_kotlin_space_before_extend_colon = false

please advise on how to fix or how to make a PR to correct. Thanks.

@Tapchicoma
Copy link
Collaborator Author

Yes, current support is very limited - you could try to run generateEditorConfig subcommand to get overview of supported properties.

Feel free to contribute support for missing properties.

@paul-dingemans
Copy link
Collaborator

paul-dingemans commented Jul 1, 2022

ktlint only respects a limited set of ij_ properties. I don't think that it should be a goal for ktlint to respect all ij_ options as that would mean that we are rebuilding the IntelliJ IDEA formatter. The goal of ktlint is to reduce the shere amount of configuration options offered by IntelliJ IDEA by a very limited set.

All standard and experimental rules offered by ktlint 0.46.x only use configuration options which are (or can be) stored in .editorconfig.

$ ktlint-0.46.1 --experimental generateEditorConfig               
20:45:14.979 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'experimental:comment-wrapping' uses property 'indent_size' with default value '4'
20:45:14.981 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'experimental:comment-wrapping' uses property 'indent_style' with default value 'space'
20:45:14.981 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'experimental:kdoc-wrapping' uses property 'indent_size' with default value '4'
20:45:14.981 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'experimental:kdoc-wrapping' uses property 'indent_style' with default value 'space'
20:45:14.981 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'experimental:function-signature' uses property 'indent_size' with default value '4'
20:45:14.981 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'experimental:function-signature' uses property 'indent_style' with default value 'space'
20:45:14.981 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'experimental:function-signature' uses property 'max_line_length' with default value '-1'
20:45:14.981 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'experimental:function-signature' uses property 'ktlint_function_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than' with default value '-1'
20:45:14.981 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'experimental:function-signature' uses property 'ktlint_function_signature_body_expression_wrapping' with default value 'default'
20:45:14.981 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'argument-list-wrapping' uses property 'indent_size' with default value '4'
20:45:14.981 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'argument-list-wrapping' uses property 'indent_style' with default value 'space'
20:45:14.982 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'argument-list-wrapping' uses property 'max_line_length' with default value '-1'
20:45:14.982 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'final-newline' uses property 'insert_final_newline' with default value 'true'
20:45:14.982 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'import-ordering' uses property 'ij_kotlin_imports_layout' with default value '*,java.**,javax.**,kotlin.**,^'
20:45:14.982 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'indent' uses property 'indent_size' with default value '4'
20:45:14.982 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'indent' uses property 'indent_style' with default value 'space'
20:45:14.982 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'max-line-length' uses property 'max_line_length' with default value '-1'
20:45:14.982 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'max-line-length' uses property 'ktlint_ignore_back_ticked_identifier' with default value 'false'
20:45:14.982 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'no-wildcard-imports' uses property 'ij_kotlin_packages_to_use_import_on_demand' with default value 'java.util.*,kotlinx.android.synthetic.**'
20:45:14.982 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'parameter-list-wrapping' uses property 'indent_size' with default value '4'
20:45:14.982 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'parameter-list-wrapping' uses property 'indent_style' with default value 'space'
20:45:14.982 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'parameter-list-wrapping' uses property 'max_line_length' with default value '-1'
20:45:14.982 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'trailing-comma' uses property 'ij_kotlin_allow_trailing_comma' with default value 'false'
20:45:14.982 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'trailing-comma' uses property 'ij_kotlin_allow_trailing_comma_on_call_site' with default value 'false'
20:45:14.982 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'wrapping' uses property 'indent_size' with default value '4'
20:45:14.982 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Rule 'wrapping' uses property 'indent_style' with default value 'space'
20:45:15.004 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Class 'DefaultEditorConfigProperties' uses property 'ktlint_code_style' with default value 'official'
20:45:15.004 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Class 'DefaultEditorConfigProperties' uses property 'disabled_rules' with default value ''
20:45:15.004 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Class 'DefaultEditorConfigProperties' uses property 'indent_style' with default value 'space'
20:45:15.004 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Class 'DefaultEditorConfigProperties' uses property 'indent_size' with default value '4'
20:45:15.004 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Class 'DefaultEditorConfigProperties' uses property 'insert_final_newline' with default value 'true'
20:45:15.005 [main] DEBUG com.pinterest.ktlint.core.internal.EditorConfigGenerator - Class 'DefaultEditorConfigProperties' uses property 'max_line_length' with default value '-1'
[*.{kt,kts}]
disabled_rules = 
ij_kotlin_allow_trailing_comma = false
ij_kotlin_allow_trailing_comma_on_call_site = false
ij_kotlin_imports_layout = *,java.**,javax.**,kotlin.**,^
ij_kotlin_packages_to_use_import_on_demand = java.util.*,kotlinx.android.synthetic.**
indent_size = 4
indent_style = space
insert_final_newline = true
ktlint_code_style = official
ktlint_function_signature_body_expression_wrapping = default
ktlint_function_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = -1
ktlint_ignore_back_ticked_identifier = false
max_line_length = -1

I propose to change the scope of this issue to:

  • Remove of XML-configuration
  • Fix documentation as mentioned in Misleading README regarding intellij integration #734
  • Prefix configuration properties created for ktlint with ktlint_. From list above, only property disabled_rules still needs to prefixed with ktlint_. Initially there should be an automatic fallback on the old property name and print a warning when it is used. In a future release this needs to be changed in an error to enforce renaming of the property.

@paul-dingemans paul-dingemans added this to the 0.47.0 milestone Jul 1, 2022
paul-dingemans added a commit to paul-dingemans/ktlint that referenced this issue Aug 3, 2022
…`.editorconfig` property `disabled_rules` to `ktlint_disabled_rules`.

Closes pinterest#701
Closes pinterest#734
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants