Skip to content

Commit 9fbf9e3

Browse files
authored
Merge pull request #274 from n-peugnet/estimate-blocklist
estimate: ignore some modules based on a blocklist
2 parents e99bc16 + 8cbb3e5 commit 9fbf9e3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

estimate.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ import (
1818
// majorVersionRegexp checks if an import path contains a major version suffix.
1919
var majorVersionRegexp = regexp.MustCompile(`([/.])v([0-9]+)$`)
2020

21+
// moduleBlocklist is a map of modules that we want to exclude from the estimate
22+
// output, associated with the reason why.
23+
var moduleBlocklist = map[string]string{
24+
"github.com/arduino/go-win32-utils": "Windows only",
25+
"github.com/Microsoft/go-winio": "Windows only",
26+
}
27+
2128
func get(gopath, repodir, repo, rev string) error {
2229
done := make(chan struct{})
2330
defer close(done)
@@ -237,6 +244,11 @@ func estimate(importpath, revision string) error {
237244
return
238245
}
239246
}
247+
// Ignore modules from the blocklist.
248+
if reason, found := moduleBlocklist[mod]; found {
249+
log.Printf("Ignoring module %s: %s", mod, reason)
250+
return
251+
}
240252
line := strings.Repeat(" ", indent)
241253
if rrseen[repoRoot] {
242254
line += fmt.Sprintf("\033[90m%s\033[0m", mod)

0 commit comments

Comments
 (0)