From 88fd1b69be95878fcecc0f7ea7d436fc3117e2c2 Mon Sep 17 00:00:00 2001 From: Denis Ah-Kang <1696128+deniak@users.noreply.github.com> Date: Tue, 17 Dec 2024 06:44:08 +0400 Subject: [PATCH] add exception on implementation report for webgpu and WGSL (#1900) * rework exception mechanism so allow the webgpu and WSGL CR to be published without implementation report * remove unneeded async function --- .cspell.json | 4 +++- lib/exceptions.json | 6 ++++++ lib/rules/headers/dl.js | 3 ++- lib/validator.js | 5 +++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.cspell.json b/.cspell.json index a4ee15961..8917d5a21 100644 --- a/.cspell.json +++ b/.cspell.json @@ -91,11 +91,13 @@ "vcard", "WHATWG", "wcag", + "webgpu", "webidl", "webperf", "webrtc", "Whut", - "wrongprocess" + "wrongprocess", + "WGSL" ], "dictionaries": ["html", "js", "css", "npm", "en-gb"], "ignorePaths": [ diff --git a/lib/exceptions.json b/lib/exceptions.json index 76e9081c7..2cba7e587 100644 --- a/lib/exceptions.json +++ b/lib/exceptions.json @@ -29,5 +29,11 @@ { "rule": "sotd.candidate-review-end" } + ], + "^webgpu|WGSL$": [ + { + "rule": "headers.dl", + "message": "Implementation report" + } ] } diff --git a/lib/rules/headers/dl.js b/lib/rules/headers/dl.js index 829d489a1..4f39d004f 100644 --- a/lib/rules/headers/dl.js +++ b/lib/rules/headers/dl.js @@ -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(); diff --git a/lib/validator.js b/lib/validator.js index 7a8372c5d..9dc9cfd77 100644 --- a/lib/validator.js +++ b/lib/validator.js @@ -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); @@ -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; }