Jump to page: 1 27  
Page
Thread overview
Is anyone working on a D source code formatting tool?
Jan 10, 2015
Walter Bright
Jan 10, 2015
Jacob Carlborg
Jan 10, 2015
Meta
Jan 10, 2015
Meta
Jan 10, 2015
Brian Schott
Jan 10, 2015
weaselcat
Jan 11, 2015
Andrej Mitrovic
Jan 10, 2015
Walter Bright
Jan 10, 2015
Tobias Pankrath
Jan 11, 2015
Joakim
Jan 11, 2015
Suliman
Jan 11, 2015
ponce
Jan 11, 2015
NVolcz
Jan 11, 2015
Walter Bright
Jan 11, 2015
Jacob Carlborg
Jan 11, 2015
Russel Winder
Jan 11, 2015
Daniel Murphy
Jan 11, 2015
Stefan Koch
Jan 11, 2015
Walter Bright
Jan 11, 2015
Jacob Carlborg
Jan 16, 2015
Ahmed Fasih
Jan 11, 2015
Walter Bright
Jan 12, 2015
Walter Bright
Jan 12, 2015
Zach the Mystic
Jan 12, 2015
qznc
Jan 12, 2015
Brian Schott
Jan 12, 2015
qznc
Jan 12, 2015
deadalnix
Jan 11, 2015
weaselcat
Jan 12, 2015
ketmar
Jan 12, 2015
Jacob Carlborg
Jan 12, 2015
deadalnix
Jan 12, 2015
ketmar
Jan 12, 2015
deadalnix
Jan 12, 2015
Jacob Carlborg
Jan 13, 2015
Bruno Medeiros
Jan 16, 2015
Ary Borenszweig
Jan 16, 2015
Brian Schott
Jan 16, 2015
qznc
Jan 11, 2015
Russel Winder
Jan 11, 2015
Walter Bright
Jan 12, 2015
Russel Winder
Jan 11, 2015
Dicebot
Jan 11, 2015
Walter Bright
Jan 11, 2015
Jacob Carlborg
Jan 11, 2015
ketmar
Jan 13, 2015
Bruno Medeiros
Jan 13, 2015
ketmar
Jan 16, 2015
deadalnix
Jan 16, 2015
ketmar
Jan 10, 2015
Brian Schott
Jan 10, 2015
Shammah Chancellor
Jan 12, 2015
Brian Schott
Jan 12, 2015
Walter Bright
Jan 12, 2015
Martin Nowak
Jan 12, 2015
deadalnix
Jan 12, 2015
Shammah Chancellor
Jan 12, 2015
deadalnix
Jan 13, 2015
Bruno Medeiros
Jan 15, 2015
HaraldZealot
January 10, 2015
Has someone made a dfmt, like http://gofmt.com/ ?
January 10, 2015
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
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
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
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
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
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
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
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
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

« First   ‹ Prev
1 2 3 4 5 6 7