Re: WIP pgindent replacement

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: WIP pgindent replacement
Дата
Msg-id 20120804164304.GD29773@momjian.us
обсуждение исходный текст
Ответ на Re: WIP pgindent replacement  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
On Fri, Aug  3, 2012 at 02:53:08PM -0400, Bruce Momjian wrote:
> On Fri, Aug  3, 2012 at 02:08:34PM -0400, Andrew Dunstan wrote:
> > >$ find . -type f -exec file {} \;|
> > >    egrep -i 'perl.*(script|module)'|grep -v '\.p[lm]:'
> > >
> > >and got:
> > >
> > >./src/pl/plperl/ppport.h: awk script text
> > >./src/tools/pginclude/pgcheckdefines: a /usr/bin/perl -w script text executable
> > >./src/tools/git_changelog: a /usr/bin/perl script text executable
> > >
> > >The last two are Perl scripts without Perl file extensions, so let's
> > >just go with 'pgindent' and I will hard-code those into the perltidy
> > >instructions.
> > >
> > 
> > 
> > 
> > Your pattern has produced a false positive, though. Wouldn't it be
> > better not to hardcode anything?
> 
> You mean use an actual 'grep' to find the Perl programs --- I can do
> that.

OK, pgindent replaced by Perl version.  I had to go with both a file
extension check and 'file' output check because some Perl scripts only
match one category;  checks are:
       (               find . -name \*.pl -o -name \*.pm
               find . -type f -exec file {} \; |               egrep -i ':.*perl[0-9]*\>' |               cut -d: -f1
   ) |       sort -u |       xargs perltidy --profile=src/tools/pgindent/perltidyrc
 

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + It's impossible for everything to be true. +


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Issue in Behavior of Interval Datatype
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: cataloguing NOT NULL constraints