Closed romtsn closed 4 years ago
Ah, yeah. I don't think the rule was intended for parameter annotations. We can put up a diff to have it ignore those annotations completely.
Is there a way to disable the annotation rule?
@francescocervone disabled_rules=experimental:annotation
in your .editorconfig
+1 for this change
I think readability and following official style are both important. I suggest to create two codestyle (https://github.com/pinterest/ktlint/issues/548), official one and strong one.
I have a following Retrofit interface:
Running ktlint in
--format
mode gives the following output:Imo, the latter is way less readable. I went through the official styleguide, but I think an annotation with arguments should be allowed for method params (even though not sure that it's applicable for all possible cases).
Also in the
showUser
function, the last two parameters should be placed on different lines (so the with-argument annotation followed by no-argument annotation). Cause otherwise theparameter-list-wrapping
rules kicks in. This is most likely a bug in formatter, right?