Skip to content

Improve formatting of PR links added to issues #517

Closed

Description

@ezio-melotti

This is a follow-up of:

Currently the code generated when multiple PRs are linked to an issue looks like:

<!-- gh-pr-number: gh-98920 -->
* PR: gh-98920
<!-- /gh-pr-number -->


<!-- gh-pr-number: gh-98952 -->
* PR: gh-98952
<!-- /gh-pr-number -->


<!-- gh-pr-number: gh-98969 -->
* PR: gh-98969
<!-- /gh-pr-number -->

And the output looks like:
image

It would be better to:

  1. combine these into a single multi-item list, rather than multiple single-item lists
  2. use a checklist or tasklist instead of a regular bullet list

If the PRs are combined in a single list, we won't be able to just append a new PR to the end, but we will need to add the PR link before the closing tag (<!-- /gh-pr-number -->). In addition, the opening tag lists the PR number, so that will need to be updated too -- unless we remove the number from the tag, since it's already included in the list.

Using tasklists is probably better than checklists, and for that, the generated source should look like:

<!-- gh-linked-prs -->
``` [tasklist]
### Linked PRs
- [ ] gh-98920
- [ ] gh-98952
- [ ] gh-98969
```
<!-- /gh-linked-prs -->

(there should be no space between ``` and [tasklist], I added it here otherwise the output breaks).

Since tasklists support a title (e.g. ### Linked PRs), there is no need to repeat PR: before each PR number. (Note that tasklists are a beta feature enabled for the python org, and don't work for other orgs (yet).)

(cc @saadmk11)

Activity

  1. saadmk11 commented on Nov 7, 2022

    @saadmk11
    Contributor

    Hi @ezio-melotti, Thanks for creating such a detailed issue. I have added a PR with the required changes here:

    As I do not have access to any repo/org with the tasklist beta feature enabled, I was only able to test the generated markdown but I was not able to test how it looks after rendering. (This PR generates markdown exactly same as the markdown you provided in the Issue body)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions