script for applying kde coding style
faure at kde.org
Wed Jul 2 16:43:58 BST 2008
On Wednesday 02 July 2008, Adriaan de Groot wrote:
> On Wednesday 02 July 2008, Ralf Habacker wrote:
> > kde-astyle - apply kde coding style to all c, cpp and header files
> > in and below the current directory (unix version)
> > kde-astyle.bat - apply kde coding style to all c, cpp and header files
> > in and below the current directory (windows version)
> > Also these scripts should be communicated on techbase as the prefered way.
> While I'm a big fan of consistency in *general*, I am hesitant to spit out
> scripts like this; part of that hesitation is that I worry about
> indiscriminate application of those scripts, leading to a loss of meaningful
> SVN history through indiscriminate re-lay-outing.
Yes they shouldn't be blindly applied. But when I'm working in a really-messed-up file
then it would be nice to have such a script to make the code readable again (then commit,
then start doing the actual changes).
> It'd be useful to be able to use these scripts to flag differences from the
> defined style so we can flag up files in krazy / the EBN, though.
And then what? How does one fix that krazy warning, without blindly applying
the script to all affected files? Also, the techbase page does say: this style is
not mandatory, only recommended. Let's stick to that. It's for people who like
the kdelibs coding style (but not everyone does, so let's not suddenly make it
mandatory when it was decided it wouldn't be so), and who like to be able to
apply it without having to do it manually (I keep doing search/replace of "( "->"("
and " )"->")" in individual konqueror methods...). Also useful for people who import
code from somewhere else (no svn history problem).
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
More information about the kde-core-devel