From 5945c8ebcc4618cba1f55294a02aa973e33e0afd Mon Sep 17 00:00:00 2001 From: Tab Atkins-Bittner Date: Mon, 16 Sep 2024 15:09:47 -0700 Subject: [PATCH] Point to Ignore MDN failures. Make Ignore MDN failures accept IDs with # in front, as the error message specifies. Update docs accordingly. --- bikeshed/mdn/mdnspeclinks.py | 2 +- bikeshed/metadata.py | 8 +++++++- docs/index.bs | 5 +---- docs/index.html | 13 +++++-------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/bikeshed/mdn/mdnspeclinks.py b/bikeshed/mdn/mdnspeclinks.py index 87882b0c9a..db3d086126 100644 --- a/bikeshed/mdn/mdnspeclinks.py +++ b/bikeshed/mdn/mdnspeclinks.py @@ -152,7 +152,7 @@ def panelsFromData(doc: t.SpecT, data: MdnDataT) -> list[t.ElementT]: h.appendChild(doc.body, anno) if missingIds: - msg = "Skipped generating some MDN panels, because the following IDs weren't present in the document:\n" + msg = "Skipped generating some MDN panels, because the following IDs weren't present in the document. Use `Ignore MDN Failures` if this is expected.\n" msg += "\n".join(" #"+missingId for missingId in missingIds) m.warn(msg) diff --git a/bikeshed/metadata.py b/bikeshed/metadata.py index 539eda7621..49935bb963 100644 --- a/bikeshed/metadata.py +++ b/bikeshed/metadata.py @@ -1016,6 +1016,12 @@ def parseDieWhen(key: str, val: str, lineNum: str | int | None) -> str: return "late" +def parseIgnoreMdnFailure(key: str, val: str, lineNum: str | int | None) -> str: + vals = [x.strip() for x in val.split(",")] + vals = [x[1:] if x.startswith("#") else x for x in vals] + return vals + + def parse(lines: t.Sequence[Line]) -> tuple[list[Line], MetadataManager]: # Given HTML document text, in the form of an array of text lines, # extracts all
 lines and parses their contents.
@@ -1364,7 +1370,7 @@ def parseLiteralList(key: str, val: str, lineNum: str | int | None) -> list[str]
         joinList,
         parseLiteralList,
     ),
-    "Ignore Mdn Failure": Metadata("Ignore MDN Failure", "ignoreMDNFailure", joinList, parseLiteralList),
+    "Ignore Mdn Failure": Metadata("Ignore MDN Failure", "ignoreMDNFailure", joinList, parseIgnoreMdnFailure),
     "Ignored Terms": Metadata("Ignored Terms", "ignoredTerms", joinList, parseCommaSeparated),
     "Ignored Vars": Metadata("Ignored Vars", "ignoredVars", joinList, parseCommaSeparated),
     "Image Auto Size": Metadata("Image Auto Size", "imgAutoSize", joinValue, parseBoolean),
diff --git a/docs/index.bs b/docs/index.bs
index 97cd1241e2..87e97afb3a 100644
--- a/docs/index.bs
+++ b/docs/index.bs
@@ -1413,12 +1413,9 @@ There are several additional optional keys:
 			to allow it to silently upgrade when possible;
 			otherwise, if directly turned on,
 			it will emit a fatal error if it can't find your spec.
-		* Ignore MDN Failure takes one of the IDs that MDN is attempting to target,
+		* Ignore MDN Failure takes a comma-separated list of IDs that MDN is attempting (and failing) to target,
 			and prevents Bikeshed from emitting a warning
 			if it can't find that ID.
-			You can supply this multiple times
-			to ignore several IDs,
-			if needed.
 			This allows you to have avoid having a build warning
 			while waiting for MDN to be updated.
 	* Several keys relate to the [Can I Use](https://caniuse.com/) project:
diff --git a/docs/index.html b/docs/index.html
index 0f1094195d..7e30a23ec7 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -1488,9 +1488,9 @@
 		}
 	}
 
-  
+  
   
-  
+