Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9f4622bbc2362afafffa06bf9b1c6a1388cadb5e
      
https://github.com/WebKit/WebKit/commit/9f4622bbc2362afafffa06bf9b1c6a1388cadb5e
  Author: David Kilzer <[email protected]>
  Date:   2026-10-01 (Thu, 01 Oct 2026)

  Changed paths:
    M Source/WebKitLegacy/mac/Misc/WebKitErrors.mm
    M Tools/Scripts/webkitpy/style/checkers/cpp.py
    M Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py

  Log Message:
  -----------
  check-webkit-style reports Objective-C dictionary literals and multi-line 
method declarations as style errors
<https://bugs.webkit.org/show_bug.cgi?id=325904>
<rdar://188882714>

Reviewed by Chris Dumez.

Teach the C++ style checker two valid Objective-C constructs it misreads
as errors.  An `@{ ... }` dictionary literal entry like `@(Key): value,`
matches the C++ member-initializer-list pattern, and the colon-aligned
continuation lines of a multi-line method declaration fail the 4-space
indentation and brace checks.  When 322353@main renamed WebKitErrors.m
to WebKitErrors.mm, the style queue reported 137 such errors because it
checks every line of a renamed file.

Include drive-by fix to write `+ (id)` with a space in WebKitErrors.mm
to match the rest of WebKit.

Covered by new unit tests for both constructs, including a check that
misformatted C++ member initializer lists are still reported.

* Source/WebKitLegacy/mac/Misc/WebKitErrors.mm:
(+[NSError _webkit_errorWithDomain:code:URL:]):
* Tools/Scripts/webkitpy/style/checkers/cpp.py:
(is_in_objective_c_dictionary_literal): Add.
(check_member_initialization_list):
(get_objective_c_method_declaration_colon_columns): Add.
(check_indentation_amount):
(check_braces):
* Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py:
(WebKitStyleTest.test_member_initialization_list):
(WebKitStyleTest.test_objective_c_multi_line_method_declaration): Add.

Canonical link: https://commits.webkit.org/322386@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to