Qt/Kde coding style and SVN tree

Posted on segunda-feira, abril 27th, 2009 at 16:57

Hi all,

today I will post  a script based on Qt/Kde coding style using astyle command in a woking svn tree to fix coding style.

This script works like the scrip from the last post but now to work in a SVN tree.

It will check the coding style just in the modified and added files to the svn commit.

#!/bin/bash

astyle --indent=spaces=4 --brackets=linux \
      --indent-labels --pad=oper --unpad=paren \
      --one-line=keep-statements --convert-tabs \
      --indent-preprocessor \
      $(svn status | awk '(/^M/ || /^A/) &&
            (/\.h\>/ || /\.c\>/ || /\.cpp\>/){print $2}')

You can get the source code from here.

References:

http://ragner.org/programming-languages/qt/174

http://techbase.kde.org/Policies/Kdelibs_Coding_Style

You can leave a response, or trackback from your own site.

Leave a Reply