We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 38145e1 commit a2e9efeCopy full SHA for a2e9efe
src/main/scala/org/janalyse/CodeExample.scala
@@ -41,13 +41,16 @@ object CodeExample {
41
42
def apply(file: File): FileCodeExample = {
43
val content = file.contentAsString
44
+ val id = extractValue(content)("id")
45
+ val idRE = "[-0-9a-f]+".r
46
+ if (id.isDefined) assert(idRE.matches(id.get), s"INVALID UUID: $id for $file")
47
FileCodeExample(
48
file = file,
49
summary = extractValue(content)("summary"),
50
keywords = extractValueList(content)("keywords"),
51
publish = extractValueList(content)("publish"),
52
authors = extractValueList(content)("authors"),
- uuid = extractValue(content)("id"),
53
+ uuid = id,
54
)
55
}
56
0 commit comments