Page MenuHomePhabricator

Fix Generic.Files.LineLength errors in MediaWiki core by breaking long lines
Closed, ResolvedPublic

Description

Line length should not be more than 100 characters.

Sniff output at P790.
Newer sniff output at P814 (ignoring languages/ completely).

Summary:

...........W............W........WW..W..W......W......WW..W.   60 / 1909 (3%)
WWWWWWW..W.WW.WWWW..W...W..W..WWW...W..WW...W...W.....WW.WW.  120 / 1909 (6%)
WWW...W....W.WW..W..W.W.WW..WW......WW...W....W..W..WWW.WW.W  180 / 1909 (9%)
..W.W.W.WW...W.....WWWWWWW...W.........W.......W.W..W.W.....  240 / 1909 (13%)
W.W...W..WWW.....W.WW.....WW.WWW.W...WWW..W..WWWWW...W.W....  300 / 1909 (16%)
WWW.WW.WWWW...W..W.WWW.W.WWW.......W....W...W..WW.W.W.WWW..W  360 / 1909 (19%)
..W.......WW.........W..............W..W.............W......  420 / 1909 (22%)
...................WW...........W...........................  480 / 1909 (25%)
............................................................  540 / 1909 (28%)
W......W....................W.......................W.......  600 / 1909 (31%)
................W.WW........................................  660 / 1909 (35%)
.........................W.....W...W........W...............  720 / 1909 (38%)
.............W.....WW.......W..................WWW.WW.......  780 / 1909 (41%)
.W...W..........W........................................WWW  840 / 1909 (44%)
..............................W................W.......W...W  900 / 1909 (47%)
.................W...W.....W..W..WWWWW.WWW.....W.W..W.......  960 / 1909 (50%)
...W.W.........W............W............................... 1020 / 1909 (53%)
........................S...............................W... 1080 / 1909 (57%)
......WW..W..........................W.....W........W.....W. 1140 / 1909 (60%)
..............................................W............. 1200 / 1909 (63%)
...........W...............W..WW............................ 1260 / 1909 (66%)
.........W.................................................. 1320 / 1909 (69%)
........................................................W... 1380 / 1909 (72%)
.......................................................W...W 1440 / 1909 (75%)
..W.W.....W..W................................W....W.......W 1500 / 1909 (79%)
.............W.W.............W.................W............ 1560 / 1909 (82%)
..............W..W....W.........W............W.W...W.....W.. 1620 / 1909 (85%)
.............W.........WW..W....W.W....W.............W.W..W. 1680 / 1909 (88%)
.................WW...W.......W.....W....................... 1740 / 1909 (91%)
................W........W.SS................S.............. 1800 / 1909 (94%)
..........W................WWS...WW.......W................W 1860 / 1909 (97%)
........W....W..W................W.........W.W...

Newer summary (ignoring languages/ completely):

..................W..........................W..............   60 / 1450 (4%)
............................................................  120 / 1450 (8%)
........................W...........................W.......  180 / 1450 (12%)
................W.......................W.WW................  240 / 1450 (17%)
.W...W........W............................W.....WW.......W.  300 / 1450 (21%)
.................WW.W.WW........W...W..........W............  360 / 1450 (25%)
............................WWW.............................  420 / 1450 (29%)
.W..............W.......W.....................W...W.....W..W  480 / 1450 (33%)
..WWWWW.WWW.....W.W..W..........W.W.........W............W..  540 / 1450 (37%)
.....................................................S......  600 / 1450 (41%)
.........................W.........WW.......................  660 / 1450 (46%)
......W.....W........W.....W................................  720 / 1450 (50%)
...............W........................W...................  780 / 1450 (54%)
......................................W.....................  840 / 1450 (58%)
............................................................  900 / 1450 (62%)
.........................W..................................  960 / 1450 (66%)
........................W...W..W.W.....W..W................. 1020 / 1450 (70%)
...............W....W.......W.............W.W.............W. 1080 / 1450 (74%)
.....W...........................W..W....W..........W....... 1140 / 1450 (79%)
......W.W...W.....W...............W.........WW..W....W.W.... 1200 / 1450 (83%)
W.............W.W..W..................WW...W.......W.....W.. 1260 / 1450 (87%)
.....................................W........W.SS.......... 1320 / 1450 (91%)
......S........................W................WWS...WW.... 1380 / 1450 (95%)
...W................W........W....W..W................W..... 1440 / 1450 (99%)
......W...

Details

