[arch-dev-public] Let's agree on a common coding style

Pierre Schmitz pierre at archlinux.de
Sat Feb 13 10:32:24 EST 2010

Hi all,

while looking at our devtools, other scripts we have written together and even 
PKGBUILDs, you will see as much different types of indention, bracing etc. as 
there are authors.

This always annoyed me and as I just watched Greg's talk at fosdem about 
committing kernel patches I'll go ahead and will start with devtools.

I would suggest to use this coding style:

* indent with tabs
* tabs have 8 characters
* don't use more than 132 columns
* opening braces are top right, closing are bottom left:

function foo() {
	echo bar

* if and for statements are like this:

if true; then
	do something
	do something else

for i in a b c; do
	echo $i

* use single quotes if a string does not parseable content

We could also talk about using `` or $(); source vs. .; $foo vs. ${bar} etc.. 
But that's probably too much.




Pierre Schmitz, https://users.archlinux.de/~pierre

More information about the arch-dev-public mailing list