Skip to content

Suggest length limit for PR titles #5375

Closed

Description

@karlhorky

Description

The suggest-commit-title-limit suggests the length of a commit title when a PR is about to be merged.

It would be nice to have a length warning also during creation and editing of the PR (the title field at the top of the page), to warn as early as possible and make it easier to merge things later (could also be a default-off option)

Screenshot

No response

Example URL

#5365

Activity

  1. fregante commented on May 1, 2022

    @fregante
  2. cheap-glitch commented on May 1, 2022

    @cheap-glitch
  3. karlhorky commented on May 1, 2022

    @karlhorky
    Author
  4. fregante commented on May 1, 2022

    @fregante
  5. karlhorky commented on May 1, 2022

    @karlhorky
    Author
  6. fregante commented on May 2, 2022

    @fregante
  7. karlhorky commented on May 18, 2022

    @karlhorky
    ContributorAuthor

    So I keep coming back to this, since some kind of feature would be a huge help to workflows with squash merging.

    Eg. consider this situation:

    1. A team is using squash merging
    2. A team wants to know as early as possible about possible errors, not when they are in the process of merging

    For this use case, I would be great to have an error earlier in the process.

    Is it possible to detect squash merging and enable for this use case?

    Or, another alternative which would also work:

    By default add a floating character counter in the input of the PR title during pull request creation (for everyone?), so that someone can just visually verify this, if it fits their workflow.

    @fregante @cheap-glitch thoughts?


    Workaround: I've created a userscript that adds a counter: https://github.com/karlhorky/userscripts/blob/main/github-pr-title-character-counter.user.js

  8. fregante commented on May 19, 2022

    @fregante
    Member

    Reopened on the basis that super-long PR titles aren't exactly ideal either, however we can't show a red color in this case, maybe an orange or yellow is better if available.

    A character count wouldn't be particularly helpful because it cannot/does not include the PR number " (#123) so: at what magic number do you have to stop on the PR #123? It's not 72, not 70, not 68, etc… so we need to use a similar logic to the commit title, except we silently subtract " (#123)".length from the total.

    It's ok to extend this feature to apply it to PRs and maybe rename the feature

  9. added
    small
    and removed on May 20, 2022
  10. changed the title [-]`suggest-commit-title-limit`: Suggest length of PR title during creation / editing[/-] [+]`suggest-commit-title-limit`: Suggest length of PR title[/+] on May 20, 2022
  11. changed the title [-]`suggest-commit-title-limit`: Suggest length of PR title[/-] [+]Suggest length limit for PR titles[/+] on May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedenhancementsmall

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions