pgindent to ignore build directories - Mailing list pgsql-hackers

From Peter Eisentraut
Subject pgindent to ignore build directories
Date
Msg-id fc77b35a-34c4-4229-82f1-8cf0ce67f276@eisentraut.org
Whole thread
Responses Re: pgindent to ignore build directories
List pgsql-hackers
A problem I'm having is that if I'm having a build directory inside the 
source tree

     meson setup build

(as is documented) and then run pgindent

     src/tools/pgindent/pgindent .

it descends into the build directory and then chokes on various files in 
there.  (exclude_file_patterns doesn't help because those patterns are 
applied relative to the source directory.)

A subproblem is that if pgindent fails on many files, it doesn't clean 
up after itself but leaves many pgsrc*.BAK files lying around.  The 
first patch fixes that.

Then, my first idea was to add an option to pgindent to exclude 
directories from being processed.  Like

     src/tools/pgindent/pgindent . --exclude-dir=build

The second patch implements that.

But then I had the idea that we could recognize build directories 
automatically by checking what files they contain.  The third patch 
implements that.  That way, my initial pgindent invocation above works 
out of the box and I don't have to remember to enumerate the build 
directories on the command line.

(So the second patch is maybe obsolete, but the third one builds on it, 
so I left it in here for discussion.  People seem to have a variety of 
workflows, so let's see what everyone wants.)

Attachment

pgsql-hackers by date:

Previous
From: Manu
Date:
Subject: Re: ERROR: failed to find conversion function from iso-8859-1 to text
Next
From: Trakshan Mishra
Date:
Subject: Re: Request to expedite commitfest account cool-off