diff --git a/gerritlib/gerrit.py b/gerritlib/gerrit.py index 19b010c..d34cc2c 100644 --- a/gerritlib/gerrit.py +++ b/gerritlib/gerrit.py @@ -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'))) diff --git a/tox.ini b/tox.ini index 3faefb3..655d2c3 100644 --- a/tox.ini +++ b/tox.ini @@ -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