all-contributors/cli

Ability to create custom URL template for types

melink14 opened this issue · 5 comments

Is your feature request related to a problem? Please describe.
I would like to add a label parameter for the Bug Report URL and create a URL for enhancement issues to add to the Ideas type.

Describe the solution you'd like
There's an example of overriding types in the configuration docs but the link just refers to url. It would be good to have an example or description of how to produce that url placeholder. (Or if it's impossible, for it to be made possible.)

I also noticed that the types section of the configuration was only present in the CLI docs so maybe any customization would also be CLI only?

Describe alternatives you've considered
I could manually change them (not too bad for my repo though backfilling is annoying) or I could just not do it and keep the defaults.

Thanks!

Have you looked at https://github.com/all-contributors/all-contributors-cli/blob/master/src/generate/__tests__/format-contribution-type.js? That shows some examples of how it could be done. But yeah, having examples in the documentation would be more accessible.

I also noticed that the types section of the configuration was only present in the CLI docs so maybe any customization would also be CLI only?

That's also available for the bot (cf. https://allcontributors.org/docs/en/bot/configuration).

Thanks for the reply. I was looking through the repo link generation code (https://github.com/all-contributors/all-contributors-cli/blob/0c7559515698b6e24919d334cd1a3713afd3a200/src/repo/index.js#L13) but those tests are definitely more digestible.

Updating the documentation to be more specfic could be the goal of this FR then since the current documentation isn't just incomplete it's also wrong. The example shows a full markdown syntax for symbol, url, and description but the actual code expects only a HTML anchor tag which it inserts into a predefined template that contains symbol and description!

I'll try to send a PR soonish.

I also learned from the test that contribution can be an object with type and url keys which makes sense but seems to be not documented anywhere. Trial and error says you can pass --url=<url> and I assume the bot will just detect URL in context and pass it correctly. (Might open a separate issue for this since it's a bit tangential)

Thanks!

edit: Don't know how I missed that section of the Bot's configuration. Must have just been in a blind spot...

@melink14 Did you get round to looking into implementing that?

Ah, I did not! Life got in the way, apologies for not updating this.

@melink14 It's fine, I'm in a similar boat.