Changeset 162365 in webkit


Ignore:
Timestamp:
Jan 20, 2014 11:39:15 AM (10 years ago)
Author:
Darin Adler
Message:

Update style checker and tests to deal with override instead of OVERRIDE
https://bugs.webkit.org/show_bug.cgi?id=127175

Reviewed by Anders Carlsson.

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

(check_braces): Use override instead of OVERRIDE.

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

(CppStyleTest.test_brace_at_begin_of_line): Ditto.

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r162358 r162365  
     12014-01-20  Darin Adler  <darin@apple.com>
     2
     3        Update style checker and tests to deal with override instead of OVERRIDE
     4        https://bugs.webkit.org/show_bug.cgi?id=127175
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * Scripts/webkitpy/style/checkers/cpp.py:
     9        (check_braces): Use override instead of OVERRIDE.
     10        * Scripts/webkitpy/style/checkers/cpp_unittest.py:
     11        (CppStyleTest.test_brace_at_begin_of_line): Ditto.
     12
    1132014-01-20  Alexey Proskuryakov  <ap@apple.com>
    214
  • trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py

    r161535 r162365  
    23642364        # We also allow '#' for #endif and '=' for array initialization.
    23652365        previous_line = get_previous_non_blank_line(clean_lines, line_number)[0]
    2366         if ((not search(r'[;:}{)=]\s*$|\)\s*((const|OVERRIDE)\s*)?(->\s*\S+)?\s*$', previous_line)
     2366        if ((not search(r'[;:}{)=]\s*$|\)\s*((const|override)\s*)?(->\s*\S+)?\s*$', previous_line)
    23672367             or search(r'\b(if|for|foreach|while|switch|else|NS_ENUM)\b', previous_line))
    23682368            and previous_line.find('#') < 0):
    23692369            error(line_number, 'whitespace/braces', 4,
    23702370                  'This { should be at the end of the previous line')
    2371     elif (search(r'\)\s*(((const|OVERRIDE)\s*)*\s*)?{\s*$', line)
     2371    elif (search(r'\)\s*(((const|override)\s*)*\s*)?{\s*$', line)
    23722372          and line.count('(') == line.count(')')
    23732373          and not search(r'\b(if|for|foreach|while|switch|NS_ENUM)\b', line)
  • trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py

    r161535 r162365  
    15881588            'Place brace on its own line for function definitions.  [whitespace/braces] [4]')
    15891589        self.assert_multi_line_lint(
    1590             'int foo() const OVERRIDE {',
     1590            'int foo() const override {',
    15911591            'Place brace on its own line for function definitions.  [whitespace/braces] [4]')
    15921592        self.assert_multi_line_lint(
    1593             'int foo() OVERRIDE {',
     1593            'int foo() override {',
    15941594            'Place brace on its own line for function definitions.  [whitespace/braces] [4]')
    15951595        self.assert_multi_line_lint(
     
    15991599            '')
    16001600        self.assert_multi_line_lint(
    1601             'int foo() OVERRIDE\n'
     1601            'int foo() override\n'
    16021602            '{\n'
    16031603            '}\n',
Note: See TracChangeset for help on using the changeset viewer.