Repository navigation
suggest-commit-title-limit - Enable on PR title - #7428
Conversation
|
cc @karlhorky |
|
Amazing, thanks! Doesn't GitHub UI cut off after 50 characters? Would it make sense to make this configurable? (or just adopt the shorter 50 characters length to match GitHub?) The original issue also mentioned that 50 characters is the limit for GitHub, but was eventually changed to 72, which doesn't seem like a common length rule (often the 50/72 rule is cited, 50 characters limit for titles and 72 characters for subsequent lines): |
|
More research: On this PR it seems like the GitHub UI is truncating after 67 characters (so 72 would be an unfortunate length leading to truncation in the UI): I guess I would suggest by default going with 50 characters (because that is also what GitHub uses), and then allowing configuration for those who want more characters. |
Never, 50 is just a suggestion for commits titles. 72 is GitHub's actual limit (72 characters are allowed, less than that is clipped to 70 + ellipsis I guess) The hard limit for PR titles is 256 characters:
That' missing the backticks used to turn part of the title into As for the limit to use here, we actually had this issue before and it was the reason why we dropped this feature (we either had it or tried to add it before). The issue: PR titles are used as commit titles together with |
|
You can see it live here: #2178 (comment) |
Interesting, so that means GitHub is rendering an ellipsis character with the But good catch on the backticks, which I indeed did not count there.
Given the new information about the 72 characters, makes sense to me 👍
Would still be nice for users to be able to configure the limit to whatever they want, since some may want to:
|
Will never happen, we just don't do that: https://github.com/refined-github/refined-github/wiki/%22Can-you-add-this-feature%3F%22#3-it-doesnt-require-options I don’t think even GitHub cares enough about that to make it a per-repo limitation. If you want actual limits you'll have to use GitHub Actions and protected branches. The scope of |
|
Sorry that it couldn't match the desired length count 🙏 |
|
Nice, no worries - I can understand your logic with it 👍 Maybe 50-character commit title counts are outdated. 72 is much more roomy, and will probably make it easier to be expressive for complex changes without too much endless "character golfing" re-editing. I'll consider switching for our team. |
|
@fregante it appears this isn't applying on the "Files changed" tab in PRs - Would it be possible to also apply this to other tabs? I tried looking for a URL / regex in the diff, but I didn't see anything that would match the |
|
Indeed! The check is called edit: the single detection change should be enough |
|
@fregante ok, maybe this is the one you mean? |
|
Thank you! |
|
I just realized today, another place that this is missing is the "create new PR" URL on the compare page: Example URL: HTML: <div class="discussion-topic-header p-0 mb-3">
<h3 id="pull_request_title_header" data-view-component="true" class="f4 mb-2">Add a title</h3>
<text-expander keys=":" data-emoji-url="/autocomplete/emoji" class="position-relative">
<input class="form-control required title js-session-resumable js-quick-submit FormControl-input FormControl-large valid" placeholder="Title" aria-labelledby="pull_request_title_header" autofocus="autofocus" autocomplete="off" required="required" type="text" value="PR title here" name="pull_request[title]" id="pull_request_title">
</text-expander>
</div>Would this also just be another item in the |
|
@fregante created a draft PR here, in case |




Test URLs
Here
Screenshot