diff --git a/.pylintrc b/.pylintrc index 375c5401..7ac7184c 100644 --- a/.pylintrc +++ b/.pylintrc @@ -21,9 +21,6 @@ disable = missing-class-docstring, missing-function-docstring, missing-module-docstring, - no-else-break, - no-else-raise, - no-else-return, no-member, no-self-use, protected-access, diff --git a/elastic_recheck/bot.py b/elastic_recheck/bot.py index c67a0c89..924fb218 100755 --- a/elastic_recheck/bot.py +++ b/elastic_recheck/bot.py @@ -140,7 +140,7 @@ class RecheckWatch(threading.Thread): if channel in self.channel_config.projects['all']: display = True break - elif project in self.channel_config.projects: + if project in self.channel_config.projects: if channel in self.channel_config.projects[project]: display = True break diff --git a/elastic_recheck/cmd/check_success.py b/elastic_recheck/cmd/check_success.py index 73182bdb..bed2abb9 100755 --- a/elastic_recheck/cmd/check_success.py +++ b/elastic_recheck/cmd/check_success.py @@ -121,8 +121,7 @@ def _status_count(results): def _failure_count(hits): if "FAILURE" in hits: return hits["FAILURE"] - else: - return 0 + return 0 def _failed_jobs(results): diff --git a/elastic_recheck/cmd/uncategorized_fails.py b/elastic_recheck/cmd/uncategorized_fails.py index 4d339c67..e9db107e 100755 --- a/elastic_recheck/cmd/uncategorized_fails.py +++ b/elastic_recheck/cmd/uncategorized_fails.py @@ -269,8 +269,7 @@ def _status_count(results): def _failure_count(hits): if "FAILURE" in hits: return hits["FAILURE"] - else: - return 0 + return 0 def _failed_jobs(results): diff --git a/elastic_recheck/elasticRecheck.py b/elastic_recheck/elasticRecheck.py index adbb9e85..34cf322b 100644 --- a/elastic_recheck/elasticRecheck.py +++ b/elastic_recheck/elasticRecheck.py @@ -145,7 +145,7 @@ class FailEvent(object): return None bug_map = {} for job in self.failed_jobs: - if len(job.bugs) is 0: + if len(job.bugs) == 0: bug_map[job.name] = None else: bug_map[job.name] = ' '.join(self.bug_urls(job.bugs)) @@ -161,7 +161,7 @@ class FailEvent(object): if self.get_all_bugs() is None: return True for job in self.failed_jobs: - if len(job.bugs) is 0: + if len(job.bugs) == 0: return False return True @@ -181,7 +181,7 @@ class FailEvent(object): bugs = set([]) for job in self.failed_jobs: bugs |= set(job.bugs) - if len(bugs) is 0: + if len(bugs) == 0: return None return list(bugs) @@ -239,9 +239,8 @@ class Stream(object): msg = ("Console logs not ready for %s %s,%s,%s" % (name, change, patch, build_short_uuid)) raise ConsoleNotReady(msg) - else: - self.log.debug("Console ready for %s %s,%s,%s" % - (name, change, patch, build_short_uuid)) + self.log.debug("Console ready for %s %s,%s,%s" % + (name, change, patch, build_short_uuid)) def _has_required_files(self, change, patch, name, build_short_uuid): query = qb.files_ready(change, patch, name, build_short_uuid) diff --git a/elastic_recheck/results.py b/elastic_recheck/results.py index 8eb3dc6e..83f42738 100644 --- a/elastic_recheck/results.py +++ b/elastic_recheck/results.py @@ -169,8 +169,7 @@ class FacetSet(dict): epoch = datetime.datetime.fromtimestamp(0, pytz.UTC) pos = int(((ts - epoch).total_seconds()) * 1000) return pos - else: - return data + return data def detect_facets(self, results, facets, res=3600): if len(facets) > 0: diff --git a/elastic_recheck/tests/unit/fake_gerrit.py b/elastic_recheck/tests/unit/fake_gerrit.py index a785ada1..04b315fb 100644 --- a/elastic_recheck/tests/unit/fake_gerrit.py +++ b/elastic_recheck/tests/unit/fake_gerrit.py @@ -32,8 +32,7 @@ class Gerrit(object): def getEvent(self): if len(self.events) > 0: return self.events.pop() - else: - raise GerritDone() + raise GerritDone() def review(self, project, name, msg): self.reviews.append({'project': project, 'name': name, 'msg': msg})