Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize printing of the hook results #700

Open
slarse opened this issue Oct 8, 2020 · 0 comments
Open

Generalize printing of the hook results #700

slarse opened this issue Oct 8, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@slarse
Copy link
Collaborator

slarse commented Oct 8, 2020

There's currently quite a bit of hard coding going on in the printing of the hook results. As more and more commands are getting hooks, it's about time this becomes more generalized. Currently, it looks like this:

if is_ext_command or args.action in [
plug.cli.CoreCommand.repos.setup,
plug.cli.CoreCommand.repos.update,
plug.cli.CoreCommand.repos.clone,
]:
if hook_results:
plug.echo(formatters.format_hook_results_output(hook_results))
if hook_results and "hook_results_file" in args and args.hook_results_file:
_handle_hook_results(
hook_results=hook_results, filepath=args.hook_results_file
)

Ugly to say the least. If the outer if that constrains printing hook results to a few commands is removed, some stuff that we don't want to print is printed (see #699). This is just poorly designed. I think the easiest way to solve this is to:

  1. Standardize the hook results format. It's a bit ad-hoc at the moment.
  2. Add metainfo somewhere about what to print.
@slarse slarse added the enhancement New feature or request label Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant