Changeset 188940 in webkit
- Timestamp:
- Aug 25, 2015 6:02:54 PM (9 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r188939 r188940 1 2015-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 1 18 2015-08-25 Brent Fulgham <bfulgham@apple.com> 2 19 -
trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py
r187154 r188940 1643 1643 return True 1644 1644 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 return1658 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 1663 1645 def check_function_definition(filename, file_extension, clean_lines, line_number, function_state, error): 1664 1646 """Check that function definitions for style issues. … … 1679 1661 parameter_list = function_state.parameter_list() 1680 1662 for parameter in parameter_list: 1681 check_function_definition_and_pass_ptr(parameter.type, parameter.row, error)1682 1683 1663 # Do checks specific to function declarations and parameter names. 1684 1664 if not function_state.is_declaration or not parameter.name: … … 1694 1674 if not _check_parameter_name_against_text(parameter, parameter.type, error): 1695 1675 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*Ptr1702 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 return1712 1713 lines = clean_lines.lines1714 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)1722 1676 1723 1677 … … 3753 3707 return 3754 3708 check_function_definition(filename, file_extension, clean_lines, line, function_state, error) 3755 check_pass_ptr_usage(clean_lines, line, function_state, error)3756 3709 check_for_leaky_patterns(clean_lines, line, function_state, error) 3757 3710 check_for_multiline_comments_and_strings(clean_lines, line, error) … … 3865 3818 'readability/naming/underscores', 3866 3819 'readability/null', 3867 'readability/pass_ptr',3868 3820 'readability/streams', 3869 3821 'readability/todo',
Note: See TracChangeset
for help on using the changeset viewer.