Re: dfmt options

2015-03-27 Thread Shammah Chancellor via Digitalmars-d
On 2015-03-14 23:15:34 +, Brian Schott said: First, a disclaimer: I am an idiot for starting this thread. Moving on... I'm working on a list of configuration options for dfmt - a formatter for D source code. So far I have the following: * Insert spaces between if, while, for, foreach,

Re: dfmt options

2015-03-27 Thread Martin Nowak via Digitalmars-d
On 03/27/2015 04:30 PM, Shammah Chancellor wrote: What am I missing? A way to configure this and have it look for the most relevant `.dfmtcfg` file! :) That is to say, make it look up from the current directory recursively until it finds a config file, and use that.This will greatly

Re: dfmt options

2015-03-23 Thread Jacob Carlborg via Digitalmars-d
On 2015-03-23 10:47, bearophile wrote: See: https://issues.dlang.org/show_bug.cgi?id=7176 Exactly. -- /Jacob Carlborg

Re: dfmt options

2015-03-23 Thread Martin Nowak via Digitalmars-d
On 03/23/2015 10:55 AM, Casper =?UTF-8?B?RsOmcmdlbWFuZCI=?= shortt...@hotmail.com wrote: Perhaps it's too much to wish for, but I think the editor would be the better place for this. IntelliJ IDEA can display short methods as single line. They're still multiline in the source, but on screen

Re: dfmt options

2015-03-23 Thread bearophile via Digitalmars-d
Jacob Carlborg: Although I would like that the D syntax allowed to drop the curly braces, like with if-satements. That would result in much nicer one-liner functions. See: https://issues.dlang.org/show_bug.cgi?id=7176 Bye, bearophile

Re: dfmt options

2015-03-23 Thread via Digitalmars-d
On Sunday, 22 March 2015 at 17:05:27 UTC, Martin Nowak wrote: I think there should be an option (even default on) to allow small single line functions. (snip) Perhaps it's too much to wish for, but I think the editor would be the better place for this. IntelliJ IDEA can display short

Re: dfmt options

2015-03-23 Thread Jacob Carlborg via Digitalmars-d
On 2015-03-22 18:05, Martin Nowak wrote: Sorry haven't read the whole thread. I think there should be an option (even default on) to allow small single line functions. This can sometimes be fairly annoying. For example when writing range adapters, see

Re: dfmt options

2015-03-22 Thread Andrei Alexandrescu via Digitalmars-d
On 3/22/15 10:05 AM, Martin Nowak wrote: On 03/15/2015 12:15 AM, Brian Schott wrote: What am I missing? Sorry haven't read the whole thread. I think there should be an option (even default on) to allow small single line functions. This can sometimes be fairly annoying. For example when

Re: dfmt options

2015-03-22 Thread Martin Nowak via Digitalmars-d
On 03/15/2015 12:15 AM, Brian Schott wrote: What am I missing? Sorry haven't read the whole thread. I think there should be an option (even default on) to allow small single line functions. This can sometimes be fairly annoying. For example when writing range adapters, see

Re: dfmt options

2015-03-17 Thread Jacob Carlborg via Digitalmars-d
On 2015-03-15 00:15, Brian Schott wrote: What am I missing? * Ideally, any space that is optional in the language should be configurable * Newlines between functions/structs/classes and so on * Preserve grouping of variable declarations, i.e. int a; int b; int foo; int bar; -- /Jacob

Re: dfmt options

2015-03-17 Thread Jacob Carlborg via Digitalmars-d
On 2015-03-15 06:54, Dicebot wrote: On actual topic : having look at Eclipse C++ codestyle options may give many useful hints. And for Eclipse Java formatting options. -- /Jacob Carlborg

Re: dfmt options

2015-03-17 Thread Dragos Carp via Digitalmars-d
On Saturday, 14 March 2015 at 23:49:00 UTC, Walter Bright wrote: On 3/14/2015 4:15 PM, Brian Schott wrote: What am I missing? I suggest defining The One True Way and have no configuration options. +1

Re: dfmt options

2015-03-17 Thread Jacob Carlborg via Digitalmars-d
On 2015-03-16 01:13, Rikki Cattermole wrote: Its just a real pain to create these stubs by hand. Atleast this way, people will moan about documentation being empty and it'll seem less work to do. This should be done by the editor. -- /Jacob Carlborg

