Skip to content

Commit

Permalink
feat(objectionary#946): skip 5 particular warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
volodya-lombrozo committed Jan 13, 2025
1 parent 0bc0d29 commit 91afcc8
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@
import com.jcabi.xml.XML;
import com.jcabi.xml.XMLDocument;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import lombok.EqualsAndHashCode;
import lombok.ToString;
Expand Down Expand Up @@ -154,7 +158,18 @@ public boolean hasAttribute(final String name, final String value) {

@Override
public void validate() {
final Collection<Defect> defects = new Program(new StrictXmir(this.doc)).defects();
final Set<String> skip = new HashSet<>(Arrays.asList(
"mandatory-home",
"name-outside-of-abstract-object",
"mandatory-version",
"empty-object",
"incorrect-package"
));
final Collection<Defect> defects = new Program(new StrictXmir(this.doc))
.defects()
.stream()
.filter(defect -> !skip.contains(defect.rule()))
.collect(Collectors.toList());
if (!defects.isEmpty()) {
throw new IllegalStateException(
String.format(
Expand Down

0 comments on commit 91afcc8

Please sign in to comment.