sopel-irc / sopel-github

GitHub plugin for Sopel
Other
3 stars 13 forks source link

github: support inline references to issues/PRs in any repo #125

Closed dgw closed 1 year ago

dgw commented 1 year ago

This accepts user/reponame#123 in all cases.

As before, if the current channel has a default repo (set using the .gh-repo command), #123 will be treated as a reference to an issue or PR in the configured default repo. Additionally, reponame#123 will now fill in the missing "username" portion from the configured default.

Implementing this feature required switching to named capture groups in all URL patterns, because the user and reponame portions of the inline references are optional. It seemed like a maintainability win, anyway, so even if I just missed thinking of a way to do it with numbered capture groups, I'm glad to have made the change anyway.

dgw commented 1 year ago

Two weeks of testing on the Sopel bot running in #sopel at Libera, no further issues noted other than parentheses breaking this feature (now fixed by 0655be380052c6f2187e18683e1be3ffb3bcf2b8. Let's ship.