English Wikipedia @ Freddythechick:Bots/Requests for approval/JJMC89 bot 10
- 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
Approved.
JJMC89 bot 10
Operator: JJMC89 (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)
Time filed: 00:28, Monday, February 6, 2017 (UTC)
Automatic, Supervised, or Manual: Automatic
Programming language(s): Python
Source code available: Pending
Function overview: Correct coordinate parameter errors and warnings from the enwiki ghel report.
Links to relevant discussions (where appropriate): N/A
Edit period(s): Weekly
Estimated number of pages affected: ~17,000 initially; varies afterward
Exclusion compliant: Yes
Already has a bot flag: Yes
Function details: Correct coordinate parameter errors and warnings from the enwiki (alt view) ghel report.
Example regex inside a {{coord}} parameter value:
- Too many colons: Replace:
\b(?:type|scale|dim|region|globe|source):((?:type|scale|dim|region|globe|source):)\b
→ <syntaxhighlight lang="text" class="" style="" inline="1">\1</syntaxhighlight> (e.g. <syntaxhighlight lang="text" class="" style="" inline="1">type:dim:1000</syntaxhighlight> → <syntaxhighlight lang="text" class="" style="" inline="1">dim:1000</syntaxhighlight>) - Missing colon: Remove:
_?(?:type|scale|dim|region|globe|source)\s*$
(e.g. <syntaxhighlight lang="text" class="" style="" inline="1">dim:1000_type</syntaxhighlight> → <syntaxhighlight lang="text" class="" style="" inline="1">dim:1000</syntaxhighlight>)
Before saving changes, coordinate parameters are checked for possible errors. For example, the value for <syntaxhighlight lang="text" class="" style="" inline="1">region</syntaxhighlight> against ^(?:[A-Z]{2}(?:-[A-Z\d]{1,3})?)$
.
Any error or warning that requires judgement (e.g. dim override) will be skipped.
Discussion
Approved for trial (25 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. This request is very esoteric, and a short trial run to produce a demonstration of the changes should help illustrate it best for reviewers. — xaosflux Talk 01:30, 6 February 2017 (UTC)
Approved for extended trial (500 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. Thank you, please run a larger batch. — xaosflux Talk 15:52, 12 February 2017 (UTC)
Could you please list some examples in function details of what the correct syntax is and what the incorrect ones are, including what is meant by "separated by underscores"? Template:Coord#Coordinate_parameters explains almost nothing and took me some guessing to finally figure out the general syntax. But I'm having trouble verifying some of these. Something like type:type:landmark is obviously wrong [1]. It's not obvious how type:region:IT is wrong [2] -- is it "region" or "type" that should be removed?
- [3] -- this change isn't listed in function details.
— HELLKNOWZ ▎TALK 22:17, 23 February 2017 (UTC)
- Coordinate parameters (type, scale, dim, region, globe, source) are specified in a single
{{coord}}
parameter (|3=
,|5=
,|7=
, or|9=
) with each parameter separated by underscores (|9=name1:value1_name2:value2
). Similar to template parameters being separated by pipes (<syntaxhighlight lang="text" class="" style="" inline="1">|</syntaxhighlight>) with name and value separated by equals (<syntaxhighlight lang="text" class="" style="" inline="1">=</syntaxhighlight>), coordinates parameters are separated by underscores (<syntaxhighlight lang="text" class="" style="" inline="1">_</syntaxhighlight>) with name and value separated by colon (<syntaxhighlight lang="text" class="" style="" inline="1">:</syntaxhighlight>). Coordinates parameters cannot by empty.- #2 <syntaxhighlight lang="text" class="" style="" inline="1">type</syntaxhighlight> is empty, and IT is the ISO 3166-1 alpha-2 country code for Italy.
- #3 Should have been skipped. It is meant to remove the parameter if it is emptied after removing
_?(?:type|scale|dim|region|globe|source)\s*$
.
- — JJMC89 (T·C) 06:04, 24 February 2017 (UTC)
- Let's say it had been type:region:river. Would the bot replace it with region:river or type:river? — HELLKNOWZ ▎TALK 22:40, 24 February 2017 (UTC)
- It should skip the page after attempting to change it to <syntaxhighlight lang="text" class="" style="" inline="1">region:river</syntaxhighlight> since <syntaxhighlight lang="text" class="" style="" inline="1">river</syntaxhighlight> would not match
^(?:[A-Z]{2}(?:-[A-Z\d]{1,3})?)$
. — JJMC89 (T·C) 04:44, 25 February 2017 (UTC)- So if it skips reasonably invalid values, why not add this to function details? As it stands, the task description does not distinguish valid/invalid values. The only exception appears to be country codes for region. Do you check other values listed in {{Coord}}? Is it likely that there are invalid ones? — HELLKNOWZ ▎TALK 12:37, 26 February 2017 (UTC)
- It should skip the page after attempting to change it to <syntaxhighlight lang="text" class="" style="" inline="1">region:river</syntaxhighlight> since <syntaxhighlight lang="text" class="" style="" inline="1">river</syntaxhighlight> would not match
- Let's say it had been type:region:river. Would the bot replace it with region:river or type:river? — HELLKNOWZ ▎TALK 22:40, 24 February 2017 (UTC)
Approved. Looks good. Also, can you please update the bot to use more descriptive summaries (other tasks too, e.g. "Replace BSicon(s)"), ideally linking to the task description. — HELLKNOWZ ▎TALK 12:16, 27 February 2017 (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.