ci: add basic config checking with ruff
[buildbot.git] / phase2 / master.cfg
index 8b7df6a8697344966ec8f0e5aeb25f1b1bea8165..e19a7314cc67267d922c81040e09aa146f47f754 100644 (file)
@@ -5,7 +5,6 @@ import os
 import re
 import sys
 import base64
-import random
 import subprocess
 import configparser
 
@@ -93,7 +92,7 @@ max_builds = dict()
 for section in ini.sections():
        if section.startswith("worker "):
                if ini.has_option(section, "name") and ini.has_option(section, "password") and \
-                  ini.has_option(section, "phase") and ini.getint(section, "phase") == 2:
+                       ini.has_option(section, "phase") and ini.getint(section, "phase") == 2:
                        name = ini.get(section, "name")
                        password = ini.get(section, "password")
                        sl_props = { 'shared_wd': False }
@@ -324,7 +323,7 @@ def IsArchitectureSelected(target):
 def UsignSec2Pub(seckey, comment="untrusted comment: secret key"):
        try:
                seckey = base64.b64decode(seckey)
-       except:
+       except Exception:
                return None
 
        return "{}\n{}".format(re.sub(r"\bsecret key$", "public key", comment),
@@ -367,7 +366,7 @@ def getNewestCompleteTime(bldr):
        if last_build and last_build[0]:
                last_complete_at = last_build[0]['complete_at']
                if last_complete_at and (last_complete_at > complete_at):
-                   return last_complete_at
+                       return last_complete_at
 
        return complete_at
 
@@ -762,7 +761,7 @@ for arch in arches:
                        description = "Uploading source archives",
                        workdir = "build/sdk",
                        command = ["rsync", "--files-from=sourcelist", "-4", "--progress", "--checksum", "--delay-updates",
-                                  WithProperties("--partial-dir=.~tmp~%s~%%(workername)s" %(arch[0])), "-avz", "dl/", "%s/" %(rsync_src_url)],
+                                       WithProperties("--partial-dir=.~tmp~%s~%%(workername)s" %(arch[0])), "-avz", "dl/", "%s/" %(rsync_src_url)],
                        env={'RSYNC_PASSWORD': rsync_src_key},
                        haltOnFailure = False,
                        flunkOnFailure = False,