Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check returns exit code 0 when LICENSE is not found #31

Open
wlynch opened this issue Jul 2, 2020 · 2 comments
Open

Check returns exit code 0 when LICENSE is not found #31

wlynch opened this issue Jul 2, 2020 · 2 comments

Comments

@wlynch
Copy link
Contributor

wlynch commented Jul 2, 2020

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/go.zipexe@v1.0.0
$ echo $?
0

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

@NotoriousPyro
Copy link

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

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

@mkyc
Copy link

mkyc commented Jul 31, 2020

#19 has tests

wlynch added a commit to wlynch/go-licenses that referenced this issue Nov 23, 2020
Previously if an unknown license was detected, an error message was
printed, but the command would still return 0, indicating success for
many CI tools.

This fixes the behavior to return a proper non-zero error code.

Fixes google#31.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants