Skip to content

Commit

Permalink
Include MissingDeprecated in the default checks
Browse files Browse the repository at this point in the history
Closes gh-420
  • Loading branch information
wilkinsona committed Jul 26, 2024
1 parent cea1d86 commit 09679cc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=default
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<property name="elementStyle" value="compact" />
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.MissingOverrideCheck" />
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.MissingDeprecatedCheck" />
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.PackageAnnotationCheck" />
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationLocationCheck">
<property name="allowSamelineSingleParameterlessAnnotation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@

package io.spring.javaformat.checkstyle;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Properties;
import java.util.Set;

Expand Down Expand Up @@ -49,17 +51,21 @@ public void loadShouldLoadChecks() {
TreeWalker treeWalker = (TreeWalker) checks.toArray()[4];
Set<?> ordinaryChecks = (Set<?>) Extractors.byName("ordinaryChecks").extract(treeWalker);
assertThat(ordinaryChecks).hasSize(61);
Set<?> commentChecks = (Set<?>) Extractors.byName("commentChecks").extract(treeWalker);
assertThat(commentChecks).hasSize(6);
}

@Test
public void loadWithExcludeShouldExcludeChecks() {
Set<String> excludes = Collections
.singleton("com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck");
Set<String> excludes = new HashSet<String>(Arrays.asList("com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck",
"com.puppycrawl.tools.checkstyle.checks.annotation.MissingDeprecatedCheck"));
Collection<FileSetCheck> checks = load(excludes);
assertThat(checks).hasSize(5);
TreeWalker treeWalker = (TreeWalker) checks.toArray()[4];
Set<?> ordinaryChecks = (Set<?>) Extractors.byName("ordinaryChecks").extract(treeWalker);
assertThat(ordinaryChecks).hasSize(60);
Set<?> commentChecks = (Set<?>) Extractors.byName("commentChecks").extract(treeWalker);
assertThat(commentChecks).hasSize(5);
}

@Test
Expand Down

0 comments on commit 09679cc

Please sign in to comment.