SubjectRepoBranchLines +/-
mediawiki/coremaster+0 -1
mediawiki/coremaster+2 -1
mediawiki/coremaster+5 -5
mediawiki/coremaster+6 -1
mediawiki/coremaster+46 -14
mediawiki/coremaster+241 -57
mediawiki/coremaster+60 -19
mediawiki/coremaster+57 -18
mediawiki/coremaster+96 -12
mediawiki/coremaster+35 -10
mediawiki/coremaster+16 -2
mediawiki/coremaster+61 -13
mediawiki/coremaster+11 -3
mediawiki/coremaster+42 -11
mediawiki/coremaster+46 -8
mediawiki/coremaster+5 -2
mediawiki/coremaster+8 -1
mediawiki/coremaster+103 -30
mediawiki/coremaster+20 -4
mediawiki/coremaster+5 -2
mediawiki/coremaster+192 -37
mediawiki/coremaster+37 -11
mediawiki/coremaster+13 -3
mediawiki/coremaster+7 -3
mediawiki/coremaster+14 -5
mediawiki/coremaster+36 -11
mediawiki/coremaster+39 -16
mediawiki/coremaster+6 -2
mediawiki/coremaster+8 -3
mediawiki/coremaster+18 -7
mediawiki/coremaster+42 -21
mediawiki/coremaster+14 -2
mediawiki/coremaster+3 -1
mediawiki/coremaster+67 -29
mediawiki/coremaster+25 -7
mediawiki/coremaster+38 -16
mediawiki/coremaster+32 -14
mediawiki/coremaster+59 -22
Show related patches Customize query in gerrit

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 241509 had a related patch set uploaded (by Amire80):
Make lines short to pass phpcs in files under includes/db/

https://gerrit.wikimedia.org/r/241509

Change 241520 had a related patch set uploaded (by Amire80):
Make lines short to pass phpcs in files under includes/api/

https://gerrit.wikimedia.org/r/241520

Change 241521 had a related patch set uploaded (by Amire80):
Make lines short to pass phpcs in files in ParserOutput.php

https://gerrit.wikimedia.org/r/241521

Change 241503 merged by jenkins-bot:
Make lines short to pass phpcs in Language.php

https://gerrit.wikimedia.org/r/241503

Change 241506 merged by jenkins-bot:
Make lines short to pass phpcs in KafkaHandler.php

https://gerrit.wikimedia.org/r/241506

Change 241505 merged by jenkins-bot:
Make lines short to pass phpcs in OutputPage.php

https://gerrit.wikimedia.org/r/241505

Change 241502 merged by jenkins-bot:
Make lines short to pass phpcs in files under maintenance/

https://gerrit.wikimedia.org/r/241502

Change 241509 merged by jenkins-bot:
Make lines short to pass phpcs in files under includes/db/

https://gerrit.wikimedia.org/r/241509

Change 241508 merged by jenkins-bot:
Make lines short to pass phpcs in files under includes/

https://gerrit.wikimedia.org/r/241508

Change 241507 merged by jenkins-bot:
Make lines short to pass phpcs in files under includes/resourceloader

https://gerrit.wikimedia.org/r/241507

Change 241504 merged by Umherirrender:
Make lines short to pass phpcs in profileinfo.php

https://gerrit.wikimedia.org/r/241504

Change 241629 had a related patch set uploaded (by Amire80):
Make lines short to pass phpcs in testHelpers.inc

https://gerrit.wikimedia.org/r/241629

Change 241521 merged by jenkins-bot:
Rewrite comments on member variables of ParserOutput as proper variables documentation

https://gerrit.wikimedia.org/r/241521

Change 241629 merged by jenkins-bot:
Make lines short to pass phpcs in testHelpers.inc

https://gerrit.wikimedia.org/r/241629

Change 241644 had a related patch set uploaded (by Amire80):
Make lines short to pass phpcs in 2 files under includes/

https://gerrit.wikimedia.org/r/241644

Change 241644 merged by jenkins-bot:
Make lines short to pass phpcs in 2 files under includes/

https://gerrit.wikimedia.org/r/241644

Change 242444 had a related patch set uploaded (by Amire80):
Make lines short to pass phpcs in parser tests PHP files

https://gerrit.wikimedia.org/r/242444

Change 242445 had a related patch set uploaded (by Amire80):
Make lines short to pass phpcs in media tests PHP files

https://gerrit.wikimedia.org/r/242445

Change 241520 abandoned by Amire80:
Make lines short to pass phpcs in files under includes/api/

https://gerrit.wikimedia.org/r/241520

Change 242480 had a related patch set uploaded (by Amire80):
Make lines short to pass phpcs in ResourcesTest.php

https://gerrit.wikimedia.org/r/242480

Change 242481 had a related patch set uploaded (by Amire80):
Make lines short to pass phpcs in BagOStuffTest.php

https://gerrit.wikimedia.org/r/242481

Change 242482 had a related patch set uploaded (by Amire80):
Make lines short to pass phpcs in 2 files under tests/phpunit/includes/

https://gerrit.wikimedia.org/r/242482

Change 242484 had a related patch set uploaded (by Amire80):
Make lines short to pass phpcs in 3 files under tests/phpunit/includes/

https://gerrit.wikimedia.org/r/242484

Change 242480 merged by jenkins-bot:
Make lines short to pass phpcs in ResourcesTest.php

https://gerrit.wikimedia.org/r/242480

Change 242481 merged by jenkins-bot:
Make lines short to pass phpcs in BagOStuffTest.php

https://gerrit.wikimedia.org/r/242481

Change 242482 merged by jenkins-bot:
Make lines short to pass phpcs in 2 files under tests/phpunit/includes/

https://gerrit.wikimedia.org/r/242482

Change 242484 merged by jenkins-bot:
Make lines short to pass phpcs in 3 files under tests/phpunit/includes/

