Poll/discussion: dfmt option for single vs double indents for multi-line code
JN
666total at wp.pl
Sat Dec 30 14:54:54 UTC 2023
On Friday, 29 December 2023 at 09:08:33 UTC, Prajwal S N wrote:
> - `dfmt_single_indent`: If set to true, indents multi-line
> function declarations with a single tab. The default is false.
> E.g.
> ```d
> // default
> void foo(int a, char b, string c, int d,
> char e, string f) {}
> // true
> void foo(int a, char b, string c, int d,
> char e, string f) {}
> ```
>
If it were my code, I'd format it like this:
```d
void foo(int a, char b, string c, int d,
char e, string f) {}
```
PEP8 for Python also recommends such vertical alignment.
Alternatively:
```d
void foo(
int a, char b,
string c, int d,
char e, string f) {}
```
More information about the Digitalmars-d
mailing list