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

Add support for file comments in spdx #625

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alpianon
Copy link

@alpianon alpianon commented Nov 15, 2022

For an open source project I'm working on (Oniro), I added initial support for comments on single files, allowed both by dep5 and spdx specs:

  • added 'comment' field to SpdxInfo
  • added conversion of dep5 Files:Comment fields into SPDX FileComment fields
  • TODO: it would be useful to be able also to add (human-readable) comments with reuse addheader

A typical (but not the only one) use case is to handle cases in which different portions of a file are subject to different licenses (I'm finding a lot of such cases with patch files in yocto layers). The official FAQ suggest to use comments to that purpose https://reuse.software/faq/#partial-license

Specific tests are still missing. If there is consensus on this PR, I will add them (as proposed to @linozen )

Add initial support for comments on single files, allowed both by dep5
and spdx specs:
- add 'comment' field to SpdxInfo
- add support for conversion of dep5 Files:Comment fields into SPDX
  FileComment fields

Signed-off-by: Alberto Pianon <alberto@pianon.eu>
@mxmehl
Copy link
Member

mxmehl commented Apr 6, 2023

Sorry for the late review. Please note that for marking portions of a file being under a different license, SPDX snippets are the way to go. They have been introduced in SPDX 2.3. We will also cover this in the next spec release.

Here's the current status: https://github.com/fsfe/reuse-docs/blob/112d289667f2c4d315613a59ac467f9a6a3f45ef/spec.md?plain=1#L165

The FAQ item you referred to will also be updated: fsfe/reuse-docs#124

Apart from that, covering SPDX comments seems to be OK. But please note that there has been some work done on the SPDX output in a different PR which probably causes the conflict. I'm also not sure whether it conflicts with the big work going on in #654.

@linozen
Copy link
Contributor

linozen commented Jun 2, 2023

Since #654 was merged, there now is a dataclass called ReuseInfo to which SPDX comments need to be added. Is this still relevant, @alpianon? If yes, this PR would need to be rebased on main and specific tests should be added.

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 this pull request may close these issues.

3 participants