Changeset 188940 in webkit


Ignore:
Timestamp:
Aug 25, 2015 6:02:54 PM (9 years ago)
Author:
Gyuyoung Kim
Message:

Remove PassRefPtr style check rule
https://bugs.webkit.org/show_bug.cgi?id=148432

Reviewed by Andreas Kling.

PassRefPtr is being removed. Thus style rule needs to be removed as well.

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

(_check_parameter_name_against_text): Deleted.
(check_function_definition_and_pass_ptr): Deleted.
(check_function_definition): Deleted.
(check_pass_ptr_usage): Deleted.
(process_line): Deleted.
(CppChecker): Deleted.

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r188939 r188940  
     12015-08-25  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
     2
     3        Remove PassRefPtr style check rule
     4        https://bugs.webkit.org/show_bug.cgi?id=148432
     5
     6        Reviewed by Andreas Kling.
     7
     8        PassRefPtr is being removed. Thus style rule needs to be removed as well.
     9
     10        * Scripts/webkitpy/style/checkers/cpp.py:
     11        (_check_parameter_name_against_text): Deleted.
     12        (check_function_definition_and_pass_ptr): Deleted.
     13        (check_function_definition): Deleted.
     14        (check_pass_ptr_usage): Deleted.
     15        (process_line): Deleted.
     16        (CppChecker): Deleted.
     17
    1182015-08-25  Brent Fulgham  <bfulgham@apple.com>
    219
  • trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py

    r187154 r188940  
    16431643    return True
    16441644
    1645 
    1646 def check_function_definition_and_pass_ptr(type_text, row, error):
    1647     """Check that function definitions for use Pass*Ptr instead of *Ptr.
    1648 
    1649     Args:
    1650        type_text: A string containing the type.
    1651        row: The row number of the type.
    1652        error: The function to call with any errors found.
    1653     """
    1654     match_ref_ptr = '(?=\W|^)RefPtr(?=\W)'
    1655     bad_type_usage = search(match_ref_ptr, type_text)
    1656     if not bad_type_usage or type_text.endswith('&') or type_text.endswith('*'):
    1657         return
    1658     type_name = bad_type_usage.group(0)
    1659     error(row, 'readability/pass_ptr', 5,
    1660           'The parameter type should use Pass%s instead of %s.' % (type_name, type_name))
    1661 
    1662 
    16631645def check_function_definition(filename, file_extension, clean_lines, line_number, function_state, error):
    16641646    """Check that function definitions for style issues.
     
    16791661    parameter_list = function_state.parameter_list()
    16801662    for parameter in parameter_list:
    1681         check_function_definition_and_pass_ptr(parameter.type, parameter.row, error)
    1682 
    16831663        # Do checks specific to function declarations and parameter names.
    16841664        if not function_state.is_declaration or not parameter.name:
     
    16941674        if not _check_parameter_name_against_text(parameter, parameter.type, error):
    16951675            continue  # Since an error was noted for this name, move to the next parameter.
    1696 
    1697 
    1698 def check_pass_ptr_usage(clean_lines, line_number, function_state, error):
    1699     """Check for proper usage of Pass*Ptr.
    1700 
    1701     Currently this is limited to detecting declarations of Pass*Ptr
    1702     variables inside of functions.
    1703 
    1704     Args:
    1705       clean_lines: A CleansedLines instance containing the file.
    1706       line_number: The number of the line to check.
    1707       function_state: Current function name and lines in body so far.
    1708       error: The function to call with any errors found.
    1709     """
    1710     if not function_state.in_a_function:
    1711         return
    1712 
    1713     lines = clean_lines.lines
    1714     line = lines[line_number]
    1715     if line_number > function_state.body_start_position.row:
    1716         matched_pass_ptr = match(r'^\s*Pass([A-Z][A-Za-z]*)Ptr<', line)
    1717         if matched_pass_ptr:
    1718             type_name = 'Pass%sPtr' % matched_pass_ptr.group(1)
    1719             error(line_number, 'readability/pass_ptr', 5,
    1720                   'Local variables should never be %s (see '
    1721                   'http://webkit.org/coding/RefPtr.html).' % type_name)
    17221676
    17231677
     
    37533707        return
    37543708    check_function_definition(filename, file_extension, clean_lines, line, function_state, error)
    3755     check_pass_ptr_usage(clean_lines, line, function_state, error)
    37563709    check_for_leaky_patterns(clean_lines, line, function_state, error)
    37573710    check_for_multiline_comments_and_strings(clean_lines, line, error)
     
    38653818        'readability/naming/underscores',
    38663819        'readability/null',
    3867         'readability/pass_ptr',
    38683820        'readability/streams',
    38693821        'readability/todo',
Note: See TracChangeset for help on using the changeset viewer.