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
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-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

Browse pgsql-hackers by date

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

Browse pgsql-patches by date

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