check-webkit-style's cpp linter incorrectly treats colon appearing in a string argument as the start of the initializer list, and emits an error if whitespace rules aren't followed. For example, running check-webkit-style on the following: MyClass::MyClass() : m_foo("foo:bar") { } Will output: ERROR: Missing spaces around : [whitespace/init] [4] Note: The problem is with the cpp linter regex, see Tools/Scripts/webkitpy/style/checkers/cpp.py:2043: # match the start of initialization list if search(r'^(?P<indentation>\s*)((explicit\s+)?[^(\s|\?)]+\([^\?]*\)\s?\:|^(\s|\?)*\:)([^\:]|\Z)[^;]*$', line): if search(r'[^:]\:[^\:\s]+', line): error(line_number, 'whitespace/init', 4, 'Missing spaces around :') ...
<rdar://problem/33216486>
Created attachment 315052 [details] Patch
Comment on attachment 315052 [details] Patch r- for now. Need to improve on this (using elided over raw_lines feels risky), and add a test case to Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py.