Skip to content

Commit 09679cc

Browse files
committed
Include MissingDeprecated in the default checks
Closes gh-420
1 parent cea1d86 commit 09679cc

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

spring-javaformat-eclipse/io.spring.javaformat.eclipse/src/io/spring/javaformat/eclipse/projectsettings/org.eclipse.jdt.core.prefs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
4545
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=default
4646
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
4747
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
48-
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
48+
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
4949
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
5050
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
5151
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled

spring-javaformat/spring-javaformat-checkstyle/src/main/resources/io/spring/javaformat/checkstyle/spring-checkstyle.xml

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<property name="elementStyle" value="compact" />
2323
</module>
2424
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.MissingOverrideCheck" />
25+
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.MissingDeprecatedCheck" />
2526
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.PackageAnnotationCheck" />
2627
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationLocationCheck">
2728
<property name="allowSamelineSingleParameterlessAnnotation"

spring-javaformat/spring-javaformat-checkstyle/src/test/java/io/spring/javaformat/checkstyle/SpringConfigurationLoaderTests.java

+8-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616

1717
package io.spring.javaformat.checkstyle;
1818

19+
import java.util.Arrays;
1920
import java.util.Collection;
2021
import java.util.Collections;
22+
import java.util.HashSet;
2123
import java.util.Properties;
2224
import java.util.Set;
2325

@@ -49,17 +51,21 @@ public void loadShouldLoadChecks() {
4951
TreeWalker treeWalker = (TreeWalker) checks.toArray()[4];
5052
Set<?> ordinaryChecks = (Set<?>) Extractors.byName("ordinaryChecks").extract(treeWalker);
5153
assertThat(ordinaryChecks).hasSize(61);
54+
Set<?> commentChecks = (Set<?>) Extractors.byName("commentChecks").extract(treeWalker);
55+
assertThat(commentChecks).hasSize(6);
5256
}
5357

5458
@Test
5559
public void loadWithExcludeShouldExcludeChecks() {
56-
Set<String> excludes = Collections
57-
.singleton("com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck");
60+
Set<String> excludes = new HashSet<String>(Arrays.asList("com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck",
61+
"com.puppycrawl.tools.checkstyle.checks.annotation.MissingDeprecatedCheck"));
5862
Collection<FileSetCheck> checks = load(excludes);
5963
assertThat(checks).hasSize(5);
6064
TreeWalker treeWalker = (TreeWalker) checks.toArray()[4];
6165
Set<?> ordinaryChecks = (Set<?>) Extractors.byName("ordinaryChecks").extract(treeWalker);
6266
assertThat(ordinaryChecks).hasSize(60);
67+
Set<?> commentChecks = (Set<?>) Extractors.byName("commentChecks").extract(treeWalker);
68+
assertThat(commentChecks).hasSize(5);
6369
}
6470

6571
@Test

0 commit comments

Comments
 (0)