Introduce Commit Tooling to Check for SPDX Headers
Open, Needs TriagePublic

It should be automatically checked on merge request that every new source file contains a valid SPDX expression.

cordlandwehr moved this task from Backlog to In Progress on the KF6 board.Feb 26 2020, 5:35 PM
cordlandwehr moved this task from In Progress to Done on the KF6 board.May 24 2020, 8:33 AM
cordlandwehr updated the task description. (Show Details)
ervin moved this task from Done to Announced on the KF6 board.Jul 12 2020, 1:24 PM
alex added a subscriber: alex.Oct 30 2021, 2:49 PM

@cordlandwehr This only works for h/cpp files and ignored the dep5 files as far as I can see.

Would it be possible to integrate a reuse check in gitlab CI? In case the project is not fully reuse compliant one could check only the newly added files.

@alex the .dep5 files with license statements should be fully respected, because the tooling internally calls reuse tool to generate a BOM file in SPDX format and parses that. Admittedly I never tested with a repository that contains .dep5 license statements. If it does not work, then it is most probably a problem in the reuse tool.

@alex please ignore the previous comment, I got mixed up with a task with an almost identical name (the tooling for autogenerating tests for license conformance)
I think it should be doable to get a hook that checks dep5 statements regarding REUSE tool output, mostly by reusing the referenced python tooling from ECM for generating the tests. But before doing that we have to check with sysadmins, if we can run the REUSE tool with every push...

alex added a comment.Nov 1 2021, 9:15 AM

That would certainly be nice.

The KRunner framework is currently reuse compliant, could it maybe make sense to just run reuse on the whole project as part of Gitlab CI?

In other projects it makes IMHO the most sense to nly check for reuse compliance in newly added files.

vkrause added a subscriber: vkrause.Nov 1 2021, 3:30 PM

For fully compliant repos we have REUSE checks for the CI already I think, see e.g. https://invent.kde.org/libraries/kpublictransport/-/blob/master/.gitlab-ci.yml#L5. Probably worth enabling for krunner as well.

alex added a comment.Nov 1 2021, 9:54 PM

Thanks, that works well :)