Skip to content

Commit

Permalink
#130 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Dec 13, 2024
1 parent ec352ec commit 774fc80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
9 changes: 7 additions & 2 deletions src/main/java/org/eolang/lints/Program.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
import java.nio.file.Path;
import java.util.Collection;
import java.util.LinkedList;
import org.cactoos.Scalar;
import org.cactoos.scalar.IoChecked;
import org.cactoos.scalar.Sticky;

/**
* A single XMIR program to analyze.
Expand All @@ -42,7 +45,9 @@ public final class Program {
/**
* Lints to use.
*/
private static final Iterable<Lint<XML>> LINTS = new ProgramLints().value();
private static final Scalar<Iterable<Lint<XML>>> LINTS = new Sticky<>(
() -> new ProgramLints().value()
);

/**
* The XMIR program to analyze.
Expand Down Expand Up @@ -72,7 +77,7 @@ public Program(final Path file) throws FileNotFoundException {
*/
public Collection<Defect> defects() throws IOException {
final Collection<Defect> messages = new LinkedList<>();
for (final Lint<XML> lint : Program.LINTS) {
for (final Lint<XML> lint : new IoChecked<>(Program.LINTS).value()) {
messages.addAll(lint.defects(this.xmir));
}
return messages;
Expand Down
5 changes: 0 additions & 5 deletions src/test/java/org/eolang/lints/ProgramLintsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,10 @@
*/
package org.eolang.lints;

import com.yegor256.MayBeSlow;
import com.yegor256.WeAreOnline;
import org.cactoos.list.ListOf;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

/**
* Tests for {@link ProgramLints}.
Expand All @@ -38,8 +35,6 @@
*/
final class ProgramLintsTest {

@ExtendWith(MayBeSlow.class)
@ExtendWith(WeAreOnline.class)
@Test
void allocatesLints() {
MatcherAssert.assertThat(
Expand Down

0 comments on commit 774fc80

Please sign in to comment.