[Development] White space / coding style patches welcome?

Oswald Buddenhagen oswald.buddenhagen at digia.com
Wed Mar 13 16:47:57 CET 2013


On Wed, Mar 13, 2013 at 03:57:01PM +0100, Axel Waggershauser wrote:
> On Wed, Mar 13, 2013 at 10:30 AM, Oswald Buddenhagen <oswald.buddenhagen at digia.com> wrote:
> > actual enforcement was lars' request.
> > but this clearly requires a very low false report rate to be accepted.
> 
> I see. Regarding false report rate, I think that checking for trailing
> ws as well as checking for leading tabs should be secure enough to
> actually strictly enforce them. See also 'git diff --check'.
> 
yes. there are a few legitimate exceptions, but most of the files are so
seldomly touched that it's ok to deal with them when it happens.

> A word about the auto-generated code situation: Having had a look at
> files in corelib/codecs/ that contain presumably auto-generated
> tables, I don't see why they should not be strictly checked as well.
> As far as I can tell, the files have been assembled/edited manually
> and if they should be updated some time, then a simple CTRL+I in
> QtCreator and saving with the "Clean Whitespace" option set should
> take care of that easily. Also, they are by no means consistent as
> they are right now, anyway.
> 
yes. and often it would be possible to simply fix the generator, too:
instead of:

print "    ";
foreach foo:
    print foo ", ";
print "\n";

use:

print "   ";
foreach foo:
    print " " foo ",";
print "\n";

of course that's a bit simplicistic, but often enough it's all that is
needed.

> The 'mixed whitespace only changes' test is definitely flaky,
>
yes, it is. don't bother.

> But I think the whole "mixed commit' issue will become more or less
> irrelevant, if all issues in the current source base are solved, as
> there would be simply no 'collateral' ws-fixes in the future.
> 
hopefully. i introduced that check as a direct response to the rejection
of my previous attempt at a global cleanup, so it would be logical if it
became obsolete now.




More information about the Development mailing list