Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ repos:

# Detect hardcoded secrets
- repo: https://github.com/gitleaks/gitleaks
rev: v8.24.0
rev: v8.24.2
hooks:
- id: gitleaks

# Dockerfile
- repo: https://github.com/hadolint/hadolint
rev: v2.12.1-beta
rev: v2.13.1-beta
hooks:
- id: hadolint

Expand All @@ -66,7 +66,7 @@ repos:
- --implicit_start

- repo: https://github.com/adrienverge/yamllint.git
rev: v1.36.2
rev: v1.37.0
hooks:
- id: yamllint
types:
Expand All @@ -77,7 +77,7 @@ repos:

# JSON5
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
rev: v4.0.0-alpha.8
hooks:
- id: prettier
# https://prettier.io/docs/en/options.html#parser
Expand All @@ -99,7 +99,7 @@ repos:

# Python
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
rev: v0.11.4
hooks:
- id: ruff
args:
Expand Down
10 changes: 5 additions & 5 deletions src/pre_commit_terraform/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def invoke_cli_app(cli_args: list[str]) -> ReturnCodeType:
root_cli_parser = initialize_argument_parser()
parsed_cli_args = root_cli_parser.parse_args(cli_args)
invoke_cli_app = cast_to(
# FIXME: attempt typing per https://stackoverflow.com/a/75666611/595220 # noqa: TD001, TD002, TD003, FIX001, E501 All these suppressions caused by "FIXME" comment
# FIXME: attempt typing per https://stackoverflow.com/a/75666611/595220 # noqa: TD001, TD002, FIX001, E501 All these suppressions caused by "FIXME" comment
'CLIAppEntryPointCallableType',
parsed_cli_args.invoke_cli_app,
)
Expand All @@ -38,24 +38,24 @@ def invoke_cli_app(cli_args: list[str]) -> ReturnCodeType:
except PreCommitTerraformExit as exit_err:
# T201 - FIXME here and below - we will replace 'print' with
# logging later
print(f'App exiting: {exit_err !s}', file=sys.stderr) # noqa: T201
print(f'App exiting: {exit_err!s}', file=sys.stderr) # noqa: T201
raise
except PreCommitTerraformRuntimeError as unhandled_exc:
print( # noqa: T201
f'App execution took an unexpected turn: {unhandled_exc !s}. '
f'App execution took an unexpected turn: {unhandled_exc!s}. '
'Exiting...',
file=sys.stderr,
)
return ReturnCode.ERROR
except PreCommitTerraformBaseError as unhandled_exc:
print( # noqa: T201
f'A surprising exception happened: {unhandled_exc !s}. Exiting...',
f'A surprising exception happened: {unhandled_exc!s}. Exiting...',
file=sys.stderr,
)
return ReturnCode.ERROR
except KeyboardInterrupt as ctrl_c_exc:
print( # noqa: T201
f'User-initiated interrupt: {ctrl_c_exc !s}. Exiting...',
f'User-initiated interrupt: {ctrl_c_exc!s}. Exiting...',
file=sys.stderr,
)
return ReturnCode.ERROR
Expand Down
2 changes: 1 addition & 1 deletion src/pre_commit_terraform/_cli_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def initialize_argument_parser() -> ArgumentParser:
Returns:
ArgumentParser: The root parser with sub-commands attached.
"""
root_cli_parser = ArgumentParser(prog=f'python -m {__package__ !s}')
root_cli_parser = ArgumentParser(prog=f'python -m {__package__!s}')
attach_subcommand_parsers_to(root_cli_parser)
return root_cli_parser

Expand Down
2 changes: 1 addition & 1 deletion tests/pytest/_cli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def invoke_cli_app(self, parsed_cli_args: Namespace) -> ReturnCodeType:
assert invoke_cli_app(['sentinel']) == ReturnCode.ERROR

captured_outputs = capsys.readouterr()
assert captured_outputs.err == f'{expected_stderr !s}\n'
assert captured_outputs.err == f'{expected_stderr!s}\n'


def test_app_exit(
Expand Down
Loading