Use pylint3 hook
The repohook configuration currently tries to force the use of a
specific executable name for pylint3. Let repohook find the most
appropriate executable by using the pylint3 hook instead.
Fix the current warnings raised.
Test: repo upload .
Change-Id: I653aa921bbc8d2aec350b827c6828c1b761821e9
diff --git a/github_archive_updater.py b/github_archive_updater.py
index cc3840f..fc3e362 100644
--- a/github_archive_updater.py
+++ b/github_archive_updater.py
@@ -23,6 +23,7 @@
import archive_utils
from base_updater import Updater
import git_utils
+# pylint: disable=import-error
import metadata_pb2 # type: ignore
import updater_utils
@@ -88,6 +89,7 @@
return True
def _fetch_latest_release(self) -> Optional[Tuple[str, List[str]]]:
+ # pylint: disable=line-too-long
url = f'https://api.github.com/repos/{self.owner}/{self.repo}/releases/latest'
try:
with urllib.request.urlopen(url) as request:
@@ -109,6 +111,7 @@
for page in range(1, 21):
# Sleeps 10s to avoid rate limit.
time.sleep(10)
+ # pylint: disable=line-too-long
url = f'https://api.github.com/repos/{self.owner}/{self.repo}/tags?page={page}'
with urllib.request.urlopen(url) as request:
data = json.loads(request.read().decode())
@@ -133,11 +136,13 @@
def _fetch_latest_commit(self) -> None:
"""Checks upstream and gets the latest commit to master."""
+ # pylint: disable=line-too-long
url = f'https://api.github.com/repos/{self.owner}/{self.repo}/commits/master'
with urllib.request.urlopen(url) as request:
data = json.loads(request.read().decode())
self._new_ver = data['sha']
self._new_url.value = (
+ # pylint: disable=line-too-long
f'https://github.com/{self.owner}/{self.repo}/archive/{self._new_ver}.zip'
)