Skip to content

Commit 4a343dd

Browse files
committed
Disable most obvious parts a.k.a. "init configuration"
1 parent 8e4d393 commit 4a343dd

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

setup.cfg

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[flake8]
2+
3+
# Ruff set to 79, but we have some noqa comments which are a bit longer, and wemake does not forgive that
4+
max-line-length = 88
5+
# Suppress WPS410 warning
6+
allowed-module-metadata=__all__
7+
8+
ignore =
9+
# Allow relative imports to the current folder.
10+
WPS300,
11+
12+
13+
per-file-ignores =
14+
# Tests contain similar string literals
15+
tests/pytest/_cli_test.py: WPS226

src/pre_commit_terraform/_cli.py

Lines changed: 7 additions & 7 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:
36+
try: # noqa: WPS225 - too many `except` cases
3737
return invoke_cli_app(parsed_cli_args)
3838
except PreCommitTerraformExit as exit_err:
39-
# T201 - FIXME here and below - we will replace 'print' with
40-
# logging later
41-
print(f'App exiting: {exit_err!s}', file=sys.stderr) # noqa: T201
39+
# T201,WPS421 - FIXME here and below - we will replace 'print'
40+
# with logging later
41+
print(f'App exiting: {exit_err!s}', file=sys.stderr) # noqa: T201,WPS421
4242
raise
4343
except PreCommitTerraformRuntimeError as unhandled_exc:
44-
print( # noqa: T201
44+
print( # noqa: T201,WPS421
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
51+
print( # noqa: T201,WPS421
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
57+
print( # noqa: T201,WPS421
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,6 @@ def invoke_cli_app(parsed_cli_args: Namespace) -> ReturnCodeType:
109109
# hook, so leave as is
110110
except subprocess.CalledProcessError as e: # noqa: PERF203
111111
# T201 - Leave print statement as is, as this is deprecated hook
112-
print(e) # noqa: T201
112+
print(e) # noqa: T201,WPS421
113113
retval = ReturnCode.ERROR
114114
return retval

0 commit comments

Comments
 (0)