Skip to content

Commit 8eb9cb2

Browse files
authored
Merge pull request #2089 from pfmoore/script_metadata
Clarify handling of script metadata
2 parents 3b1b5ce + 9dd85f2 commit 8eb9cb2

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎source/specifications/inline-script-metadata.rst‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@ and the regular expression, the text specification takes precedence.
7070
Tools MUST NOT read from metadata blocks with types that have not been
7171
standardized by this specification.
7272

73+
Note that the specification only requires that *top-level* comment blocks are
74+
recognised as containing metadata. However, parsing Python code is non-trivial,
75+
and therefore:
76+
77+
* Tools MAY choose to do a simple textual scan, rather than a full Python parse.
78+
* As a result of the previous point, the behaviour of scripts that contain data
79+
that looks like metadata within another Python construct such as a multi-line
80+
string is tool-dependent and should not be relied on.
81+
* The canonical regular expression provided above is an example of an
82+
implementation that does a simple textual scan.
83+
7384
script type
7485
-----------
7586

0 commit comments

Comments
 (0)