Target E261 - two spaces before inline comment

This commit is contained in:
Stephan Kulow
2022-02-18 16:39:16 +01:00
parent a8623bb8d8
commit 0561e06cb1
26 changed files with 38 additions and 38 deletions

View File

@@ -1,4 +1,4 @@
[flake8]
exclude = abichecker
max-line-length = 100
ignore = W503,W504,E501,F401,E128,E251,E201,E202,E302,E305,F841,E261
ignore = W503,W504,E501,F401,E128,E251,E201,E202,E302,E305,F841

View File

@@ -37,7 +37,7 @@ class BiArchTool(ToolBase.ToolBase):
'i586': set([
'belle-sip',
'release-notes-openSUSE',
'openSUSE-EULAs', # translate-toolkit
'openSUSE-EULAs', # translate-toolkit
'skelcd-openSUSE',
'plasma5-workspace',
'patterns-base',

View File

@@ -75,7 +75,7 @@ class Fetcher(object):
code = result.get('code')
count = int(result.get('count'))
if code == 'excluded' or code == 'disabled' or code == 'locked':
continue # ignore
continue # ignore
if code == 'succeeded':
succeeded += count
continue

View File

@@ -220,7 +220,7 @@ class ChangeLogger(cmdln.Cmdln):
srpm1 = v1pkgs[group[srpm][0]]['sourcerpm']
# print group[srpm], srpm, srpm1
if srpm1 == srpm:
continue # source package unchanged
continue # source package unchanged
try:
t1 = v1changelogs[srpm1]['changelogtime'][0]
except IndexError:
@@ -235,7 +235,7 @@ class ChangeLogger(cmdln.Cmdln):
print(' {} ERROR: no changelog'.format(name))
continue
if t1 == v2changelogs[srpm]['changelogtime'][0]:
continue # no new changelog entry, probably just rebuilt
continue # no new changelog entry, probably just rebuilt
pkgs = sorted(group[srpm])
details += "\n==== %s ====\n" % name
if v1pkgs[pkgs[0]]['version'] != v2pkgs[pkgs[0]]['version']:

View File

@@ -212,7 +212,7 @@ class FccSubmitter(object):
def create_submitrequest(self, package):
"""Create a submit request using the osc.commandline.Osc class."""
src_project = self.factory # submit from Factory only
src_project = self.factory # submit from Factory only
dst_project = self.to_prj
msg = 'Automatic request from %s by F-C-C Submitter. Please review this change and decline it if Leap do not need it.' % src_project
@@ -311,7 +311,7 @@ class FccSubmitter(object):
pseudometa_project, pseudometa_package = project_pseudometa_package(self.apiurl, 'openSUSE:Factory')
skip_pkgs_list = self.load_skip_pkgs_list(pseudometa_project, pseudometa_package).splitlines()
ms_packages = [] # collect multi specs packages
ms_packages = [] # collect multi specs packages
for i in range(0, min(int(self.submit_limit), len(succeeded_packages))):
package = succeeded_packages[i]

View File

@@ -249,7 +249,7 @@ class Listener(PubSubConsumer):
elif re.search(r'.openqa.', method.routing_key):
data = json.loads(body)
if '/' in data.get('BUILD'):
return # Ignore PR verification runs
return # Ignore PR verification runs
self.on_openqa_job(data.get('ISO'))
else:
self.logger.warning("unknown rabbitmq message {}".format(method.routing_key))

View File

@@ -157,7 +157,7 @@ def issues_get(apiurl, project, package, trackers, db):
url = osc.core.makeurl(apiurl, ['source', project, package], {'view': 'issues'})
root = ET.parse(osc.core.http_GET(url)).getroot()
now = datetime.now(tzlocal()) # Much harder than should be.
now = datetime.now(tzlocal()) # Much harder than should be.
for issue in root.findall('issue'):
# Normalize issues to active API instance issue-tracker definitions.
# Assumes the two servers have the name trackers, but different labels.

View File

@@ -246,7 +246,7 @@ def who_workaround(request, review, relax=False):
# - openSUSE/open-build-service#3898
global who_workaround_swap, who_workaround_miss
who = review.get('who') # All that should be required (used as fallback).
who = review.get('who') # All that should be required (used as fallback).
when = review.get('when')
if relax:
# Super hack, chop off seconds to relax in hopes of finding potential.

View File

@@ -36,7 +36,7 @@ class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):
sentry_sdk.capture_exception()
class RequestHandler(BaseHTTPRequestHandler):
COOKIE_NAME = 'openSUSE_session' # Both OBS and IBS.
COOKIE_NAME = 'openSUSE_session' # Both OBS and IBS.
GET_PATHS = [
'origin/config',
'origin/history',
@@ -282,9 +282,9 @@ class RequestHandler(BaseHTTPRequestHandler):
def handle_package_diff(self, args, query):
# source_project source_package target_project [target_package] [source_revision] [target_revision]
command = ['osc', 'rdiff', args[0], args[1], args[2]] # len(args) == 3
command = ['osc', 'rdiff', args[0], args[1], args[2]] # len(args) == 3
if len(args) >= 4:
command.append(args[3]) # target_package
command.append(args[3]) # target_package
if len(args) >= 5:
command.append('--revision')
command.append(':'.join(args[4:6]))
@@ -364,7 +364,7 @@ class OSCRequestEnvironmentException(Exception):
pass
def main(args):
conf.get_config() # Allow sentry DSN to be available.
conf.get_config() # Allow sentry DSN to be available.
sentry_sdk = sentry_init()
RequestHandler.apiurl = args.apiurl

View File

@@ -63,7 +63,7 @@ class CleanupRings(object):
print('# {} links to {} but is not in a ring'.format(pkg, mainpkg))
print("osc linkpac {}/{} {}/{}".format(mainprj, mainpkg, prj, mainpkg))
else:
if pkg != 'glibc.i686': # FIXME: ugly exception
if pkg != 'glibc.i686': # FIXME: ugly exception
print("osc linkpac -f {}/{} {}/{}".format(destring, mainpkg, prj, pkg))
self.links[mainpkg] = pkg
@@ -94,7 +94,7 @@ class CleanupRings(object):
name = package.attrib['name'].split(':')[0]
for pkg in package.findall('pkgdep'):
if pkg.text not in self.bin2src:
if not pkg.text.startswith('texlive-'): # XXX: texlive bullshit packaging
if not pkg.text.startswith('texlive-'): # XXX: texlive bullshit packaging
print('Package {} not found in place'.format(pkg.text))
continue
b = self.bin2src[pkg.text]
@@ -177,7 +177,7 @@ class CleanupRings(object):
if (source not in self.pkgdeps and
source not in self.links and
source not in self.whitelist):
if source.startswith('texlive-specs-'): # XXX: texlive bullshit packaging
if source.startswith('texlive-specs-'): # XXX: texlive bullshit packaging
continue
# Expensive check so left until last.
if self.check_requiredby(prj, source):

View File

@@ -7,7 +7,7 @@ def version_calculate():
try:
return describe()
except FileNotFoundError:
pass # Fall through to final return.
pass # Fall through to final return.
return '0.0.0-dev'

View File

@@ -175,7 +175,7 @@ DEFAULT = {
'openqa': '',
'lock': '',
'lock-ns': '',
'_priority': '0', # Apply defaults first
'_priority': '0', # Apply defaults first
},
}
@@ -210,7 +210,7 @@ class Config(object):
self.populate_conf()
@staticmethod
@memoize(session=True) # Allow reset by memoize_session_reset() for ReviewBot.
@memoize(session=True) # Allow reset by memoize_session_reset() for ReviewBot.
def get(apiurl, project):
"""Cached version for directly accessing project config."""
# Properly handle loading the config for interconnect projects.

View File

@@ -177,7 +177,7 @@ def package_binary_list(apiurl, project, repository, arch, package=None, strip_m
root = ET.parse(http_GET(url)).getroot()
package_binaries = []
binary_map = {} # last duplicate wins
binary_map = {} # last duplicate wins
for binary_list in root:
package = binary_list.get('package')
if strip_multibuild:

View File

@@ -96,7 +96,7 @@ def config_origin_generator(origins, apiurl=None, project=None, package=None, sk
origin = origin_workaround_ensure(origin)
yield origin, values
break # Only support single value inside list item.
break # Only support single value inside list item.
def config_resolve(apiurl, project, config):
defaults = POLICY_DEFAULTS.copy()
@@ -803,7 +803,7 @@ def origin_updatable(apiurl):
projects = project_attributes_list(apiurl, [
'OSRT:OriginConfig',
], [
'OBS:Maintained', # Submitting maintenance updates not currently supported.
'OBS:Maintained', # Submitting maintenance updates not currently supported.
'OSRT:OriginUpdateSkip',
], locked=False)

View File

@@ -78,13 +78,13 @@ class OriginSourceChangeListener(PubSubConsumer):
if not action.get('targetpackage'):
package = action['sourcepackage']
else:
repository_suffix_length = len(project) + 1 # package.project
repository_suffix_length = len(project) + 1 # package.project
package = action['targetpackage'][:-repository_suffix_length]
elif action['type'] == 'maintenance_release':
if action['sourcepackage'] == 'patchinfo':
continue
project = action['targetproject']
repository_suffix_length = len(project) + 1 # package.project
repository_suffix_length = len(project) + 1 # package.project
package = action['sourcepackage'][:-repository_suffix_length]
elif action['type'] == 'submit':
project = action['targetproject']

View File

@@ -195,7 +195,7 @@ def merge_susetags(output, files):
release = evr.pop()
version = '-'.join(evr)
key = s.name + "-" + version + "." + s.arch
if re.search('-release', s.name): # just take one version of it
if re.search('-release', s.name): # just take one version of it
key = s.name + "." + s.arch
packages[key] = { 'name': s.name, 'version': version, 'arch': s.arch, 'release': release, 'provides': set()}
for dep in s.lookup_deparray(solv.SOLVABLE_PROVIDES):

View File

@@ -212,7 +212,7 @@ class RepoChecker():
del oldstate['check'][source]
packages = config.get('rebuildpacs-leafs', '').split()
if not self.rebuild: # ignore in this case
if not self.rebuild: # ignore in this case
packages = []
# first round: collect all infos from obs

View File

@@ -147,7 +147,7 @@ class TestCase(unittest.TestCase):
self.execute(args)
def execute(self, args):
print('$ ' + ' '.join(args)) # Print command for debugging.
print('$ ' + ' '.join(args)) # Print command for debugging.
try:
env = os.environ
env['OSC_CONFIG'] = OSCRC
@@ -155,7 +155,7 @@ class TestCase(unittest.TestCase):
except subprocess.CalledProcessError as e:
print(e.output)
raise e
print(self.output) # For debugging assertion failures.
print(self.output) # For debugging assertion failures.
def assertOutput(self, text):
self.assertTrue(text in self.output, '[MISSING] ' + text)

View File

@@ -44,7 +44,7 @@ class TestTagChecker(OBSLocal.TestCase):
self.checker = TagChecker(apiurl=APIURL,
user='maintbot',
logger=self.logger)
self.checker.override_allow = False # Test setup cannot handle.
self.checker.override_allow = False # Test setup cannot handle.
self._request_data = """
<request id="293129" creator="darix">

View File

@@ -33,7 +33,7 @@ class TestConfig(unittest.TestCase):
def test_remote_none(self):
wf = self.setup_vcr()
wf.load_config('not_real_project')
self.assertTrue(True) # Did not crash!
self.assertTrue(True) # Did not crash!
def test_pattern_order(self):
wf = self.setup_vcr()

View File

@@ -10,7 +10,7 @@ class MockedContainerCleaner(ContainerCleaner):
"""Mock certain OBS APIs returning directory entries"""
if path == ["source", "mock:prj"]:
srccontainers = [a.split(":")[0] for a in self.container_arch_map.keys()]
return list(set(srccontainers)) # Remove duplicates
return list(set(srccontainers)) # Remove duplicates
elif path == ["build", "mock:prj", "containers"]:
all_archs = []
for archs in self.container_arch_map.values():

View File

@@ -36,7 +36,7 @@ class TestFactorySourceAccept(OBSLocal.TestCase):
self.checker = FactorySourceChecker(apiurl = APIURL,
user = 'factory-source',
logger = self.logger)
self.checker.override_allow = False # Test setup cannot handle.
self.checker.override_allow = False # Test setup cannot handle.
def test_accept_request(self):

View File

@@ -13,7 +13,7 @@ from osclib.accept_command import AcceptCommand
# Import the involved bots
from check_source import CheckSource
legal_auto = __import__("legal-auto") # Needed because of the dash in the filename
legal_auto = __import__("legal-auto") # Needed because of the dash in the filename
LegalAuto = legal_auto.LegalAuto
PROJECT = 'openSUSE:Factory'

View File

@@ -29,7 +29,7 @@ class TestMaintenance(OBSLocal.TestCase):
self.checker = MaintenanceChecker(apiurl = APIURL,
user = 'maintbot',
logger = self.logger)
self.checker.override_allow = False # Test setup cannot handle.
self.checker.override_allow = False # Test setup cannot handle.
def test_non_maintainer_submit(self):
"""same as above but already has devel project as reviewer

View File

@@ -8,5 +8,5 @@ class TestMetrics(OBSLocal.TestCase):
def test_all(self):
self.osc_user('staging-bot')
self.execute_script(['--help']) # Avoids the need to influxdb instance.
self.execute_script(['--help']) # Avoids the need to influxdb instance.
self.assertOutput('metrics.py')

View File

@@ -19,9 +19,9 @@ from osclib.accept_command import AcceptCommand
# Import the involved bots
from check_source import CheckSource
from check_tags_in_requests import TagChecker
legal_auto = __import__("legal-auto") # Needed because of the dash in the filename
legal_auto = __import__("legal-auto") # Needed because of the dash in the filename
LegalAuto = legal_auto.LegalAuto
origin_manager = __import__("origin-manager") # Same than above, dash in the filename
origin_manager = __import__("origin-manager") # Same than above, dash in the filename
OriginManager = origin_manager.OriginManager
PROJECT = 'SUSE:SLE-15-SP3:GA'