User:Headbomb/sandbox

From Wikipedia, the free encyclopedia

A slight deviation from WP:COSMETICBOT ?[edit]

After some consultation between BAG members and some bot ops, there's an issue BAG wants to raise, but it would deviate from BAG's usual take on the policy on cosmetic bots, in its most literal reading. We believe there's a type of very specific cosmetic bot that would make a lot of sense.

Wikimarkup is hard-enough to learn, and having clean presentation in the edit windows goes a long way in creating a more pleasant editing experience. Infoboxes are a notorious cluttering factor in several articles, and making them more presentable would make many people be less intimidated by them, especially given that they are nearly always the first thing you see after clicking the 'edit' button, and templates can be particularly daunting to newcomers (especially if they have half-assed markup). Now factor-in that many articles have their infoboxes copy-pasted from other articles, and you have awful markup propagating itself throughout the wiki.

We came up with a tentative list of rules an infobox cleaning bot could use to minimize the nearly useless edits with those that help accessibility. The idea is to take infoboxes like this [1], and turn them into things like this [2].

Proposed logic[edit]

Major cleanup rules (good enough to warrant an edit)
Rule # Type Before After
1.a
  • Move pipes to the left
{{Infobox foobar
 param1=|
 param2=|
 param3=|
}}
{{Infobox foobar
 |param1=
 |param2=
 |param3=
}}
1.b
  • One parameter per line
{{Infobox foobar
 |param1= |param2=
 |param3=
}}
{{Infobox foobar
 |param1=
 |param2=
 |param3=
}}
1.c
  • Spurious pipe removal
{{Infobox foobar
 |param1=|
 |param2=|
 |param3=
}}
{{Infobox foobar
 |param1=
 |param2=
 |param3=
}}
1.d
  • Identify possible input
{{Infobox foobar
 |param1=|Text
 |param2=
|Hello
 |param3=
}}
{{Infobox foobar
 |param1=
 |param2=
 |param3=
<!-- POSSIBLE INPUTS
 "Text"
 "Hello"
 See [diff link] for their original location
-->
}}
Minor cleanup rules (not enough to warrant an edit on their own)
Rule # Type Before After
2.a
  • Pipe space-uniformization
    (use dominant style)
{{Infobox foobar
 |  param1=
 |param2=
 |param3=
}}
{{Infobox foobar
 |param1=
 |param2=
 |param3=
}}
{{Infobox foobar
| param1=
| param2=
|param3=
}}
{{Infobox foobar
| param1=
| param2=
| param3=
}}
2.b
  • Equal space-uniformization
    (use dominant style)
{{Infobox foobar
 |param1  =Input
 |param2=Input
 |longparameter3=Input
 |param3=Input
}}
{{Infobox foobar
 |param1=Input
 |param2=Input
 |longparameter3=Input
 |param3=Input
}}
{{Infobox foobar
 |param-1       = Input
 |parameter2 = Input
 |longparameter3=Input
 |para4         = Input
}}
{{Infobox foobar
 |param-1       = Input
 |parameter2    = Input
 |longparameter3= Input
 |para4         = Input
}}
2.c
  • Removal of hard-coded "tabs"
{{Infobox foobar
| param1	=	Input
| param2	=	Input
| param2	=	Input
}}
{{Infobox foobar
| param1 = Input
| param2 = Input
| param2 = Input
}}
2.d
  • Empty line removal
{{Infobox foobar
 |param1=
 |param2=

 |param3=
}}
{{Infobox foobar
 |param1=
 |param2=
 |param3=
}}
2.e
  • Bypass template redirect
{{Infobox Foo-Bar
 | param1
 | param2
 | param3
}}
{{Infobox foobar
 | param1
 | param2
 | param3
}}
2.f
  • Final }} location
{{Infobox foobar
 |param1=
 |param2=
 |param3=}}
{{Infobox foobar
 |param1=
 |param2=
 |param3=
}}
Optional rules (opt-in, on a per-template basis, not to be used without a BRFA)
Rule # Type Before After
3.a
  • Parameter order standardization
{{Infobox foobar
 |param1=
 |param3=
 |param2=
}}
{{Infobox foobar
 |param1=
 |param2=
 |param3=
}}
3.b
  • Default parameters list
    (non-empty optional parameters are kept)
{{Infobox foobar
 |default-param1 =
 |optional-param1=
 |default-param2 =
 |default-param4 =
 |optional-param2=
 |default-param5 =
}}
{{Infobox foobar
 |default-param1 =
 |default-param2 =
 |default-param3 =
 |default-param4 =
 |default-param5 =
}}

What this proposal is, and what it isn't[edit]

