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

Re: Coding standards

From: Chris Browne <cbbrowne(at)acm(dot)org>
To: pgsql-patches(at)postgresql(dot)org
Subject: Re: Coding standards
Date: 2008-04-18 15:46:07
Message-ID: 607ievqi80.fsf@dba2.int.libertyrms.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
bryce2(at)obviously(dot)com (Bryce Nesbitt) writes:
> Alvaro Herrera wrote:
>> People [are] complaining here that we don't teach people here anyway, so
>> hopefully my comments were still useful :-)
>>
> Yes they are useful.  As a new patcher, where should I look for coding
> standards?  How about a little FAQ at the
> top of the CVS source tree?
>
> Though, darn it, I sure like //
>
> And my vi is set to:
>  set sw=4
>  set ts=4
>  set expandtab
> Because my corporate projects require spaces not tabs.

Note that you can find config for vim and emacs to get them to support the coding standards in:

/opt/src/pgsql-HEAD/src/tools/editors/emacs.samples
/opt/src/pgsql-HEAD/src/tools/editors/vim.samples

For vim, the essentials are thus:

:if match(getcwd(), "/pgsql") >=0 ||  match(getcwd(), "/postgresql") >= 0
:  set cinoptions=(0
:  set tabstop=4
:  set shiftwidth=4
:endif

The hooks are slightly different (though not by spectacularly much,
somewhat surprisingly) for Emacs...
-- 
let name="cbbrowne" and tld="cbbrowne.com" in name ^ "@" ^ tld;;
http://cbbrowne.com/info/advocacy.html
"A language that doesn't affect the way you think about programming,
is not worth knowing."  -- Alan J. Perlis

In response to

pgsql-hackers by date

Next:From: Gregory StarkDate: 2008-04-18 16:21:26
Subject: Re: Proposed patch - psql wraps at window width
Previous:From: Bruce MomjianDate: 2008-04-18 15:45:03
Subject: Re: Lessons from commit fest

pgsql-patches by date

Next:From: Gregory StarkDate: 2008-04-18 16:21:26
Subject: Re: Proposed patch - psql wraps at window width
Previous:From: Alvaro HerreraDate: 2008-04-18 15:27:11
Subject: Re: Coding standards

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