aboutsummaryrefslogtreecommitdiff
path: root/internal/postgres/insert_module_test.go
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2021-01-06 10:17:05 -0500
committerJonathan Amsterdam <jba@google.com>2021-01-14 13:52:37 +0000
commitbc1c66ddadd31b581aea246a7053c6c216e7fddd (patch)
treecf255be0741047b119c6da9bdf5b6805d869e862 /internal/postgres/insert_module_test.go
parent5c60e501fd361f2fee2a9814c8207c76128eb5a0 (diff)
downloadgo-x-pkgsite-bc1c66ddadd31b581aea246a7053c6c216e7fddd.tar.xz
internal/licenses: use new licensecheck
Use the new version of licensecheck, which is more precise and has other improvements. The new version uses regexps instead of fuzzy matching to categorize licenses. That makes it much stricter than the old version, so we need many exceptions in order to match the same licenses we did before. It is also intolerant of various corruptions like truncation and search-and-replace errors. We observed many of these, and filed bugs against the offending repos where possible. We validated that except for corrupted licenses, this package accepts the same licensesn as it did before for all latest-version modules. The new version uses SPDX identifiers where they exist, so we no longer need to map licensecheck names to SPDX IDs. We also need include many variant SPDX identifiers in our list of redistributable licenses (e.g. "GPL2.0-or-later"). The new version dispenses with "-Short" and "-Header" variants, so we don't need to canonicalize the names. Change-Id: I5c1aaa2bdf745aff6ebb8c121fa63d6550931069 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/283654 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
Diffstat (limited to 'internal/postgres/insert_module_test.go')
-rw-r--r--internal/postgres/insert_module_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/postgres/insert_module_test.go b/internal/postgres/insert_module_test.go
index fb21c6ac..b290af58 100644
--- a/internal/postgres/insert_module_test.go
+++ b/internal/postgres/insert_module_test.go
@@ -96,7 +96,7 @@ func checkModule(ctx context.Context, t *testing.T, want *internal.Module) {
}
wantu.Subdirectories = subdirectories
opts := cmp.Options{
- cmpopts.IgnoreFields(licenses.Metadata{}, "OldCoverage"),
+ cmpopts.IgnoreFields(licenses.Metadata{}, "Coverage", "OldCoverage"),
cmp.AllowUnexported(source.Info{}, safehtml.HTML{}),
}
if diff := cmp.Diff(wantu, got, opts); diff != "" {