D source code formatter

Timothee Cour thelastmammoth at gmail.com
Thu Feb 22 07:39:06 UTC 2018


note that we'd need to implement
https://github.com/dlang-community/dfmt/issues/159 (
option to format only diff-ed lines (like git clang-format))
in order to run dfmt on only the part of source code that was modified in a PR.

this is  to avoid concern that it affects git history  / git blame
(although these can skip blacklisted format-only commits or skip
white-space diffs)

On Wed, Feb 21, 2018 at 11:00 PM, Seb via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> On Thursday, 22 February 2018 at 04:35:24 UTC, psychoticRabbit wrote:
>>
>> I rely (heavily) on clang-format in my C code. It save me so much effort
>> and has become a vital day to day tool for me.
>>
>> I was wondering whether D also has a 'reliable' source code formatter.
>> (reliable being a key word there).
>>
>> Also, if it does, then why is it not included in the distribution - given
>> the importance of consistent source code formatting these days.
>
>
> See https://github.com/dlang-community/dfmt/issues/249 for why it was never
> included in the release distribution.
>
> In short: Brian was never really interested in packaging and investing time
> into releasing his tools, so it stalled. Now that dub is part of the release
> distribution, it's simply:
>
> dub fetch dfmt
> dub run dfmt
>
> So there's essentially no big need to ship it in the release archives.
> Though Sociomantic has recently taken over the release process of dfmt and
> currently provides APT packages at bintray:
>
> https://bintray.com/dlang-community/apt/dfmt


More information about the Digitalmars-d mailing list