PLEASE READ: Whitespace rules

Blair Zajac blair at orcaware.com
Fri Sep 7 11:59:20 PDT 2007


Simon Ruderich wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
> 
> Kevin Ballard wrote:
>> Last time this was brought up only one person complained, but it really
>> is a serious problem and we need standards. Therefore I propose the
>> following:
> 
> If I remember correctly, last time was decided every port maintainer can
> use his/her own rules.
> Even if there is no standard rule with this, I think we should give
> every maintainer/developer the freedom to choose this on his/her own.
> 
>>  * All source code files MUST use soft tabs at a tabstop of 4. No hard
>> tabs are allowed.
>>  * All source code files SHOULD have the following as the first line of
>> the file:
>>         # -*- Mode: Tcl; tab-width: 4; indent-tabs-mode: nil;
>> c-basic-offset: 4 -*- vim:et:sw=4:ts=4:sts=4
>>     This is a modeline that works for both emacs and vim.
> 
> I really don't like this! Why add "useless" additional data to every
> file just because two editors work a bit better with this lines? There
> are many, many texteditors out there and why add additional information
> for only two of them (not counting the clones here).
> 
> If emacs and vim users want to use standard settings for Portfiles then
> they can modify their editor settings.
> 
> Please don't get me wrong, I really like vim (haven't worked with emacs
> yet), but I don't use it as main editor. And seeing this unnecessary
> information annoys me every time. Couldn't everybody just use his/her
> own settings? Without this additional line.
> 
> By the way, the line is too long for 78 columns, so it would have to be
> split in two.
> 
>>  * Portfiles SHOULD use soft tabs at a tabstop of 4, but implementation
>> of this is left up to the discretion of the maintainer.
>>  * Portfiles SHOULD use the given modeline
>>  * Makefiles MUST use tabs as it is required by the syntax. Makefiles
>> SHOULD use a tab stop of 4.
>>  * Makefiles MAY use a modeline. The following works for emacs and vim:
>>         # -*- Mode: Makefile; tab-width: 4; indent-tabs-mode: t -*-
>> vim:noet:sw=4:ts=4
>>  * All other files (documentation, etc) SHOULD use soft tabs at a
>> tabstop of 4 if the document format allows.
>>  * All other files (documentation, etc) SHOULD NOT use a modeline as it
>> is probably meant for human consumption.
> 
> All those changes will just end in a tabs/spaces war; some people like
> tabs more, others spaces. And then there is a wide range of tabs or soft
> tabs lengths, 8, 4, 2 ... the list goes on. I think we can't find an
> agreement here, so everybody should do it like he/she prefers. And
> because it's no difficulty in reading a file with other tab/space rules
> there shouldn't be a problem for anyone.

Why is it that most well known open-source projects have formatting rules that 
they abide to, even if some people personally don't like them.  For example, the 
Subversion project uses the GNU C coding style, which I don't use in any of my 
personal code, but I use that style when I code on that project.  They went 
through the war, had a vote, and choose and everybody abides by it.  How come we 
can't do the same?

I don't care what formatting rules we go with on Portfile's and would go with 
any standard, but I would much rather see consistency there.  But I like 
consistency like that.

Blair



More information about the macports-dev mailing list