diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/pgindent/README | 30 | ||||
-rw-r--r-- | src/tools/pgindent/exclude_file_patterns | 42 | ||||
-rwxr-xr-x | src/tools/pgindent/pgindent | 1 |
3 files changed, 39 insertions, 34 deletions
diff --git a/src/tools/pgindent/README b/src/tools/pgindent/README index 9b16b0ed504..56f07c7ee4c 100644 --- a/src/tools/pgindent/README +++ b/src/tools/pgindent/README @@ -138,33 +138,11 @@ Which files are processed The pgindent run processes (nearly) all PostgreSQL *.c and *.h files, but we currently exclude *.y and *.l files, as well as *.c and *.h files derived from *.y and *.l files. Additional exceptions are listed -in exclude_file_patterns: - -src/include/storage/s_lock.h and src/include/port/atomics/ are excluded -because they contain assembly code that pgindent tends to mess up. - -src/backend/utils/fmgrtab.c is excluded because it confuses pgindent -and it's a derived file anyway. - -src/interfaces/ecpg/test/expected/ is excluded to avoid breaking the ecpg -regression tests, since what ecpg generates is not necessarily formatted -as pgindent would do it. (Note that we do not exclude ecpg's header files -from the run; some of them get copied verbatim into ecpg's output, meaning -that the expected files may need to be updated to match.) - -src/include/snowball/libstemmer/ and src/backend/snowball/libstemmer/ -are excluded because those files are imported from an external project, -not maintained locally, and are machine-generated anyway. Likewise for -plperl/ppport.h. - -src/include/jit/llvmjit.h is excluded because it contains C++ constructs -that confuse pgindent. - -src/backend/utils/probes.h and its alias src/include/utils/probes.h -are excluded because that file is machine-generated by code not under -our control, and some versions of dtrace build files that confuse -pgindent. +in exclude_file_patterns; see the notes therein for rationale. +Note that we do not exclude ecpg's header files from the run. Some of them +get copied verbatim into ecpg's output, meaning that ecpg's expected files +may need to be updated to match. The perltidy run processes all *.pl and *.pm files, plus a few executable Perl scripts that are not named that way. See the "find" diff --git a/src/tools/pgindent/exclude_file_patterns b/src/tools/pgindent/exclude_file_patterns index a8f1a92f4b3..b2e9d8f6547 100644 --- a/src/tools/pgindent/exclude_file_patterns +++ b/src/tools/pgindent/exclude_file_patterns @@ -1,11 +1,37 @@ -#list of file patterns to exclude from pgindent runs, see notes in README -/storage/s_lock\.h$ -/port/atomics/ -/utils/fmgrtab\.c$ -/ecpg/test/expected/ +# List of filename patterns to exclude from pgindent runs +# +# These contain assembly code that pgindent tends to mess up. +src/include/storage/s_lock\.h$ +src/include/port/atomics/ +# +# This contains C++ constructs that confuse pgindent. +src/include/jit/llvmjit\.h$ +# +# This confuses pgindent, and it's a derived file anyway. +src/backend/utils/fmgrtab\.c$ +# +# kwlist_d files are made by gen_keywordlist.pl. While we could insist that +# they match pgindent style, they'd look worse not better, so exclude them. +kwlist_d\.h$ +# +# Exclude ecpg test files to avoid breaking the ecpg regression tests +# (but include files at the top level of the ecpg/test/ directory). +src/interfaces/ecpg/test/.*/ +# +# src/include/snowball/libstemmer/ and src/backend/snowball/libstemmer/ +# are excluded because those files are imported from an external project, +# rather than maintained locally, and they are machine-generated anyway. /snowball/libstemmer/ -/pl/plperl/ppport\.h$ -/jit/llvmjit\.h$ -/utils/probes\.h$ +# +# These files are machine-generated by code not under our control, +# so we shouldn't expect them to conform to our style. +# (Some versions of dtrace build probes.h files that confuse pgindent, too.) +src/backend/utils/probes\.h$ +src/include/pg_config\.h$ +src/pl/plperl/ppport\.h$ +src/pl/plperl/SPI\.c$ +src/pl/plperl/Util\.c$ +# +# Exclude any temporary installations that may be in the tree. /tmp_check/ /tmp_install/ diff --git a/src/tools/pgindent/pgindent b/src/tools/pgindent/pgindent index 457e3288248..4124d27dea6 100755 --- a/src/tools/pgindent/pgindent +++ b/src/tools/pgindent/pgindent @@ -159,6 +159,7 @@ sub process_exclude while (my $line = <$eh>) { chomp $line; + next if $line =~ m/^#/; my $rgx = qr!$line!; @files = grep { $_ !~ /$rgx/ } @files if $rgx; } |