exclude tmp_check and tmp_install from pgindent

Started by Peter Eisentrautover 7 years ago6 messages
#1Peter Eisentraut
peter.eisentraut@2ndquadrant.com

pgindent spends a long time digging through tmp_check and tmp_install
directories and ends up re-indenting installed header files. How about
excluding those directories, like below or directly in the script?

diff --git a/src/tools/pgindent/exclude_file_patterns
b/src/tools/pgindent/exclude_file_patterns
index 65c42c131d..c8efc9a913 100644
--- a/src/tools/pgindent/exclude_file_patterns
+++ b/src/tools/pgindent/exclude_file_patterns
@@ -6,3 +6,5 @@
 /snowball/libstemmer/
 /pl/plperl/ppport\.h$
 /jit/llvmjit\.h$
+/tmp_check/
+/tmp_install/

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

#2Andrew Dunstan
andrew.dunstan@2ndquadrant.com
In reply to: Peter Eisentraut (#1)
Re: exclude tmp_check and tmp_install from pgindent

On 10/08/2018 05:49 AM, Peter Eisentraut wrote:

pgindent spends a long time digging through tmp_check and tmp_install
directories and ends up re-indenting installed header files. How about
excluding those directories, like below or directly in the script?

diff --git a/src/tools/pgindent/exclude_file_patterns
b/src/tools/pgindent/exclude_file_patterns
index 65c42c131d..c8efc9a913 100644
--- a/src/tools/pgindent/exclude_file_patterns
+++ b/src/tools/pgindent/exclude_file_patterns
@@ -6,3 +6,5 @@
/snowball/libstemmer/
/pl/plperl/ppport\.h$
/jit/llvmjit\.h$
+/tmp_check/
+/tmp_install/

Seems reasonable - I tend to do vpath builds so this hasn't been a
problem for me ;-)

I wonder if a more general solution might be a good idea. Say like
ignoring everything pointed to by

    git status --porcelain --ignored

with a status of '??' (untracked) or '!!' (ignored).

cheers

andrew

--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

#3Michael Paquier
michael@paquier.xyz
In reply to: Andrew Dunstan (#2)
Re: exclude tmp_check and tmp_install from pgindent

On Mon, Oct 08, 2018 at 08:33:38AM -0400, Andrew Dunstan wrote:

Seems reasonable - I tend to do vpath builds so this hasn't been a problem
for me ;-)

+1.

I wonder if a more general solution might be a good idea. Say like ignoring
everything pointed to by

    git status --porcelain --ignored

with a status of '??' (untracked) or '!!' (ignored).

I had exactly the same thought, but with "git ls-files". There are
still some files which should not be indented, like ppport.h which is
generated automatically still part of the tree.
--
Michael

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#2)
Re: exclude tmp_check and tmp_install from pgindent

Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes:

On 10/08/2018 05:49 AM, Peter Eisentraut wrote:

pgindent spends a long time digging through tmp_check and tmp_install
directories and ends up re-indenting installed header files. How about
excluding those directories, like below or directly in the script?

I wonder if a more general solution might be a good idea. Say like
ignoring everything pointed to by
    git status --porcelain --ignored

Peter's idea sounds better to me. We don't have that many derived .c
or .h files, so I doubt the "git status" calls would pay for themselves.

(Personally, I don't run pgindent in non-cleaned trees ...)

regards, tom lane

#5Andrew Dunstan
andrew.dunstan@2ndquadrant.com
In reply to: Michael Paquier (#3)
Re: exclude tmp_check and tmp_install from pgindent

On 10/08/2018 09:13 AM, Michael Paquier wrote:

On Mon, Oct 08, 2018 at 08:33:38AM -0400, Andrew Dunstan wrote:

Seems reasonable - I tend to do vpath builds so this hasn't been a problem
for me ;-)

+1.

I wonder if a more general solution might be a good idea. Say like ignoring
everything pointed to by

��� git status --porcelain --ignored

with a status of '??' (untracked) or '!!' (ignored).

I had exactly the same thought, but with "git ls-files". There are
still some files which should not be indented, like ppport.h which is
generated automatically still part of the tree.

That's already explicitly excluded.

cheers

andrew

--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#5)
Re: exclude tmp_check and tmp_install from pgindent

Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes:

On 10/08/2018 09:13 AM, Michael Paquier wrote:

I had exactly the same thought, but with "git ls-files". There are
still some files which should not be indented, like ppport.h which is
generated automatically still part of the tree.

That's already explicitly excluded.

Yeah. Doing this might allow us to simplify pgindent's explicit
blacklist, but I doubt it'd net out to a win speed-wise.

regards, tom lane