google / go-licenses

A lightweight tool to report on the licenses used by a Go package and its dependencies. Highlight! Versioned external URL to licenses can be found at the same time.
Apache License 2.0
790 stars 117 forks source link

Ignore `W0104 contains non-Go code` warnings in errors #249

Open samirsss opened 5 months ago

samirsss commented 5 months ago

Hi,

This is a great tool for us to use, to be able to identify the licenses that we're using (including the dependencies) to ensure we dont use any forbidden or restricted licenses.

However the error reporting from the tool includes the warnings:

W0104 10:49:27.896553 54153 library.go:101] "golang.org/x/sys/unix" contains non-Go code that can't be inspected for further dependencies:

/pkg/mod/golang.org/x/sys@v0.13.0/unix/asm_bsd_arm64.s /pkg/mod/golang.org/x/sys@v0.13.0/unix/zsyscall_darwin_arm64.s W0104 10:49:27.927581 54153 library.go:101] "github.com/petermattis/goid" contains non-Go code that can't be inspected for further dependencies: /pkg/mod/github.com/petermattis/goid@v0.0.0-20230904192822-1876fd5063bc/goid_go1.5.s W0104 10:49:29.034446 54153 library.go:101] "golang.org/x/crypto/chacha20" contains non-Go code that can't be inspected for further dependencies: /pkg/mod/golang.org/x/crypto@v0.14.0/chacha20/chacha_arm64.s W0104 10:49:29.739647 54153 library.go:101] "github.com/confluentinc/confluent-kafka-go/kafka" contains non-Go code that can't be inspected for further dependencies: /pkg/mod/github.com/confluentinc/confluent-kafka-go@v1.9.2/kafka/glue_rdkafka.h /pkg/mod/github.com/confluentinc/confluent-kafka-go@v1.9.2/kafka/select_rdkafka.h W0104 10:49:29.764589 54153 library.go:101] "github.com/confluentinc/confluent-kafka-go/kafka/librdkafka_vendor" contains non-Go code that can't be inspected for further dependencies: /pkg/mod/github.com/confluentinc/confluent-kafka-go@v1.9.2/kafka/librdkafka_vendor/rdkafka.h /pkg/mod/github.com/confluentinc/confluent-kafka-go@v1.9.2/kafka/librdkafka_vendor/rdkafka_mock.h It would be great if these W0104 warnings can be suppressed to actually get to real errors. We want to be able to include this in our CI to alert developers if any new components/dependencies were included which has licenses that we shouldnt be using in our codebase.