File tree 5 files changed +45
-5
lines changed
main/resources/com/qulice/checkstyle
java/com/qulice/checkstyle
resources/com/qulice/checkstyle
qulice-maven-plugin/src/it/checkstyle-violations
5 files changed +45
-5
lines changed Original file line number Diff line number Diff line change 169
169
<property name =" fileExtensions" value =" java" />
170
170
</module >
171
171
172
- <!--
173
- Enable suppressions
174
- -->
172
+ <module name =" SuppressionFilter" >
173
+ <property name =" file" value =" ${project.basedir}/src/main/resources/com/qulice/checkstyle/suppressions.xml" />
174
+ <property name =" optional" value =" false" />
175
+ </module >
176
+
175
177
<module name =" TreeWalker" >
176
178
<property name =" cacheFile" value =" ${cache.file}" />
177
179
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" ?>
2
+ <!DOCTYPE suppressions PUBLIC "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN" "https://checkstyle.org/dtds/suppressions_1_2.dtd">
3
+
4
+ <suppressions >
5
+ <suppress checks =" JavadocMethod" files =" .+(Test|ITCase|IT).java" />
6
+ </suppressions >
Original file line number Diff line number Diff line change 53
53
* exclude `TooManyMethods`. Good candidates for moving out of this class
54
54
* are all that use `validateCheckstyle` method.
55
55
*/
56
- @ SuppressWarnings ({ "PMD.TooManyMethods" , "PMD.AvoidDuplicateLiterals" })
56
+ @ SuppressWarnings (
57
+ {
58
+ "PMD.TooManyMethods" , "PMD.AvoidDuplicateLiterals" , "PMD.GodClass"
59
+ }
60
+ )
57
61
public final class CheckstyleValidatorTest {
58
62
59
63
/**
@@ -167,6 +171,16 @@ public void reportsErrorWhenIndentationIsIncorrect() throws Exception {
167
171
);
168
172
}
169
173
174
+ /**
175
+ * CheckstyleValidator does not report an error when there is no JavaDoc
176
+ * on method in JUnit tests.
177
+ * @throws Exception when error.
178
+ */
179
+ @ Test
180
+ public void doesNotReportErrorWhenMissingJavadocInTests () throws Exception {
181
+ this .runValidation ("MissingJavadocTest.java" , true );
182
+ }
183
+
170
184
/**
171
185
* CheckstyleValidator reports an error when comment or Javadoc has too
172
186
* long line.
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Hello.
3
+ */
4
+ package foo ;
5
+
6
+ import org .junit .Test ;
7
+
8
+ /**
9
+ * Simple.
10
+ * @since 1.0
11
+ */
12
+ public class MissingJavadocTest {
13
+
14
+ @ Test
15
+ public void testSomething () {
16
+ return "something" ;
17
+ }
18
+ }
Original file line number Diff line number Diff line change @@ -47,5 +47,5 @@ assert log.text.contains('Violations.java[33]: ArrayList should be initialized w
47
47
assert log. text. contains(' Violations.java[34]: ArrayList should be initialized with a size parameter' )
48
48
assert log. text. findAll(' Pdd.java.*: .todo tag has wrong format' ). empty
49
49
assert ! log. text. contains(' Got an exception - java.lang.NullPointerException' )
50
- // assert ! log.text.contains ('SomeTest.java[5]: This method must be static, because it does not refer to "this"' )
50
+ assert log. text. findAll (' SomeTest.java .+ (JavadocMethodCheck) ' ) . isEmpty( )
51
51
assert ! log. text. contains(' IndentationChecks.java[19]: method call rparen at indentation level 12' )
You can’t perform that action at this time.
0 commit comments