Fixed linting issues

Newer versions of flake8 identify these valid violations.
N802 added as skip because the entire library uses camelcase.

Change-Id: Ia687b05bb8d0590eb30a970a710a2639548dbc60
This commit is contained in:
Sorin Sbarnea 2020-05-21 15:11:35 +01:00
parent 2f666c7b35
commit 95e17ddf05
2 changed files with 8 additions and 3 deletions

View File

@ -130,8 +130,8 @@ class GerritWatcher(threading.Thread):
self.state = IDLE
def _read(self, fd):
l = fd.readline()
data = json.loads(l)
line = fd.readline()
data = json.loads(line)
self.log.debug("Received data from Gerrit event stream: \n%s" %
pprint.pformat(data))
self.gerrit.addEvent(data)
@ -316,7 +316,7 @@ class Gerrit(object):
else:
cmd = 'gerrit ls-groups'
# ensure group names with spaces are escaped and quoted
group = "\"%s\"" % group.replace(' ', '\ ')
group = "\"%s\"" % group.replace(' ', r'\ ')
out, err = self._ssh(' '.join([cmd, '-q', group]))
return list(filter(None, out.split('\n')))

View File

@ -24,4 +24,9 @@ commands = {posargs}
[flake8]
show-source = True
# These are ignored intentionally in infra projects;
# please don't submit patches that solely correct them or enable them.
ignore =
E124,E125,E129,E252,E402,E741,H,W503,W504
N802 # N802 function name {} should be lowercase
exclude = .venv,.tox,dist,doc,build,*.egg