Skip to content

Commit c0f824b

Browse files
authored
Add "pgindent" rule for make to run pgindent (#71)
Add "pgindent" rule for make to run pgindent
1 parent 516fe64 commit c0f824b

File tree

3 files changed

+264
-1
lines changed

3 files changed

+264
-1
lines changed

Diff for: Makefile

+27-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ include Makefile.common.mk
33

44
RELEASE_SQL = $(EXTENSION)--$(PGSPHERE_VERSION).sql
55
USE_PGXS = 1
6-
USE_HEALPIX =? 1
6+
USE_HEALPIX ?= 1
7+
PGINDENT ?= pgindent
8+
PGBSDINDENT ?= pg_bsd_indent
79

810
# the base dir name may be changed depending on git clone command
911
SRC_DIR = $(shell basename $(shell pwd))
@@ -223,3 +225,27 @@ endif
223225
dist : clean sparse.c sscan.c
224226
find . -name '*~' -type f -exec rm {} \;
225227
cd .. && tar --transform s/$(SRC_DIR)/pgsphere-$(PGSPHERE_VERSION)/ --exclude CVS --exclude .git -czf pgsphere-$(PGSPHERE_VERSION).tar.gz $(SRC_DIR) && cd -
228+
229+
# To use pgindent, set the PATH environment variable to include the directories
230+
# containing the binaries pgindent and pg_bsd_indent. It is important to
231+
# utilize a specific version of pg_bsd_indent, which sources can be found
232+
# in the <postgresql>/src/tools/pg_bsd_indent directory, where <postgresql>
233+
# is the root directory of the PostgreSQL project source tree.
234+
#
235+
# The sources of the utilities can be found in the following directories:
236+
# - <postgresql>/src/tools/pgindent
237+
# - <postgresql>/src/tools/pg_bsd_indent
238+
#
239+
# pgindent-typedefs.list should be updated every time after implementing
240+
# new types and introducing new typedefs in the code. For details how
241+
# to update pgindent-typedefs.list and for other information about pgindent,
242+
# please, read the doc: <postgresql>/src/tools/pgindent/README.
243+
#
244+
# pgindent-excludes.list is used to specify files to be ignored.
245+
#
246+
pgindent:
247+
$(PGINDENT) \
248+
--typedefs=pgindent-typedefs.list \
249+
--excludes=pgindent-excludes.list \
250+
--indent=${PGBSDINDENT} \
251+
src

Diff for: pgindent-excludes.list

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pgs_process_moc.h

Diff for: pgindent-typedefs.list

+236
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
align_val_t
2+
allocator_type
3+
__alloc_rebind
4+
ArrayType
5+
AttrDefault
6+
AttrNumber
7+
_Base_ptr
8+
BlockNumber
9+
Box3D
10+
BpChar
11+
bpoint
12+
BrinDesc
13+
BrinOpcInfo
14+
brin_serialize_callback_type
15+
BrinValues
16+
__builtin_va_list
17+
_Char_alloc_type
18+
char_type
19+
CommonEntry
20+
__compar_fn_t
21+
ConsiderSplitContext
22+
_Const_Base_ptr
23+
__const_iterator
24+
const_iterator
25+
_Const_Link_type
26+
const_pointer
27+
ConstrCheck
28+
const_reference
29+
const_reverse_iterator
30+
const_void_pointer
31+
coord_t
32+
CPoint
33+
Datum
34+
difference_type
35+
_DistanceType
36+
div_t
37+
DomainConstraintCache
38+
double_t
39+
__dso_handle
40+
__enable_if_t
41+
false>
42+
false_type
43+
__FILE
44+
FILE
45+
first_type
46+
flex_int16_t
47+
flex_uint8_t
48+
float4
49+
float8
50+
float_t
51+
FmgrInfo
52+
fmNodePtr
53+
FormData_pg_attribute
54+
__fpos_t
55+
fpos_t
56+
FunctionCallInfo
57+
GISTENTRY
58+
GistEntryVector
59+
GISTPageOpaque
60+
GISTPageOpaqueData
61+
GIST_SPLITVEC
62+
GiSTSPointKey
63+
__gnuc_va_list
64+
Healpix_Base2
65+
hpint64
66+
insert_return_type
67+
int16
68+
__int16_t
69+
int16_t
70+
int32
71+
__int32_t
72+
int32_t
73+
int64
74+
__int64_t
75+
int64_t
76+
int8
77+
__int8_t
78+
int8_t
79+
int_fast16_t
80+
int_fast32_t
81+
int_fast64_t
82+
int_fast8_t
83+
__int_least16_t
84+
int_least16_t
85+
__int_least32_t
86+
int_least32_t
87+
__int_least64_t
88+
int_least64_t
89+
__int_least8_t
90+
int_least8_t
91+
__intmax_t
92+
intmax_t
93+
intptr_t
94+
int_type
95+
_IO_lock_t
96+
iostate
97+
ItemIdData
98+
iterator
99+
iterator_category
100+
iterator_type
101+
key_compare
102+
key_type
103+
layout_vec
104+
ldiv_t
105+
_Link_type
106+
lldiv_t
107+
LocationIndex
108+
__make_not_void
109+
map_const_iter
110+
map_iterator
111+
mapped_type
112+
map_rev_iter
113+
max_align_t
114+
__mbstate_t
115+
mbstate_t
116+
MemoryContext
117+
moc_interval
118+
moc_map
119+
moc_map_entry
120+
moc_out_data
121+
moc_tree_entry
122+
NameData
123+
_Node_allocator
124+
NodeTag
125+
node_type
126+
NullableDatum
127+
nullptr_t
128+
__off64_t
129+
OffsetNumber
130+
__off_t
131+
Oid
132+
ostream
133+
__ostream_type
134+
other
135+
output_map
136+
Page
137+
PageGistNSN
138+
PageHeader
139+
PageHeaderData
140+
PageXLogRecPtr
141+
Pg_finfo_record
142+
PGFunction
143+
Pg_magic_struct
144+
pgs_error_handler
145+
phasevec
146+
Point
147+
Point3D
148+
__pointer
149+
pointer
150+
Pointer
151+
ptrdiff_t
152+
__ptr_rebind
153+
rebind
154+
rebind_alloc
155+
reference
156+
Relation
157+
_Rep_type
158+
reverse_iterator
159+
rintv_iter
160+
rnode_iter
161+
rtype
162+
SBOX
163+
SCIRCLE
164+
second_type
165+
_Self
166+
SELLIPSE
167+
SEuler
168+
Size
169+
size_t
170+
size_type
171+
SLine
172+
Smoc
173+
SPATH
174+
SplitInterval
175+
SPoint
176+
SPOLY
177+
StrategyNumber
178+
streamsize
179+
string
180+
__sv_type
181+
t_ang
182+
tdiff
183+
text
184+
_Tp_alloc_type
185+
TransactionId
186+
true_type
187+
tsize
188+
TupleConstr
189+
TupleDesc
190+
__type
191+
type
192+
TypeCacheEntry
193+
uchar
194+
uint16
195+
__uint16_t
196+
uint16_t
197+
uint32
198+
__uint32_t
199+
uint32_t
200+
uint64
201+
__uint64_t
202+
uint64_t
203+
uint8
204+
__uint8_t
205+
uint8_t
206+
uint_fast16_t
207+
uint_fast32_t
208+
uint_fast64_t
209+
uint_fast8_t
210+
__uint_least16_t
211+
uint_least16_t
212+
__uint_least32_t
213+
uint_least32_t
214+
__uint_least64_t
215+
uint_least64_t
216+
__uint_least8_t
217+
uint_least8_t
218+
__uintmax_t
219+
uintmax_t
220+
uintptr_t
221+
va_list
222+
value_type
223+
varattrib_4b
224+
vec3
225+
Vector3D
226+
wctrans_t
227+
wctype_t
228+
wint_t
229+
YY_BUFFER_STATE
230+
YY_CHAR
231+
yy_size_t
232+
yy_state_type
233+
YYSTYPE
234+
yytype_int16
235+
yytype_int8
236+
yytype_uint8

0 commit comments

Comments
 (0)