From 6c278a39cde6cd6d8b4e59fee06e4bbb74df27b3 Mon Sep 17 00:00:00 2001 From: Denis Ah-Kang Date: Mon, 16 Dec 2024 18:28:45 +0400 Subject: [PATCH 1/2] rework exception mechanism so allow the webgpu and WSGL CR to be published without implementation report --- .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..5e3557c52 100644 --- a/lib/validator.js +++ b/lib/validator.js @@ -195,12 +195,13 @@ Specberus.prototype.validate = function (options) { .catch(err => this.throw(err.toString())); }; -Specberus.prototype.error = function (rule, key, extra) { +Specberus.prototype.error = async function (rule, key, extra) { let name; if (typeof rule === 'string') name = rule; else name = rule.name; + const shortname = this.shortname || (await this.getShortname()); if ( - this.shortname !== undefined && + shortname !== undefined && this.exceptions.has(this.shortname, name, key, extra) ) this.warning(rule, key, extra); From 231061fa886bb2114bbc09411516e7e6d0a84690 Mon Sep 17 00:00:00 2001 From: Denis Ah-Kang Date: Mon, 16 Dec 2024 18:40:23 +0400 Subject: [PATCH 2/2] remove unneeded async function --- lib/validator.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/validator.js b/lib/validator.js index 5e3557c52..9dc9cfd77 100644 --- a/lib/validator.js +++ b/lib/validator.js @@ -195,11 +195,11 @@ Specberus.prototype.validate = function (options) { .catch(err => this.throw(err.toString())); }; -Specberus.prototype.error = async function (rule, key, extra) { +Specberus.prototype.error = function (rule, key, extra) { let name; if (typeof rule === 'string') name = rule; else name = rule.name; - const shortname = this.shortname || (await this.getShortname()); + const shortname = this.getShortname(); if ( shortname !== undefined && this.exceptions.has(this.shortname, name, key, extra) @@ -449,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; }