You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apologies if this is not an explicit goal, but I'm unable to find anything addressing this or not.
The Google Java Style guidelines have no preference regarding if annotations with parameters are formatted on a single or multiple lines, but Google Java Format makes the decision that if any annotation has parameters, it is formatted across multiple lines:
In mixed-language projects, this leads to inconsistency issues, particularly around declarations that often use multiple annotations with arguments (JPA, lint/warning suppressions, serialization, etc).
The text was updated successfully, but these errors were encountered:
xeals
changed the title
Formatting of annotations is inconsistent with GJF
Formatting of field annotations is inconsistent with GJF
May 2, 2022
I vaguely remember why, but we used to follow the JetBrains convention of annotations with arguments on their own line. It created a bunch of awkward constructs with some short named annotations breaking lines into many lines (Your example for bar seems to be of that style).
I'm open to looking at this again, if there's a PR I can run it on the codebase and see if it comes up awkward or not. Otherwise it may take some time until I make this PR and test it.
Apologies if this is not an explicit goal, but I'm unable to find anything addressing this or not.
The Google Java Style guidelines have no preference regarding if annotations with parameters are formatted on a single or multiple lines, but Google Java Format makes the decision that if any annotation has parameters, it is formatted across multiple lines:
ktfmt prefers to always format annotations on a single line where they fit:
In mixed-language projects, this leads to inconsistency issues, particularly around declarations that often use multiple annotations with arguments (JPA, lint/warning suppressions, serialization, etc).
The text was updated successfully, but these errors were encountered: