[elbe-devel] [PATCH v2 54/66] elbeproject: Fix Pylint

Olivier Dion dion at linutronix.de
Fri Jun 5 19:07:18 CEST 2020


870:0: R1707: (trailing-comma-tuple)
1:0:   C0302: (too-many-lines)
119:0: R0205: (useless-object-inheritance)
447:4: W0102: (dangerous-default-value)
447:4: R0914: (too-many-locals)
447:4: R0912: (too-many-branches)
119:0: R0904: (too-many-public-methods)

Signed-off-by: Olivier Dion <dion at linutronix.de>
Reviewed-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/elbeproject.py | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/elbepack/elbeproject.py b/elbepack/elbeproject.py
index 8d45469d..4b2b48ab 100644
--- a/elbepack/elbeproject.py
+++ b/elbepack/elbeproject.py
@@ -8,6 +8,8 @@
 #
 # SPDX-License-Identifier: GPL-3.0-or-later
 
+# pylint: disable=too-many-lines
+
 import os
 import datetime
 import io
@@ -115,10 +117,12 @@ def gen_sdk_scripts(triplet,
 
     return sdkname
 
-
+# TODO:py3 Remove object inheritance
+# pylint: disable=useless-object-inheritance
 class ElbeProject (object):
 
     # pylint: disable=too-many-instance-attributes
+    # pylint: disable=too-many-public-methods
 
     def __init__(
             self,
@@ -446,7 +450,11 @@ class ElbeProject (object):
 
     def build_cdroms(self, build_bin=True,
                      build_sources=False, cdrom_size=None,
-                     tgt_pkg_lst=[]):
+                     tgt_pkg_lst=None):
+
+        # pylint: disable=too-many-branches
+        # pylint: disable=too-many-locals
+
         self.repo_images = []
 
         env = None
@@ -488,10 +496,11 @@ class ElbeProject (object):
                 # Target component
                 cache = self.get_rpcaptcache(env=self.buildenv)
                 tgt_lst = []
-                for pkg_name in tgt_pkg_lst:
-                    pkg = cache.get_pkg(pkg_name)
-                    tgt_lst.append((pkg.name, pkg.installed_version))
-                components = {"target":(self.targetfs, cache, tgt_lst)}
+                if tgt_pkg_lst is not None:
+                    for pkg_name in tgt_pkg_lst:
+                        pkg = cache.get_pkg(pkg_name)
+                        tgt_lst.append((pkg.name, pkg.installed_version))
+                    components = {"target":(self.targetfs, cache, tgt_lst)}
 
                 # Main component
                 main_lst = []
@@ -867,7 +876,7 @@ class ElbeProject (object):
             env = self.buildenv
 
         if norecommend is None:
-            norecommend = not self.xml.prj.has('install-recommends'),
+            norecommend = not self.xml.prj.has('install-recommends')
 
         if env.arch == "default":
             arch = self.arch
-- 
2.27.0




More information about the elbe-devel mailing list