Skip to content

Commit 7b97a17

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

File tree

3 files changed

+27
-8
lines changed

3 files changed

+27
-8
lines changed

setup.cfg

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#
2+
# Configuration of wemake-python-styleguide
3+
# Docs: https://wemake-python-styleguide.readthedocs.io
4+
#
5+
[flake8]
6+
7+
# Ruff set to 79, but we have some noqa comments which are a bit longer, and wemake does not forgive that
8+
max-line-length = 88
9+
# Suppress WPS410 warning
10+
allowed-module-metadata=__all__
11+
12+
ignore =
13+
# Allow relative imports to the current folder.
14+
WPS300,
15+
16+
17+
per-file-ignores =
18+
# Tests contain similar string literals
19+
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)