-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathastyle-header.ini
More file actions
110 lines (83 loc) · 2.49 KB
/
astyle-header.ini
File metadata and controls
110 lines (83 loc) · 2.49 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Quotation from Rust Style Guide:
# "Formatting code is a mostly mechanical task which takes both time and mental effort.
# By using an automatic formatting tool, a programmer is relieved of this task and can concentrate on more important things.
# Furthermore, by sticking to an established style guide (such as this one),
# programmers don't need to formulate ad hoc style rules,
# nor do they need to debate with other programmers what style rules should be used, saving time, communication overhead, and mental energy."
# Allman is more similar to the Quake 1+2 styles instead of Doom 3
--style=allman
#int Foo(bool isBar)
#{
# if (isBar)
# {
# bar();
# return 1;
# }
# else
# return 0;
#}
# Don't waste time typing lots of empty space and use tabs
--indent=tab=4
--indent=force-tab=4
# Indent macros within multiple level hierarchies
--indent-preproc-block
#ifdef _WIN32
#include <windows.h>
#ifndef NO_EXPORT
#define EXPORT
#endif
#endif
#becomes:
#ifdef _WIN32
#include <windows.h>
#ifndef NO_EXPORT
#define EXPORT
#endif
#endif
--indent-switches
--indent-col1-comments
# Insert space padding between a header (e.g. 'if', 'for', 'while'...) and the following paren.
#--pad-header
# Insert space padding around operators. This will also pad commas.
#if (foo==2)
# a=bar((b-c)*a,d--);
#becomes:
#if (foo == 2)
# a = bar((b - c) * a, d--);
--pad-oper
# Uncommon but introduced by id Software and I really like it:
# Insert space padding around paren on the inside only.
#if ( isFoo( a, b ) )
# bar( a, b );
--pad-paren-in
# BROKEN: Remove padding around square brackets on both the outside and the inside.
#--unpad-brackets
# Remove extra space padding around parens on the outside.
--unpad-paren
# Attach a pointer or reference operator (*, &, or ^) to the variable type
#char *foo1;
#char &foo2;
#becomes (with align-pointer=type):
#char* foo1;
#char& foo2;
--align-pointer=type
--align-reference=type
# Add braces to unbraced one line conditional statements (e.g. 'if', 'for', 'while'...).
#if (isFoo)
# isFoo = false;
#becomes:
#if (isFoo) {
# isFoo = false;
#}
# Braces are important and removing them is dangerous.
# See the 'Apple goto fail' critical security bug.
--add-braces
--max-code-length=200
#--break-after-logical
# Closes whitespace between the ending angle brackets of template definitions.
--close-templates
# No .orig Backups
--suffix=none
# Header specific for compact reading
# Don't break one-line blocks.
--keep-one-line-blocks