[libvirt] [PATCH v3 05/22] build-aux: rewrite whitespace checker in Python

Peter Krempa pkrempa at redhat.com
Fri Sep 27 11:32:25 UTC 2019


On Fri, Sep 27, 2019 at 12:24:05 +0100, Daniel Berrange wrote:
> On Fri, Sep 27, 2019 at 11:42:28AM +0100, Daniel P. Berrangé wrote:
> > On Fri, Sep 27, 2019 at 10:33:45AM +0100, Daniel P. Berrangé wrote:
> > > On Thu, Sep 26, 2019 at 06:08:14PM +0200, Ján Tomko wrote:
> > > > On Tue, Sep 24, 2019 at 03:58:46PM +0100, Daniel P. Berrangé wrote:
> > > > > As part of an goal to eliminate Perl from libvirt build tools,
> > > > > rewrite the check-spacing.pl tool in Python.
> > > > > 
> > > > > This was a straight conversion, manually going line-by-line to
> > > > > change the syntax from Perl to Python. Thus the overall structure
> > > > > of the file and approach is the same.
> > > > > 
> > > > > Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
> > > > > ---

[...]

> The attached lv.cfg file is an uncrustify config that is reasonably
> close to our current style.
> 
> To see what it does, run this in your source tree:
> 
>   find src/ -name '*.c' | xargs uncrustify --replace -c uncrustify.cfg 
> 
> There's quite a few real mistakes it is correcting for us.
> 
> Most of the big stuff is due to us having followed inconsistent
> rules in different parts of the source tree. No matter which tool
> we pick will suffer this as we have to pick one style
> 
> switch/case indents are the big one - sometimes we line up case + switch,
> sometimes we don't.

[...]

> If anyone fancies taking this further feel free. I'm not going to work on
> uncrustify right now. I'll just drop this whitespace patch rewrite and
> focus on the other things as a priority.

As I've mentioned in a different subthread: What do you think of
applying this on some recently created files first? That way there is
already a churn barrier originating from the refactor so the reformat
itself will not make backports much more painful.




More information about the libvir-list mailing list