1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-10 09:21:54 +03:00
postgres/src/tools/pgindent/exclude_file_patterns
Peter Eisentraut 964d01ae90 Automatically generate node support functions
Add a script to automatically generate the node support functions
(copy, equal, out, and read, as well as the node tags enum) from the
struct definitions.

For each of the four node support files, it creates two include files,
e.g., copyfuncs.funcs.c and copyfuncs.switch.c, to include in the main
file.  All the scaffolding of the main file stays in place.

I have tried to mostly make the coverage of the output match what is
currently there.  For example, one could now do out/read coverage of
utility statement nodes, but I have manually excluded those for now.
The reason is mainly that it's easier to diff the before and after,
and adding a bunch of stuff like this might require a separate
analysis and review.

Subtyping (TidScan -> Scan) is supported.

For the hard cases, you can just write a manual function and exclude
generating one.  For the not so hard cases, there is a way of
annotating struct fields to get special behaviors.  For example,
pg_node_attr(equal_ignore) has the field ignored in equal functions.

(In this patch, I have only ifdef'ed out the code to could be removed,
mainly so that it won't constantly have merge conflicts.  It will be
deleted in a separate patch.  All the code comments that are worth
keeping from those sections have already been moved to the header
files where the structs are defined.)

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/c1097590-a6a4-486a-64b1-e1f9cc0533ce%40enterprisedb.com
2022-07-09 08:53:59 +02:00

55 lines
1.9 KiB
Plaintext

# 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$
#
# These are generated files with incomplete code fragments that
# confuse pgindent.
src/backend/nodes/\w+\.funcs\.c$
src/backend/nodes/\w+\.switch\.c$
#
# This confuses pgindent, and it's a derived file anyway.
src/backend/utils/fmgrtab\.c$
#
# pgindent might mangle entries in this that match typedef names.
# Since it's a derived file anyway, just exclude it.
src/backend/utils/fmgrprotos\.h$
#
# 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$
#
# These are generated by the scripts from src/common/unicode/. They use
# hash functions generated by PerfectHash.pm whose format looks worse with
# pgindent.
src/include/common/unicode_norm_hashfunc\.h$
src/include/common/unicode_normprops_table\.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/
#
# 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/
# ... and for paranoia's sake, don't touch git stuff.
/\.git/