forked from opencollab/flexdock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_style.xml
88 lines (88 loc) · 5.7 KB
/
check_style.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
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<!--keep the file in project root although NetBeans 8.0.2 doesn't find it there and allow to add additional project files (don't skip a proper project structure in favour of IDE deficies)-->
<module name="Checker">
<!-- Following interprets the header file as regular expressions. -->
<!-- Due to the fact that checkstyle only seems to be able to (re)use text from a license file if no text stands before the header in the source code and the fact that variable text is used in the header (package name), use the `RegexpHeader` module to validate the headers -->
<!--<module name="RegexpHeader">
<property
name="header"
value="^/\*\n \* Permission is hereby granted, free of charge, to any person obtaining a copy\n \* of this software and associated documentation files \(the "Software"\), to deal\n \* in the Software without restriction, including without limitation the rights\n \* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n \* copies of the Software, and to permit persons to whom the Software is\n \* furnished to do so, subject to the following conditions:\n \*\n \* The above copyright notice and this permission notice shall be included in\n \* all copies or substantial portions of the Software.\n \*\n \* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n \* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n \* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n \* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n \* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n \* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n \* SOFTWARE.\n \*/\n"/>
<property name="fileExtensions" value="java"/>
</module>-->
<!-- Header check has to be left out because of multiple copyleft protected contributions (e.g. `org.flexdock.demos.maximizing.SimpleInternalFrame`) and the ridiculous incapacity of `maven-checkstyle-plugin` to process different regex headers (see http://stackoverflow.com/questions/33266679/how-to-specify-an-optional-regex-group-with-a-newline-character-in-checkstyles for details) -->
<!-- Checks that there are no tab characters ('\t') in the source code. -->
<module name="FileTabCharacter">
<!-- Report on each line in each file -->
<property name="eachLine" value="true"/>
</module>
<module name="TreeWalker">
<!-- No EOL should be placed before block start ('{') -->
<module name="LeftCurly">
<property name="option" value="eol"/>
<property name="severity" value="error"/>
</module>
<!-- '}' rules -->
<module name="RightCurly">
<!-- '}' should be on the same line as a next statement -->
<property name="option" value="same"/>
<property name="severity" value="error"/>
</module>
<!-- Braces are mandatory around code blocks -->
<module name="NeedBraces">
<property name="severity" value="error"/>
</module>
<!-- Checks the Javadoc of a method or constructor. -->
<module name="JavadocMethod">
<property name="scope" value="public"/>
<property name="severity" value="warning"/>
</module>
<!-- Checks Javadoc comments for class and interface definitions. -->
<module name="JavadocType">
<property name="scope" value="public"/>
<property name="severity" value="warning"/>
</module>
<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sourceforge.net/config_naming.html -->
<!-- Sun Naming Conventions -->
<module name="ConstantName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/>
<!-- Checks correct indentation of Java Code. -->
<module name="Indentation">
<!-- how many spaces to use for new indentation level -->
<property name="basicOffset" value="4" />
<!-- how far brace should be indented when on next line -->
<property name="braceAdjustment" value="0"/>
<!-- how much to indent a case label -->
<property name="caseIndent" value="4"/>
</module>
<!-- Specify method parameters code conventions -->
<!--<module name="MethodParamPad">
Whitespace is required after method name
<property name="option" value="space" />
Check only methods and constructors declarations
<property name="tokens" value="METHOD_DEF, CTOR_DEF" />
</module> -->
<!-- Checks the policy on the padding of parentheses; i.e. whether a space is required after a left parenthesis and before a
right parenthesis, or such spaces are forbidden. -->
<!--<module name="ParenPad">
Whitespace required before ')' and after ')'
<property name="option" value="space"/>
</module> -->
<module name="Regexp">
<property name="format" value="[ \t]+$"/>
<property name="illegalPattern" value="true"/>
<property name="message" value="Trailing whitespace"/>
</module>
<module name="UnusedImports"/>
</module>
</module>