forked from typedb/typedb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkstyle.xml
114 lines (96 loc) · 3.81 KB
/
checkstyle.xml
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
109
110
111
112
113
114
<?xml version="1.0"?>
<!--
~ Grakn - A Distributed Semantic Database
~ Copyright (C) 2016-2018 Grakn Labs Limited
~
~ Grakn is free software: you can redistribute it and/or modify
~ it under the terms of the GNU Affero General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Grakn is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with Grakn. If not, see <http://www.gnu.org/licenses/gpl.txt>.
-->
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<!-- Use 4 spaces, not tabs -->
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
<!-- Make sure every source file has the license at the top -->
<module name="RegexpHeader">
<property name="headerFile" value="header.txt"/>
<property name="fileExtensions" value="java"/>
</module>
<module name="TreeWalker">
<!-- Java filename must match name of outer class -->
<module name="OuterTypeFilename"/>
<!-- Use \n, \b etc. instead of octal or unicode escape (e.g. \012) -->
<module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
<property name="format" value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
<property name="message" value="Avoid using corresponding octal or Unicode escape."/>
</module>
<!-- Disallow unicode escapes, except control or non-printable chars -->
<module name="AvoidEscapedUnicodeCharacters">
<property name="allowEscapesForControlCharacters" value="true"/>
<property name="allowByTailComment" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/>
</module>
<!-- Avoid wildcard star imports -->
<module name="AvoidStarImport"/>
<!-- Only one top-level class per file -->
<module name="OneTopLevelClass"/>
<!-- No line-wrapping on import and package statements, e.g.
```
import long.import.
.on.many.Lines;
```
-->
<module name="NoLineWrap"/>
<!-- No empty blocks allowed -->
<module name="EmptyBlock"/>
<!-- In some cases, empty blocks are allowed with a comment inside, e.g.
This is bad:
```
try {
doThing();
} catch (MyException ex) {}
```
This is fine:
```
try {
doThing();
} catch (MyException ex) {
// I'm ignoring this for a good reason, I promise!
}
```
-->
<module name="EmptyBlock">
<property name="option" value="text"/>
<property name="tokens" value="LITERAL_CATCH, LITERAL_CASE, LITERAL_DEFAULT, ARRAY_INIT"/>
</module>
<!-- No multi-line statements without braces, e.g.
```
if (youDoThis)
maven.willGetAngry();
```
-->
<module name="NeedBraces">
<property name="allowSingleLineStatement" value="true"/>
</module>
<!-- Allow only one statement per line -->
<module name="OneStatementPerLine"/>
<!-- Require JavaDoc on types (classes, interfaces, etc.) -->
<module name="JavadocType">
<property name="scope" value="public"/>
</module>
</module>
</module>