Skip to content

Commit 68cc61e

Browse files
author
David Saff
committed
Merge pull request #502 from awulder/issue-426
issue #426 Description of the coding style
2 parents 0f9517b + 2ac2500 commit 68cc61e

File tree

1 file changed

+132
-0
lines changed

1 file changed

+132
-0
lines changed

CODING_STYLE

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
==================================
2+
Coding style
3+
==================================
4+
5+
----------------------------------
6+
Tabs and Indents
7+
----------------------------------
8+
* Tab size : 4
9+
* Indent : 4
10+
* Continuation indent : 8
11+
* Label indent : 0
12+
13+
> Don't use tab characters.
14+
15+
----------------------------------
16+
Spaces
17+
----------------------------------
18+
Before Parentheses
19+
* if parentheses
20+
* for parentheses
21+
* while parentheses
22+
* switch parentheses
23+
* try parentheses
24+
* catch parentheses
25+
* synchronized parentheses
26+
27+
Around Operators
28+
* Assignment operators (=, +=, …)
29+
* Logical operators (&&, ||)
30+
* Equality operators (==, !=)
31+
* Relational operators (<, >, <=, >=)
32+
* Bitwise operators (&, |, ^)
33+
* Additive operators (+, -)
34+
* Multiplicative operators (*, /, %)
35+
* Shift operators (<<, >>, >>>)
36+
37+
Before Left Brace
38+
* Class left brace
39+
* Method left brace
40+
* if left brace
41+
* else left brace
42+
* for left brace
43+
* while left brace
44+
* do left brace
45+
* switch left brace
46+
* try left brace
47+
* catch left brace
48+
* finally left brace
49+
* synchronized left brace
50+
51+
Before Keywords
52+
* else keyword
53+
* while keyword
54+
* catch keyword
55+
* finally keyword
56+
57+
In Ternary Operator (?:)
58+
* Before ?
59+
* After ?
60+
* Before :
61+
* After :
62+
63+
Within Type Arguments
64+
* After comma
65+
66+
Other
67+
* After comma
68+
* After semicolon
69+
* After type cast
70+
71+
----------------------------------
72+
Wrapping and Braces
73+
----------------------------------
74+
Braces placement
75+
* In class declaration : End of line
76+
* In method declaration : End of line
77+
* Other : End of line
78+
79+
Use Of Braces
80+
* if() statement : When multiline
81+
* for() statement : When multiline
82+
* while() statement : When multiline
83+
* do .. while() statement : When multiline
84+
85+
Annotations
86+
* Class annotations : Wrap always
87+
* Method annotations : Wrap always
88+
* Field annotations : Wrap always
89+
* Paramater annotations : Do not wrap
90+
* Local variable annotations : Do not wrap
91+
92+
----------------------------------
93+
Blank Lines
94+
----------------------------------
95+
Minimum Blank Lines
96+
* Before package statement : 0
97+
* After package statement : 1
98+
* Before imports : 1
99+
* After imports : 1
100+
* Around class : 1
101+
* After class header : 0
102+
* After anonymous class header : 0
103+
* Around field in interface : 0
104+
* Around field : 0
105+
* Around method in interface : 1
106+
* Around method : 1
107+
* Before method body : 0
108+
109+
----------------------------------
110+
JavaDoc
111+
----------------------------------
112+
Alignment
113+
* Align thrown exception descriptions
114+
115+
Blank Lines
116+
* After description
117+
118+
Other
119+
* Enable leading asterisks
120+
* Use @throws rather than @exception
121+
* Keep empty lines
122+
123+
----------------------------------
124+
Imports
125+
----------------------------------
126+
import static (all other imports)
127+
<blank line>
128+
import java.*
129+
import javax.*
130+
import com.*
131+
<blank line>
132+
import (all other imports)

0 commit comments

Comments
 (0)