From c94e11158a997b9f14f035ce8652513c160bb92b Mon Sep 17 00:00:00 2001 From: "alp@webkit.org" Date: Fri, 11 Apr 2008 00:45:17 +0000 Subject: [PATCH] 2008-03-12 Michael Emmel Reviewed by Alp Toker. http://bugs.webkit.org/show_bug.cgi?id=18397 Fix leaving spaces before parens in functions * WebKitTools/Scripts/wkstyle: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@31791 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- ChangeLog | 9 +++++++++ WebKitTools/Scripts/wkstyle | 29 ++++++++++++++++++++++++++--- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f9a94ff..20dcd14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-03-12 Michael Emmel + + Reviewed by Alp Toker. + + http://bugs.webkit.org/show_bug.cgi?id=18397 + Fix leaving spaces before parens in functions + + * WebKitTools/Scripts/wkstyle: + 2008-04-07 Jan Michael Alonzo Build fix, rubber-stamped and landed by ap. diff --git a/WebKitTools/Scripts/wkstyle b/WebKitTools/Scripts/wkstyle index 690b5fa..4b3447f 100755 --- a/WebKitTools/Scripts/wkstyle +++ b/WebKitTools/Scripts/wkstyle @@ -25,16 +25,36 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -astyle \ +cmdcpp="astyle \ +--unpad=paren \ --style=linux \ +--brackets=linux \ --indent=spaces=4 \ ---convert-tabs \ -$@ +--indent-switches \ +--convert-tabs" + +cmdh="astyle \ +--unpad=paren \ +--style=linux \ +--brackets=break \ +--indent=spaces=4 \ +--convert-tabs" #astyle does not support unpadding so we use sed for i in $@ do echo $i + +ext=`echo $i|awk -F . '{print $NF}'` + +cmd=$cmdcpp + +if [ $ext == "h" ] ; then + cmd=$cmdh +fi + +$cmd $i + #first print the changes we are making sed -n -e ' /( .*/p @@ -59,6 +79,9 @@ s/ )/)/g N s/\n{/ {/ } +#fixup extra tab in constructor initalizer +/^ \+,/{s/^ //} +/^ \+:/{s/^ //} ' $i > $i.sed mv $i.sed $i done -- 1.8.3.1