-
Notifications
You must be signed in to change notification settings - Fork 8.3k
scripts: ci: check_compliance: Warn on missing Apache-2.0 license #99003
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
base: main
Are you sure you want to change the base?
Conversation
| paths, | ||
| "License may not be allowed", | ||
| "warning", | ||
| "error", |
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.
this seems like an unrelated change? We'd first need to add all okay-ish license to /LICENSES until we can turn this into an error?
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.
Yeah, the PR was a draft for that reason, the intention is to add the allowed licenses alongside that change.
But I wanted to get some feedback first 🙂
EDIT: License files added
f9e97ce to
7f9c2a6
Compare
7f9c2a6 to
1e40022
Compare
Print a compliance warning if a modified file is not licensed under Apache-2.0. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
1e40022 to
5f7a0e3
Compare
Add license files for the reuse tool, downloaded using reuse download. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Increase the severity if a file is licensed without it being allowed. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
5f7a0e3 to
a8d128e
Compare
|
|
Ok so now if any file that does not have an apache spdx header gets modified it'll fail compliance, right? Meaning that to merge it we'll have to bypass the check. |
Not really, if it has a compliant license header (from the LICENSES directory), but misses the apache one, it will put a non-blocking warning annotation (similar to the generic missing one currently). |
| files_without_apache, | ||
| "No Apache-2.0 license", | ||
| "warning", | ||
| "File is not licensed under Apache-2.0", |
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.
what is the rationale behind this? This is just going to be generating noise and might trigger someone to take unnecessary action, i.e. I change checkpatch, I get:
File:scripts/checkpatch.pl
Line:1
WARNING : Test LicenseAndCopyrightCheck warning:
No Apache-2.0 license:File is not licensed under Apache-2.0
File:scripts/checkpatch.pl
Line:1
ERROR : Test LicenseAndCopyrightCheck failed:
License may not be allowed:License file for 'GPL-2.0' not found in /LICENSES. Please check https://docs.zephyrproject.org/latest/contribute/guidelines.html#components-using-other-licenses.
File:scripts/checkpatch.pl
so now we will error on this as well?
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.
errors on modified files that are GPL for example, checkpatch.pl
Should we list and exclude these files explicitly?
We currently have the same "noise" as the |
They are kindof already listed in |
yeah, that is something we should do, all exceptions in some yaml file, use it to generate the LICENSING.rst file and then apply exclusions when runnning |



Print a compliance warning if a modified file is not licensed under Apache-2.0.
Missing license files are now turned into compliance errors.