Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
Add some explanatory text about one incompatibility between this tool…
Browse files Browse the repository at this point in the history
… and ktlint.

Fixes #21
  • Loading branch information
hovinen committed Oct 7, 2021
1 parent bc6ec8a commit 98c9d89
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,24 @@ To restore default behaviour, add the following comment:
* Does not have all of the rules of ktlint, e.g. replacing `${variable}` with `$variable` in a
string template.

It should be fine to use both ktlint and this formatter in the same project.
For the most part, it should be fine to use both ktlint and this formatter in the same project. There
is one point where this formatter's output is incompatible with the default settings in ktlint. Namely,
ktlint will complain about the newline before the lambda expression in the following:

```kotlin
aFunctionCall(someArgument, someOtherArgument)
{ ...a lambda argument }
```

If the column limit is right after the closing right parenthesis on the first line, then the above
is exactly how this tool will format the code. The recommended solution here, should you be using
ktlint and run into this, is to disable the corresponding ktlint rule by adding the line

```editorconfig
disabled_rules=curly-spacing
```

to your project's `.editorconfig` file.

### Kotlin autoformatter vs. [ktfmt](https://github.com/facebookincubator/ktfmt)

Expand Down

0 comments on commit 98c9d89

Please sign in to comment.