Skip to content

Commit 62870fd

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 93cc4b8 commit 62870fd

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/pre_commit_terraform/_cli.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,28 @@ def invoke_cli_app(cli_args: list[str]) -> ReturnCodeType:
3333
parsed_cli_args.invoke_cli_app,
3434
)
3535

36-
try: # noqa: WPS225 - too many `except` cases
36+
try:
3737
return invoke_cli_app(parsed_cli_args)
3838
except PreCommitTerraformExit as exit_err:
3939
# T201,WPS421 - FIXME here and below - we will replace 'print'
4040
# with logging later
41-
print(f'App exiting: {exit_err!s}', file=sys.stderr) # noqa: T201,WPS421
41+
print(f'App exiting: {exit_err!s}', file=sys.stderr) # noqa: T201
4242
raise
4343
except PreCommitTerraformRuntimeError as unhandled_exc:
44-
print( # noqa: T201,WPS421
44+
print( # noqa: T201
4545
f'App execution took an unexpected turn: {unhandled_exc!s}. '
4646
'Exiting...',
4747
file=sys.stderr,
4848
)
4949
return ReturnCode.ERROR
5050
except PreCommitTerraformBaseError as unhandled_exc:
51-
print( # noqa: T201,WPS421
51+
print( # noqa: T201
5252
f'A surprising exception happened: {unhandled_exc!s}. Exiting...',
5353
file=sys.stderr,
5454
)
5555
return ReturnCode.ERROR
5656
except KeyboardInterrupt as ctrl_c_exc:
57-
print( # noqa: T201,WPS421
57+
print( # noqa: T201
5858
f'User-initiated interrupt: {ctrl_c_exc!s}. Exiting...',
5959
file=sys.stderr,
6060
)

src/pre_commit_terraform/terraform_docs_replace.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def populate_argument_parser(subcommand_parser: ArgumentParser) -> None:
5858
)
5959

6060

61-
def invoke_cli_app(parsed_cli_args: Namespace) -> ReturnCodeType: # noqa: WPS231
61+
def invoke_cli_app(parsed_cli_args: Namespace) -> ReturnCodeType:
6262
"""Run the entry-point of the CLI app.
6363
6464
Returns:
@@ -86,7 +86,7 @@ def invoke_cli_app(parsed_cli_args: Namespace) -> ReturnCodeType: # noqa: WPS23
8686
retval = ReturnCode.OK
8787

8888
for directory in dirs:
89-
try: # noqa: WPS229 - ignore as it's deprecated hook
89+
try:
9090
proc_args = []
9191
proc_args.append('terraform-docs')
9292
if cast_to('bool', parsed_cli_args.sort):
@@ -107,8 +107,8 @@ def invoke_cli_app(parsed_cli_args: Namespace) -> ReturnCodeType: # noqa: WPS23
107107
subprocess.check_call(' '.join(proc_args), shell=True) # noqa: S602
108108
# PERF203 - try-except shouldn't be in a loop, but it's deprecated
109109
# hook, so leave as is
110-
except subprocess.CalledProcessError as e: # noqa: PERF203,WPS111
110+
except subprocess.CalledProcessError as e: # noqa: PERF203
111111
# T201 - Leave print statement as is, as this is deprecated hook
112-
print(e) # noqa: T201,WPS421
112+
print(e) # noqa: T201
113113
retval = ReturnCode.ERROR
114114
return retval

0 commit comments

Comments
 (0)