Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Commit 6c2f585

Browse files
chore: typehint context object (#496)
1 parent ae3fc7e commit 6c2f585

16 files changed

+60
-37
lines changed

codecov_cli/commands/base_picking.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from codecov_cli.fallbacks import CodecovOption, FallbackFieldEnum
77
from codecov_cli.helpers.encoder import slug_without_subgroups_is_invalid
88
from codecov_cli.services.commit.base_picking import base_picking_logic
9+
from codecov_cli.types import CommandContext
910

1011
logger = logging.getLogger("codecovcli")
1112

@@ -45,7 +46,7 @@
4546
)
4647
@click.pass_context
4748
def pr_base_picking(
48-
ctx,
49+
ctx: CommandContext,
4950
base_sha: str,
5051
pr: typing.Optional[int],
5152
slug: typing.Optional[str],

codecov_cli/commands/commit.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from codecov_cli.helpers.git import GitService
88
from codecov_cli.helpers.options import global_options
99
from codecov_cli.services.commit import create_commit_logic
10+
from codecov_cli.types import CommandContext
1011

1112
logger = logging.getLogger("codecovcli")
1213

@@ -35,7 +36,7 @@
3536
@global_options
3637
@click.pass_context
3738
def create_commit(
38-
ctx,
39+
ctx: CommandContext,
3940
commit_sha: str,
4041
parent_sha: typing.Optional[str],
4142
pull_request_number: typing.Optional[int],

codecov_cli/commands/create_report_result.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from codecov_cli.helpers.options import global_options
66
from codecov_cli.services.report import create_report_results_logic
7+
from codecov_cli.types import CommandContext
78

89
logger = logging.getLogger("codecovcli")
910

@@ -15,7 +16,7 @@
1516
@global_options
1617
@click.pass_context
1718
def create_report_results(
18-
ctx,
19+
ctx: CommandContext,
1920
commit_sha: str,
2021
code: str,
2122
slug: str,

codecov_cli/commands/empty_upload.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from codecov_cli.helpers.git import GitService
88
from codecov_cli.helpers.options import global_options
99
from codecov_cli.services.empty_upload import empty_upload_logic
10+
from codecov_cli.types import CommandContext
1011

1112
logger = logging.getLogger("codecovcli")
1213

@@ -16,7 +17,7 @@
1617
@global_options
1718
@click.pass_context
1819
def empty_upload(
19-
ctx,
20+
ctx: CommandContext,
2021
commit_sha: str,
2122
force: bool,
2223
slug: typing.Optional[str],

codecov_cli/commands/get_report_results.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from codecov_cli.helpers.git import GitService
88
from codecov_cli.helpers.options import global_options
99
from codecov_cli.services.report import send_reports_result_get_request
10+
from codecov_cli.types import CommandContext
1011

1112
logger = logging.getLogger("codecovcli")
1213

@@ -18,7 +19,7 @@
1819
@global_options
1920
@click.pass_context
2021
def get_report_results(
21-
ctx,
22+
ctx: CommandContext,
2223
commit_sha: str,
2324
code: str,
2425
slug: str,

codecov_cli/commands/labelanalysis.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
LabelAnalysisRequestResult,
1717
LabelAnalysisRunnerInterface,
1818
)
19+
from codecov_cli.types import CommandContext
1920

2021
logger = logging.getLogger("codecovcli")
2122

@@ -77,7 +78,7 @@
7778
)
7879
@click.pass_context
7980
def label_analysis(
80-
ctx: click.Context,
81+
ctx: CommandContext,
8182
token: str,
8283
head_commit_sha: str,
8384
base_commit_sha: str,

codecov_cli/commands/report.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from codecov_cli.fallbacks import CodecovOption, FallbackFieldEnum
66
from codecov_cli.helpers.options import global_options
77
from codecov_cli.services.report import create_report_logic
8+
from codecov_cli.types import CommandContext
89

910
logger = logging.getLogger("codecovcli")
1011

@@ -25,7 +26,7 @@
2526
@global_options
2627
@click.pass_context
2728
def create_report(
28-
ctx,
29+
ctx: CommandContext,
2930
commit_sha: str,
3031
code: str,
3132
slug: str,

codecov_cli/commands/send_notifications.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from codecov_cli.helpers.git import GitService
88
from codecov_cli.helpers.options import global_options
99
from codecov_cli.services.upload_completion import upload_completion_logic
10+
from codecov_cli.types import CommandContext
1011

1112
logger = logging.getLogger("codecovcli")
1213

@@ -15,7 +16,7 @@
1516
@global_options
1617
@click.pass_context
1718
def send_notifications(
18-
ctx,
19+
ctx: CommandContext,
1920
commit_sha: str,
2021
slug: typing.Optional[str],
2122
token: typing.Optional[str],

codecov_cli/commands/staticanalysis.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from codecov_cli.fallbacks import CodecovOption, FallbackFieldEnum
99
from codecov_cli.helpers.validators import validate_commit_sha
1010
from codecov_cli.services.staticanalysis import run_analysis_entrypoint
11+
from codecov_cli.types import CommandContext
1112

1213
logger = logging.getLogger("codecovcli")
1314

@@ -48,7 +49,7 @@
4849
)
4950
@click.pass_context
5051
def static_analysis(
51-
ctx,
52+
ctx: CommandContext,
5253
foldertosearch,
5354
numberprocesses,
5455
pattern,

codecov_cli/commands/upload.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from codecov_cli.fallbacks import CodecovOption, FallbackFieldEnum
99
from codecov_cli.helpers.options import global_options
1010
from codecov_cli.services.upload import do_upload_logic
11+
from codecov_cli.types import CommandContext
1112

1213
logger = logging.getLogger("codecovcli")
1314

@@ -190,7 +191,7 @@ def global_upload_options(func):
190191
@global_options
191192
@click.pass_context
192193
def do_upload(
193-
ctx: click.Context,
194+
ctx: CommandContext,
194195
commit_sha: str,
195196
report_code: str,
196197
branch: typing.Optional[str],

0 commit comments

Comments
 (0)