From 3e0b5c9d6bb779d23bf27ea368a88ab5dc2b6047 Mon Sep 17 00:00:00 2001 From: DmitriyLewen Date: Thu, 7 Mar 2024 10:40:32 +0600 Subject: [PATCH] fix: exclude scaladoc files --- pkg/crawler/crawler.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/crawler/crawler.go b/pkg/crawler/crawler.go index ab11129..e943446 100644 --- a/pkg/crawler/crawler.go +++ b/pkg/crawler/crawler.go @@ -265,8 +265,10 @@ func (c *Crawler) sha1Urls(ctx context.Context, url string) ([]string, error) { // e.g. https://repo.maven.apache.org/maven2/africa/absa/inception-oauth2-resource-server/1.0.0/ // We need to use `href` to make sure we use the correct filename if fileName, ok := selection.Attr("href"); ok { + // don't include sources, test, javadocs, scaladoc files if strings.HasSuffix(fileName, ".jar.sha1") && !strings.HasSuffix(fileName, "sources.jar.sha1") && - !strings.HasSuffix(fileName, "test.jar.sha1") && !strings.HasSuffix(fileName, "javadoc.jar.sha1") { + !strings.HasSuffix(fileName, "test.jar.sha1") && !strings.HasSuffix(fileName, "javadoc.jar.sha1") && + !strings.HasSuffix(fileName, ".scaladoc.jar.sha1") { sha1URLs = append(sha1URLs, url+fileName) } }