Thread overview | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
February 22, 2018 D source code formatter | ||||
---|---|---|---|---|
| ||||
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. |
February 22, 2018 Re: D source code formatter | ||||
---|---|---|---|---|
| ||||
Posted in reply to psychoticRabbit | 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.
look for 'dfmt'
|
February 22, 2018 Re: D source code formatter | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nicholas Wilson | On Thursday, 22 February 2018 at 04:48:58 UTC, Nicholas Wilson 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.
>
> look for 'dfmt'
thanks. but do you mean:
dfmt is certainly reliable, so go look for it.
or
for look for dfmt and work out whether it's reliable.
|
February 22, 2018 Re: D source code formatter | ||||
---|---|---|---|---|
| ||||
Posted in reply to psychoticRabbit | On 22/02/2018 6:38 PM, psychoticRabbit wrote: > On Thursday, 22 February 2018 at 04:48:58 UTC, Nicholas Wilson 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. >> >> look for 'dfmt' > > thanks. but do you mean: > > dfmt is certainly reliable, so go look for it. > or > for look for dfmt and work out whether it's reliable. It's the only one we have as a separate tool. https://github.com/dlang-community/dfmt |
February 22, 2018 Re: D source code formatter | ||||
---|---|---|---|---|
| ||||
Posted in reply to psychoticRabbit | 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 |
February 21, 2018 Re: D source code formatter | ||||
---|---|---|---|---|
| ||||
Posted in reply to Seb | 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@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 |
February 22, 2018 Re: D source code formatter | ||||
---|---|---|---|---|
| ||||
Posted in reply to psychoticRabbit | On Thursday, 22 February 2018 at 05:38:38 UTC, psychoticRabbit wrote:
> On Thursday, 22 February 2018 at 04:48:58 UTC, Nicholas Wilson 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.
>>
>> look for 'dfmt'
>
> thanks. but do you mean:
>
> dfmt is certainly reliable, so go look for it.
> or
> for look for dfmt and work out whether it's reliable.
dfmt is available along witj DCD and other D tools in Visual Studio Code. Its all package in the code-d package. dfmt formats D code good enough for the common cases as I don't do much CTFE or cryptic D coding style.
VS Code is slow though. Its built with electron (html, css, Javascript) and uses a lot of cpu and ram.
|
February 22, 2018 Re: Debian support [was D source code formatter] | ||||
---|---|---|---|---|
| ||||
Posted in reply to Seb Attachments:
| On Thu, 2018-02-22 at 07:00 +0000, Seb via Digitalmars-d wrote: > […] > 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 So now we have both: http://d-apt.sourceforge.net/ and https://bintray.com/dlang-community/apt Is now the time to discuss harmonising Debian support especially since there is a whole slew of stuff getting into the main Debian archive due to the efforts of the Debian D Language Group: pkg-d-devel@lists.alioth.debian.org -- Russel. =========================================== Dr Russel Winder t: +44 20 7585 2200 41 Buckmaster Road m: +44 7770 465 077 London SW11 1EN, UK w: www.russel.org.uk |
Copyright © 1999-2021 by the D Language Foundation