Re: dfmt options

2015-03-17 Thread ketmar via Digitalmars-d
On Tue, 17 Mar 2015 10:36:47 +0100, Jacob Carlborg wrote: On 2015-03-16 01:13, Rikki Cattermole wrote: Its just a real pain to create these stubs by hand. Atleast this way, people will moan about documentation being empty and it'll seem less work to do. This should be done by the editor.

Re: dfmt options

2015-03-16 Thread Idan Arye via Digitalmars-d
On Monday, 16 March 2015 at 02:16:18 UTC, Brad Anderson wrote: On Saturday, 14 March 2015 at 23:15:35 UTC, Brian Schott wrote: First, a disclaimer: I am an idiot for starting this thread. Moving on... I'm working on a list of configuration options for dfmt - a formatter for D source code.

Re: dfmt options

2015-03-15 Thread Sönke Ludwig via Digitalmars-d
Am 15.03.2015 um 06:55 schrieb Dicebot: On Sunday, 15 March 2015 at 01:45:56 UTC, Walter Bright wrote: On 3/14/2015 4:59 PM, Brian Schott wrote: On Saturday, 14 March 2015 at 23:49:00 UTC, Walter Bright wrote: I suggest defining The One True Way and have no configuration options. I hope you

Re: dfmt options

2015-03-15 Thread ketmar via Digitalmars-d
On Sun, 15 Mar 2015 13:47:26 +, ketmar wrote: on the other side, i can see a sense in generating stubs for functions and templates, as it's somewhat boring to copypaste argument names. not that it's a big deal, but... ;-) i mean ddoc stubs, of course. ;-) signature.asc Description: PGP

Re: dfmt options

2015-03-15 Thread anonymous via Digitalmars-d
On Saturday, 14 March 2015 at 23:15:35 UTC, Brian Schott wrote: * Hard limit for line length * Soft limit for line length offset for line wrap, e.g: - right guide = 80; - right tolerance = 10; if line length = 84 then no new line if line length = 91 then new line from the leftmost token

Re: dfmt options

2015-03-15 Thread ketmar via Digitalmars-d
On Sat, 14 Mar 2015 18:44:02 -0700, Walter Bright wrote: On 3/14/2015 5:01 PM, Orvid King wrote: At which point you realize that The One True Way is wrong, Maybe it's time to transcend that. Correct me if I'm wrong, but I believe the purpose of a formatter is to make the formatting of

Re: dfmt options

2015-03-15 Thread Mathias Lang via Digitalmars-d
2015-03-15 13:56 GMT+01:00 ketmar via Digitalmars-d digitalmars-d@puremagic.com: maybe it's time to fix the compiler, so it will simply reject the UnTrue Sources? why relay to external tool for such fundamental task? That would be terrible. They are thing the compiler should enforce (IMO

Re: dfmt options

2015-03-15 Thread ketmar via Digitalmars-d
On Mon, 16 Mar 2015 02:37:46 +1300, Rikki Cattermole wrote: On 16/03/2015 2:33 a.m., ketmar wrote: On Mon, 16 Mar 2015 02:19:08 +1300, Rikki Cattermole wrote: On 16/03/2015 2:16 a.m., ketmar wrote: On Sun, 15 Mar 2015 16:32:25 +1300, Rikki Cattermole wrote: This might be a bit of a out of

Re: dfmt options

2015-03-15 Thread ketmar via Digitalmars-d
On Sun, 15 Mar 2015 14:49:35 +0100, Mathias Lang via Digitalmars-d wrote: but One True Way would just lead to fork exactly! signature.asc Description: PGP signature

Re: dfmt options

2015-03-15 Thread Rikki Cattermole via Digitalmars-d
On 16/03/2015 2:16 a.m., ketmar wrote: On Sun, 15 Mar 2015 16:32:25 +1300, Rikki Cattermole wrote: This might be a bit of a out of scope, but auto generating of DDOC comments for symbols would be nice. Basically to enforce before e.g. committing that everything has been explained. this never

Re: dfmt options

2015-03-15 Thread ketmar via Digitalmars-d
On Sun, 15 Mar 2015 16:32:25 +1300, Rikki Cattermole wrote: This might be a bit of a out of scope, but auto generating of DDOC comments for symbols would be nice. Basically to enforce before e.g. committing that everything has been explained. this never helps. what sense of having

