# HG changeset patch # User hodgestar # Date 1306143551 0 # Node ID 5d9fedf2f851e8ff4be3853b6ff20fff8f40a6a4 # Parent bcc8f7f95b774318b8c4b653c4f80679a4ca731c 0.6dev: Merged [997] from trunk. diff --git a/bitten/build/pythontools.py b/bitten/build/pythontools.py --- a/bitten/build/pythontools.py +++ b/bitten/build/pythontools.py @@ -173,7 +173,7 @@ problems.append(xmlio.Element('problem', category=category, type=msg_type, tag=tag, line=lineno, file=filename)[ - match.group('msg') or '' + xmlio.Element('msg')[match.group('msg') or ''] ]) ctxt.report('lint', problems) finally: diff --git a/bitten/build/tests/pythontools.py b/bitten/build/tests/pythontools.py --- a/bitten/build/tests/pythontools.py +++ b/bitten/build/tests/pythontools.py @@ -210,6 +210,26 @@ def tearDown(self): shutil.rmtree(self.basedir) + def test_summary_format(self): + # thoroughly check on report line + self.summary.write(""" +%s/module/file1.py:42: [C] Missing docstring +""" % (self.ctxt.basedir,)) + self.summary.close() + pythontools.pylint(self.ctxt, file_=self.summary.name) + type, category, generator, xml = self.ctxt.output.pop() + self.assertEqual(Recipe.REPORT, type) + self.assertEqual('lint', category) + self.assertEqual(1, len(xml.children)) + child = xml.children[0] + self.assertEqual('problem', child.name) + self.assertEqual('module/file1.py', child.attr['file']) + self.assertEqual(1, len(child.children)) + msg = child.children[0] + self.assertEqual('msg', msg.name) + self.assertEqual(1, len(msg.children)) + self.assertEqual('Missing docstring', msg.children[0]) + def test_summary_with_absolute_path(self): # One posix + one windows path to normalize self.summary.write(""" @@ -248,6 +268,7 @@ self.assertEqual('problem', child.name) self.assertEqual('module/file2.py', child.attr['file']) + class FigleafTestCase(unittest.TestCase): def setUp(self): diff --git a/doc/reports.txt b/doc/reports.txt --- a/doc/reports.txt +++ b/doc/reports.txt @@ -121,6 +121,9 @@ | | ``convention \| warning \| refactor \| error`` | +-----------------+----------------------------------------------------------+ +Each ```` elements may contain a ```` element whose +text is the issue description reported by pylint. + Example: .. code-block:: xml @@ -130,6 +133,6 @@ line="17" tag="TestResultsChartGenerator" file="bitten/report/testing.py"> - Missing docstring + Missing docstring