From 95e17ddf05609168303b28e0c5440d0eda23052e Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Thu, 21 May 2020 15:11:35 +0100 Subject: [PATCH] Fixed linting issues Newer versions of flake8 identify these valid violations. N802 added as skip because the entire library uses camelcase. Change-Id: Ia687b05bb8d0590eb30a970a710a2639548dbc60 --- gerritlib/gerrit.py | 6 +++--- tox.ini | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) 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