cgit lister: Add missing types on the init method
Related to T2984
This commit is contained in:
parent
ea8ecee541
commit
d62e77c1b4
2 changed files with 5 additions and 1 deletions
|
@ -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,
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue