You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some uses of the --help option cause a failure with traceback. It happened for me with safety validate --help and safety generate --help, but I did not test all safety subcommands.
Describe the ideal solution
--help should not fail.
Alternatives and current workarounds
No response
Additional context
No response
What I Did
$ safety generate --help
(zhmc312) maiera-mbp-3:python-zhmcclient maiera$ safety generate --help
Generate a boilerplate Safety CLI policy file for customized security policies.
Note: Safety Platform policies will override any local policy files found
Example: safety generate policy_file
Usage: safety generate [OPTIONS] NAME
Options
┏━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ ┃ ┃
┡━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ ['--path'] │ The path where the generated file will be saved (default: current directory). │
│ │ │
│ │ Example: safety generate policy_file --path .my-project-safety-policy.yml │
├────────────┼───────────────────────────────────────────────────────────────────────────────┤
│ ['--help'] │ Show this message and exit. │
└────────────┴───────────────────────────────────────────────────────────────────────────────┘
Traceback (most recent call last):
File "/Users/maiera/virtualenvs/zhmc312/bin/safety", line 8, in <module>
sys.exit(cli())
^^^^^
File "/Users/maiera/virtualenvs/zhmc312/lib/python3.12/site-packages/click/core.py", line 1161, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/maiera/virtualenvs/zhmc312/lib/python3.12/site-packages/click/core.py", line 1082, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Users/maiera/virtualenvs/zhmc312/lib/python3.12/site-packages/safety/cli_util.py", line 734, in invoke
super(SafetyCLILegacyGroup, self).invoke(ctx)
File "/Users/maiera/virtualenvs/zhmc312/lib/python3.12/site-packages/click/core.py", line 1695, in invoke
sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/maiera/virtualenvs/zhmc312/lib/python3.12/site-packages/click/core.py", line 949, in make_context
self.parse_args(ctx, args)
File "/Users/maiera/virtualenvs/zhmc312/lib/python3.12/site-packages/click/core.py", line 1417, in parse_args
value, args = param.handle_parse_result(ctx, opts, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/maiera/virtualenvs/zhmc312/lib/python3.12/site-packages/click/core.py", line 2403, in handle_parse_result
value = self.process_value(ctx, value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/maiera/virtualenvs/zhmc312/lib/python3.12/site-packages/click/core.py", line 2365, in process_value
value = self.callback(ctx, self, value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/maiera/virtualenvs/zhmc312/lib/python3.12/site-packages/click/decorators.py", line 550, in show_help
echo(ctx.get_help(), color=ctx.color)
^^^^^^^^^^^^^^
File "/Users/maiera/virtualenvs/zhmc312/lib/python3.12/site-packages/click/core.py", line 711, in get_help
return self.command.get_help(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/maiera/virtualenvs/zhmc312/lib/python3.12/site-packages/click/core.py", line 1334, in get_help
self.format_help(ctx, formatter)
File "/Users/maiera/virtualenvs/zhmc312/lib/python3.12/site-packages/safety/cli_util.py", line 764, in format_help
pretty_format_help(self, ctx, markup_mode="rich")
File "/Users/maiera/virtualenvs/zhmc312/lib/python3.12/site-packages/safety/cli_util.py", line 245, in pretty_format_help
custom_print_options_panel(
File "/Users/maiera/virtualenvs/zhmc312/lib/python3.12/site-packages/safety/cli_util.py", line 39, in custom_print_options_panel
table.add_row(str(param.opts), param.help or "")
^^^^^^^^^^
AttributeError: 'Argument' object has no attribute 'help'
The text was updated successfully, but these errors were encountered:
We appreciate your effort in reporting this. Our team will review it and get back to you soon.
If you have any additional details or updates, feel free to add them to this issue.
Note: If this is a serious security issue that could impact the security of Safety CLI users, please email [email protected] immediately.
Checklist
Safety version
3.2.14
Python version
3.12.7
Operating System
macOS 14.7.2
Describe the problem you'd like to have solved
Some uses of the
--help
option cause a failure with traceback. It happened for me withsafety validate --help
andsafety generate --help
, but I did not test all safety subcommands.Describe the ideal solution
--help
should not fail.Alternatives and current workarounds
No response
Additional context
No response
What I Did
The text was updated successfully, but these errors were encountered: