[check-licenses] Print guidance before license
Some of our views of failing test results truncate the text emitted
from the tool, so this puts "add the relevant license pattern to
//tools/check-licenses/license/patterns/*" where contributors will see
it before noticing and having to follow "(failure summary truncated,
see check licenses stderr for full failure details)".
We also correct a "//tools/check-licenses/license/pattern/*" typo; the
correct path is "//tools/check-licenses/license/patterns/*".
Change-Id: Ide10ff1a91577fcda9378cc46347589db5d10e6a
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/694164
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
Fuchsia-Auto-Submit: Nathaniel Manista <nathaniel@google.com>
Reviewed-by: Jerry Belton <jcecil@google.com>
diff --git a/tools/check-licenses/result/checks.go b/tools/check-licenses/result/checks.go
index ae9ebd6..2614722 100644
--- a/tools/check-licenses/result/checks.go
+++ b/tools/check-licenses/result/checks.go
@@ -84,12 +84,11 @@
func AllLicenseTextsMustBeRecognized() error {
if len(license.Unrecognized.Matches) > 0 {
var b strings.Builder
- b.WriteString("Found license texts that were unrecognized:\n\n")
+ b.WriteString("Found unrecognized license texts - please add the relevant license pattern(s) to //tools/check-licenses/license/patterns/* and have it(them) reviewed by the OSRB team:\n\n")
for _, m := range license.Unrecognized.Matches {
b.WriteString(fmt.Sprintf("-> Line %v of %v\n", m.LineNumber, m.FilePath))
b.WriteString(fmt.Sprintf("\n%v\n\n", string(m.Data)))
}
- b.WriteString("\nPlease add the relevant license pattern to //tools/check-licenses/license/pattern/*, and have it reviewed by the OSRB team.\n")
return fmt.Errorf(b.String())
}
return nil