[Pharo-project] about code formatting in pharo

Lukas Renggli renggli at gmail.com
Sun Feb 28 04:51:54 EST 2010


I would use a formatter, like this you can make it really consistent.
The RBConfigurableFormatter is pretty good in that, the only thing I
don't like is the placing of the square brackets. I should look into
fixing that, otherwise it formats exactly the way I would format
myself (and in the way you propose).

Lukas

On 28 February 2010 10:36, stephane ducasse <stephane.ducasse at free.fr> wrote:
> Hi guys
>
> I would like to build a set of canonical code formatting convention for Pharo.
> I need your help. Now take time before replying :)
> I would like to structure the discussion and proceed step by step. So at max I would like to discuss one or two formatting approach per mail.
> Once we agree I would like to define a wiki page.
>
>
> **Space after : rule
> =============
> for example I would like to always have a space after a :
>
> classes := Smalltalk allClasses select:[:aClass|
>               (aClass class includesSelector: #cleanUp)
>                       or:[aClass class includesSelector: #cleanUp:]
>       ].
>
> ->
>
>
> classes := Smalltalk allClasses select: [:aClass|
>               (aClass class includesSelector: #cleanUp)
>                       or: [aClass class includesSelector: #cleanUp:]
>       ].
>
>
> **Block arg rule
> =============
> Do we want a space before and after block arg
>
> Smalltalk allClasses select: [:aClass :method|
>
> -> Smalltalk allClasses select: [ :aClass :method |
>
>
> ** selector or block indented compared to receiver
> =======================================
>
> Finally do we follow kent block ideas?
>
> classes := Smalltalk allClasses select: [:aClass|
>               (aClass class includesSelector: #cleanUp)
>                       or: [aClass class includesSelector: #cleanUp:]
>       ].
>
> ->
> classes := Smalltalk allClasses
>                        select: [:aClass| (aClass class includesSelector: #cleanUp)
>                                                        or: [aClass class includesSelector: #cleanUp:]].
>
> Stef
> _______________________________________________
> Pharo-project mailing list
> Pharo-project at lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



-- 
Lukas Renggli
http://www.lukas-renggli.ch




More information about the Pharo-dev mailing list