Some flake8 improvements
Was bored while waiting for a test run to finish. The rule is that two empty lines distinguish larger blocks and shouldn't be used between functions or within functions.
This commit is contained in:
parent
ac861592d3
commit
8483632683
2
.flake8
2
.flake8
@ -1,4 +1,4 @@
|
||||
[flake8]
|
||||
exclude = .open-build-service/, abichecker, openqa, openqa-maintenance.py
|
||||
max-line-length = 100
|
||||
ignore = E501,F401,E302,E228,E128,E251,E201,E202,E203,E305,F841,E265,E261,E266,E712,E401,E126,E502,E222,E241,E711,E226,E125,E123,W293,W391,E731,E101,E227,E713,E225,E124,E221,E127,E701,E714,W503,W504,E129,E303,E741,E722
|
||||
ignore = E501,F401,E302,E228,E128,E251,E201,E202,E203,E305,F841,E265,E261,E266,E712,E401,E126,E502,E222,E241,E711,E226,E125,E123,W293,W391,E101,E227,E713,E225,E124,E221,E127,E701,E714,W503,W504,E129,E741,E722,E731
|
||||
|
@ -107,7 +107,6 @@ class ToolBase(object):
|
||||
query = [] if not query else query
|
||||
return osc.core.makeurl(self.apiurl, l, query)
|
||||
|
||||
|
||||
def process(self, packages):
|
||||
""" reimplement this """
|
||||
True
|
||||
|
@ -249,7 +249,6 @@ class BiArchTool(ToolBase.ToolBase):
|
||||
except HTTPError as e:
|
||||
logger.error('failed to update %s: %s', pkg, e)
|
||||
|
||||
|
||||
def enable_baselibs_packages(self, force=False, wipebinaries=False):
|
||||
self._init_biarch_packages()
|
||||
todo = dict()
|
||||
|
@ -137,7 +137,6 @@ class MaintenanceChecker(ReviewBot.ReviewBot):
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def check_one_request(self, req):
|
||||
self.add_factory_source = False
|
||||
self.needs_maintainer_review = set()
|
||||
|
@ -176,7 +176,6 @@ class ChangeLogger(cmdln.Cmdln):
|
||||
pprint(pkgs[package])
|
||||
pprint(changelogs[pkgs[package]['sourcerpm']])
|
||||
|
||||
|
||||
def _get_packages_grouped(self, pkgs, names):
|
||||
group = dict()
|
||||
for pkg in names:
|
||||
@ -186,7 +185,6 @@ class ChangeLogger(cmdln.Cmdln):
|
||||
group[pkgs[pkg]['sourcerpm']].append(pkg)
|
||||
return group
|
||||
|
||||
|
||||
@cmdln.option("--dir", action="store", type='string', dest='dir', help="data directory")
|
||||
def do_diff(self, subcmd, opts, version1, version2):
|
||||
"""${cmd_name}: diff two snapshots
|
||||
|
@ -408,7 +408,6 @@ class FccSubmitter(object):
|
||||
print('None')
|
||||
|
||||
|
||||
|
||||
def main(args):
|
||||
# Configure OSC
|
||||
osc.conf.get_config(override_apiurl=args.apiurl)
|
||||
|
@ -153,7 +153,6 @@ class Manager42(object):
|
||||
return self.cached_GET(makeurl(self.apiurl,
|
||||
['source', project, package], opts))
|
||||
|
||||
|
||||
def crawl(self, packages):
|
||||
"""Main method of the class that runs the crawler."""
|
||||
|
||||
@ -232,7 +231,6 @@ class Manager42(object):
|
||||
return None
|
||||
raise
|
||||
|
||||
|
||||
def _is_ignored(self, package):
|
||||
if package in self.config.ignored_packages:
|
||||
logger.debug("%s in ignore list", package)
|
||||
|
@ -345,7 +345,6 @@ def osrt_origin_report(apiurl, opts, *args):
|
||||
for package, origins in sorted(package_diff.items()):
|
||||
report.append(line_format.format(package, *origins))
|
||||
|
||||
|
||||
body = '\n'.join(report)
|
||||
print(body)
|
||||
|
||||
|
@ -72,7 +72,6 @@ class CleanupRings(object):
|
||||
print("osc linkpac -f {}/{} {}/{}".format(destring, mainpkg, prj, pkg))
|
||||
self.links[mainpkg] = pkg
|
||||
|
||||
|
||||
def fill_pkgdeps(self, prj, repo, arch):
|
||||
root = builddepinfo(self.api.apiurl, prj, repo, arch)
|
||||
|
||||
|
@ -36,7 +36,6 @@ class PrioCommand(object):
|
||||
except HTTPError as e:
|
||||
print(e)
|
||||
|
||||
|
||||
def perform(self, projects=None, priority=None):
|
||||
"""
|
||||
Set priority on specific stagings or all of them at once
|
||||
|
@ -174,7 +174,6 @@ class StagingAPI(object):
|
||||
if (retry_sleep_seconds % 60):
|
||||
retry_sleep_seconds += 1
|
||||
|
||||
|
||||
def retried_GET(self, url):
|
||||
return self._retried_request(url, http_GET)
|
||||
|
||||
|
@ -125,7 +125,6 @@ class TestApiCalls(OBSLocal.TestCase):
|
||||
xpath = "//review[@name='new' and @by_project='{}']".format(self.staging_b.name)
|
||||
self.assertIsNotNone(rq.xpath(xpath))
|
||||
|
||||
|
||||
def test_add_sr(self):
|
||||
# setup is already adding the request, we just verify
|
||||
prj = self.staging_b.name
|
||||
|
@ -274,8 +274,6 @@ class TestMaintenance(unittest.TestCase):
|
||||
|
||||
self.assertFalse(result['devel_review_added'])
|
||||
|
||||
|
||||
|
||||
def test_backports_submit(self):
|
||||
|
||||
httpretty.register_uri(httpretty.GET,
|
||||
|
@ -257,7 +257,6 @@ class TestOrigin(OBSLocal.TestCase):
|
||||
request = get_request(self.wf.apiurl, request_id_update)
|
||||
request_state_change(self.wf.apiurl, request_id_update, 'accepted')
|
||||
|
||||
|
||||
devel_project_new = self.randomString('develnew')
|
||||
self.wf.create_package(devel_project_new, package)
|
||||
attribute_value_save(self.wf.apiurl, devel_project_new, 'ApprovedRequestSource', '', 'OBS')
|
||||
|
Loading…
x
Reference in New Issue
Block a user