Thread overview | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
February 20, 2015 dfmt 0.1.0 | ||||
---|---|---|---|---|
| ||||
dfmt is a D source code formatting tool. https://github.com/Hackerpilot/dfmt/ https://github.com/Hackerpilot/dfmt/releases/tag/v0.1.0 |
February 20, 2015 Re: dfmt 0.1.0 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brian Schott | On Friday, 20 February 2015 at 02:21:01 UTC, Brian Schott wrote:
> https://github.com/Hackerpilot/dfmt/
> https://github.com/Hackerpilot/dfmt/releases/tag/v0.1.0
Congrats, I found the reformatting a bit harsh from time to time, but it's a good opportunity to finally settle style discussions.
|
February 20, 2015 Re: dfmt 0.1.0 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brian Schott | On Friday, 20 February 2015 at 02:21:01 UTC, Brian Schott wrote:
> dfmt is a D source code formatting tool.
>
> https://github.com/Hackerpilot/dfmt/
> https://github.com/Hackerpilot/dfmt/releases/tag/v0.1.0
Thanks, you should list some of the formatting changes it makes in the README.
|
February 20, 2015 Re: dfmt 0.1.0 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Joakim | On Friday, 20 February 2015 at 05:23:45 UTC, Joakim wrote:
> On Friday, 20 February 2015 at 02:21:01 UTC, Brian Schott wrote:
>> dfmt is a D source code formatting tool.
>>
>> https://github.com/Hackerpilot/dfmt/
>> https://github.com/Hackerpilot/dfmt/releases/tag/v0.1.0
>
> Thanks, you should list some of the formatting changes it makes in the README.
It doesn't do formatting changes. It wipes out the formatting during lexing and builds it up from scratch. The only thing that gets preserved is that it will look at line numbers on comments and try to keep them in roughly the same place. (For example, "//" comments that are on the end of a line instead of on the next line)
|
February 20, 2015 Re: dfmt 0.1.0 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brian Schott | On Friday, 20 February 2015 at 05:53:32 UTC, Brian Schott wrote:
> On Friday, 20 February 2015 at 05:23:45 UTC, Joakim wrote:
>> On Friday, 20 February 2015 at 02:21:01 UTC, Brian Schott wrote:
>>> dfmt is a D source code formatting tool.
>>>
>>> https://github.com/Hackerpilot/dfmt/
>>> https://github.com/Hackerpilot/dfmt/releases/tag/v0.1.0
>>
>> Thanks, you should list some of the formatting changes it makes in the README.
>
> It doesn't do formatting changes. It wipes out the formatting during lexing and builds it up from scratch. The only thing that gets preserved is that it will look at line numbers on comments and try to keep them in roughly the same place. (For example, "//" comments that are on the end of a line instead of on the next line)
Well, you should indicate what that new formatting is in the README, so potential users know what to expect without having to run it first.
|
February 20, 2015 Re: dfmt 0.1.0 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brian Schott | On Friday, 20 February 2015 at 05:53:32 UTC, Brian Schott wrote:
> On Friday, 20 February 2015 at 05:23:45 UTC, Joakim wrote:
>> On Friday, 20 February 2015 at 02:21:01 UTC, Brian Schott wrote:
>>> dfmt is a D source code formatting tool.
>>>
>>> https://github.com/Hackerpilot/dfmt/
>>> https://github.com/Hackerpilot/dfmt/releases/tag/v0.1.0
>>
>> Thanks, you should list some of the formatting changes it makes in the README.
>
> It doesn't do formatting changes. It wipes out the formatting during lexing and builds it up from scratch. The only thing that gets preserved is that it will look at line numbers on comments and try to keep them in roughly the same place. (For example, "//" comments that are on the end of a line instead of on the next line)
Several examples in the README would indeed be nice.
|
February 20, 2015 Re: dfmt 0.1.0 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brian Schott | On 2015-02-20 03:21, Brian Schott wrote: > dfmt is a D source code formatting tool. > > https://github.com/Hackerpilot/dfmt/ > https://github.com/Hackerpilot/dfmt/releases/tag/v0.1.0 I looked at the tests, in particular "contracts.d.ref". I would expect an empty newline between an instance variable and a method. -- /Jacob Carlborg |
February 20, 2015 Re: dfmt 0.1.0 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brian Schott | On Friday, 20 February 2015 at 02:21:01 UTC, Brian Schott wrote:
> dfmt is a D source code formatting tool.
>
> https://github.com/Hackerpilot/dfmt/
> https://github.com/Hackerpilot/dfmt/releases/tag/v0.1.0
Great!
I've been using clang-format lately for my C++ code and it's really blown me away how good it is. It's not opinionated about how things should be, it just does whatever style you've set it to. The Visual Studio plugin they have just gives me a keyboard shortcut and when I hit it, it formats the current line or selection.
I waste almost no time formatting code now. I just type and hit the format key and move on. If it formatted something differently than how I would have done it I just let it be because how it formatted is usually almost as good anyway. I feel like it's been as big of boon to my coding speed as learning vim was.
From what I understand they implemented a LaTeX style weighted line breaker which would explain why it works so much better than a typical code formatter. It's very smart about how it does line breaks. This seems to make all the difference.
This is all to say I hope dfmt becomes as awesome as clang-format is at some point. Hopefully I can find some time to contribute.
|
February 20, 2015 Re: dfmt 0.1.0 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brad Anderson | On Friday, 20 February 2015 at 23:00:25 UTC, Brad Anderson wrote:
> From what I understand they implemented a LaTeX style weighted line breaker which would explain why it works so much better than a typical code formatter. It's very smart about how it does line breaks. This seems to make all the difference.
dfmt uses a weighting system for line breaks as well, though because this is 0.1.0 it doesn't always do what I expect it to do.
|
February 22, 2015 Re: dfmt 0.1.0 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brian Schott | On Friday, 20 February 2015 at 02:21:01 UTC, Brian Schott wrote:
> dfmt is a D source code formatting tool.
>
> https://github.com/Hackerpilot/dfmt/
> https://github.com/Hackerpilot/dfmt/releases/tag/v0.1.0
I just tagged 0.1.1. The only change is a bug fix for a case where certain long lines with parenthesis wouldn't wrap properly.
|
Copyright © 1999-2021 by the D Language Foundation