[erlang-questions] OTP-compliant patches
Fri Feb 7 16:36:14 CET 2014
Note that I always (at least that’s my intent) use spaces in my patches and have never been told anything.
Le 7 févr. 2014 à 14:49, Steve Vinoski <vinoski@REDACTED> a écrit :
> On Fri, Feb 7, 2014 at 2:42 AM, Vlad Dumitrescu <vladdu55@REDACTED> wrote:
> Just so that I make sure I understand correctly, in the light of the
> flame war that I recently started :-\
> The documentation says
> > Make sure your changes follow the coding and indentation style of the code surrounding your
> > changes. (At some point in the future, there will be a style guide, either included in the
> > documentation or on some web site, but it is not ready yet.)
> So if the local indentation is not what erlang-mode would give, then I
> still have to manually adjust it to match what already was there. Is
> that correct?
> IMO yes, that's correct. BTW this approach is typical of most software projects -- I recall being taken to task for breaking this rule way back in 1987, a lesson I've never forgotten.
> Since I've had some diff look ok in emacs but not on github (or the
> other way around, I don't remember exactly), which one is the
> reference in case of mismatch?
> Of course, the typical reason for edits looking incorrect on github is using spaces where you need tabs for vice versa. Unfortunately, some files use a mixture of tabs and spaces, with some lines using tabs for leading whitespace and others using only spaces. My approach of dynamically setting the emacs indent-tabs-mode variable locally in the buffer based on searching the file for leading tabs upon opening it often works but isn't foolproof, since localized areas of the file might use spaces rather than tabs or vice versa. The only way I'm aware of to be fully sure that I'm respecting existing whitespace practices in the files I edit is to visually check the diffs.
> erlang-questions mailing list
More information about the erlang-questions