Re: dfmt options

2015-03-15 Thread Rikki Cattermole via Digitalmars-d
On 16/03/2015 2:33 a.m., ketmar wrote: On Mon, 16 Mar 2015 02:19:08 +1300, Rikki Cattermole wrote: On 16/03/2015 2:16 a.m., ketmar wrote: On Sun, 15 Mar 2015 16:32:25 +1300, Rikki Cattermole wrote: This might be a bit of a out of scope, but auto generating of DDOC comments for symbols would

Re: dfmt options

2015-03-15 Thread ketmar via Digitalmars-d
On Mon, 16 Mar 2015 02:19:08 +1300, Rikki Cattermole wrote: On 16/03/2015 2:16 a.m., ketmar wrote: On Sun, 15 Mar 2015 16:32:25 +1300, Rikki Cattermole wrote: This might be a bit of a out of scope, but auto generating of DDOC comments for symbols would be nice. Basically to enforce before

Re: dfmt options

2015-03-15 Thread weaselcat via Digitalmars-d
On Sunday, 15 March 2015 at 09:10:13 UTC, Walter Bright wrote: On 3/15/2015 1:12 AM, Jonathan M Davis via Digitalmars-d wrote: Which would instantly make it useless for many users, because many of them will disagree with the One True Way regardless of what it is. Tabs vs spaces, BSD Allman

Re: dfmt options

2015-03-15 Thread via Digitalmars-d
On Saturday, 14 March 2015 at 23:15:35 UTC, Brian Schott wrote: First, a disclaimer: I am an idiot for starting this thread. Moving on... I'm working on a list of configuration options for dfmt - a formatter for D source code. So far I have the following: * Insert spaces between if, while,

Re: dfmt options

2015-03-15 Thread Dicebot via Digitalmars-d
On Sunday, 15 March 2015 at 10:03:15 UTC, Walter Bright wrote: Haven't we all got better things to do than argue about formatting styles? If I was a manager paying programmers , I do not want to pay them to argue about formatting, either. But this is exactly the point! There is a team

Re: dfmt options

2015-03-15 Thread Szymon Gatner via Digitalmars-d
On Sunday, 15 March 2015 at 10:12:09 UTC, Dicebot wrote: On Sunday, 15 March 2015 at 10:03:15 UTC, Walter Bright wrote: Haven't we all got better things to do than argue about formatting styles? If I was a manager paying programmers , I do not want to pay them to argue about formatting,

Re: dfmt options

2015-03-15 Thread Jonathan M Davis via Digitalmars-d
On Saturday, March 14, 2015 16:48:21 Walter Bright via Digitalmars-d wrote: On 3/14/2015 4:15 PM, Brian Schott wrote: What am I missing? I suggest defining The One True Way and have no configuration options. Which would instantly make it useless for many users, because many of them will

Re: dfmt options

2015-03-15 Thread Walter Bright via Digitalmars-d
On 3/15/2015 1:12 AM, Jonathan M Davis via Digitalmars-d wrote: Which would instantly make it useless for many users, because many of them will disagree with the One True Way regardless of what it is. Tabs vs spaces, BSD Allman bracing vs KR bracing, if(...) vs if (...), ( test1 test2 ) vs

Re: dfmt options

2015-03-15 Thread Walter Bright via Digitalmars-d
On 3/15/2015 2:38 AM, Dicebot wrote: Walter, please understand, that no choice alone (in vacuum) is good or bad. One true way was good decision for Go because it comes as part of consistent opinionated approach to language design. It isn't just matter of formatting but applies to all decisions -

Re: dfmt options

2015-03-15 Thread Dicebot via Digitalmars-d
Walter, please understand, that no choice alone (in vacuum) is good or bad. One true way was good decision for Go because it comes as part of consistent opinionated approach to language design. It isn't just matter of formatting but applies to all decisions - either you do what language

Re: dfmt options

2015-03-15 Thread Brian Schott via Digitalmars-d
On Sunday, 15 March 2015 at 10:12:09 UTC, Dicebot wrote: On Sunday, 15 March 2015 at 10:03:15 UTC, Walter Bright wrote: Haven't we all got better things to do than argue about formatting styles? If I was a manager paying programmers , I do not want to pay them to argue about formatting,

