defluffing Portfiles (port lint)

Jyrki Wahlstedt jwa at macports.org
Tue Jul 10 22:08:12 PDT 2007


On 11.7.2007, at 2.06, Anders F Björklund wrote:

> Ryan Schmidt wrote:
>
>>> The simple solution being defining tabs to something like 8.
>>
>> To bring back some of the arguments from earlier threads: I do not  
>> wish to configure my editor to use 8-space tabs. I prefer 4-space  
>> tabs. This is why editors let you change the tab width: because  
>> it's a personal preference. Do not force your personal preferences  
>> on me. Different people prefer 4- or 8- or 2- or 3-space tab  
>> settings in their editors, and that's just fine. They should be  
>> allowed to do that.
>
> It's of course possible to keep indentation in Portfiles
> up to the port maintainer. Maybe I should have mention that
> suggested "port lint" didn't actually check any indentation,
> just the use of newlines between certain port constructs...
>
> BTW; 8 is the default Unix hard tab size, not anything personal
> (it will show up when using for instance a browser or terminal)

To say my word, too, here:
I have tried to follow the traditional model quite long, using lots  
of tabs actually. That of course works quite well, as whitespace in  
proper places makes the file readable. Lately I have changed my own  
writing somewhat, due to my use of emacs, because then I don't have  
to take care of the indentation myself. Emacs has its own mode for  
tcl, that works quite well. It can be adjusted, so if in the future a  
common coding style is agreed upon, perhaps a document page is  
written to define the correct values for all the variables concerned.

>
>> But this is the reason why using tabs to keep columns aligned is a  
>> bad idea and should not be done -- columns become unaligned for  
>> all tab-width settings other than the one the author used. This is  
>> also a reason why using spaces everywhere, even for line  
>> indentation, is bad IMHO: it forces your personal line indentation  
>> preference on everyone else.
>
> Unless there is a common project line indentation standard,
> it's no useful idea of trying to force anything upon anyone.
>
I agree. However, I'd say, it's perhaps more important to have some  
indentation (I think this is the case) than to try very hard to  
define, what it's like.

>> Other users will of course argue that their editors are configured  
>> to use spaces, and they do not wish to reconfigure their editors  
>> to use tabs... I think this is where we stalemated last time.
>
> Maybe just keep it flexible then ? Or leave it to the Portfile
> prettyprinter, to show the Portfiles in some readable manner...
> (and adding some syntax coloring wouldn't hurt either, probably
> can use Tcl with some extra keywords for the common variables?)
>
> Standardizing the variable order might not be a bad thing though,
> nor providing a Portfile template (whether blank or interactive).
>
> --anders

I'll second that. Some of the portfiles are large, and to read them  
is a lot easier, if variables, phases, and variants are always in  
some definite order. I don't myself see very much significance  
between different indentation styles. I'd guess most of files can  
read files with some (intelligible) indentation. Flexibility on the  
other hand makes it easier to write them, as each one of us likes to  
do things in a personal way (that said, it doesn't matter to me, if I  
can adjust my tcl-mode to indent the lines in the generally accepted  
and recommended manner).

!
! Jyrki Wahlstedt
!	http://www.wahlstedt.fi/jyrki/
!
! Our life is no dream; but it ought to become one and perhaps will.
! PGP key ID: 0x139CC386 fingerprint: F355 B46F 026C B8C1 89C0  A780  
6366 EFD9 139C C386






More information about the macports-dev mailing list