10BC0 revised Checkstyle and Formatter · tooper3/ThinkJavaCode2@76a6ee2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 76a6ee2

Browse files
committed
revised Checkstyle and Formatter
1 parent 6b758bd commit 76a6ee2

File tree

3 files changed

+442
-347
lines changed

3 files changed

+442
-347
lines changed

Checkstyle.xml

Lines changed: 52 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,110 @@
11
<?xml version="1.0"?>
22
<!DOCTYPE module PUBLIC
3-
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
4-
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
3+
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
4+
"https://checkstyle.org/dtds/configuration_1_3.dtd">
55

66
<!--
77
Checkstyle configuration for Think Java, 2nd Edition.
88
-->
99
<module name="Checker">
10+
<property name="severity" value="warning"/>
1011

11-
<!-- See http://checkstyle.sf.net/config.html#TreeWalker -->
12+
<!-- See https://checkstyle.sourceforge.io/config.html#TreeWalker -->
1213
<module name="TreeWalker">
1314

14-
<!-- See http://checkstyle.sf.net/config_annotation.html -->
15+
<!-- See https://checkstyle.sourceforge.io/config_annotation.html -->
1516
<module name="AnnotationLocation"/>
1617
<module name="AnnotationUseStyle"/>
1718

18-
<!-- See http://checkstyle.sf.net/config_blocks.html -->
19+
<!-- See https://checkstyle.sourceforge.io/config_blocks.html -->
1920
<module name="AvoidNestedBlocks"/>
2021
<module name="EmptyBlock"/>
22+
<module name="EmptyCatchBlock"/>
2123
<module name="LeftCurly"/>
2224
<module name="NeedBraces"/>
2325
<module name="RightCurly"/>
2426

25-
<!-- See http://checkstyle.sf.net/config_design.html -->
27+
<!-- See https://checkstyle.sourceforge.io/config_design.html -->
2628
<module name="VisibilityModifier">
2729
<property name="protectedAllowed" value="true"/>
2830
</module>
2931

30-
<!-- See http://checkstyle.sf.net/config_coding.html -->
32+
<!-- See https://checkstyle.sourceforge.io/config_coding.html -->
33+
<module name="AvoidDoubleBraceInitialization"/>
3134
<module name="AvoidInlineConditionals"/>
35+
<module name="AvoidNoArgumentSuperConstructorCall"/>
3236
<module name="DeclarationOrder"/>
37+
<module name="DefaultComesLast"/>
3338
<module name="EmptyStatement"/>
3439
<module name="FallThrough"/>
3540
<module name="InnerAssignment"/>
3641
<module name="ModifiedControlVariable"/>
42+
<module name="MultipleVariableDeclarations"/>
3743
<module name="OneStatementPerLine"/>
3844
<module name="ParameterAssignment"/>
39-
<module name="RequireThis">
40-
<!--
41-
<property name="checkMethods" value="false"/>
42-
<property name="validateOnlyOverlapping" value="false"/>
43-
-->
45+
<module name="RequireThis"/>
46+
<module name="ReturnCount">
47+
<property name="format" value="^$"/>
4448
</module>
4549
<module name="SimplifyBooleanExpression"/>
4650
<module name="SimplifyBooleanReturn"/>
4751
<module name="StringLiteralEquality"/>
4852
<module name="UnnecessaryParentheses"/>
4953

50-
<!-- See http://checkstyle.sf.net/config_imports.html -->
54+
<!-- See https://checkstyle.sourceforge.io/config_imports.html -->
5155
<module name="AvoidStarImport">
52-
<property name="excludes" value="org.junit.Assert"/>
56+
<property name="excludes" value="org.junit.jupiter.api.Assertions,org.junit.Assert"/>
5357
</module>
5458
<module name="AvoidStaticImport">
55-
<property name="excludes" value="org.junit.Assert.*"/>
59+
<property name="excludes" value="org.junit.jupiter.api.Assertions.*,org.junit.Assert.*"/>
5660
</module>
5761
<module name="IllegalImport"/>
5862
<module name="RedundantImport"/>
5963
<module name="UnusedImports"/>
6064