Re: dfmt options

2015-03-15 Thread Dicebot via Digitalmars-d
On Sunday, 15 March 2015 at 01:45:56 UTC, Walter Bright wrote: On 3/14/2015 4:59 PM, Brian Schott wrote: On Saturday, 14 March 2015 at 23:49:00 UTC, Walter Bright wrote: I suggest defining The One True Way and have no configuration options. I hope you like tabs as much as I do. We'll all

Re: dfmt options

2015-03-15 Thread John Colvin via Digitalmars-d
On Saturday, 14 March 2015 at 23:49:00 UTC, Walter Bright wrote: On 3/14/2015 4:15 PM, Brian Schott wrote: What am I missing? I suggest defining The One True Way and have no configuration options. One of the big benefits of auto-formatting is that people don't have to agree on the correct

Re: dfmt options

2015-03-15 Thread Idan Arye via Digitalmars-d
On Sunday, 15 March 2015 at 09:10:13 UTC, Walter Bright wrote: On 3/15/2015 1:12 AM, Jonathan M Davis via Digitalmars-d wrote: Which would instantly make it useless for many users, because many of them will disagree with the One True Way regardless of what it is. Tabs vs spaces, BSD Allman

Re: dfmt options

2015-03-15 Thread Walter Bright via Digitalmars-d
On 3/15/2015 10:37 AM, Idan Arye wrote: The thing is - gofmt was where from the very beginning of Go(or at least from r56, the first stable release. I didn't dig any deeper...). This means that any Go project was using the one true style from the beginning. dfmt, on the other hand, comes out

Re: dfmt options

2015-03-15 Thread Idan Arye via Digitalmars-d
On Saturday, 14 March 2015 at 23:15:35 UTC, Brian Schott wrote: First, a disclaimer: I am an idiot for starting this thread. Moving on... I'm working on a list of configuration options for dfmt - a formatter for D source code. So far I have the following: * Insert spaces between if, while,

Re: dfmt options

2015-03-15 Thread Martin Nowak via Digitalmars-d
On 03/15/2015 12:48 AM, Walter Bright wrote: On 3/14/2015 4:15 PM, Brian Schott wrote: What am I missing? I suggest defining The One True Way and have no configuration options. It's a bit late to enforce a particular D code style on all the existing code and people already using D. Something

Re: dfmt options

2015-03-15 Thread Walter Bright via Digitalmars-d
On 3/14/2015 8:32 PM, Rikki Cattermole wrote: This might be a bit of a out of scope, but auto generating of DDOC comments for symbols would be nice. Basically to enforce before e.g. committing that everything has been explained. Autogeneration of documentation is by definition useless.

Re: dfmt options

2015-03-15 Thread Jonathan M Davis via Digitalmars-d
On Sunday, March 15, 2015 03:02:53 Walter Bright via Digitalmars-d wrote: Haven't we all got better things to do than argue about formatting styles? Sure, like we have better things than to argue about vim vs emacs. But I wouldn't want to be forced to use emacs (or micro-emacs) just because

Re: dfmt options

2015-03-15 Thread Walter Bright via Digitalmars-d
On 3/15/2015 3:12 AM, Dicebot wrote: It is also matter of expectation. Until now D was very un-opinionated language, probably even closer to language construction set. If this changes for one case, one may fear more similar decisions may follow. That's not entirely correct. For example, the

Re: dfmt options

2015-03-15 Thread Jonathan M Davis via Digitalmars-d
On Sunday, March 15, 2015 02:10:13 Walter Bright via Digitalmars-d wrote: Let's _please_ not try and force any particular style on the D community. Forcing is a little strong. dfmt is an optional tool, not the core language. Yes, sorry. Forcing is too strong a word. However, if we're putting

Re: dfmt options

2015-03-15 Thread ketmar via Digitalmars-d
On Sun, 15 Mar 2015 13:23:09 -0700, Jonathan M Davis via Digitalmars-d wrote: Yes, sorry. Forcing is too strong a word. However, if we're putting out an official formatting tool which has no configurability, unless we're telling folks that it's specifically for the official source code and

Re: dfmt options

2015-03-15 Thread Rikki Cattermole via Digitalmars-d
On 16/03/2015 8:08 a.m., Walter Bright wrote: On 3/14/2015 8:32 PM, Rikki Cattermole wrote: This might be a bit of a out of scope, but auto generating of DDOC comments for symbols would be nice. Basically to enforce before e.g. committing that everything has been explained. Autogeneration of

Re: dfmt options

2015-03-15 Thread Walter Bright via Digitalmars-d
On 3/15/2015 1:34 PM, Jonathan M Davis via Digitalmars-d wrote: but I hate it when I have to format code in ways that I don't like. It's like walking around with a pebble in your shoe. It may not stop you from getting any work done, but it's a constant point of pain. I fully understand your

Re: dfmt options

2015-03-15 Thread Brian Schott via Digitalmars-d
On Monday, 16 March 2015 at 01:52:57 UTC, Idan Arye wrote: And if you need a more concrete reason - a code formatter should be able to act as a filter - put code in STDIN, get formatted code from STDOUT. There are probably some languages where this will work, such as Lua, but this will never

Re: dfmt options

2015-03-15 Thread Idan Arye via Digitalmars-d
On Monday, 16 March 2015 at 00:13:58 UTC, Rikki Cattermole wrote: On 16/03/2015 8:08 a.m., Walter Bright wrote: On 3/14/2015 8:32 PM, Rikki Cattermole wrote: This might be a bit of a out of scope, but auto generating of DDOC comments for symbols would be nice. Basically to enforce before e.g.

Re: dfmt options

2015-03-15 Thread Brad Anderson via Digitalmars-d
On Saturday, 14 March 2015 at 23:15:35 UTC, Brian Schott wrote: First, a disclaimer: I am an idiot for starting this thread. Moving on... I'm working on a list of configuration options for dfmt - a formatter for D source code. So far I have the following: * Insert spaces between if, while,

dfmt options

2015-03-14 Thread Brian Schott via Digitalmars-d
First, a disclaimer: I am an idiot for starting this thread. Moving on... I'm working on a list of configuration options for dfmt - a formatter for D source code. So far I have the following: * Insert spaces between if, while, for, foreach, etc loops and the ( * Allman vs One True Brace

Re: dfmt options

2015-03-14 Thread Walter Bright via Digitalmars-d
On 3/14/2015 4:59 PM, Brian Schott wrote: On Saturday, 14 March 2015 at 23:49:00 UTC, Walter Bright wrote: I suggest defining The One True Way and have no configuration options. I hope you like tabs as much as I do. We'll all have to compromise at some point to have a One True Way, but

Re: dfmt options

2015-03-14 Thread ketmar via Digitalmars-d
On Sat, 14 Mar 2015 23:15:34 +, Brian Schott wrote: First, a disclaimer: I am an idiot for starting this thread. Moving on... I'm working on a list of configuration options for dfmt - a formatter for D source code. So far I have the following: * Insert spaces between if, while,

Re: dfmt options

2015-03-14 Thread Andrei Alexandrescu via Digitalmars-d
On 3/14/15 4:15 PM, Brian Schott wrote: First, a disclaimer: I am an idiot for starting this thread. Moving on... I'm working on a list of configuration options for dfmt - a formatter for D source code. So far I have the following: * Insert spaces between if, while, for, foreach, etc loops

Re: dfmt options

2015-03-14 Thread Walter Bright via Digitalmars-d
On 3/14/2015 4:15 PM, Brian Schott wrote: What am I missing? I'd also suggest making dfmt an algorithm. Then people can use it like map, reduce, filter, etc., in their programs. dfmt as a program then becomes incidental and trivial.

Re: dfmt options

2015-03-14 Thread weaselcat via Digitalmars-d
On Saturday, 14 March 2015 at 23:15:35 UTC, Brian Schott wrote: First, a disclaimer: I am an idiot for starting this thread. Moving on... I'm working on a list of configuration options for dfmt - a formatter for D source code. So far I have the following: * Insert spaces between if, while,

Re: dfmt options

2015-03-14 Thread Daniel Murphy via Digitalmars-d
Brian Schott wrote in message news:iobidfcyoneyxrzkh...@forum.dlang.org... First, a disclaimer: I am an idiot for starting this thread. Hahaha. What am I missing? - Enum members each on new line or all on same line - Threshold for array initializers, when exceeded each element is on

Re: dfmt options

2015-03-14 Thread Daniel Murphy via Digitalmars-d
Andrei Alexandrescu wrote in message news:me2orn$2fjp$1...@digitalmars.com... I think a simple starting point would be to define and enforce automatically one style for all phobos pull requests. -- Andrei And with ddmd, we can do the same.

Re: dfmt options

2015-03-14 Thread Brian Schott via Digitalmars-d
On Saturday, 14 March 2015 at 23:51:51 UTC, Walter Bright wrote: On 3/14/2015 4:15 PM, Brian Schott wrote: What am I missing? I'd also suggest making dfmt an algorithm. Then people can use it like map, reduce, filter, etc., in their programs. dfmt as a program then becomes incidental and

Re: dfmt options

2015-03-14 Thread Brian Schott via Digitalmars-d
On Saturday, 14 March 2015 at 23:49:00 UTC, Walter Bright wrote: I suggest defining The One True Way and have no configuration options. I hope you like tabs as much as I do.

Re: dfmt options

2015-03-14 Thread Walter Bright via Digitalmars-d
On 3/14/2015 5:01 PM, Orvid King wrote: At which point you realize that The One True Way is wrong, Maybe it's time to transcend that. Correct me if I'm wrong, but I believe the purpose of a formatter is to make the formatting of the code consistent in the way that the user wants it to be.

Re: dfmt options

2015-03-14 Thread Walter Bright via Digitalmars-d
On 3/14/2015 4:58 PM, Brian Schott wrote: On Saturday, 14 March 2015 at 23:51:51 UTC, Walter Bright wrote: On 3/14/2015 4:15 PM, Brian Schott wrote: What am I missing? I'd also suggest making dfmt an algorithm. Then people can use it like map, reduce, filter, etc., in their programs. dfmt as

Re: dfmt options

2015-03-14 Thread Orvid King via Digitalmars-d
On Saturday, 14 March 2015 at 23:49:00 UTC, Walter Bright wrote: On 3/14/2015 4:15 PM, Brian Schott wrote: What am I missing? I suggest defining The One True Way and have no configuration options. At which point you realize that The One True Way is wrong, ask for it to be changed, and are

Re: dfmt options

2015-03-14 Thread Andrei Alexandrescu via Digitalmars-d
On 3/14/15 6:45 PM, Walter Bright wrote: On 3/14/2015 4:59 PM, Brian Schott wrote: On Saturday, 14 March 2015 at 23:49:00 UTC, Walter Bright wrote: I suggest defining The One True Way and have no configuration options. I hope you like tabs as much as I do. We'll all have to compromise at

Re: dfmt options

2015-03-14 Thread Rikki Cattermole via Digitalmars-d
On 15/03/2015 12:15 p.m., Brian Schott wrote: First, a disclaimer: I am an idiot for starting this thread. Moving on... I'm working on a list of configuration options for dfmt - a formatter for D source code. So far I have the following: * Insert spaces between if, while, for, foreach, etc

Re: dfmt options

2015-03-14 Thread Walter Bright via Digitalmars-d
On 3/14/2015 4:15 PM, Brian Schott wrote: What am I missing? I suggest defining The One True Way and have no configuration options.

Re: dfmt options

2015-03-14 Thread Mathias Lang via Digitalmars-d
2015-03-15 0:15 GMT+01:00 Brian Schott via Digitalmars-d digitalmars-d@puremagic.com: What am I missing? I suggest you fire a recent version of Visual Studio and go to tools / Options / Tet editor / C# (or C/C++) / Formatting. There you got a bunch of formatting options. Maybe not all of them

Re: dfmt options

2015-03-14 Thread Meta via Digitalmars-d
On Saturday, 14 March 2015 at 23:15:35 UTC, Brian Schott wrote: First, a disclaimer: I am an idiot for starting this thread. Moving on... I'm working on a list of configuration options for dfmt - a formatter for D source code. So far I have the following: * Insert spaces between if, while,

Re: dfmt options

2015-03-14 Thread Dicebot via Digitalmars-d
On Sunday, 15 March 2015 at 00:51:30 UTC, Meta wrote: Maybe nobody else does this, but I prefer to write switch cases in an indented block style. switch (expr) { case 0: //Do stuff end; case 1 .. case 9: //Do other stuff end; default: //Do default