2010-04-05 Chris Jerdonek <cjerdonek@webkit.org>
authorhamaji@chromium.org <hamaji@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Apr 2010 03:59:15 +0000 (03:59 +0000)
committerhamaji@chromium.org <hamaji@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Apr 2010 03:59:15 +0000 (03:59 +0000)
        Reviewed by Shinichiro Hamaji.

        Fixed check-webkit-style issue where the script was prematurely
        exiting when encountering deleted files in patches.

        https://bugs.webkit.org/show_bug.cgi?id=37122

        * Scripts/webkitpy/style/checker.py:
          - Changed non-existent file message from ERROR to WARN.
          - StyleChecker.check_file() no longer raises an exception when
            a file is not found.

        * Scripts/webkitpy/style/checker_unittest.py:
          - Updated unit tests as necessary.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@57119 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitTools/ChangeLog
WebKitTools/Scripts/webkitpy/style/checker.py
WebKitTools/Scripts/webkitpy/style/checker_unittest.py

index 59d6337..c6c6633 100644 (file)
@@ -1,3 +1,20 @@
+2010-04-05  Chris Jerdonek  <cjerdonek@webkit.org>
+
+        Reviewed by Shinichiro Hamaji.
+
+        Fixed check-webkit-style issue where the script was prematurely
+        exiting when encountering deleted files in patches.
+
+        https://bugs.webkit.org/show_bug.cgi?id=37122
+
+        * Scripts/webkitpy/style/checker.py:
+          - Changed non-existent file message from ERROR to WARN.
+          - StyleChecker.check_file() no longer raises an exception when
+            a file is not found.
+
+        * Scripts/webkitpy/style/checker_unittest.py:
+          - Updated unit tests as necessary.
+
 2010-04-05  Adam Barth  <abarth@webkit.org>
 
         Reviewed by Eric Seidel.
 2010-04-05  Adam Barth  <abarth@webkit.org>
 
         Reviewed by Eric Seidel.
index f5fae41..258a0b3 100644 (file)
@@ -678,8 +678,8 @@ class StyleChecker(object):
                         mock_process_file)
 
         if not os_path_exists(file_path):
                         mock_process_file)
 
         if not os_path_exists(file_path):
-            _log.error("File does not exist: %s" % file_path)
-            sys.exit(1)
+            _log.warn("Skipping non-existent file: %s" % file_path)
+            return
 
         _log.debug("Checking: " + file_path)
 
 
         _log.debug("Checking: " + file_path)
 
index d632f05..fd289aa 100755 (executable)
@@ -641,9 +641,10 @@ class StyleCheckerCheckFileTest(StyleCheckerCheckFileBase):
         self.assertFalse(self.mock_os_path_exists(file_path))
 
         # Check the outcome.
         self.assertFalse(self.mock_os_path_exists(file_path))
 
         # Check the outcome.
-        self.assertRaises(SystemExit, self.call_check_file, file_path)
-        self.assertLog(["ERROR: File does not exist: "
-                        "file_does_not_exist.txt\n"])
+        self.call_check_file(file_path)
+        self.assert_attributes(None, None, None, "")
+        self.assertLog(['WARNING: Skipping non-existent file: '
+                        'file_does_not_exist.txt\n'])
 
     def test_check_file_on_skip_without_warning(self):
         """Test check_file() for a skipped-without-warning file."""
 
     def test_check_file_on_skip_without_warning(self):
         """Test check_file() for a skipped-without-warning file."""