Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rfcbot: update to recognise expanded template name #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

A-smart-kitten
Copy link

@A-smart-kitten A-smart-kitten commented Jul 25, 2024

  • modify template-finding regex to also match expanded versions of the {{rfc}} template, in preparation for the planned move of the template to {{request for comment}} (https://w.wiki/Ak3j).
  • in order to bridge the gap between the old and the new template names, modify the code that gets a list of pages transcluding {{rfc}} to also get a list of pages transcluding {{request for comment}} (before then merging the two lists together).
  • also changed some str_replace calls in the syntax-fixing code to use str_ireplace, to fix a potential edge case where a capital letter at the start of an {{RFC}} tag could prevent the bot from successfully fixing its syntax.

hopefully this won’t break anything


With respect to #13 (comment), I don’t see that the template being renamed means that the bot necessarily has to output the expanded version of the title — {{rfc}} will still redirect to {{request for comment}}, and so will work as normal as a template shortcut. As I see it, the main benefit here would be the actual template name being expanded for clarity - imo, there wouldn't be an issue with Legobot continuing to output {{rfc}}.

I also added support for the version without spaces ({{requestforcomment}}); which is currently marked as being deprecated, but which could be re-redirected to the main template if this PR gets merged.

- modify template-finding regex to also match expanded versions of the {{rfc}} template, in preparation for the planned move of the template to {{request for comment}} (https://w.wiki/Ak3j).
- in order to bridge the gap between the old and the new template names, modify the code that gets a list of pages transcluding {{rfc}} to also get a list of pages transcluding {{request for comment}} (before then merging the two lists together).
- also changed some `str_replace` calls in the syntax-fixing code to use `str_ireplace`, to fix a potential edge case where a capital letter at the start of an {{RFC}} tag could prevent the bot from successfully fixing its syntax.


hopefully this won’t break anything
@A-smart-kitten A-smart-kitten marked this pull request as ready for review July 25, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant