Skip to content

Header Apache-2 license is not recognized in v2 #339

@dsimansk

Description

@dsimansk

After update to go-licenses v2 uknown license is reported for gotest.tools library. The issue is license format, that was previously recognized in v1 (v1 check passes) as header type, and I think it should be the case for v2.

This is still valid Apache-2 license in gotest.tools.

https://github.com/gotestyourself/gotest.tools/blob/main/LICENSE

  Did not find license for library 'gotest.tools/v3/assert'.
  Did not find license for library 'gotest.tools/v3/assert/cmp'.
  Did not find license for library 'gotest.tools/v3/internal/assert'.
  Did not find license for library 'gotest.tools/v3/internal/format'.
  Did not find license for library 'gotest.tools/v3/internal/source'.

v1: https://github.com/google/go-licenses/blob/v1.6.0/licenses/classifier.go#L95-L98
v2: https://github.com/google/go-licenses/blob/v2.0.1/licenses/classifier.go#L69-L71

Adding the following to L69 fixes the issue:

if match.MatchType != "License" &&  match.MatchType != "Header" {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions