From c0dc8edb05ef72f6dcd143e1afabdc62460afd51 Mon Sep 17 00:00:00 2001 From: David Douard <david.douard@sdfa3.org> Date: Tue, 27 Aug 2024 17:40:30 +0200 Subject: [PATCH] Make qa tools happy again --- swh/lister/golang/lister.py | 10 +++++----- swh/lister/packagist/lister.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/swh/lister/golang/lister.py b/swh/lister/golang/lister.py index 368c1d08..5e676b02 100644 --- a/swh/lister/golang/lister.py +++ b/swh/lister/golang/lister.py @@ -73,9 +73,9 @@ class GolangLister(Lister[GolangStateType, GolangPageType]): def state_to_dict(self, state: GolangStateType) -> Dict[str, Any]: return { - "last_seen": state.last_seen.isoformat() - if state.last_seen is not None - else None + "last_seen": ( + state.last_seen.isoformat() if state.last_seen is not None else None + ) } def finalize(self): @@ -135,7 +135,7 @@ class GolangLister(Lister[GolangStateType, GolangPageType]): # The index returns packages whose timestamp are greater or # equal to the date provided as parameter, which will create # an infinite loop if not stopped here. - return [], since + return if since is not None: self.state.last_seen = since @@ -143,7 +143,7 @@ class GolangLister(Lister[GolangStateType, GolangPageType]): yield page page, since = self.get_single_page(since=since) if since == self.state.last_seen: - return [], since + return if since is not None: self.state.last_seen = since diff --git a/swh/lister/packagist/lister.py b/swh/lister/packagist/lister.py index ba7ac12f..fea19522 100644 --- a/swh/lister/packagist/lister.py +++ b/swh/lister/packagist/lister.py @@ -47,7 +47,7 @@ class PackagistLister(Lister[PackagistListerState, PackagistPageType]): For each package, its metadata are retrieved using Packagist API endpoints whose responses are served from static files, which are guaranteed to be - efficient on the Packagist side (no dymamic queries). + efficient on the Packagist side (no dynamic queries). Furthermore, subsequent listing will send the "If-Modified-Since" HTTP header to only retrieve packages metadata updated since the previous listing operation in order to save bandwidth and return only origins which might have -- GitLab