[Kstars-devel] whitespace: worth fixing?

Jason Harris jharris at 30doradus.org
Sat Sep 22 01:28:58 CEST 2007


Hi,

I ran the ruby script I got from a KDE dev on skymapevents.cpp as a test.  It 
bombed out on a large switch() block, so it looks like the case-align code 
isn't bulletproof.

Anyway, here's an example of what will change:

before (indents are TABs):
	//color scheme
	kstarsData->colorScheme()->loadFromConfig( KGlobal::config().data() );
	if ( Options::darkAppColors() ) {
		QApplication::setPalette( DarkPalette );
	} else {
		QApplication::setPalette( OriginalPalette );
	}

after (indents are 4-spaces, and spaces removed from parenths):
    //color scheme
    kstarsData->colorScheme()->loadFromConfig(KGlobal::config().data());
    if (Options::darkAppColors()) {
        QApplication::setPalette(DarkPalette);
    } else {
        QApplication::setPalette(OriginalPalette);
    }

I actually prefer the spaces in parenths and brackets, and if these aren't 
always consistent it doesn't really bother me as much as the indents.  I'd 
like to hear your opinions too.

Jason


On Friday 21 September 2007 12:54, Jason Harris wrote:
> Hello,
>
> Whitespace is currently a bit of a mess in our codebase.  I've always tried
> to use TAB characters in my code, which I now kind of regret because many
> non-Jason people use spaces instead, and spaces are recommended by the
> kdelibs coding style guidelines[1].
>
> We can fix the code in an automated was using astyle[2], but this will add
> a "useless" entry to the svn history of all files, and would require a
> large file transfer the next time you svn up.
>
> Is it worth fixing the whitespace in our codebase to use 4 spaces instead
> of a TAB?  If so, does it make sense to do it now, before 4.0.0 is
> released, or should we wait until after the freeze is lifted for such a
> pervasive (but non-functional) change?
>
> thanks,
> Jason
>
> [1]: http://techbase.kde.org/Policies/Kdelibs_Coding_Style#Indentation
> [2]: http://astyle.sourceforge.net/

-- 
Jason Harris
jharris at 30doradus.org


More information about the Kstars-devel mailing list