Operator: Primefac (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)
Time filed: 18:54, Monday, December 26, 2016 (UTC)
Automatic, Supervised, or Manual: automatic
Programming language(s): AWB
Source code available: AWB
Function overview: Replace deprecated parameters post-TFD merger of ((video game release)) and ((video game release new))
Links to relevant discussions (where appropriate): TFD and the ensuing discussion
Edit period(s): one time run
Estimated number of pages affected: 13,000 ± 500
Exclusion compliant (Yes/No): yes
Already has a bot flag (Yes/No): yes
Function details: Using regex, will replace \| *(JP|NA|PAL|EU|AUS|BR|UK|INT|WW) *= *
with |$1|
in the template call in order to remove named parameters (which are being phased out thanks to better coding post-merge).
@Primefac: We might want to account for when the parameter has no value. For instance ((Video game release|EU=|NA=January 1, 2018))
would get converted to ((Video game release|EU|NA|January 1, 2018))
. This makes a link to EU but with NA as the link text, which I don't think is what we want — MusikAnimal talk 02:58, 28 December 2016 (UTC)Reply[reply]
\| *(JP|NA|PAL|EU|AUS|BR|UK|INT|WW) *= *(.*?)\|
going to |$1|$2|
would cover that, and would leave a blank second parameter. Primefac (talk) 03:09, 28 December 2016 (UTC)Reply[reply]
((Video game release|NA=|EU|January 1, 2018|AUS|1 January, 2017))
which still leaves the NA=
, but the rendered template is correct. How does that sound? — MusikAnimal talk 03:53, 28 December 2016 (UTC)Reply[reply]
...= *\w
as you've suggested, and one which does ...= *(\||})
, the latter replacing to |$1|$2
. This would catch both sets of conditions. Primefac (talk) 04:03, 28 December 2016 (UTC)Reply[reply]
...= *(\||})
would have to account for when the pipe or closing )) is on a new line. If we can take care of that, a two-step process might work. A programmatic approach, if possible, might be more well-rounded. For instance [3], which accounts for all the weird possibilities with newlines, and both sets of conditions. Here you could check if there was a second value in the match group, and if not (as with match 2), remove that parameter altogether. Note the /m
to make .*?
match newlines. If you want to go the simpler approach that's perfectly fine :) Do however make sure \w is a positive lookahead, which I forgot, otherwise that single word character would get removed. In Ruby this is (?=\w)
. See [4] vs [5] — MusikAnimal talk 04:41, 28 December 2016 (UTC)Reply[reply]
Approved for trial (100 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. but do link either here, the TfD or the discussion in the edit summary. The edit rate you went with for other tasks seems reasonable too – 10 to 20 edits per minute. We can speed this up a tad if there are no issues with the trial — MusikAnimal talk 18:28, 28 December 2016 (UTC)Reply[reply]