[bitbake-devel] [PATCH 11/11] toaster: toastergui: run pylint on the toaster files

Ed Bartosh ed.bartosh at linux.intel.com
Thu Jul 30 16:25:19 UTC 2015


From: Alexandru DAMIAN <alexandru.damian at intel.com>

This patch enables pylint running on the toaster files, showing
only the errors. This enables spotting common mistakes in the
toaster python files.

Signed-off-by: Alexandru DAMIAN <alexandru.damian at intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
---
 lib/toaster/contrib/tts/tests.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/toaster/contrib/tts/tests.py b/lib/toaster/contrib/tts/tests.py
index 3a4eed1..c510ebb 100644
--- a/lib/toaster/contrib/tts/tests.py
+++ b/lib/toaster/contrib/tts/tests.py
@@ -38,6 +38,12 @@ class Test00PyCompilable(unittest.TestCase):
         except ShellCmdException as exc:
             self.fail("Error compiling python files: %s" % (exc))
 
+    def test_pylint_file(self):
+        try:
+            run_shell_cmd(r"find . -iname \"*\.py\" -type f -print0 | PYTHONPATH=${PYTHONPATH}:. xargs -r -0 -n1 pylint --load-plugins pylint_django -E --reports=n 2>&1", cwd=config.TESTDIR + "/bitbake/lib/toaster")
+        except ShellCmdException as exc:
+            self.fail("Pylint fails: %s\n" % exc)
+
 class Test01PySystemStart(unittest.TestCase):
     ''' Attempts to start Toaster, verify that it is succesfull, and stop it '''
     def setUp(self):
-- 
2.1.4




More information about the bitbake-devel mailing list