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: (view raw or whole thread)
Lists: pgadmin-hackers
I just did a testrun with astyle to reindent and restyle the code. I
created a rule in per:

diff --git a/ b/
index be6af45..8266f8d 100644
--- a/
+++ b/
@@ -65,3 +65,13 @@ endif
 # We need to ensure the help cache is world writeable
        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)
+       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:

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


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-2015 The PostgreSQL Global Development Group