Thread: exclude tmp_check and tmp_install from pgindent
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
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
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
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
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
Attachment
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
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