https://gerrit.wikimedia.org/r/242484

Change 242444 merged by jenkins-bot:
Make lines short to pass phpcs in parser tests PHP files

https://gerrit.wikimedia.org/r/242444

Change 242445 merged by jenkins-bot:
Make lines short to pass phpcs in media tests PHP files

https://gerrit.wikimedia.org/r/242445

Change 243016 had a related patch set uploaded (by Amire80):
Add @codingStandardsIgnoreStart to 5 files under tests/phpunit/includes

https://gerrit.wikimedia.org/r/243016

Change 243017 had a related patch set uploaded (by Amire80):
Make lines short to pass phpcs in WikitextContentTest.php

https://gerrit.wikimedia.org/r/243017

Change 243018 had a related patch set uploaded (by Amire80):
Make lines short to pass phpcs in WikiReferenceTest.php

https://gerrit.wikimedia.org/r/243018

Change 243385 had a related patch set uploaded (by Amire80):
Fix Generic.Files.LineLength phpcs failure in 11 files under includes/

https://gerrit.wikimedia.org/r/243385

Change 243386 had a related patch set uploaded (by Amire80):
Fix Generic.Files.LineLength phpcs check in 11 files under tests/phpunit/includes/

https://gerrit.wikimedia.org/r/243386

Change 243392 had a related patch set uploaded (by Amire80):
Fix Generic.Files.LineLength phpcs check in 13 files under tests/phpunit/includes/api

https://gerrit.wikimedia.org/r/243392

Change 243393 had a related patch set uploaded (by Amire80):
Fix Generic.Files.LineLength phpcs check in 10 files under tests/phpunit/includes/

https://gerrit.wikimedia.org/r/243393

AN ACTUAL UPDATE

The chain of patches from https://gerrit.wikimedia.org/r/#/c/243016/ until https://gerrit.wikimedia.org/r/#/c/243393/ fixes most of the remaining failures.

Thanks to @Umherirrender, @Reedy, @siebrand, @Jdforrester-WMF, @Legoktm, @Anomie, @polybuildr, @matmarex and everybody else who helped review it.

What's remaining, however, is the two failures that are described at T114213. I'm not sure how to resolve it because I'm not a real phpcs expert. Shall we ignore the failing files till there's an upstream solution?

Change 243016 merged by jenkins-bot:
Add @codingStandardsIgnoreStart to 5 files under tests/phpunit/includes

https://gerrit.wikimedia.org/r/243016

Change 243017 merged by jenkins-bot:
Make lines short to pass phpcs in WikitextContentTest.php

https://gerrit.wikimedia.org/r/243017

Change 243018 merged by jenkins-bot:
Make lines short to pass phpcs in WikiReferenceTest.php

https://gerrit.wikimedia.org/r/243018

Change 243385 merged by jenkins-bot:
Fix Generic.Files.LineLength phpcs failure in 11 files under includes/

https://gerrit.wikimedia.org/r/243385

Change 243386 merged by jenkins-bot:
Fix Generic.Files.LineLength phpcs check in files under phpunit/includes

https://gerrit.wikimedia.org/r/243386

Change 243392 merged by jenkins-bot:
Fix Generic.Files.LineLength phpcs check under phpunit/includes/api

https://gerrit.wikimedia.org/r/243392

Change 243393 merged by jenkins-bot:
Fix remaining Generic.Files.LineLength failures

https://gerrit.wikimedia.org/r/243393

Change 243418 had a related patch set uploaded (by Amire80):
Fix the last Generic.Files.LineLength phpcs failures

https://gerrit.wikimedia.org/r/243418

Change 243616 had a related patch set uploaded (by Amire80):
Re-enable Generic.Files.LineLength and exclude failing files

https://gerrit.wikimedia.org/r/243616

Change 243418 merged by jenkins-bot:
Fix the last Generic.Files.LineLength phpcs failures

https://gerrit.wikimedia.org/r/243418

Change 243616 abandoned by Amire80:
Re-enable Generic.Files.LineLength and exclude failing files

Reason:
Looks like If853510b55d787765a84bac22b2dbff2e6c526c0 is the direction.

https://gerrit.wikimedia.org/r/243616

Change 243927 had a related patch set uploaded (by Amire80):
Fix long line to make phpcs pass

https://gerrit.wikimedia.org/r/243927

Change 243927 merged by jenkins-bot:
Fix long line to make phpcs pass

https://gerrit.wikimedia.org/r/243927

Change 241501 merged by jenkins-bot:
Reenable LineLength phpcs check

https://gerrit.wikimedia.org/r/241501

BANG!

And it's fixed.

No more lines over 100 characters!

Oh you're welcome, it's just shortening some lines ;)

Thanks to @polybuildr for kicking off this process, and thanks to everybody who reviewed hundreds of modified lines!

Oh you're welcome, it's just shortening some lines ;)

"some" doesn't do justice to the number. :P

I opened up just 3 patches and the counts go:
+241, -57
+60, -19
+57, -18

When I filed this task and saw the number of failures, I had assumed that all of them would probably never get fixed.

No, there's no denying it. You're AWESOME! :D