Skip to content

Commit

Permalink
Reduce minimum test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRandomLabs committed Feb 7, 2021
1 parent 6edf4da commit 330a293
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "2.0.0-pre8"
ext {
commonGradleBranch = "master"
mainClass = "${group}.Main"
jacocoMinimumInstructionCoverage = 0.8
jacocoMinimumInstructionCoverage = 0.7
jacocoExcludes = [
"com.therandomlabs.changeloggenerator.ChangelogEntry",
"com.therandomlabs.changeloggenerator.ChangelogGeneratorOptions",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ public abstract class ChangelogGenerator {
*/
public static final String VERSION = "@VERSION@";

/**
* The ChangelogGenerator logger.
*/
protected static final Logger logger = LoggerFactory.getLogger(ChangelogGenerator.class);
private static final Logger logger = LoggerFactory.getLogger(ChangelogGenerator.class);

private final List<ChangelogProvider> providers = new ArrayList<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import com.therandomlabs.curseapi.file.CurseFileChange;
import com.therandomlabs.curseapi.file.CurseFiles;
import com.therandomlabs.curseapi.minecraft.modpack.CurseModpack;
import com.therandomlabs.curseapi.project.CurseProject;
import com.therandomlabs.curseapi.util.JsoupUtils;

/**
Expand Down Expand Up @@ -105,7 +106,7 @@ protected void appendFiles(
/**
* {@inheritDoc}
*/
@SuppressWarnings({"Duplicates", "ConstantConditions"})
@SuppressWarnings("Duplicates")
@Override
protected void appendChangelogEntries(
StringBuilder builder, String projectName, ChangelogEntries changelogEntries
Expand Down Expand Up @@ -213,11 +214,19 @@ protected void appendChangelogEntries(
}

if (extraEntries > 0) {
//fileChange.project() is guaranteed to return a non-null value,
//since it is necessary to determine whether there are extra entries in the first place.
//This is guaranteed to be non-null, but we have to appease the static code analysis
//tools.
final CurseProject project = fileChange.project();

if (project == null) {
builder.append(System.lineSeparator()).append("#### ").append(extraEntries).
append(" more entr").append(extraEntries == 1 ? "y" : "ies");
return;
}

builder.append(System.lineSeparator()).append("#### [").append(extraEntries).
append(" more entr").append(extraEntries == 1 ? "y](" : "ies](").
append(fileChange.project().url()).append("/files/all)").
append(project.url()).append("/files/all)").
append(System.lineSeparator());
}
}
Expand Down

0 comments on commit 330a293

Please sign in to comment.