-
Notifications
You must be signed in to change notification settings - Fork 2k
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
license checker #1181
license checker #1181
Conversation
Should we integrate this into Travis? I could just return |
As I pointed out during on of the recent developer meetings: I'm not in favor of such checks in the CI system, because that would blurs real building and testing issues. |
I guess someone should implement this against the github API then in order to tag the PR accordingly. |
Broken licenses are a real issue... |
current output is wc -l out/*
2 out/1c-BSD
11 out/1c-BSD-ccnl
12 out/1c-BSD-embunit
2 out/1c-BSD-isc
1 out/2c-BSD-v1
2 out/3c-BSD-atmel
1 out/3c-BSD-clark
26 out/3c-BSD-openbsd
3 out/3c-BSD-ti
1 out/3c-BSD-v1
4 out/3c-BSD-v2
1 out/chan
0 out/gplv2-short-v1
10 out/gplv2-v1
0 out/gplv3-short-v1
0 out/gplv3-v1
0 out/gplv3-v2
0 out/lgpl-short-broken-grammar
208 out/lgpl-short-riot
5 out/lgplv2.1-v1
33 out/lgplv2-short-v1
25 out/lgplv2-short-v2
11 out/lgplv2-short-v3
1 out/publicdomain-v1
7 out/unknown
366 total shall we fix the unknown licenses to close #392? cat out/unknown
boards/msba2-common/tools/src/boot_23xx.c
boards/msba2-common/tools/src/boot_2xxx.c
boards/msba2-common/tools/src/control_2xxx.c
cpu/arm_common/atomic.s
cpu/arm_common/common.s
cpu/lpc2387/asmfunc.s
cpu/lpc2387/startup.s |
#!/bin/sh | ||
|
||
# customizable | ||
LICENSEDIR=patterns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use ${VarName:-Default}
to have a default string/fallback expression. If $VarName
is undeclared or empty, then Default
is used. Default
can be an expression like ${VarName2:-${VarName3}}
, too.
I am not sure if that is POSIX, but the plain Bourne shell and BASH support it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think this will actually be used? I'm too lazy to think of new names right now...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a probability bordering on certainty not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'm not doing it then.
I like 👍. |
I'd remove the regular expressions for license strings that have been replaced already. |
I think it's in a merge-able state now. |
squash? |
Gogogo. |
squashed & rebased. |
Maybe use cd "$( cd "$( dirname "${0}" )" && pwd )" at the start of the script? Works in ([bd]?a|k)sh. |
Why would I want to do that? |
Because a user won't expect that he has to run the script out of the script's directory. |
Why is there an extra |
That's the canonical example I found everywhere, I did not question the purpose of the subshell. |
A quick search only came up with |
@Kijewski how about that? |
I like. 👍 |
ACK. |
Creates file structure that maps files to licenses by grepping for license patterns (patterns for licenses found in RIOT included). Sets exit code to 1 if an unknown license header is detected.
Compares all source files against regular expressions for licenses and creates a file structure with files named after licenses that contain a list of files that apply to the respective license. E.g: