NEW311387
stylechecker is trying to tackle lines contained in R"js( … )js"_s
https://bugs.webkit.org/show_bug.cgi?id=311387
Summary stylechecker is trying to tackle lines contained in R"js( … )js"_s
Karl Dubost
Reported 2026-04-02 19:23:27 PDT
In my case I was working on a script injection: And the style checker sent: Source/WebCore/page/Quirks.cpp:143: error: [whitespace/parens] More than one command on the same line in if Source/WebCore/page/Quirks.cpp:146: error: [whitespace/braces] Place brace on its own line for function definitions. Source/WebCore/page/Quirks.cpp:155: error: [whitespace/parens] More than one command on the same line in if Source/WebCore/page/Quirks.cpp:160: error: [whitespace/newline] More than one command on the same line For this code: static constexpr auto ceacBeforeUnloadFixScript = R"js((function() { if (window.__ceacBeforeUnloadFix) return; window.__ceacBeforeUnloadFix = true; var origAEL = window.addEventListener; window.addEventListener = function(type, fn, opts) { if (type === 'beforeunload') { return origAEL.call(this, type, function(e) { var ae = document.activeElement; if (ae && ae.tagName === 'INPUT') { var t = (ae.type || '').toLowerCase(); if (t === 'radio' || t === 'checkbox' || t === 'submit' || t === 'button') return; } if (typeof fn === 'function') fn.call(this, e); }, opts); } return origAEL.apply(this, arguments); }; })();)js"_s; The easy fix is to put everything as a one-liner but then we lose the readability of the code. Maybe the style should avoid to parse lines inside a R"js( … )js"_s structure. Related to https://github.com/WebKit/WebKit/pull/61948
Attachments
Radar WebKit Bug Importer
Comment 1 2026-04-09 19:24:12 PDT
Note You need to log in before you can comment on or make changes to this bug.