Re: Keyword list sanity check - Mailing list pgsql-hackers

From David Fetter
Subject Re: Keyword list sanity check
Date
Msg-id 20090430072745.GL31039@fetter.org
Whole thread Raw
In response to Keyword list sanity check  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Keyword list sanity check  (Andy Lester <andy@petdance.com>)
Re: Keyword list sanity check  (Robert Haas <robertmhaas@gmail.com>)
Re: Keyword list sanity check  (Bruce Momjian <bruce@momjian.us>)
Re: Keyword list sanity check  (Peter Eisentraut <peter_e@gmx.net>)
Re: Keyword list sanity check  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
On Tue, Apr 28, 2009 at 11:33:28AM +0300, Heikki Linnakangas wrote:
> I wrote a little perl script to perform a basic sanity check to
> keywords  in gram.y and kwlist.h. It checks that all lists are in
> alphabetical  order, all keywords present in gram.y are listed in
> kwlist.h in the  right category, and conversely that all keywords
> listed in kwlist.h are  listed in gram.y.
>
> It found one minor issue already:
>
> $ perl src/tools/check_keywords.pl 'SCHEMA' after 'SERVER' in
> unreserved_keyword list is misplaced
>
> SERVER is not in the right place in gram.y, it should go between
> SERIALIZABLE and SERVER. I'll fix that.
>
> I'll put this into src/tools. It's heavily dependent on the format
> of  the lists in gram.y and kwlist.h but if it bitrots due to
> changes in  those files, we can either fix it or just remove it if
> it's not deemed  useful anymore.

Please clean up this code at least to the point where it's
strict-clean, which means putting "use strict;" right after the
shebang line and not checking it in until it runs that way.

I tried, but couldn't make heads or tails of the thing, given all the
unused- and similarly-named variables, failure to indent, etc.  I
don't know how to put this gently, but if you checked in C code with
quality like this, you'd have it bounced with derision.

I'd also like to propose that "strict clean" be a minimum code quality
metric for any Perl code in our code base.  A lot of what's in there
is just about impossible to maintain.

Cheers,
David.
-- 
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: Throw some low-level C scutwork at me
Next
From: Andy Lester
Date:
Subject: Re: Keyword list sanity check