Support K&R-Java brace style.
Please add support for this: https://en.wikipedia.org/wiki/Brace_style#Variant:_Java
@StevenTheEVILZ What its differences from otbs?
@StevenTheEVILZ
That is the .editorconfig I use.
[*.d]
indent_style = space
indent_size = 4
max_line_length = 100
dfmt_soft_max_line_length = 80
dfmt_brace_style = otbs
dfmt_split_operator_at_line_end = true
Sample result: https://github.com/georgy7/forgetter/blob/master/core/source/io.d
The only thing I don't like is the strange lines' concatenation. https://github.com/Hackerpilot/dfmt/issues/270
I found a difference:
}
catch (Exception e) {
Must be
} catch (Exception e) {
Also https://github.com/georgy7/forgetter/blob/master/core/source/image_dao.d
@Autowire private Io io;
certainly must be
@Autowire
private Io io;
But I am not sure about @safe, @nogc, etc.
This does not apply to annotations of method arguments. For instance, these both are correct:
@RequestMapping("/url")
public void someMethod(@RequestParam String a, @RequestParam String b) {
}
@RequestMapping("/url")
public void someMethod2(
@RequestParam String a,
@RequestParam String b) {
}
And this is correct too:
@RequestMapping("/url")
public void someMethod2(
@RequestParam String a,
@RequestParam String b
) {
// ...
}
If a coder formats his/er code with one of acceptable variants, dfmt should not reformat it.
Yet another major correct variant:
@RequestMapping("/url")
public void someMethod(@RequestParam String a,
@RequestParam String b) {
}
public void orEven(int a,
int b, int c, int d,
int e,
int f) {
// ...
}
@georgy7
The main reasons are the annotations and the catch/else statements that pair up with others.
Also this: if (x()) y(); and
if (x())
y();
should both be correct (I think) in java but not OTBS