BAG remains very aware that cosmetic bots can be very annoying. This RFC only aims to give BAG an idea of what the community expects when it comes to dealing with such issues, and if the above rules are in the "correct ballpark". The idea is to take infoboxes like this, and turn them into things like this this (see diff). Headbomb did such a cleanup run on {{infobox disease}} back in December 2010, and no one batted an eye because this was seen as desirable.

What you shouldn't see are bots making edits like this, which makes no difference in how easy it is to "read the infobox", or how easy it is to edit it. Nor should you see bots screwing around with citations inside infoboxes, or anything like that.

Additionally, this isn't a proposal for a specific bot. Any bot that wants to do edits like this would need to go through BRFA as usual, with extensive trials, subject to community approval, and all of that. The above rules are just for "the general idea", and anything that is found to be disruptive (or of too low-value to warrant an edit) would get either removed, switched from "major / good enough" to "minor / not good enough on its own", or otherwise tweaked.

BAG members, sign here[edit]

Headbomb {talk / contribs / physics / books} 16:33, 22 August 2013 (UTC)

Comments[edit]

Put your comments here

I was not aware of this till now. I certainly support this. -- Magioladitis (talk) 23:27, 29 December 2016 (UTC)

@Bgwhite: This is very interesting. -- Magioladitis (talk) 23:28, 29 December 2016 (UTC)

  • I think this is a great idea, and the first two points would be relatively straight forward to code via regex/AWB. My main interest, of course, is how often this problem actually occurs. With 2.8 million articles using {{infobox}}, we can't just just run AWB on all of them (even if 99.9% get skipped for not needing changes). I can't think offhand of what would be used to even search for the cases found above. Primefac (talk) 18:49, 2 February 2017 (UTC)
I'm not sure what would be the issue of just running this on all infoboxes (with sane skip conditions). But for testing, or at least for started, we could build a list of very badly used infoboxes. I know {{infobox disease}} has a ton of instances with pipes on the right and straight pipes. {{infobox journal}} also has a ton of cases with with unpadded parameters (e.g. the = doesn't line up) or missing/unwanted/out-of-order parameters. Headbomb {talk / contribs / physics / books} 23:20, 2 February 2017 (UTC)
Fair enough re: running everything. If we ran just box #1, the skip would be pretty easy (no changes made). However, if we're also running #2, pages like Abortion would get edited (which would violate COSMETIC). Unless we're not using AWB, I don't think there's a good way to skip "only box #2 changed" edits. But #1 is pretty important (and you can make a claim that the cosmetic fix is necessary for readability), so I'll start working on the regex for that. Primefac (talk) 23:31, 2 February 2017 (UTC)
Well, AWB does have the option to skip if only 'minor' replacements are made. However, it doesn't work with the advanced settings regex. I'll make a feature request. Headbomb {talk / contribs / physics / books} 02:04, 3 February 2017 (UTC)
T157100 Filed. Headbomb {talk / contribs / physics / books} 02:10, 3 February 2017 (UTC)
Going to ping Magioladitis and Bgwhite on this. Headbomb {talk / contribs / physics / books} 02:17, 3 February 2017 (UTC)
I do like this and think it will help. Another case is where Visual Editor will mush up an infobox into one long line. This happens when TemplateData is using inline formatting or there is no TemplateData. Here is an example.
I think I could run the CheckWiki program for finding some issues. For example, with some coding it should be able to find pipes on the right side.
An option for missing/unwanted parameters is Bambot's Template Parameters. TemplageTiger does something similar to Bambot's tool.
I am hesitant as it's a toxic atmosphere right now for any "cosmetic" change. The amount of insults and reverts I'm getting over the past few months keeps increasing. Will this fly in the current atmosphere? Bgwhite (talk) 01:40, 4 February 2017 (UTC)
For now it would probably be best to hold off running a dedicated bot that does only that. But bundling this alongside more substantial edits? That shouldn't really be a problem. The one-line infobox issue certainly is one worth fixing because that is such a clear case of editor-unfriendliness, but if only two such parameter is inlined while the rest are on seperate lines...? Might not really meet the threshold that's worth an edit on its own. A missing/unwanted parameter bot could probably go through a successful RFA though, but again it would really come down to details. Headbomb {talk / contribs / physics / books} 02:50, 4 February 2017 (UTC)
I haven't a clue how to code this up in AWB (Hello Magioladitis). I'm willing to test this when running AWB manually and then add it to my bot when ready. Bgwhite (talk) 00:25, 9 February 2017 (UTC)
Let me know how it goes. For now at least, it's probably a good idea to restrict yourself to pages that would otherwise have been edited for other reasons. {{Infobox disease}} would make a good test case. Headbomb {talk / contribs / physics / books} 00:29, 9 February 2017 (UTC)