-
Notifications
You must be signed in to change notification settings - Fork 148
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
Licenses only used in REUSE.toml
get ignored
#1062
Comments
I can reproduce as described, but this is partially expected behaviour :) Empty files are ignored by REUSE according to the spec. So when Now the question is whether this behaviour is correct. The spec says:
and
and
The last one could be more unambiguous, I suppose. But in my reading, the current behaviour is correct spec-wise. We could maybe improve the spec by adding some words about the corner case 'what if REUSE.toml has an entry for a file that does not exist, using a licence used by no other file'. Super super super corner case, but I have to assume that you didn't report this bug for no reason, so I would love to hear your use case for this corner case :) Thanks @juhannc ! |
Thanks for getting back so quickly. It turns out, I had a typo in my So here is a more complicated MWE. This is working: cd $(mktemp -d)
echo "# SPDX-FileCopyrightText: 2024 foo\n#\n# SPDX-License-Identifier: MIT\n\nversion = 1\n\n[[annotations]]\npath = \"figures/sample*\"\nSPDX-FileCopyrightText = \"pdfobject.com\"\nSPDX-License-Identifier = \"0BSD\"\n\n[[annotations]]\npath = \"figures/image*\"\nSPDX-FileCopyrightText = \"picsum.photos\"\nSPDX-License-Identifier = \"CC0-1.0\"\n" > REUSE.toml
mkdir -p figures/
wget https://picsum.photos/200 -O figures/image.jpg
wget https://pdfobject.com/pdf/sample.pdf -O figures/sample.pdf Here, However, let's introduce a typo in the cd $(mktemp -d)
echo "# SPDX-FileCopyrightText: 2024 foo\n#\n# SPDX-License-Identifier: MIT\n\nversion = 1\n\n[[annotations]]\npath = \"figues/sample*\"\nSPDX-FileCopyrightText = \"pdfobject.com\"\nSPDX-License-Identifier = \"0BSD\"\n\n[[annotations]]\npath = \"figures/image*\"\nSPDX-FileCopyrightText = \"picsum.photos\"\nSPDX-License-Identifier = \"CC0-1.0\"\n" > REUSE.toml
mkdir -p figures/
wget https://picsum.photos/200 -O figures/image.jpg
wget https://pdfobject.com/pdf/sample.pdf -O figures/sample.pdf Now,
As the error message includes the correct path name, it was really hard for me to find this typo. I feel like, additional info could be helpful here, mentioning paths/globs that do not point to anything. |
If a license is only used in the
REUSE.toml
and not as a header/.license
-file,reuse download
will not download it andreuse lint
will identify it as unused.Now,
reuse download --all
will only download the MIT license, not the BSD Zero Clause License.If we manually create the 0BSD file, e.g., by
mkdir -p LICENSES && touch LICENSES/0BSD.txt
,reuse lint
will complain that the 0BSD has not been used:The text was updated successfully, but these errors were encountered: