defluffing Portfiles (port lint)

Ryan Schmidt ryandesign at macports.org
Tue Jul 10 14:17:42 PDT 2007


On Jul 10, 2007, at 07:47, Anders F Björklund wrote:

> It does highlight some portstyle issues to be sorted out,
> like where the newlines should go and amounts of tabbing.

Seems like coding style has thus far been left up to each port author.

There has been some debate on whether to use tabs or spaces.  
Different people have different opinions on this, with people on both  
sides claiming that their way is easier for them and/or their text  
editors.

I use tabs to control indentation at the beginnings of lines, but  
spaces to keep columns aligned. This seems like the best idea to me.  
Many portfiles currently use tabs everywhere, even to keep columns  
aligned, which of course fails if I'm using different tab settings  
than the portfile author. Other portfiles use spaces everywhere.

I think the idea of portlint was supposed to be a utility that checks  
for valid syntax, valid variables, required variables and so on, but  
I don't know that it needs to enforce any particular coding style --  
especially not until there is a clear consensus about what that style  
should be. The last time we tried to settle even the tabs-vs.-spaces  
issue there was a heated debate and no resolution.

The style of my portfiles should be consistent with each other --  
with perhaps a few exceptions for portfiles I haven't gotten to yet.  
But my port writing style is different from some others. Since we had  
no real consensus on style, I wanted to try something different to  
see how I liked it. So far, I kinda do.






More information about the macports-dev mailing list