Skip to content

Commit a280c92

Browse files
committed
Add ignores for deprecated hooks
1 parent 4a343dd commit a280c92

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

setup.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#
2+
# Configuration of wemake-python-styleguide
3+
#
14
[flake8]
25

36
# Ruff set to 79, but we have some noqa comments which are a bit longer, and wemake does not forgive that
@@ -13,3 +16,5 @@ ignore =
1316
per-file-ignores =
1417
# Tests contain similar string literals
1518
tests/pytest/_cli_test.py: WPS226
19+
# We will not spend time on fixing coplexity in depprecated hook
20+
src/pre_commit_terraform/terraform_docs_replace.py: WPS232

src/pre_commit_terraform/terraform_docs_replace.py

Lines changed: 3 additions & 3 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:
61+
def invoke_cli_app(parsed_cli_args: Namespace) -> ReturnCodeType: # noqa: WPS231
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:
8686
retval = ReturnCode.OK
8787

8888
for directory in dirs:
89-
try:
89+
try: # noqa: WPS229 - ignore as it's deprecated hook
9090
proc_args = []
9191
proc_args.append('terraform-docs')
9292
if cast_to('bool', parsed_cli_args.sort):
@@ -107,7 +107,7 @@ def invoke_cli_app(parsed_cli_args: Namespace) -> ReturnCodeType:
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
110+
except subprocess.CalledProcessError as e: # noqa: PERF203,WPS111
111111
# T201 - Leave print statement as is, as this is deprecated hook
112112
print(e) # noqa: T201,WPS421
113113
retval = ReturnCode.ERROR

0 commit comments

Comments
 (0)