Bug 181606 - check-webkit-style: false positive for [whitespace/braces] with os_log format string
Summary: check-webkit-style: false positive for [whitespace/braces] with os_log format...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
Keywords: InRadar
Depends on:
Reported: 2018-01-12 12:02 PST by Keith Rollin
Modified: 2018-01-13 12:39 PST (History)
11 users (show)

See Also:

Patch v1 (2.84 KB, patch)
2018-01-12 21:51 PST, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Rollin 2018-01-12 12:02:11 PST
I get the following errors:

$ check-webkit-style 
ERROR: Source/WebCore/loader/ResourceLoadObserver.cpp:316:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/loader/ResourceLoadObserver.cpp:317:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp:748:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp:749:  Missing space before {  [whitespace/braces] [5]

on lines like:

#define LOCAL_LOG(str, ...) \
        RELEASE_LOG(ResourceLoadStatistics, "ResourceLoadObserver::logUserInteraction: counter = %" PRIu64 ": " str, counter, ##__VA_ARGS__)

        LOCAL_LOG(R"({ "url": "%{public}s",)", escapedURL.utf8().data());
        LOCAL_LOG(R"(  "domain" : "%{public}s",)", escapedDomain.utf8().data());

check-webkit-style appears to be stumbling over the {}'s in the print specification (that is, the "%s{public}s"). The use of {public} in the format string is an extension used by os_log() to the standard C/C++ format string specification.
Comment 1 David Kilzer (:ddkilzer) 2018-01-12 21:51:14 PST
Created attachment 331276 [details]
Patch v1
Comment 2 WebKit Commit Bot 2018-01-13 12:38:09 PST
Comment on attachment 331276 [details]
Patch v1

Clearing flags on attachment: 331276

Committed r226938: <https://trac.webkit.org/changeset/226938>
Comment 3 WebKit Commit Bot 2018-01-13 12:38:11 PST
All reviewed patches have been landed.  Closing bug.
Comment 4 Radar WebKit Bug Importer 2018-01-13 12:39:27 PST