Wikipedia:Bots/Requests for approval/Galobot


 * The following discussion is an archived debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA. The result of the discussion was

Galobot
Operator:

Time filed: 07:12, Friday, August 3, 2018 (UTC)

Automatic, Supervised, or Manual: Automatic

Programming language(s): Python (Pywikibot)

Source code available: Here

Function overview: Fix multiple unclosed formatting tags lint errors

Links to relevant discussions (where appropriate): Village pump (technical) Bot requests

Edit period(s): One time run

Estimated number of pages affected: ~10000 based on 34000 errors

Exclusion compliant (Yes/No): Yes

Already has a bot flag (Yes/No): No

Function details: Basically, replaces things like … with … as suggested here. Tags fixed are, , , , , , and. Specifically:
 * 1) for each page that has multiple unclosed formatting tags, finds every multiple unclosed formatting tags error for that page
 * 2) uses the "location" output of Linter to narrow down where to fix the error in the page text
 * 3) searches for two instances of start tags of the erroneous tag
 * 4) if there are no closing tags or templates in between, it replaces the latter instance with a closing tag
 * update: the two deprecated tags are now handled a bit differently; tags are replaced with  tags and  with mono if the fix is to the 99%+ case of reviewer
 * 1) only makes an edit if it has fixed all multiple unclosed formatting tags errors.

I know that 's is having a BRFA partly for doing the same for just ; however, this fixes all non-nesting tags with such errors, and as it only edits when all errors are fixed there shouldn't be any double-watchlist hits from both bots or anything like that. Also, my bot account was blocked by for having "bot" in its name; probably should be unblocked, at-least now :)

Discussion

 * Unblocked as there is a BRFA open on this and it is not editing outside the bot policy. — xaosflux  Talk 13:03, 3 August 2018 (UTC)


 * Regarding "only makes an edit if it has fixed all multiple unclosed formatting tags errors" - is this for the entire page, how will you determine this? — xaosflux  Talk 13:08, 3 August 2018 (UTC)
 * Yes, this is for the entire page. All the multiple unclosed formatting tags errors of the page are gotten through an API call; if for any of the errors on a page it cannot make a fix, it doesn't edit the page (there is no need to make more than one fix per error given by Linter). This filtering decreases the number of pages edited by ~5%. Galobtter (pingó mió) 13:24, 3 August 2018 (UTC)
 * From an "error-handling" perspective, how likely is it that there will be nested instances of these calls? I know it's unlikely that there will be something like  (which shows up as , but it's very possible you could have someone saying "To highlight code, use  ", which has two  calls in it. Primefac (talk) 16:12, 3 August 2018 (UTC)
 * I mean, I know that the second example I've given doesn't actually throw any errors, but if there was another error on the page, would it correct it? Primefac (talk) 16:13, 3 August 2018 (UTC)
 * Interesting edge case, but no :). Linter gives the location of the error (from the start tag to the incorrect end tag (addendum: or sometimes till the end of the line)). The script only tries fixing the specific tag that Linter says is problematic within that particular location. (see here for example of API output) So another error elsewhere would not cause "fixing" of that.


 * (Additional thoughts that may not make sense and are of minor import: The only way that would even be close happening is if the page had two unclosed formatting lint errors as in here. Linter sometimes gives the location as from the first erroneous tag to the very last one, instead of stopping at the second paired erronous tag (but not in the case I've made though), and thus the whole of the text would be in the location of one of the reported errors, and thus the text to be fixed would include the example you've given, and the program would be looking to fix a error within that. But the program would only fix the first error there and not "fix" the next line; and the location of the second error would only contain Bar ) Galobtter (pingó mió) 16:47, 3 August 2018 (UTC)
 * Cool. I've been a little more out-of-the-loop on the Linter stuff recently, so I wasn't sure how the errors were being handled these days. Primefac (talk) 16:29, 4 August 2018 (UTC)

PAGE ]]) 18:18, 17 August 2018 (UTC)
 * I've added the source code, nothing too much too it Galobtter (pingó mió) 21:46, 7 August 2018 (UTC)
 * Galobtter (pingó mió) 15:15, 13 August 2018 (UTC)
 * Wouldn't it be better to change tt tags to tt or to  (and similarly for strike tags), since they're now deprecated? Jc86035 (talk) 07:53, 14 August 2018 (UTC)
 * ✅, thanks.  are instead replaced with .. if there are no pipes in between to muck things up. are replaced with  Galobtter (pingó mió) 09:44, 14 August 2018 (UTC)
 * You should also check for curley brackets, just in case someone was trying to type &lt;tt>}}&lt;/tt> and accidentally did &lt;tt>}}&lt;tt> instead. I also created a pull request to explicitly call out the first parameter as "1=" and to add "|needs_review=yes". --Ahecht ([[User talk:Ahecht|TALK
 * 99%+ of fixes are of reviewer from an old version of Pending changes reviewer granted so I'm thinking of maybe only changing  to mono then (to avoid any errors); or at-least in that case the fixes won't need review (mono is what is used now for those notices) Galobtter (pingó mió) 18:28, 17 August 2018 (UTC)
 * Yeah, code updated to only replace with mono if it is reviewer Galobtter (pingó mió) 10:36, 18 August 2018 (UTC)

PAGE ]]) 02:54, 14 October 2018 (UTC)
 * tis been nearly a month, I have dealt with any issues brought up; would appreciate if this could move forward. Thanks. Galobtter (pingó mió) 13:43, 1 September 2018 (UTC)
 * SQL Query me! 23:56, 7 September 2018 (UTC)
 * , thanks, Edits. I made the bot skip user talk base pages for the trial per comments by Xaosflux on the Ahechtbot BRFA regarding creating new messages alerts. A large portion of the edits were of changing the  tag; here are sample edits of each of the tags: tt (tt fix that isn't of reviewer<tt> ), s, code, b, i, u, strike. There was one error, but I spotted it and tweaked the bot code (turns out the location given by linter is sometimes 1 off, and code was tweaked to account for that; it now skips that page). Other than that I was checking every edit and there were no issues I could spot. Galobtter (pingó mió) 12:49, 8 September 2018 (UTC)
 * Galobtter (pingó mió) 14:03, 7 October 2018 (UTC)
 * It's been over a month since the trial was completed, and a week since Galobtter nudged . --Ahecht ([[User talk:Ahecht|<span style="color:#FFF;background:#04A;display:inline-block;padding:1px;vertical-align:-.3em;font:bold 50%/1 sans-serif;text-align:center">TALK
 * I apologize for the delay. I've been very busy off-wiki. I don't see any issues with the trial edits, and there has been more than ample time for anyone else comment on this task.  SQL <sup style="font-size: 5pt;color:#999">Query me!  03:40, 14 October 2018 (UTC)
 * The above discussion is preserved as an archive of the debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA.