Thread overview | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
January 10, 2015 Is anyone working on a D source code formatting tool? | ||||
---|---|---|---|---|
| ||||
Has someone made a dfmt, like http://gofmt.com/ ? |
January 10, 2015 Re: Is anyone working on a D source code formatting tool? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On 2015-01-10 21:17, Walter Bright wrote: > Has someone made a dfmt, like http://gofmt.com/ ? I have thought about it a couple of times but never started. It would be really nice to have. -- /Jacob Carlborg |
January 10, 2015 Re: Is anyone working on a D source code formatting tool? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On Saturday, 10 January 2015 at 20:54:56 UTC, Jacob Carlborg wrote: > On 2015-01-10 21:17, Walter Bright wrote: >> Has someone made a dfmt, like http://gofmt.com/ ? > > I have thought about it a couple of times but never started. It would be really nice to have. https://github.com/Hackerpilot/dfix |
January 10, 2015 Re: Is anyone working on a D source code formatting tool? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Meta | On Saturday, 10 January 2015 at 21:17:29 UTC, Meta wrote:
> On Saturday, 10 January 2015 at 20:54:56 UTC, Jacob Carlborg wrote:
>> On 2015-01-10 21:17, Walter Bright wrote:
>>> Has someone made a dfmt, like http://gofmt.com/ ?
>>
>> I have thought about it a couple of times but never started. It would be really nice to have.
>
> https://github.com/Hackerpilot/dfix
Ah, never mind me. Although the functionality between dfix and a dfmt is probably quite similar.
|
January 10, 2015 Re: Is anyone working on a D source code formatting tool? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Saturday, 10 January 2015 at 20:18:03 UTC, Walter Bright wrote: > Has someone made a dfmt, like http://gofmt.com/ ? Uncrustify claims D support. http://uncrustify.sourceforge.net/ |
January 10, 2015 Re: Is anyone working on a D source code formatting tool? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On 1/10/2015 12:17 PM, Walter Bright wrote:
> Has someone made a dfmt, like http://gofmt.com/ ?
Next question - standalone tool, or built in to dmd (like Ddoc)?
BTW, I think dfmt would be a significant win for D:
1. people expect this sort of thing these days
2. it tends to end bikeshedding arguments about the right way to format things
3. it'll help standardize the format of D code in the D repositories
4. it's simply nice and convenient!
5. it's a great first step when you're faced with fixing someone else's crap code
I don't think it'll be hard to do as a builtin feature of dmd.
My only concern about it is if dfmt is changed, then we get faced with a blizzard of changes in the D github repositories.
|
January 10, 2015 Re: Is anyone working on a D source code formatting tool? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Saturday, 10 January 2015 at 22:11:55 UTC, Walter Bright wrote:
> On 1/10/2015 12:17 PM, Walter Bright wrote:
>> Has someone made a dfmt, like http://gofmt.com/ ?
>
> Next question - standalone tool, or built in to dmd (like Ddoc)?
>
> My only concern about it is if dfmt is changed, then we get faced with a blizzard of changes in the D github repositories.
Build it into DMD with an option to change files in place or dump them to stdout. I do think though, this would require a pragma or a special comment to disable it for parts of code. There will always be the case where the standard is wrong.
|
January 10, 2015 Re: Is anyone working on a D source code formatting tool? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Saturday, 10 January 2015 at 20:18:03 UTC, Walter Bright wrote:
> Has someone made a dfmt, like http://gofmt.com/ ?
I have a module in libdparse that takes an AST and formats it to an output range, but it is still fairly primitive at the moment. It could probably be made into a real formatter with a few days of work.
|
January 10, 2015 Re: Is anyone working on a D source code formatting tool? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Meta | On Saturday, 10 January 2015 at 21:18:58 UTC, Meta wrote:
>> https://github.com/Hackerpilot/dfix
>
> Ah, never mind me. Although the functionality between dfix and a dfmt is probably quite similar.
dfix is more complicated than it could be because it tries to avoid changing the formatting of the file that it's operating on.
|
January 10, 2015 Re: Is anyone working on a D source code formatting tool? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On 2015-01-10 20:17:34 +0000, Walter Bright said:
> Has someone made a dfmt, like http://gofmt.com/ ?
No, I was planning on working on one if we ever got libd parsing 100% of the code. Unfortunately I haven't had a lot of time to work on these sorts of things lately.
-Shammah
|
Copyright © 1999-2021 by the D Language Foundation