Wikipedia: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.
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
→\1
(e.g.type:dim:1000
→dim:1000
) - Missing colon: Remove:
_?(?:type|scale|dim|region|globe|source)\s*$
(e.g.dim:1000_type
→dim:1000
)
Before saving changes, coordinate parameters are checked for possible errors. For example, the value for region
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)[reply]
- 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)[reply]
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)[reply]
- 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 (|
) with name and value separated by equals (=
), coordinates parameters are separated by underscores (_
) with name and value separated by colon (:
). Coordinates parameters cannot by empty.- #2
type
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*$
.
- #2
- — JJMC89 (T·C) 06:04, 24 February 2017 (UTC)[reply]
- 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)[reply]
- It should skip the page after attempting to change it to
region:river
sinceriver
would not match^(?:[A-Z]{2}(?:-[A-Z\d]{1,3})?)$
. — JJMC89 (T·C) 04:44, 25 February 2017 (UTC)[reply]- 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)[reply]
- Only coordinate parameters are checked. There could be problems with other {{coord}} parameters; however, they should be visible on the page, and many would not be fixable by a bot. — JJMC89 (T·C) 20:22, 26 February 2017 (UTC)[reply]
- 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)[reply]
- It should skip the page after attempting to change it to
- 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)[reply]
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)[reply]
- 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.