From c08d7d9472a6ca122d4772a92dfd9b17d2b0851f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 20:57:09 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/gitleaks/gitleaks: v8.24.0 → v8.24.2](https://github.com/gitleaks/gitleaks/compare/v8.24.0...v8.24.2) - [github.com/hadolint/hadolint: v2.12.1-beta → v2.13.1-beta](https://github.com/hadolint/hadolint/compare/v2.12.1-beta...v2.13.1-beta) - [github.com/adrienverge/yamllint.git: v1.36.2 → v1.37.0](https://github.com/adrienverge/yamllint.git/compare/v1.36.2...v1.37.0) - [github.com/pre-commit/mirrors-prettier: v3.1.0 → v4.0.0-alpha.8](https://github.com/pre-commit/mirrors-prettier/compare/v3.1.0...v4.0.0-alpha.8) - [github.com/astral-sh/ruff-pre-commit: v0.8.4 → v0.11.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.4...v0.11.4) --- .pre-commit-config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 93278fd92..740b1adcd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 @@ -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: @@ -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 @@ -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: From d775d5a89029474343edcd869133f3ce40f1244c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 20:57:30 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/pre_commit_terraform/_cli.py | 10 +++++----- src/pre_commit_terraform/_cli_parsing.py | 2 +- tests/pytest/_cli_test.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pre_commit_terraform/_cli.py b/src/pre_commit_terraform/_cli.py index 976429790..abd95df75 100644 --- a/src/pre_commit_terraform/_cli.py +++ b/src/pre_commit_terraform/_cli.py @@ -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, ) @@ -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 diff --git a/src/pre_commit_terraform/_cli_parsing.py b/src/pre_commit_terraform/_cli_parsing.py index 4bdebf6d0..fac4da15c 100644 --- a/src/pre_commit_terraform/_cli_parsing.py +++ b/src/pre_commit_terraform/_cli_parsing.py @@ -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 diff --git a/tests/pytest/_cli_test.py b/tests/pytest/_cli_test.py index 262df81d7..fd4b1fef5 100644 --- a/tests/pytest/_cli_test.py +++ b/tests/pytest/_cli_test.py @@ -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(