Changeset 160706 in webkit


Ignore:
Timestamp:
Dec 17, 2013 8:18:21 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Fix for C++ should have the & or * beside the type not the variable name check.
https://bugs.webkit.org/show_bug.cgi?id=125846

Patch by Gergo Balogh <geryxyz@inf.u-szeged.hu> on 2013-12-17
Reviewed by Darin Adler.

  • Scripts/webkitpy/style/checkers/cpp.py:

(check_spacing):

  • Scripts/webkitpy/style/checkers/cpp_unittest.py:

(CppStyleTest.test_pointer_reference_marker_location):

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r160689 r160706  
     12013-12-17  Gergo Balogh  <geryxyz@inf.u-szeged.hu>
     2
     3        Fix for C++ should have the & or * beside the type not the variable name check.
     4        https://bugs.webkit.org/show_bug.cgi?id=125846
     5
     6        Reviewed by Darin Adler.
     7
     8        * Scripts/webkitpy/style/checkers/cpp.py:
     9        (check_spacing):
     10        * Scripts/webkitpy/style/checkers/cpp_unittest.py:
     11        (CppStyleTest.test_pointer_reference_marker_location):
     12
    1132013-12-16  Rob Buis  <rob.buis@samsung.com>
    214
  • trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py

    r160647 r160706  
    19251925    if file_extension == 'cpp':
    19261926        # C++ should have the & or * beside the type not the variable name.
    1927         matched = match(r'\s*\w+(?<!\breturn|\bdelete)\s+(?P<pointer_operator>\*|\&)\w+', line)
     1927        matched = match(r'\s*([\w\s]+)(?<!\breturn|\bdelete)\s+(?P<pointer_operator>\*|\&)\s*\w+', line)
    19281928        if matched:
    19291929            error(line_number, 'whitespace/declaration', 3,
  • trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py

    r160647 r160706  
    20672067                         'Declaration has space between type name and * in int *b  [whitespace/declaration] [3]',
    20682068                         'foo.cpp')
     2069        self.assert_lint('int * b;',
     2070                         'Declaration has space between type name and * in int * b  [whitespace/declaration] [3]',
     2071                         'foo.cpp')
    20692072        self.assert_lint('return *b;', '', 'foo.cpp')
    20702073        self.assert_lint('delete *b;', '', 'foo.cpp')
Note: See TracChangeset for help on using the changeset viewer.