cgit lister: Add missing types on the init method

Related to T2984
This commit is contained in:
Vincent SELLIER 2021-01-25 18:00:21 +01:00
parent ea8ecee541
commit d62e77c1b4
No known key found for this signature in database
GPG key ID: 3F13C434EADAD17D
2 changed files with 5 additions and 1 deletions

View file

@ -35,7 +35,9 @@ class CGitLister(StatelessLister[Repositories]):
LISTER_NAME = "cgit"
def __init__(self, scheduler: SchedulerInterface, url=None, instance=None):
def __init__(
self, scheduler: SchedulerInterface, url: str, instance: Optional[str] = None
):
"""Lister class for CGit repositories.
Args:
@ -47,6 +49,7 @@ class CGitLister(StatelessLister[Repositories]):
"""
if not instance:
instance = urlparse(url).hostname
assert instance is not None # Make mypy happy
super().__init__(
scheduler=scheduler, credentials=None, url=url, instance=instance,

View file

@ -10,6 +10,7 @@ from swh.lister.cli import SUPPORTED_LISTERS, get_lister
from .test_utils import init_db
lister_args = {
"cgit": {"url": "https://git.eclipse.org/c/",},
"phabricator": {
"instance": "softwareheritage",
"url": "https://forge.softwareheritage.org/api/diffusion.repository.search",