Title: [152599] trunk/Tools
- Revision
- 152599
- Author
- [email protected]
- Date
- 2013-07-12 11:36:25 -0700 (Fri, 12 Jul 2013)
Log Message
check-webkit-style: Ignore false positive: Instance of 'Popen' has no 'pid' member
https://bugs.webkit.org/show_bug.cgi?id=118592
Patch by Brian Holt <[email protected]> on 2013-07-12
Reviewed by Martin Robinson.
Added a suppression for pylint false positives and a unit test.
* Scripts/webkitpy/style/checkers/python.py:
(Pylinter):
* Scripts/webkitpy/style/checkers/python_unittest.py:
(PythonCheckerTest.test_check):
(PythonCheckerTest):
(PythonCheckerTest.test_pylint_false_positives):
(PythonCheckerTest.test_pylint_false_positives._mock_handle_pylint_false_positives):
* Scripts/webkitpy/style/checkers/python_unittest_falsepositives.py: Added.
(test_popen):
Modified Paths
Added Paths
Diff
Modified: trunk/Tools/ChangeLog (152598 => 152599)
--- trunk/Tools/ChangeLog 2013-07-12 18:31:29 UTC (rev 152598)
+++ trunk/Tools/ChangeLog 2013-07-12 18:36:25 UTC (rev 152599)
@@ -1,3 +1,22 @@
+2013-07-12 Brian Holt <[email protected]>
+
+ check-webkit-style: Ignore false positive: Instance of 'Popen' has no 'pid' member
+ https://bugs.webkit.org/show_bug.cgi?id=118592
+
+ Reviewed by Martin Robinson.
+
+ Added a suppression for pylint false positives and a unit test.
+
+ * Scripts/webkitpy/style/checkers/python.py:
+ (Pylinter):
+ * Scripts/webkitpy/style/checkers/python_unittest.py:
+ (PythonCheckerTest.test_check):
+ (PythonCheckerTest):
+ (PythonCheckerTest.test_pylint_false_positives):
+ (PythonCheckerTest.test_pylint_false_positives._mock_handle_pylint_false_positives):
+ * Scripts/webkitpy/style/checkers/python_unittest_falsepositives.py: Added.
+ (test_popen):
+
2013-07-11 Arnaud Renevier <[email protected]>
Unreviewed. Add myself as a committer.
Modified: trunk/Tools/Scripts/webkitpy/style/checkers/python.py (152598 => 152599)
--- trunk/Tools/Scripts/webkitpy/style/checkers/python.py 2013-07-12 18:31:29 UTC (rev 152598)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/python.py 2013-07-12 18:36:25 UTC (rev 152599)
@@ -95,6 +95,7 @@
"Instance of 'Popen' has no 'stdout' member",
"Instance of 'Popen' has no 'stderr' member",
"Instance of 'Popen' has no 'wait' member",
+ "Instance of 'Popen' has no 'pid' member",
]
def __init__(self):
Modified: trunk/Tools/Scripts/webkitpy/style/checkers/python_unittest.py (152598 => 152599)
--- trunk/Tools/Scripts/webkitpy/style/checkers/python_unittest.py 2013-07-12 18:31:29 UTC (rev 152598)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/python_unittest.py 2013-07-12 18:36:25 UTC (rev 152599)
@@ -61,3 +61,20 @@
(4, "pep8/W291", 5, "trailing whitespace"),
(4, "pylint/E0602", 5, "Undefined variable 'error'"),
])
+
+ def test_pylint_false_positives(self):
+ """Test that pylint false positives are suppressed."""
+ errors = []
+
+ def _mock_handle_pylint_false_positives(line_number, category, confidence,
+ message):
+ error = (line_number, category, confidence, message)
+ errors.append(error)
+
+ current_dir = os.path.dirname(__file__)
+ file_path = os.path.join(current_dir, "python_unittest_false_positives.py")
+
+ checker = PythonChecker(file_path, _mock_handle_style_error)
+ checker.check(lines=[])
+
+ self.assertEqual(errors, [])
Added: trunk/Tools/Scripts/webkitpy/style/checkers/python_unittest_falsepositives.py (0 => 152599)
--- trunk/Tools/Scripts/webkitpy/style/checkers/python_unittest_falsepositives.py (rev 0)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/python_unittest_falsepositives.py 2013-07-12 18:36:25 UTC (rev 152599)
@@ -0,0 +1,16 @@
+# This test verifies that the false positives generated by pylint are
+# correctly suppressed.
+
+import subprocess
+
+
+def test_popen(proc):
+ p = subprocess.Popen(proc, stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT)
+ tmp1 = p.poll
+ tmp2 = p.returncode
+ tmp3 = p.stdin
+ tmp4 = p.stdout
+ tmp5 = p.stderr
+ tmp6 = p.wait
+ tmp7 = p.pid
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes