-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
When running pixee explain on an empty result set, the following exception occurs:
$ pixee explain
Reading results from `results.codetf.json`
No changes applied
Traceback (most recent call last):
File "/opt/homebrew/bin/pixee", line 8, in <module>
sys.exit(main())
^^^^^^
File "/opt/homebrew/Cellar/pixee/0.5.5/libexec/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/pixee/0.5.5/libexec/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/pixee/0.5.5/libexec/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/pixee/0.5.5/libexec/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/pixee/0.5.5/libexec/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/pixee/0.5.5/libexec/lib/python3.11/site-packages/pixee/cli.py", line 388, in explain
codemod := select(
^^^^^^^
File "/opt/homebrew/Cellar/pixee/0.5.5/libexec/lib/python3.11/site-packages/questionary/prompts/select.py", line 133, in select
raise ValueError("A list of choices needs to be provided.")
ValueError: A list of choices needs to be provided.
There are probably two changes we should make for this fix:
- Ensure that
pixee explainexits cleanly without an exception in the case of an empty CodeTF file - Do not generate a CodeTF file if
pixee fixdoes not generate any fixes. This would help ensure that the last actual fix results remain available forpixee explainwhere applicable.
Metadata
Metadata
Assignees
Labels
No labels