go-licenses icon indicating copy to clipboard operation
go-licenses copied to clipboard

Check returns exit code 0 when LICENSE is not found

Open wlynch opened this issue 4 years ago • 2 comments

Expected behavior

go-licenses check returns non-zero exit code when it cannot find a valid license so that tools/scripts can report error.

Actual behavior

Exit code 0 is returned.

$ go-licenses check github.com/daaku/go.zipexe
E0701 18:49:16.281709   29087 library.go:108] Failed to find license for github.com/daaku/go.zipexe: no file/directory matching regexp "^(LICEN(S|C)E|COPYING|README|NOTICE)(\\..+)?$" found for /Users/wlynch/go/pkg/mod/github.com/daaku/[email protected]
$ echo $?
0

The actual cause of the missing license is because go-licenses doesn't consider casing. It sounds like #30 may fix this.

wlynch avatar Jul 02 '20 01:07 wlynch

You can try #30 at https://github.com/NotoriousPyro/go-licenses/tree/caseinsensitive.

I forked the code due to the requirement to 'CLA'...

NotoriousPyro avatar Jul 30 '20 09:07 NotoriousPyro

#19 has tests

mkyc avatar Jul 31 '20 12:07 mkyc