Per project code formatting settings and policy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Per project code formatting settings and policy

Holger Freyther
Hi!

I found myself doing codereview and commenting on style (e.g. missing indention). It seems like a task that can be easily automated and in fact we have RBFormmatter/BlueInk to do it.

What I didn't see is if a project can supply the style (instead of the image configuration)? How could this be achieved?

holger
Reply | Threaded
Open this post in threaded view
|

Re: Per project code formatting settings and policy

Ben Coman


On Fri, 15 Mar 2019 at 15:56, Holger Freyther <[hidden email]> wrote:
Hi!

I found myself doing codereview and commenting on style (e.g. missing indention). It seems like a task that can be easily automated and in fact we have RBFormmatter/BlueInk to do it.

What I didn't see is if a project can supply the style (instead of the image configuration)? How could this be achieved?


That would be a nice feature, if it is not already.
cheers -ben 
Reply | Threaded
Open this post in threaded view
|

Re: Per project code formatting settings and policy

Marcus Denker-4
In reply to this post by Holger Freyther


> On 15 Mar 2019, at 08:48, Holger Freyther <[hidden email]> wrote:
>
> Hi!
>
> I found myself doing codereview and commenting on style (e.g. missing indention). It seems like a task that can be easily automated and in fact we have RBFormmatter/BlueInk to do it.
>
> What I didn't see is if a project can supply the style (instead of the image configuration)? \\
> How could this be achieved?
>

That would be really nice!  Right now it uses global Preferences.

We should check how much work it would be to allow the global setup to be overridden per Class and per Package…

This would need some refactoring, though… the settings are already localised in the BIPrettyPrinterContext class.
There is one instance in the class var DefaultPrettyPrintContext in the main pretty printer class.

We would need some way to do this *per instance* of the pretty printer and then set it when creating the pretty printer,
asking the class and the manifest for a PrettyPrintContext before setting the default…

        Marcus
Reply | Threaded
Open this post in threaded view
|

Re: Per project code formatting settings and policy

Sean P. DeNigris
Administrator
In reply to this post by Holger Freyther
Holger Freyther wrote
> What I didn't see is if a project can supply the style (instead of the
> image configuration)

Great idea!!



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Per project code formatting settings and policy

Sean P. DeNigris
Administrator
In reply to this post by Marcus Denker-4
Marcus Denker-4 wrote
> We should check how much work it would be to allow the global setup to be
> overridden per Class and per Package…

Ideally this would be integrated with Metacello or similar, but I see that
the Metacello registry doesn't seem to cache the packages that belong to
each project (i.e. baseline/config)



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Cheers,
Sean