blob: 3610d46a93f2cb110e60df5dcfcf69a32a5315a8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
This can format all PostgreSQL *.c and *.h files, but excludes *.y, and *.l
files.
To use it, first get the list of typedef's to be included in pgindent by
running this on the pgsql/bin and pgsql/lib directories:
src/tools/find_typedef /usr/local/pgsql/bin /usr/local/pgsql/lib
and update the list in pgindent. This requires the binaries have debug
symbols.
From the top directory, run:
find . -name '*.[ch]' -type f -print |
egrep -v '/s_lock.h|/ecpg/test/expected/|/snowball/libstemmer/' |
xargs -n100 pgindent
We have standardized on NetBSD's indent. We have fixed a few bugs which
requre the NetBSD source to be patched with indent.bsd.patch patch. A
fully patched version is available at ftp://ftp.postgresql.org/pub/dev.
GNU indent, version 2.2.6, has several problems, and is not recommended.
These bugs become pretty major when you are doing >500k lines of code.
If you don't believe me, take a directory and make a copy. Run pgindent
on the copy using GNU indent, and do a diff -r. You will see what I
mean. GNU indent does some things better, but mangles too.
Notes about excluded files:
src/include/storage/s_lock.h is excluded because it contains assembly code
that pgindent tends to mess up.
src/interfaces/ecpg/test/expected/ is excluded to avoid breaking the ecpg
regression tests.
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.
|