-
Notifications
You must be signed in to change notification settings - Fork 3
/
android-checkstyle.xml
executable file
·138 lines (125 loc) · 5.46 KB
/
android-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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
~ SPDX-License-Identifier: Apache-2.0
-->
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<!-- Checkstyle rules for FLUID based on Android's coding guidelines. -->
<property name="severity" value="error"></property>
<module name="TreeWalker">
<property name="tabWidth" value="4"></property>
<!-- To get suppression comments working -->
<module name="FileContentsHolder"/>
<!-- Annotations -->
<module name="MissingDeprecated"/>
<module name="MissingOverride"/>
<module name="PackageAnnotation"/>
<!-- Block checks -->
<module name="EmptyBlock"/>
<module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="RightCurly"/>
<module name="AvoidNestedBlocks"/>
<!-- Class design -->
<module name="VisibilityModifier">
<property name="packageAllowed" value="true"/>
<property name="protectedAllowed" value="true"/>
</module>
<module name="FinalClass"/>
<module name="InterfaceIsType"/>
<module name="HideUtilityClassConstructor"/>
<module name="InnerTypeLast"/>
<!-- Coding -->
<module name="CovariantEquals"/>
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="FinalLocalVariable"/>
<module name="HiddenField"/>
<module name="InnerAssignment"/>
<module name="MagicNumber">
<property name="tokens" value="NUM_DOUBLE, NUM_FLOAT"/>
<property name="ignoreNumbers" value="-1, 0, 0.5, 1, 2"/>
<property name="ignoreAnnotation" value="true"/>
</module>
<module name="MissingSwitchDefault"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="NestedTryDepth"/>
<module name="NoFinalizer"/>
<module name="SuperClone"/>
<module name="IllegalCatch">
<property name="illegalClassNames" value="java.lang.Exception"></property>
</module>
<module name="IllegalThrows"/>
<module name="PackageDeclaration"/>
<module name="DeclarationOrder"/>
<module name="ParameterAssignment"/>
<module name="ExplicitInitialization"/>
<module name="DefaultComesLast"/>
<module name="MultipleVariableDeclarations"/>
<module name="UnnecessaryParentheses"/>
<module name="OneStatementPerLine"/>
<!-- Header TODO add copyright checks, could also do Regex -->
<!--<module name="RegexpHeader">
<property name="headerFile" value="amazon.header"/> this header needs to accound for java and xml
<property name="fileExtensions" value="xml, java"/>
</module> -->
<!-- Import -->
<module name="AvoidStarImport"/>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<module name="ImportOrder">
<property name="groups" value="android, amazon, java"/>
<property name="ordered" value="true"/>
<property name="separated" value="true"/>
</module>
<!-- javadoc rules, set scope to be package and greater-->
<module name="JavadocType">
<property name="scope" value="protected"></property>
<property name="allowUnknownTags" value="true"></property>
</module>
<module name="JavadocMethod">
<property name="scope" value="protected"></property>
<!-- Allows missing javadoc on property setter / getter methods -->
<property name="allowMissingPropertyJavadoc" value="true"></property>
<property name="allowMissingParamTags" value="true"></property>
<property name="allowMissingJavadoc" value="true"></property>
</module>
<module name="JavadocVariable">
<property name="scope" value="protected"></property>
</module>
<module name="JavadocStyle">
<property name="scope" value="protected"></property>
<property name="checkEmptyJavadoc" value="true"></property>
</module>
<!-- Miscellaneous -->
<module name="TodoComment">
<property name="format" value="TODO"/>
<property name="severity" value="warning"></property>
</module>
<module name="UpperEll"/>
<module name="OuterTypeFilename"/>
<!-- Naming Conventions -->
<module name="MemberName">
<property name="applyToPublic" value="false"/>
<property name="format" value="^m[A-Z][a-zA-Z0-9]*$"/>
</module>
<module name="StaticVariableName">
<property name="format" value="^s[A-Z][a-zA-Z0-9]*$"/>
</module>
<module name="ConstantName"/>
<module name="MethodName"/>
<module name="PackageName"/>
<module name="TypeName"/>
</module>
<!-- Suppressions -->
<module name="SuppressionFilter">
<property name="file" value="./suppressions.xml"/>
</module>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="fluid-cs-off\: ([\w\|]+)"/>
<property name="onCommentFormat" value="fluid-cs-on\: ([\w\|]+)"/>
<property name="checkFormat" value="$1"/>
</module>
</module>