#6992 Add SPDX checking for copyright/license (java) #7404
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Nigel Jones [email protected]
Description
One of the missing aspects to the gradle build is SPDX header checking. There is a shortage of gradle plugins, or github actions.
My approximation so far is to use ‘checkstyle’ which allows specification of REGEXes which must match -for example one for copyright, one for license.
Due to the way the gradle build works, for now these only check java files.
In the process, I’ve noticed some omissions
/* SPDX-License-Identifier: Apache 2.0 */
whilst it should be/* SPDX-License-Identifier: Apache-2.0 */
. Subtle, but it breaches the SPDX spec which specifically requires certain identifiers. There are over 2500 source files breaching this.Both are easy to fix, especially the former, (the latter is slightly more tedious) and I’m happy to do so, but it will result in thousands of file changes in a commit.
For now I can submit this additional check, ERROR will be reported in the output log, but will not fail the build.
Interesting that our previous maven based checks did not find these errors.
Related Issue(s)
Testing
Release Notes & Documentation
Additional notes