Diff
Modified: trunk/Tools/ChangeLog (160229 => 160230)
--- trunk/Tools/ChangeLog 2013-12-06 18:54:32 UTC (rev 160229)
+++ trunk/Tools/ChangeLog 2013-12-06 18:56:35 UTC (rev 160230)
@@ -1,3 +1,18 @@
+2013-12-06 Tamas Gergely <[email protected]>
+
+ Remove function from style/checkers/cpp.py.
+ https://bugs.webkit.org/show_bug.cgi?id=125341
+
+ Reviewed by Darin Adler.
+
+ Corrects a FIXME: by removing a function from cpp.py.
+
+ * Scripts/webkitpy/style/checkers/cpp.py:
+ (CppChecker.__init__):
+ (CppChecker.check):
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+ (CppStyleTestBase.process_file_data):
+
2013-12-06 Gergo Balogh <[email protected]>
check-webkit-style: false positive warning for indentation of #ifdef code.
Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py (160229 => 160230)
--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py 2013-12-06 18:54:32 UTC (rev 160229)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py 2013-12-06 18:56:35 UTC (rev 160230)
@@ -3723,7 +3723,7 @@
])
def __init__(self, file_path, file_extension, handle_style_error,
- min_confidence):
+ min_confidence, unit_test_config={}):
"""Create a CppChecker instance.
Args:
@@ -3731,10 +3731,12 @@
the leading dot.
"""
+ global _unit_test_config
self.file_extension = file_extension
self.file_path = file_path
self.handle_style_error = handle_style_error
self.min_confidence = min_confidence
+ _unit_test_config = unit_test_config
# Useful for unit testing.
def __eq__(self, other):
@@ -3758,12 +3760,3 @@
def check(self, lines):
_process_lines(self.file_path, self.file_extension, lines,
self.handle_style_error, self.min_confidence)
-
-
-# FIXME: Remove this function (requires refactoring unit tests).
-def process_file_data(filename, file_extension, lines, error, min_confidence, unit_test_config):
- global _unit_test_config
- _unit_test_config = unit_test_config
- checker = CppChecker(filename, file_extension, error, min_confidence)
- checker.check(lines)
- _unit_test_config = {}
Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py (160229 => 160230)
--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py 2013-12-06 18:54:32 UTC (rev 160229)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py 2013-12-06 18:56:35 UTC (rev 160230)
@@ -247,9 +247,8 @@
# Helper function to avoid needing to explicitly pass confidence
# in all the unit test calls to cpp_style.process_file_data().
def process_file_data(self, filename, file_extension, lines, error, unit_test_config={}):
- """Call cpp_style.process_file_data() with the min_confidence."""
- return cpp_style.process_file_data(filename, file_extension, lines,
- error, self.min_confidence, unit_test_config)
+ checker = CppChecker(filename, file_extension, error, self.min_confidence, unit_test_config)
+ checker.check(lines)
def perform_lint(self, code, filename, basic_error_rules, unit_test_config={}, lines_to_check=None):
error_collector = ErrorCollector(self.assertTrue, FilterConfiguration(basic_error_rules), lines_to_check)