Skip to content

Commit e8d2f01

Browse files
committed
Formatting code style
1 parent 887ef2e commit e8d2f01

File tree

4 files changed

+501
-497
lines changed

4 files changed

+501
-497
lines changed

.astylerc

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# astylerc
2+
align-pointer=name
3+
align-reference=name
4+
break-after-logical
5+
#indent=spaces=2
6+
max-code-length=120
7+
style=google
8+
suffix=none
9+
10+
# Indent
11+
indent-preproc-block
12+
13+
# Padding
14+
pad-header
15+
unpad-paren
16+
17+
# Formatting:
18+
add-brackets
19+
#convert-tabs
20+
21+
# Output:
22+
formatted

.format.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
# Search in the script folder
4+
pushd "$(dirname $0)" >/dev/null
5+
CWD="$(pwd -P)"
6+
popd >/dev/null
7+
FILES='ngx_http_upstream_check_module.c ngx_http_upstream_check_module.h'
8+
9+
# The file format in accordance with the style defined in .astylerc
10+
astyle -v --options='.astylerc' ${FILES} || (echo 'astyle failed'; exit 1);
11+
12+
# To correct this, the issuance dos2unix on each file
13+
# sometimes adds in Windows as a string-endins (\r\n).
14+
dos2unix --quiet ${FILES} || (echo 'dos2unix failed'; exit 2);
15+

0 commit comments

Comments
 (0)