Page MenuHomePhabricator

Fix Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed
Closed, ResolvedPublic

Description

The difficult, and worst offenders here are the ResourceLoader tests that have embedded js, but use spaces not tabs

Fixing those give https://gerrit.wikimedia.org/r/#/c/241341/ it causes whitespace related errors in https://integration.wikimedia.org/ci/job/mediawiki-phpunit-hhvm/15676/consoleFull

The other files would be the xml backup files which embed xml, and have leading spaces rather than tabs...

Details

Related Gerrit Patches:

Event Timeline

Reedy created this task.Sep 26 2015, 5:37 PM
Reedy raised the priority of this task from to Needs Triage.
Reedy updated the task description. (Show Details)
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 26 2015, 5:37 PM
Reedy added a subscriber: Reedy.Sep 26 2015, 5:56 PM

Trying the xml dump/backup tests spaces -> tabs in https://gerrit.wikimedia.org/r/#/c/241344/ ....

Reedy added a subscriber: Legoktm.Sep 26 2015, 7:29 PM

So, speaking to @Legoktm, he was going to file an upstream issue about "leading spaces" when they were in strings...

Might be worth reverting the backup tests commit in the near future when that's fixed...

Reedy changed the task status from Open to Stalled.Sep 26 2015, 8:10 PM

Filed an issue for leading spaces in strings showing as a warning

https://github.com/squizlabs/PHP_CodeSniffer/issues/722

Not a lot we can do about this till it's fixed upstream...

I tested this by updating CodeSniffer, and the issue was gone. Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed's code has changed and no longer checks for T_CONSTANT_ENCAPSED_STRING, so the issue no longer occurs. The CodeSniffer dependency was updated in rMCSN9a1a1acc5e8c: Update squizlabs/php_codesniffer to 2.3.4, but we still have to cut a new version ( T113516: Release version 0.4.0 of mediawiki/tools/codesniffer ). Once that is done, we can update core's version of mediawiki-codesniffer and we should be good to go.

Change 243419 had a related patch set uploaded (by Umherirrender):
Enable Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed

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

Change 243419 merged by jenkins-bot:
Enable Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed

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

Umherirrender closed this task as Resolved.Oct 3 2015, 6:39 PM
Umherirrender set Security to None.