Skip to content

Commit b95c7ed

Browse files
committed
TC006 - Add quotes to type expression in typing.cast()
1 parent 7275ada commit b95c7ed

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/pre_commit_terraform/_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def invoke_cli_app(cli_args: list[str]) -> ReturnCodeType:
2323
parsed_cli_args = root_cli_parser.parse_args(cli_args)
2424
invoke_cli_app = cast_to(
2525
# FIXME: attempt typing per https://stackoverflow.com/a/75666611/595220
26-
CLIAppEntryPointCallableType,
26+
'CLIAppEntryPointCallableType',
2727
parsed_cli_args.invoke_cli_app,
2828
)
2929

src/pre_commit_terraform/terraform_docs_replace.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def invoke_cli_app(parsed_cli_args: Namespace) -> ReturnCodeType:
5757
)
5858

5959
dirs: list[str] = []
60-
for filename in cast_to(list[str], parsed_cli_args.filenames):
60+
for filename in cast_to('list[str]', parsed_cli_args.filenames):
6161
if os.path.realpath(filename) not in dirs and (
6262
filename.endswith(('.tf', '.tfvars'))
6363
):
@@ -69,7 +69,7 @@ def invoke_cli_app(parsed_cli_args: Namespace) -> ReturnCodeType:
6969
try:
7070
procArgs = []
7171
procArgs.append('terraform-docs')
72-
if cast_to(bool, parsed_cli_args.sort):
72+
if cast_to('bool', parsed_cli_args.sort):
7373
procArgs.append('--sort-by-required')
7474
procArgs.extend(
7575
(
@@ -78,7 +78,7 @@ def invoke_cli_app(parsed_cli_args: Namespace) -> ReturnCodeType:
7878
'>',
7979
'./{dir}/{dest}'.format(
8080
dir=dir,
81-
dest=cast_to(bool, parsed_cli_args.dest),
81+
dest=cast_to('bool', parsed_cli_args.dest),
8282
),
8383
),
8484
)

0 commit comments

Comments
 (0)