-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A type with multiple annotations inside a TypeArgumentList is not formatted correctly #1725
Comments
When I really exaggerate the example code, it turns out that it is not so easy to find an acceptable outcome that is deterministic when formatting generic type parameters that are annotated. Suppose I have following classes and annotations:
Example A below shows the code in which annotations are not wrapped:
This can be made more readable by wrapping each generic type having multiple annotations:
A valid question with the example above is whether the same should also have be done with If each annotation is wrapped to a separate line, the result would look like:
Advantage is that this is consistent with other formatting. Disadvantage of course is that it is lengthy. Despite that, I am inclined to choose this formatting. But when combined with the rule suppression mechanism, the developer could choose in specific case to use a manual formatting like below:
|
Code below:
is formatted as:
KtLint: 0.47.1
Originally posted by @Vadgyik in #673 (comment)
The text was updated successfully, but these errors were encountered: