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

Add option to output to Markdown table #69

Open
peterjaap opened this issue Nov 10, 2020 · 7 comments
Open

Add option to output to Markdown table #69

peterjaap opened this issue Nov 10, 2020 · 7 comments

Comments

@peterjaap
Copy link

We use Gitlab instead of Github, and Gitlab uses markdown for issues. It would be great to have an option to have the output of this plugin generated as a Markdown table, so we can copy/paste it into an issue.

@pyrech
Copy link
Owner

pyrech commented Nov 10, 2020

Hello, thanks for your suggestion.

I like the idea, I don't think implementing it would be too complicated. We could either change the default output or just add an option to allow the choice of the desired output.

Would you like to give it a try?

@peterjaap
Copy link
Author

Changing the default output to a Markdown table wouldn't look pretty in the console. So I'm in favor of adding an option, although I'm not sure how to pass that option to the plugin without having to pass a flag everytime.

@pyrech
Copy link
Owner

pyrech commented Nov 10, 2020

Indeed, let's have another optional table output instead 👍 Speaking of it, which columns do you need? It would be better to have the same columns for the three operations (install, update, uninstall).

About the architecture, I think we could add support for a new option in the plugin section of the composer.json. See this documentation to have a look at the existing config supported by this plugin with the ConfigBuilder and the related Config DTO.

I guess we could add an OutputFormatter interface with 2 implementations (current formatting and table). Then, according to the new config option, we would pass the correct implementation to the OutputFormatter / getOutput method of OperationHandler classes.

Does this sounds good to you?

@peterjaap
Copy link
Author

Yes, sounds good!

The table columns would preferably be package name, previous version, current version, release notes link, compare link. So something like this; https://github.com/davidrjonas/composer-lock-diff#example-plain-text-table-output

@peterjaap
Copy link
Author

peterjaap commented Nov 10, 2020

@pyrech come to think of it, your suggestion would mean I'd have to edit the composer.json file in every project I'd like to see a table output, which in our case is a lot (we run an agency). Isn't there a way to store parameters like this somewhere in composer's global scope, like in a file somewhere? I'd rather not touch the repositories themselves.

@pyrech
Copy link
Owner

pyrech commented Nov 10, 2020

Yes, that is supported 🙂. The plugin configuration can also be set in your global location (usually in ~/.composer/composer.json) 😉. See https://github.com/pyrech/composer-changelogs/blob/master/doc/configuration.md#location

@peterjaap
Copy link
Author

@pyrech of course, forgot about that one. Perfect!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants