Skip to content

Commit cc73a9e

Browse files
committed
chore: clean up comments/logs
1 parent 7d61116 commit cc73a9e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/deps/enrich_cyclonedx.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,21 @@ func enrichForks(component cdx.Component, project Project) cdx.Component {
5454
}
5555

5656
func enrichLicense(component cdx.Component, project Project) cdx.Component {
57-
if project.License != nil && *project.License != "" {
57+
if project.License != nil {
5858
return enrichProperty(component, "deps:license", *project.License)
5959
}
6060
return component
6161
}
6262

6363
func enrichDescription(component cdx.Component, project Project) cdx.Component {
64-
if project.Description != nil && *project.Description != "" {
64+
if project.Description != nil {
6565
return enrichProperty(component, "deps:description", *project.Description)
6666
}
6767
return component
6868
}
6969

7070
func enrichHomepage(component cdx.Component, project Project) cdx.Component {
71-
if project.Homepage != nil && *project.Homepage != "" {
71+
if project.Homepage != nil {
7272
return enrichProperty(component, "deps:homepage", *project.Homepage)
7373
}
7474
return component
@@ -108,7 +108,7 @@ func enrichComponentRecursive(component cdx.Component, enrichFuncs []func(cdx.Co
108108
if ref.Type == "vcs" {
109109
proj, err := GetRepoDataWithCache(ref.URL, logger, cache)
110110
if err != nil {
111-
logger.Debug().
111+
logger.Warn().
112112
Str("component", component.Name).
113113
Str("url", ref.URL).
114114
Err(err).

lib/deps/repo.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func normalizeRepoURL(repoURL string) string {
8989
// Parse the URL
9090
parsedURL, err := url.Parse(repoURL)
9191
if err != nil || parsedURL.Host == "" {
92-
// If parsing fails or no host, fall back to simple string manipulation
92+
// If parsing fails or no host, return the original URL unchanged
9393
// This handles cases like "not-a-valid-url/but/has/slashes"
9494
return repoURL
9595
}
@@ -186,7 +186,7 @@ func createRetryClient(logger *zerolog.Logger) *http.Client {
186186
return 0
187187
}
188188

189-
// Check for rate limit headers (deps.dev may use different headers)
189+
// Check for Retry-After header for rate limiting
190190
if retryAfter := resp.Header.Get("Retry-After"); retryAfter != "" {
191191
if sleep, ok := parseRetryAfterHeader(retryAfter); ok {
192192
logger.Warn().

0 commit comments

Comments
 (0)