61-
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
65+
<!-- See https://checkstyle.sourceforge.io/config_javadoc.html -->
6266
<module name="AtclauseOrder"/>
67+
<module name="InvalidJavadocPosition"/>
68+
<module name="JavadocBlockTagLocation"/>
69+
<module name="JavadocContentLocation"/>
70+
<module name="JavadocMethod"/>
71+
<module name="JavadocMissingWhitespaceAfterAsterisk"/>
6372
<module name="JavadocStyle"/>
73+
<module name="JavadocType">
74+
<property name="authorFormat" value="\S"/>
75+
<property name="versionFormat" value="\S"/>
76+
</module>
77+
<module name="MissingJavadocMethod">
78+
<property name="scope" value="private"/>
79+
<property name="allowMissingPropertyJavadoc" value="true"/>
80+
</module>
81+
<module name="MissingJavadocType">
82+
<property name="scope" value="private"/>
83+
</module>
6484
<module name="NonEmptyAtclauseDescription"/>
85+
<module name="SummaryJavadocCheck"/>
6586

66-
<!-- See http://checkstyle.sf.net/config_misc.html -->
87+
<!-- See https://checkstyle.sourceforge.io/config_misc.html -->
6788
<module name="ArrayTypeStyle"/>
6889
<module name="CommentsIndentation"/>
6990
<module name="Indentation">
7091
<property name="basicOffset" value="4"/>
7192
<property name="braceAdjustment" value="0"/>
7293
<property name="caseIndent" value="4"/>
94+
<property name="throwsIndent" value="4"/>
7395
<property name="arrayInitIndent" value="8"/>
96+
<property name="lineWrappingIndentation" value="4"/>
7497
</module>
7598
<property name="tabWidth" value="4"/>
99+
<module name="OuterTypeFilename"/>
76100
<module name="UpperEll"/>
77101

78-
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
102+
<!-- See https://checkstyle.sourceforge.io/config_modifiers.html -->
79103
<module name="ModifierOrder"/>
80104
<module name="RedundantModifier"/>
81105

82-
<!-- See http://checkstyle.sf.net/config_naming.html -->
106+
<!-- See https://checkstyle.sourceforge.io/config_naming.html -->
107+
<module name="CatchParameterName"/>
83108
<module name="ConstantName"/>
84109
<module name="LocalFinalVariableName">
85110
<property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>
@@ -92,42 +117,38 @@ Checkstyle configuration for Think Java, 2nd Edition.
92117
<module name="StaticVariableName"/>
93118
<module name="TypeName"/>
94119

95-
<!-- See http://checkstyle.sf.net/config_regexp.html -->
120+
<!-- See https://checkstyle.sourceforge.io/config_regexp.html -->
96121
<module name="Regexp">
97122
<property name="format" value=" //[^ ]"/>
98123
<property name="illegalPattern" value="true"/>
99124
<message key="illegal.regexp" value="missing space after ''//'' in comment."/>
100125
</module>
101126

102-
<!-- See http://checkstyle.sf.net/config_sizes.html -->
103-
<module name="LineLength"/>
127+
<!-- See https://checkstyle.sourceforge.io/config_sizes.html -->
104128
<module name="MethodLength"/>
105129

106-
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
130+
<!-- See https://checkstyle.sourceforge.io/config_whitespace.html -->
107131
<module name="EmptyLineSeparator">
108132
<property name="allowNoEmptyLineBetweenFields" value="true"/>
109133
</module>
134+
<module name="GenericWhitespace"/>
110135
<module name="MethodParamPad"/>
111136
<module name="NoWhitespaceAfter"/>
112137
<module name="NoWhitespaceBefore"/>
113138
<module name="OperatorWrap"/>
114139
<module name="ParenPad"/>
140+
<module name="SeparatorWrap"/>
115141
<module name="TypecastParenPad"/>
116142
<module name="WhitespaceAfter"/>
117143
<module name="WhitespaceAround"/>
118144

119145
</module>
120146

121-
<!-- See http://checkstyle.sf.net/config_misc.html -->
122-
<!--
123-
<module name="NewlineAtEndOfFile">
124-
<property name="lineSeparator" value="lf_cr_crlf"/>
125-
</module>
126-
-->
127-
<!-- See http://checkstyle.sf.net/config_sizes.html -->
147+
<!-- See https://checkstyle.sourceforge.io/config_sizes.html -->
128148
<module name="FileLength"/>
149+
<module name="LineLength"/>
129150

130-
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
151+
<!-- See https://checkstyle.sourceforge.io/config_whitespace.html -->
131152
<module name="FileTabCharacter"/>
132153

133154
</module>

0 commit comments

Comments
 (0)
0