Skip site navigation (1) Skip section navigation (2)

Source reindenting

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Source reindenting
Date: 2010-12-29 17:30:46
Message-ID: AANLkTi=KNTbrDtX_ADJQani5W56gLFpCCeAWoHYme-ba@mail.gmail.com (view raw or flat)
Thread:
Lists: pgadmin-hackers
I just did a testrun with astyle to reindent and restyle the code. I
created a rule in Makefile.am per:

diff --git a/Makefile.am b/Makefile.am
index be6af45..8266f8d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -65,3 +65,13 @@ endif
 # We need to ensure the help cache is world writeable
 install-data-hook:
        chmod 0666 $(help_cache)
+
+# Perform astyle cleanup per rules:
+# * -p - insert space around parenthesis
+# * -b - bracket style
+# * -S - indent switches
+# * -s4 - intent with spaces, 4 of them
+# * -k3 - align pointer or reference operators
+# Also add the -n to make it not save .orig files (we have git for that)
+style:
+       astyle -n -p -b -S -s4 -k3  `find . -name "*.cpp" -o -name
"*.h" | egrep -v "(wx-build|xrcDialogs|pgscript/test)"`


diffstat for the whole thing is:
 631 files changed, 36590 insertions(+), 30757 deletions(-)

And yes, it is smart enough not to edit things if I run it again - phew.

I've pushed a branch to github for your reviewing pleasure:
https://github.com/mhagander/pgadmin3/compare/master...reindent


It's going to cause merge conflicts like hell. but it's going to do
that whenever we run it. So should we just go ahead and run it?


-- 
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

Responses

pgadmin-hackers by date

Next:From: Dave PageDate: 2010-12-29 17:44:24
Subject: Re: Source reindenting
Previous:From: Nail SamatovDate: 2010-12-29 16:47:20
Subject: Re: fix: cannot build wxWidgets if sources are located at another disk

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group