Skip to content

Commit

Permalink
only output non complaint license
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeWang1127 committed Nov 27, 2024
1 parent c7be109 commit 828bc56
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,20 @@ private String packageInfoReport() {
} else {
for (int i = 1; i < packageInfos.size(); i++) {
PackageInfo info = packageInfos.get(i);
String dependencyInfo = String.format("""
### Package information of %s
%s
""", info.versionKey(), packageInfoSection(info));
builder.append(dependencyInfo);
boolean hasNonComplaintLicenses = false;
for (License license : info.licenses()) {
if (!license.isCompliant()) {
hasNonComplaintLicenses = true;
break;
}
}
if (hasNonComplaintLicenses) {
builder.append(String.format("%s: %s", info.versionKey(), info.licenses()));
}

for (Advisory advisory : info.advisories()) {
builder.append(String.format("%s: %s", info.versionKey(), advisory.url()));
}
}
}
builder.append("\n");
Expand Down

0 comments on commit 828bc56

Please sign in to comment.