Skip to content

Commit

Permalink
Point to Ignore MDN failures. Make Ignore MDN failures accept IDs wit…
Browse files Browse the repository at this point in the history
…h # in front, as the error message specifies. Update docs accordingly.
  • Loading branch information
tabatkins committed Sep 16, 2024
1 parent caab1a0 commit 5945c8e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bikeshed/mdn/mdnspeclinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
8 changes: 7 additions & 1 deletion bikeshed/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <pre class=metadata> lines and parses their contents.
Expand Down Expand Up @@ -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),
Expand Down
5 changes: 1 addition & 4 deletions docs/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
* <dfn>Ignore MDN Failure</dfn> takes one of the IDs that MDN is attempting to target,
* <dfn>Ignore MDN Failure</dfn> 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:
Expand Down
13 changes: 5 additions & 8 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1488,9 +1488,9 @@
}
}
</style>
<meta content="Bikeshed version 26c78a10d, updated Wed Jul 24 12:23:55 2024 -0700" name="generator">
<meta content="Bikeshed version caab1a033, updated Mon Sep 9 11:32:00 2024 -0700" name="generator">
<link href="https://speced.github.io/bikeshed/" rel="canonical">
<meta content="26c78a10d73876e96a126dbf7599eab4d0d998ed" name="revision">
<meta content="caab1a03393262252169dcf1748b64aeb3ff7156" name="revision">
<meta content="dark light" name="color-scheme">
<style>/* Boilerplate: style-autolinks */
.css.css, .property.property, .descriptor.descriptor {
Expand Down Expand Up @@ -2299,7 +2299,7 @@
<div class="head">
<p data-fill-with="logo"></p>
<h1 class="p-name no-ref" id="title">Bikeshed Documentation</h1>
<h2 class="no-num no-toc no-ref heading settled" id="profile-and-date"><span class="content">Living Standard, <time class="dt-updated" datetime="2024-08-06">6 August 2024</time></span></h2>
<h2 class="no-num no-toc no-ref heading settled" id="profile-and-date"><span class="content">Living Standard, <time class="dt-updated" datetime="2024-09-16">16 September 2024</time></span></h2>
<div data-fill-with="spec-metadata">
<dl>
<dt>This version:
Expand All @@ -2314,7 +2314,7 @@ <h2 class="no-num no-toc no-ref heading settled" id="profile-and-date"><span cla
<div data-fill-with="warning"></div>
<p class="copyright" data-fill-with="copyright"><a href="http://creativecommons.org/publicdomain/zero/1.0/" rel="license"><img alt="CC0" height="15" src="https://licensebuttons.net/p/zero/1.0/80x15.png" width="80"></a> To the extent possible under law, the editors have waived all copyright
and related or neighboring rights to this work.
In addition, as of 6 August 2024,
In addition, as of 16 September 2024,
the editors have made this specification available under the <a href="https://www.openwebfoundation.org/the-agreements/the-owf-1-0-agreements-granted-claims/owfa-1-0" rel="license">Open Web Foundation Agreement Version 1.0</a>,
which is available at https://www.openwebfoundation.org/the-agreements/the-owf-1-0-agreements-granted-claims/owfa-1-0.
Parts of this work may be from another specification document. If so, those parts are instead covered by the license of that specification document. </p>
Expand Down Expand Up @@ -3799,12 +3799,9 @@ <h2 class="heading settled" data-level="4" id="metadata"><span class="secno">4.
otherwise, if directly turned on,
it will emit a fatal error if it can’t find your spec.</p>
<li data-md>
<p><dfn class="dfn-paneled" data-dfn-for="metadata" data-dfn-type="dfn" data-export id="metadata-ignore-mdn-failure">Ignore MDN Failure</dfn> takes one of the IDs that MDN is attempting to target,
<p><dfn class="dfn-paneled" data-dfn-for="metadata" data-dfn-type="dfn" data-export id="metadata-ignore-mdn-failure">Ignore MDN Failure</dfn> 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.</p>
</ul>
Expand Down

0 comments on commit 5945c8e

Please sign in to comment.