-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
format differences with PrettierJS #218
Comments
I put it here, as I think the change has to be done in the same place. We have also this bug : public static void main(String[] args) {
if(test == 1 && test == 1 && test == 1 && test == 1 && test == 1 && test == 1 && test == 1 && test == 1) {
}
} Converted in public class Args {
public static void main(String[] args) {
if (test
== 1
&& test
== 1
&& test
== 1
&& test
== 1
&& test
== 1
&& test
== 1
&& test
== 1
&& test
== 1) {}
}
} |
What should the formatting be? |
It should break at 80 characters (or other line limit characters)? |
It should, but I'm unsure what to look for, maybe something like this instead? public class Args {
public static void main(String[] args) {
if (test == 1
&& test == 1
&& test == 1
&& test == 1
&& test == 1
&& test == 1
&& test == 1
&& test == 1) {}
}
} |
In js, it is printed like that: function HelloWorld() {
if (
test === 1 &&
test === 1 &&
test === 1 &&
test === 1 &&
test === 1 &&
test === 1 &&
test === 1 &&
test === 1
) {
}
} but we can move the && to the next line |
Probably a mix of both result like: function HelloWorld() {
if (test === 1 &&
test === 1 &&
test === 1 &&
test === 1 &&
test === 1 &&
test === 1 &&
test === 1 &&
test === 1) {
}
} |
Is it common to put && on the next line in Java?
@DanielFran I think the example by @clement26695 is slightly clearer, but regardless of my own personal opinion on the topic, should not we closely match the style of prettier-js simplify because it is much more mature and thus we would likely avoid pitfalls and issues that they already resolved? |
Just wanted to chime in that putting the
Not a dealbreaker for us, but if there was an option to put these operators on the next line we would use that option |
Closed with #255 |
We want to stay as close as possible to the reformatting style of Prettier JS
Below are some examples that should be reviewed:
The text was updated successfully, but these errors were encountered: