[erlang-questions] Controversial subject of the day: tabs and spaces for indentation

Bengt Kleberg bengt.kleberg@REDACTED
Thu Feb 6 13:48:19 CET 2014


Greetings,

These are my opinions, not facts.

"erl-indent" can only be used on the OTP files that follow the style
guide they recommend. Even if that is just a few it is better than the
current cut-and-paste of tabs and spaces that I have to do in all files.
Thank you for the tool.


bengt

On Thu, 2014-02-06 at 12:35 +0100, Vlad Dumitrescu wrote:
> 
> On 6 Feb 2014 12:27, "Bengt Kleberg" <bengt.kleberg@REDACTED>
> wrote:
> >
> > Greetings,
> >
> > These are my opinions, not facts.
> >
> > Does your "erl-indent" program format according to the current OTP
> style
> > guide? It would be very good if that was the case.
> 
> It uses erlang - mode to indent. I certainly assume that it uses the
> style recommended by otp. 
> 
> Not all otp source files are idempotent under the indentation, so it
> might mean that not all are following the otp style. 
> 
> /vlad 
> 
> >
> > bengt
> >
> > On Thu, 2014-02-06 at 10:43 +0100, Vlad Dumitrescu wrote:
> > > On Thu, Feb 6, 2014 at 10:31 AM, Lukas Larsson <lukas@REDACTED>
> wrote:
> > > > On Thu, Feb 6, 2014 at 9:38 AM, Loïc Hoguin <essen@REDACTED>
> wrote:
> > > >>
> > > >> Plus this doesn't help your code get merged at all. If you
> submit code
> > > >> with broken whitespace, then tools will also display this
> whitespace change.
> > > >> You can of course hide whitespace changes, but the problem is
> that
> > > >> whitespace does matter in some places, so you're basically
> hiding
> > > >> potentially important information by doing that.
> > > >>
> > > > This is in my opinion the reason why it would be a very bad
> thing to do a
> > > > huge commit that changes the current whitespace format of a
> project to
> > > > another. It is already very hard to figure out what change could
> have caused
> > > > a bug without having to deal with whitespace changes in the
> middle of a
> > > > diff.
> > >
> > > Yes, if such a thing would be done, the best time is as a separate
> > > commit right before a release, this will minimize the number of
> > > merges/rebases with mixed styles of indentation. Of course, as
> Lukas
> > > points out, if diffing with older code, then you have a problem.
> > >
> > > Anyway, I have a suggestion for a workaround at
> > > https://gist.github.com/vladdu/8841089. Put those files in your
> ~/bin
> > > (which should be on $PATH), edit them to match your system and
> style
> > > and you can reindent files simply by running "erl-indent
> > > /path/to/myfile.erl". It still requires to have emacs installed,
> but I
> > > can live with that.
> > >
> > > The downside is that if you want to use only spaces, then the
> whole
> > > file will be changed to use them. The really big downside is that
> with
> > > this tool there will be even less incitament to change the
> indentation
> > > style...
> > >
> > > regards,
> > > Vlad
> > > _______________________________________________
> > > erlang-questions mailing list
> > > erlang-questions@REDACTED
> > > http://erlang.org/mailman/listinfo/erlang-questions
> >
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-questions@REDACTED
> > http://erlang.org/mailman/listinfo/erlang-questions
> 
> 




More information about the erlang-questions mailing list