dfmt icon indicating copy to clipboard operation
dfmt copied to clipboard

Dfmt is a formatter for D source code

Results 104 dfmt issues
Sort by recently updated
recently updated
newest added

It is for bug introducted by me, where the `else` get incorrect indentation if `if` has an `[]` in the condition. For example: ```d if (true) { if (args[0]) {...

Example: ```d bool isALetter(dchar input) { switch (input) { case 0x02C2: .. case 0x02C5: case 0x02D2: .. case 0x02D7: case 0x02DE: case 0x02DF: case 0x02E5: .. case 0x02EB: case 0x02ED:...

```d auto x = Foo( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, // foo ); ``` gets formatted (keep_line_breaks) to ```d auto x = Foo( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, // foo ); ``` gets formatted (keep_line_breaks) to ```d auto...

bug
feature:keep_line_breaks

Current state: ``` unittest { auto db = new dorm.DB( new dorm.Config( DBDriver.MySQL, "abc.def", "127.0.0.1", 3306, "user", "password" ) ); } ``` Expected behaviour: ``` unittest { auto db =...

bug
feature:keep_line_breaks

e.g. ```d void main() { writeln(); writeln(); } ``` should get reformatted to ```d void main() { writeln(); writeln(); } ```

Similar to https://github.com/dlang-community/D-Scanner/pull/857.

Requested enhancement to add the option of keeping single-line functions on one line. This is a feature in many other formatting tools & can improve readability when many tiny functions...

Consider: ``` void main() { call(new class Object { void method() { call; } }); } ``` dfmt's take: ``` void main() { call(new class Object { void method() {...

bug

it would be nice to have alphabetical attribute reordering - as seen in the [official d style guide](https://dlang.org/dstyle.html#phobos_attributes) - as an option. honestly, we were surprised it wasn't already built...

Would be nice to have an option which checks whether formatting is correct and errors when it is not. That would make it easy to add as a pre-commit git...

enhancement
question