Skip to content

Commit

Permalink
fix: fix type hinting for GitLabURL.query_params
Browse files Browse the repository at this point in the history
  • Loading branch information
suhanoves authored and andreoliwa committed Apr 12, 2024
1 parent d4ab58a commit e19728a
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/nitpick/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,8 +757,8 @@ class GitLabURL:
project: list[str]
path: str
git_reference: str
query_params: tuple[tuple[str, str], ...]
auth_token: str | None = None
query_params: tuple[tuple[str, str], ...] | None = None

@property
def token(self) -> str | None:
Expand Down Expand Up @@ -828,7 +828,15 @@ def _from_http_scheme_furl(cls, url: furl) -> GitLabURL:
git_reference = segments[blob_index] # The first argument after "blob"
path = segments[blob_index + 1 :] # Everything after the git_reference

return cls(url.scheme, url.host, project, path, git_reference, auth_token, query_params)
return cls(
scheme=url.scheme,
host=url.host,
project=project,
path=path,
git_reference=git_reference,
query_params=query_params,
auth_token=auth_token,
)

@classmethod
def _from_gitlab_scheme_furl(cls, url: furl) -> GitLabURL:
Expand All @@ -849,7 +857,15 @@ def _from_gitlab_scheme_furl(cls, url: furl) -> GitLabURL:
project = [project]
path = "/".join(path)

return cls(url.scheme, url.host, project, path, git_reference, auth_token, query_params)
return cls(
scheme=url.scheme,
host=url.host,
project=project,
path=path,
git_reference=git_reference,
query_params=query_params,
auth_token=auth_token,
)

@classmethod
def from_furl(cls, url: furl) -> GitLabURL:
Expand Down

0 comments on commit e19728a

Please sign in to comment.