-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy path.astylerc
83 lines (65 loc) · 1.27 KB
/
.astylerc
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# This astylerc tries to follow BARR-C:2018
# Section 1.
# 1.2 - Line Widths
# 90 chars to fit github gist embedded in medium -- BARR-C:2018 recommends 80, deviation.
--max-code-length=90
# 1.3 - Braces
# foo
# {
# bar();
# }
--style=break
# Deviation - attach closing while -- BARR-C:2018 does not define exceptions.
# do
# {
# foo();
# } while(bar());
--attach-closing-while
# Deviation - attach extern "C" -- BARR-C:2018 does not define exceptions.
# extern "C" {
--attach-extern-c
# 3 - White Space Rules
# 3.1 - Spaces
# if (bar * baz == foo)
--pad-oper
--pad-paren-out
# char * foo
--align-pointer=middle
# remove space not requested above, i.e. bar ( baz, foo ) => bar (baz, foo)
--unpad-paren
# 3.3 - Blank lines
# Remove extra lines
--delete-empty-lines
# if(foo)
# {
# bar();
# baz();
# }
--add-one-line-braces
# baz = 1;
#
# if(foo)
# {
# bar = 2;
# }
# else
# {
# bar = 1;
# }
#
# foo = bar + baz;
--break-blocks
# End lines with LF
--lineend=linux
# Indent by 4 spaces
--indent=spaces=4
--convert-tabs
# Desired indentation for preprocessor cannot be implemented with AStyle as of 2019Q4
# while(foo)
# {
# // Bar baz
# bar(baz);
# }
# Indend switch-cases and comments
--indent-switches
--indent-col1-comments