Changeset 57870 in webkit
- Timestamp:
- Apr 19, 2010 10:41:51 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r57869 r57870 1 2010-04-19 Shinichiro Hamaji <hamaji@chromium.org> 2 3 Reviewed by David Levin. 4 5 check-webkit-style: exits when encountering a deleted file 6 https://bugs.webkit.org/show_bug.cgi?id=37122 7 8 This reverts the quick fix done by r57119 and makes check_patch 9 not call check_file for deleted files. 10 11 Also this change fixes the behavior for "-", which should mean 12 stdin. Before this change, the style checker just ignored "-" 13 with a warning message. 14 15 * Scripts/webkitpy/style/checker.py: 16 * Scripts/webkitpy/style/checker_unittest.py: 17 1 18 2010-04-19 Daniel Bates <dbates@rim.com> 2 19 -
trunk/WebKitTools/Scripts/webkitpy/style/checker.py
r57803 r57870 691 691 class. 692 692 693 Raises: 694 SystemExit: if the file does not exist. 695 693 696 """ 694 697 if mock_handle_style_error is None: … … 707 710 mock_process_file) 708 711 709 if not os_path_exists(file_path) :710 _log. warn("Skipping non-existent file: %s" % file_path)711 return712 if not os_path_exists(file_path) and file_path != "-": 713 _log.error("File does not exist: %s" % file_path) 714 sys.exit(1) 712 715 713 716 _log.debug("Checking: " + file_path) … … 767 770 % (len(line_numbers), path)) 768 771 769 self._file_checker.check_file(file_path=path, 770 line_numbers=line_numbers) 772 # If line_numbers is empty, the file has no new or 773 # modified lines. In this case, we don't check the file 774 # because we'll never output errors for the file. 775 # This optimization also prevents the program from exiting 776 # due to a deleted file. 777 if line_numbers: 778 self._file_checker.check_file(file_path=path, 779 line_numbers=line_numbers) -
trunk/WebKitTools/Scripts/webkitpy/style/checker_unittest.py
r57467 r57870 632 632 mock_process_file=self.mock_process_file) 633 633 634 file_count = 1 if self.mock_os_path_exists(file_path) else 0 635 636 self.assertEquals(file_count, style_checker.file_count) 634 self.assertEquals(style_checker.file_count, 1) 637 635 638 636 def test_check_file_does_not_exist(self): … … 643 641 644 642 # Check the outcome. 643 self.assertRaises(SystemExit, self.call_check_file, file_path) 644 self.assertLog(["ERROR: File does not exist: " 645 "file_does_not_exist.txt\n"]) 646 647 def test_check_file_stdin(self): 648 file_path = "-" 649 650 # Confirm that the file does not exist. 651 self.assertFalse(self.mock_os_path_exists(file_path)) 652 653 # Check the outcome. 645 654 self.call_check_file(file_path) 646 self.assert_attributes(None, None, None, "") 647 self.assertLog(['WARNING: Skipping non-existent file: ' 648 'file_does_not_exist.txt\n']) 655 expected_processor = CppProcessor(file_path, 656 "", 657 self.mock_handle_style_error, 3) 658 self.assert_attributes(file_path, 659 self.mock_handle_style_error, 660 expected_processor, 661 "") 649 662 650 663 def test_check_file_on_skip_without_warning(self): … … 783 796 """) 784 797 self._assert_checked([("__init__.py", set([2]))]) 798 799 def test_check_patch_with_deletion(self): 800 self._call_check_patch("""Index: __init__.py 801 =================================================================== 802 --- __init__.py (revision 3593) 803 +++ __init__.py (working copy) 804 @@ -1 +0,0 @@ 805 -foobar 806 """) 807 # _mock_check_file should not be called for the deletion patch. 808 self._assert_checked([])
Note: See TracChangeset
for help on using the changeset viewer.