Skip to content

Commit

Permalink
Improve naming and help output
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxymVlasov committed Jan 3, 2025
1 parent c2aab92 commit 449d448
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/pre_commit_terraform/_cli_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def populate_common_argument_parser(parser: ArgumentParser) -> None:
'-h',
'--hook-config',
action='append',
metavar='KEY=VALUE',
help='Arguments that configure hook behavior',
default=[],
)
Expand All @@ -42,6 +43,8 @@ def populate_common_argument_parser(parser: ArgumentParser) -> None:
'-e',
'--env-vars',
'--envs',
dest='env_vars_strs',
metavar='KEY=VALUE',
action='append',
help='Setup additional Environment Variables during hook execution',
default=[],
Expand Down
10 changes: 5 additions & 5 deletions tests/pytest/test__cli_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_populate_common_argument_parser(mocker):
assert args.args == ['arg1']
assert args.hook_config == ['hook1']
assert args.tf_init_args == ['init1']
assert args.env_vars == ['env1']
assert args.env_vars_strs == ['env1']
assert args.files == ['file1', 'file2']


Expand All @@ -32,7 +32,7 @@ def test_populate_common_argument_parser_defaults(mocker):
assert args.args == []
assert args.hook_config == []
assert args.tf_init_args == []
assert args.env_vars == []
assert args.env_vars_strs == []
assert args.files == []


Expand Down Expand Up @@ -65,7 +65,7 @@ def test_populate_common_argument_parser_multiple_values(mocker):
assert args.args == ['arg1', 'arg2']
assert args.hook_config == ['hook1', 'hook2']
assert args.tf_init_args == ['init1', 'init2']
assert args.env_vars == ['env1', 'env2']
assert args.env_vars_strs == ['env1', 'env2']
assert args.files == ['file1', 'file2']


Expand All @@ -91,7 +91,7 @@ def test_attach_subcommand_parsers_to(mocker):
assert args.args == ['arg1']
assert args.hook_config == ['hook1']
assert args.tf_init_args == ['init1']
assert args.env_vars == ['env1']
assert args.env_vars_strs == ['env1']
assert args.files == ['file1', 'file2']
assert args.invoke_cli_app == mock_subcommand_module.invoke_cli_app

Expand Down Expand Up @@ -168,7 +168,7 @@ def test_initialize_argument_parser(mocker):
assert args.args == ['arg1']
assert args.hook_config == ['hook1']
assert args.tf_init_args == ['init1']
assert args.env_vars == ['env1']
assert args.env_vars_strs == ['env1']
assert args.files == ['file1', 'file2']
assert args.invoke_cli_app == mock_subcommand_module.invoke_cli_app

Expand Down

0 comments on commit 449d448

Please sign in to comment.