ktfmt icon indicating copy to clipboard operation
ktfmt copied to clipboard

Consume .editorconfig for configuration

Open tyvsmith opened this issue 5 years ago • 3 comments

https://editorconfig.org/ is a simple standard that both KTLint and Intellij can consume from. This would be a nice addition to ktfmt to allow for more configuration when needed without custom APIs/params in the tool.

tyvsmith avatar May 29 '20 00:05 tyvsmith

What did you have in mind? Something like that?

[*.kt]
indent_size = 4 # or 2

(ktfmt only supports one flag: --dropbox-style.)

cgrushko avatar May 29 '20 11:05 cgrushko

Here's our current one at Uber. Intellij and Ktlint will read from this for indent_size, continuation_indent_size, and max length (I believe)

[*.{kt,kts}]
indent_size=2
continuation_indent_size=4
insert_final_newline=true
max_line_length=120
disabled_rules=package-name

tyvsmith avatar May 29 '20 18:05 tyvsmith

If there is any interest I could work some more on #303 until it is usable.

knobo avatar Mar 30 '22 06:03 knobo