Skip to content

Commit

Permalink
typing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nora-codecov committed Oct 16, 2024
1 parent ea99777 commit e13f05e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions codecov_cli/helpers/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ def send_get_request(
return request_result(get(url=url, headers=headers, params=params))


def get_token_header_or_fail(token: str) -> dict:
def get_token_header_or_fail(token: Optional[str]) -> dict:
if token is None:
raise click.ClickException(
"Codecov token not found. Please provide Codecov token with -t flag."
)
return {"Authorization": f"token {token}"}


def get_token_header(token: str) -> Optional[dict]:
def get_token_header(token: Optional[str]) -> Optional[dict]:
if token is None:
return None
return {"Authorization": f"token {token}"}
Expand Down
2 changes: 1 addition & 1 deletion codecov_cli/services/commit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def create_commit_logic(
pr: typing.Optional[str],
branch: typing.Optional[str],
slug: typing.Optional[str],
token: typing.Union[str, None],
token: typing.Optional[str],
service: typing.Optional[str],
enterprise_url: typing.Optional[str] = None,
fail_on_error: bool = False,
Expand Down
4 changes: 2 additions & 2 deletions codecov_cli/services/report/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def create_report_logic(
code: str,
slug: str,
service: str,
token: typing.Union[str, None],
token: typing.Optional[str],
enterprise_url: str,
pull_request_number: int,
fail_on_error: bool = False,
Expand Down Expand Up @@ -68,7 +68,7 @@ def create_report_results_logic(
code: str,
slug: str,
service: str,
token: typing.Union[str, None],
token: typing.Optional[str],
enterprise_url: str,
fail_on_error: bool = False,
args: dict = None,
Expand Down
2 changes: 1 addition & 1 deletion codecov_cli/services/upload/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def do_upload_logic(
pull_request_number: typing.Optional[str],
report_code: str,
slug: typing.Optional[str],
token: typing.Union[str, None],
token: typing.Optional[str],
upload_file_type: str = "coverage",
use_legacy_uploader: bool = False,
):
Expand Down
2 changes: 1 addition & 1 deletion codecov_cli/services/upload/upload_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def send_upload_data(
self,
upload_data: UploadCollectionResult,
commit_sha: str,
token: typing.Union[str, None],
token: typing.Optional[str],
env_vars: typing.Dict[str, str],
report_code: str,
upload_file_type: str = "coverage",
Expand Down

0 comments on commit e13f05e

Please sign in to comment.