Snippet documentation seems to contradict example
bernhardreiter opened this issue · comments
Good catch, @bernhardreiter (also, great to hear from you, it’s been a while!)
This is to do with SPDX really:
https://spdx.github.io/spdx-spec/v2.3/file-tags/#h3-snippet-tags-format
https://spdx.github.io/spdx-spec/v2.3/file-tags/#h4-caveats
https://spdx.github.io/spdx-spec/v2.3/using-SPDX-short-identifiers-in-source-files/
The problem is that License-Identifier
is (older and) specific when it comes to SPDX tags, and therefore not bound to the File
. Which also kinda explains why it looks different with the dash instead of CamelCase.
There are other package-, file-, and snippet-level SDPX (2.x) tags:
Package level:
PackageLicenseDeclared
PackageLicenseInfoFromFiles
PackageLicenseConcluded
File level:
LicenseInfoInFile
LicenseConcluded
Snippet level:
LicenseInfoInSnippet
SnippetLicenseConcluded
But the major difference is that these are intended to be in the SPDX Document, which is typically generated by a tool such as a license scanner or SCA tool that parses information found in the source code; whereas License-Identifier
was specifically created to be used in source code, and therefore the tools would translate License-Identifier
into the appropriate tag in the SPDX Document.
That said, yes, we probably should clarify within REUSE – just as it already is in SDPX File Tags annex – that License-Identifier
is a special case.
Good catch, indeed. It's also wrong in the FAQ, we should fix that before 3.2 spec.