Skip to content

Commit

Permalink
add exception on implementation report for webgpu and WGSL (#1900)
Browse files Browse the repository at this point in the history
* rework exception mechanism so allow the webgpu and WSGL CR to be published without implementation report

* remove unneeded async function
  • Loading branch information
deniak authored Dec 17, 2024
1 parent fb91f3e commit 88fd1b6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,13 @@
"vcard",
"WHATWG",
"wcag",
"webgpu",
"webidl",
"webperf",
"webrtc",
"Whut",
"wrongprocess"
"wrongprocess",
"WGSL"
],
"dictionaries": ["html", "js", "css", "npm", "en-gb"],
"ignorePaths": [
Expand Down
6 changes: 6 additions & 0 deletions lib/exceptions.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,11 @@
{
"rule": "sotd.candidate-review-end"
}
],
"^webgpu|WGSL$": [
{
"rule": "headers.dl",
"message": "Implementation report"
}
]
}
3 changes: 2 additions & 1 deletion lib/rules/headers/dl.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export const name = self.name;
*/
function checkLink({ sr, rule = self, element, linkName, mustHave = true }) {
if (!element || !element.href) {
if (mustHave) sr.error(rule, 'not-found', { linkName });
if (mustHave)
sr.error(rule, 'not-found', { linkName, message: linkName });
return false;
}
const text = sr.norm(element.textContent).trim();
Expand Down
5 changes: 3 additions & 2 deletions lib/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,9 @@ Specberus.prototype.error = function (rule, key, extra) {
let name;
if (typeof rule === 'string') name = rule;
else name = rule.name;
const shortname = this.getShortname();
if (
this.shortname !== undefined &&
shortname !== undefined &&
this.exceptions.has(this.shortname, name, key, extra)
)
this.warning(rule, key, extra);
Expand Down Expand Up @@ -448,7 +449,7 @@ Specberus.prototype.getEditorIDs = function () {
return result;
};

Specberus.prototype.getShortname = async function () {
Specberus.prototype.getShortname = function () {
if (undefined !== this.shortname) {
return this.shortname;
}
Expand Down

0 comments on commit 88fd1b6

Please sign in to comment.