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

Re: Keyword list sanity check

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: David Fetter <david(at)fetter(dot)org>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Keyword list sanity check
Date: 2009-04-30 15:34:32
Message-ID: 200904301534.n3UFYXL11914@momjian.us (view raw or flat)
Thread:
Lists: pgsql-hackers
David Fetter wrote:
> 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.

Good suggestion;  I see this has been done:

	revision 1.2
	date: 2009/04/30 10:26:35;  author: heikki;  state: Exp;  lines: +24 -11
	Clean up check_keywords.pl script, making it 'strict' and removing a few
	leftover unused variables.
	
	Laurent Laborde

-- 
  Bruce Momjian  <bruce(at)momjian(dot)us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

In response to

pgsql-hackers by date

Next:From: Simon RiggsDate: 2009-04-30 16:33:35
Subject: Documenting bgwriter during recovery
Previous:From: Fujii MasaoDate: 2009-04-30 15:07:26
Subject: pg_resetxlog bug?

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