Jump to content

Wikipedia:Bots/Requests for approval/DeprecatedFixerBot 2

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by TheSandDoctor (talk | contribs) at 18:20, 21 March 2018 (Discussion: re). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Operator: TheSandDoctor (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)

Time filed: 16:40, Wednesday, March 14, 2018 (UTC)

Automatic, Supervised, or Manual: automatic

Programming language(s): Python

Source code available: https://github.com/TheSandDoctor/DivCol-ColumnsList-Fix

Function overview: Remove deprecated parameters from both Template:Columns-list and Template:Div col transclusions, as found in Category:Pages using Columns-list with deprecated parameters and Category:Pages using div col with deprecated parameters

Links to relevant discussions (where appropriate): Template talk:Div col#Proposal for standardized changes (by bot or AWB)

Edit period(s): Routine runs until categories are cleared, possible maintenance runs in future

Estimated number of pages affected: 57,000+

Exclusion compliant (Yes/No): Yes

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

Function details: The bot would run through one category at a run in a series of subsequent runs.

As described in the linked discussion,

{{div col|2}} → {{div col}}
{{div col|cols=2}} → {{div col}}
{{colbegin|2}} → {{div col}}
{{colbegin|cols=2}} → {{div col}}
(etc. for other redirects)
{{colbegin|3}} (or cols=3) → {{div col|colwidth=22em}}
{{colbegin|4}} (or cols=4) → {{div col|colwidth=18em}}
{{colbegin|5}} (or cols=5) → {{div col|colwidth=15em}}
{{colbegin|6}} (or cols=6) → {{div col|colwidth=13em}}
{{colbegin|7+}} (or cols=7+) → {{div col|colwidth=10em}} (any number of columns 7 or higher)
{{Columns-list|2| → {{Columns-list|colwidth=30em| (while we're here; also do for all redirects to this one)
{{Columns-list|3| → {{Columns-list|colwidth=22em| (and etc. as below)
{{div col||([0-9]em)}} → {{div col|colwidth=$1}}
{{div col|([0-9]em)}} → {{div col|colwidth=$1}} (as currently coded, this is an error, but fixable)
{{colend}} → {{div col end}} (replace all end template redirects with div col end)

If the bot finds the first unnamed parameter, it assesses its value. If the value is less than 2 (1), then it removes that parameter so the template is set to its default value. If the value is between 2 and 6, it changes as shown above. If the value is 7 or greater, then the bot changes the value to 10em.

In offline tests (printing both input and output to individual local files on a random few), it worked as expected.

Discussion

@TheSandDoctor: Per WP:BOTACC "The account's name should identify the bot function (e.g. <Task>Bot), or the operator's main account (e.g. <Username>Bot)." I would find it extremely confusing if a Twitter-related bot started to do div-related changes. We need either a new bot account, or a rename of the existing bot account (such as TheSandDoctor's Bot / TheSandDoctorBot or similar). This also applies to Wikipedia:Bots/Requests for approval/TweetCiteBot 2. Headbomb {t · c · p · b} 21:33, 17 March 2018 (UTC)[reply]

Moved task from TweetCiteBot to DeprecatedFixerBot. --TheSandDoctor (talk) 21:59, 17 March 2018 (UTC)[reply]
{{BAGAssistanceNeeded}} --TheSandDoctor Talk 16:41, 21 March 2018 (UTC)[reply]

I'm a bit concerned this could fall under WP:CONTEXTBOT. I can conceive of cases where exactly two or exactly three columns is what is meant, rather than a more lax "well on my screen, 3 columns looks nicer so let's go with that". You might argue that those should be done with different templates, but how would the bot deal with something like say

Team A
  • Alice
  • Bob
  • Charles
Team B
  • Denver
  • Emily
  • Fiona
Team C
  • Gilligan
  • Hector
  • Ines

Headbomb {t · c · p · b} 17:08, 21 March 2018 (UTC)[reply]

@Headbomb: It would just remove "cols" and use the default, nothing would visibly change (aside from a slight shift left on my screen at least, but barely noticeable).
Team A
  • Alice
  • Bob
  • Charles
Team B
  • Denver
  • Emily
  • Fiona
Like that. --TheSandDoctor Talk 17:23, 21 March 2018 (UTC)[reply]
What about the 3 column output then (updated my example)? Also this seems to contradict the listed logic "{{div col|cols=2}} → {{div col}} {{div col|colwidth=30em}}"Headbomb {t · c · p · b} 17:53, 21 March 2018 (UTC)[reply]
Headbomb, please read the linked discussion above. Specifying a number of columns is deprecated behavior, for the same reason that the behavior was deprecated (and removed) in {{reflist}}. This is just a continuation of that work. – Jonesey95 (talk) 18:16, 21 March 2018 (UTC)[reply]
@Headbomb: It would look like this
Team A
  • Alice
  • Bob
  • Charles
Team B
  • Denver
  • Emily
  • Fiona
Team C
  • Gilligan
  • Hector
  • Ines
I was hesitant in responding until I figured out the issue. For some reason, when I previously set colwidth to 22em, it just gave a vertical list, yet now it posts normally. Clearly I did something wrong. Either way, works now? (cc @Jonesey95: --TheSandDoctor Talk 18:20, 21 March 2018 (UTC)[reply]