[Surfraw-devel] Patch to fix whitespace errors

Jason Ryan jasonwryan at gmail.com
Sun Oct 5 05:31:47 UTC 2014


On 05/10/14 at 07:16am, Lucas Hoffmann wrote:
>
>On Sun, Oct 05, 2014 at 10:31:20AM +1300, Jason Ryan wrote:
>> Thanks Lucas,
>>
>> Applied.
>>
>> And for the commandlinefu elvi, which was also added.
>Thanks for merging these.  I have seen some more style inconsistencies
>and want to ask:
>
>Is there any style (guide?) set up for surfraw?  The HACKING file says
>> You must call w3_global_usage at the end of this function and follow
>> the surfraw usage style least you be marked a quiche eater.
>But I'm not sure if that is meant for any general style.
>
Not that I am aware of; but we could certainly kick one off with this
discussion.

My preferences would be:

>What I have seen:
>* different leading whitespace (4 spaces or tabs)
Non-committal but I think that tabs currently outweigh spaces

>* different process substitutions ( `` or $() )
Should use $(), it is *much* more legible

>* variables in functions declared local and not declared local
Declare local

>* initializing variables to the empty string with var= and var=""
The latter

>* long lines
Aim for 80, where reasonable

>* if ... then and for ... do on the same line and in different lines
Different lines

>
>Additionally I have found some pieces of code that are not portable (one
>sed command does not work for BSD-sed but does for GNU-sed) and some
>pieces of code that I consider ineffective and that could be shortened
>or made faster.
>
>Is it welcome if I send patches for this stuff?  Should the above list
>be split over several patches (for each topic, which might be easier to
>understand later) or should it be one big patch saying "style
>improvement" in order to not produce to many commits (and spamming the
>list)?
>
Patches would be welcome (several, I would think, perhaps grouped according to
what is is they are attending to).

What do others think about a agreeing a style guide and then tidying up the code
to conform to it (if only so people don't have to wear the stigma of being a
quiche eater)?

Cheers,

/J

-- 

http://jasonwryan.com/  [GnuPG Key: B1BD4E40]


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/surfraw-devel/attachments/20141005/3f27292d/attachment.sig>


More information about the Surfraw-devel mailing list