chiark / gitweb /
fix pylint unused-argument
authorHans-Christoph Steiner <hans@eds.org>
Thu, 13 Apr 2017 10:30:04 +0000 (12:30 +0200)
committerHans-Christoph Steiner <hans@eds.org>
Tue, 23 May 2017 20:34:16 +0000 (22:34 +0200)
fdroidserver/build.py
fdroidserver/checkupdates.py
fdroidserver/common.py
fdroidserver/scanner.py
fdroidserver/update.py
tests/common.TestCase

index 8913136060b5042d3ded37d735656e23bd155940..fbf9c54947723b2428743fecdde421d9bbfdb2e0 100644 (file)
@@ -735,7 +735,7 @@ def build_local(app, build, vcs, build_dir, output_dir, log_dir, srclib_dir, ext
         src = os.path.normpath(apks[0])
 
     # Make sure it's not debuggable...
-    if common.isApkAndDebuggable(src, config):
+    if common.isApkAndDebuggable(src):
         raise BuildException("APK is debuggable")
 
     # By way of a sanity check, make sure the version and version
index cc884505acd002881acb42e7b88ed9d21b16ce47..098280b29c6892627cd20b8531603f6dcba30b0c 100644 (file)
@@ -241,7 +241,7 @@ def check_repomanifest(app, branch=None):
         return (None, msg)
 
 
-def check_repotrunk(app, branch=None):
+def check_repotrunk(app):
 
     try:
         if app.RepoType == 'srclib':
@@ -370,7 +370,7 @@ def fetch_autoname(app, tag):
     return commitmsg
 
 
-def checkupdates_app(app, first=True):
+def checkupdates_app(app):
 
     # If a change is made, commitmsg should be set to a description of it.
     # Only if this is set will changes be written back to the metadata.
index 0ede37a62a9dd3dbcd4eafe6b95d325c19cf6ccc..ca02219fe50466f20ea916bb52377507e76c5366 100644 (file)
@@ -655,7 +655,7 @@ class vcs:
 
     # Derived classes need to implement this. It's called once basic checking
     # has been performend.
-    def gotorevisionx(self, rev):
+    def gotorevisionx(self, rev):  # pylint: disable=unused-argument
         raise VCSException("This VCS type doesn't define gotorevisionx")
 
     # Initialise and update submodules
@@ -1683,7 +1683,7 @@ def get_apk_debuggable_androguard(apkfile):
     return False
 
 
-def isApkAndDebuggable(apkfile, config):
+def isApkAndDebuggable(apkfile):
     """Returns True if the given file is an APK and is debuggable
 
     :param apkfile: full path to the apk to check"""
index 363f8c8a7bc74eb9597e2f41e10fb41f145dae3a..2449ae0707d6bec357fdd0d6e0bb7db647a4e35a 100644 (file)
@@ -39,9 +39,10 @@ def get_gradle_compile_commands(build):
     return [re.compile(r'\s*' + c, re.IGNORECASE) for c in compileCommands]
 
 
-# Scan the source code in the given directory (and all subdirectories)
-# and return the number of fatal problems encountered
-def scan_source(build_dir, root_dir, build):
+def scan_source(build_dir, build):
+    """Scan the source code in the given directory (and all subdirectories)
+    and return the number of fatal problems encountered
+    """
 
     count = 0
 
@@ -111,7 +112,7 @@ def scan_source(build_dir, root_dir, build):
                     return True
         return False
 
-    def ignoreproblem(what, fd, fp):
+    def ignoreproblem(what, fd):
         logging.info('Ignoring %s at %s' % (what, fd))
         return 0
 
@@ -127,7 +128,7 @@ def scan_source(build_dir, root_dir, build):
 
     def handleproblem(what, fd, fp):
         if toignore(fd):
-            return ignoreproblem(what, fd, fp)
+            return ignoreproblem(what, fd)
         if todelete(fd):
             return removeproblem(what, fd, fp)
         logging.error('Found %s at %s' % (what, fd))
@@ -301,12 +302,12 @@ def main():
                     logging.info("...scanning version " + build.versionName)
 
                     # Prepare the source code...
-                    root_dir, _ = common.prepare_source(vcs, app, build,
-                                                        build_dir, srclib_dir,
-                                                        extlib_dir, False)
+                    common.prepare_source(vcs, app, build,
+                                          build_dir, srclib_dir,
+                                          extlib_dir, False)
 
                     # Do the scan...
-                    count = scan_source(build_dir, root_dir, build)
+                    count = scan_source(build_dir, build)
                     if count > 0:
                         logging.warn('Scanner found %d problems in %s (%s)' % (
                             count, appid, build.versionCode))
index 273b5f0d2834714fa34df7d9a738da8e994abb95..2e79ea2975cc82f259956f07181efb28e117e3c2 100644 (file)
@@ -1137,7 +1137,7 @@ def scan_apk(apkcache, apkfilename, repodir, knownapks, use_date_from_apk):
             apk['minSdkVersion'] = 1
 
         # Check for debuggable apks...
-        if common.isApkAndDebuggable(apkfile, config):
+        if common.isApkAndDebuggable(apkfile):
             logging.warning('{0} is set to android:debuggable="true"'.format(apkfile))
 
         # Get the signature (or md5 of, to be precise)...
index d5978405e1f547fe83db89009e548873e04d5946..74364098ecd73391cbf6ef4abac5c212c9e8c33e 100755 (executable)
@@ -78,7 +78,7 @@ class CommonTest(unittest.TestCase):
         testfiles.append(os.path.join(os.path.dirname(__file__), 'urzip-badsig.apk'))
         testfiles.append(os.path.join(os.path.dirname(__file__), 'urzip-badcert.apk'))
         for apkfile in testfiles:
-            debuggable = fdroidserver.common.isApkAndDebuggable(apkfile, config)
+            debuggable = fdroidserver.common.isApkAndDebuggable(apkfile)
             self.assertTrue(debuggable,
                             "debuggable APK state was not properly parsed!")
         # these are set NOT debuggable
@@ -86,7 +86,7 @@ class CommonTest(unittest.TestCase):
         testfiles.append(os.path.join(os.path.dirname(__file__), 'urzip-release.apk'))
         testfiles.append(os.path.join(os.path.dirname(__file__), 'urzip-release-unsigned.apk'))
         for apkfile in testfiles:
-            debuggable = fdroidserver.common.isApkAndDebuggable(apkfile, config)
+            debuggable = fdroidserver.common.isApkAndDebuggable(apkfile)
             self.assertFalse(debuggable,
                              "debuggable APK state was not properly parsed!")