Skip to content
This repository was archived by the owner on May 27, 2024. It is now read-only.

Commit 5cfce12

Browse files
committed
Improve Snippet section
I removed some stuff that was already defined in the SPDX spec, and reworded things to be a little clearer. Signed-off-by: Carmen Bianca BAKKER <[email protected]>
1 parent 779c2f7 commit 5cfce12

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

spec.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -168,34 +168,29 @@ echo "SPDX-License-Identifier: MIT" > file.txt
168168

169169
### In-line Snippet comments
170170

171-
If some Copyright and Licensing Information is to apply only to a certain
172-
Snippet instead of the whole Commentable File, SPDX snippet tags MUST be used
173-
(as defined in [SPDX Specification, Annex
171+
If some Copyright and Licensing Information inside of a Commentable File is to
172+
apply only to a certain Snippet instead of the whole file, SPDX snippet tags
173+
MUST be used for that Snippet (as defined in [SPDX Specification, Annex
174174
H](https://spdx.github.io/spdx-spec/v2.3/file-tags/#h3-snippet-tags-format)).
175+
This means that Copyright Notices inside of Snippets MUST be prefixed with
176+
`SPDX-SnippetCopyrightText`.
175177

176-
Such an annotated Snippet block MUST start with `SPDX-SnippetBegin` to mark its
177-
beginning and end with `SPDX-SnippetEnd` to mark the Snippet's end.
178+
Like with comment headers, the SPDX snippet tags SHOULD be commented.
178179

179-
Do note that SPDX snippet tags MUST start with `SPDX-Snippet`, meaning that the
180-
correct SPDX copyright tag in a Snippet is `SPDX-SnippetCopyrightText`.
180+
A Snippet SHOULD contain both a Copyright Notice and an SPDX License Expression.
181181

182182
Example:
183183

184184
```
185185
# SPDX-SnippetBegin
186-
# SPDX-License-Identifier: MIT
187186
# SPDX-SnippetCopyrightText: 2022 Jane Doe <[email protected]>
187+
# SPDX-License-Identifier: MIT
188188
189-
{$snippet_code_goes_here}
189+
print("Hello, world!")
190190
191191
# SPDX-SnippetEnd
192192
```
193193

194-
Snippets may nest, and this is denoted by having
195-
`SPDX-SnippetBegin`/`SPDX-SnippetEnd` pairs within other pairs, in the same way
196-
that parentheses nest in mathematical expressions. In the case of nested
197-
Snippets, the SPDX snippet tags are considered to apply to the inner-most Snippet.
198-
199194
### DEP5
200195

201196
Alternatively, Copyright and Licensing Information MAY be associated with a

0 commit comments

Comments
 (0)