Page MenuHomePhabricator

Don't check languages/messages for Generic.Files.LineLength
Closed, ResolvedPublic

Description

From a discussion at T102614: Fix Generic.Files.LineLength errors in MediaWiki core by breaking long lines, it might be a good idea to not check the message files in languages/messages for Generic.Files.LineLength.

The annotated sample ruleset.xml has the example:

<!--
   You can also hard-code ignore patterns for specific sniffs,
   a feature not available on the command line. Please note that
   all sniff-specific ignore patterns are checked using absolute paths.

   The code here will hide all messages from the Squiz DoubleQuoteUsage
   sniff for files that match either of the two exclude patterns.
-->
<rule ref="Squiz.Strings.DoubleQuoteUsage">
   <exclude-pattern>*/tests/*</exclude-pattern>
   <exclude-pattern>*/data/*</exclude-pattern>
</rule>

<!--
   You can also be more specific and just exclude some messages.
   Please note that all message-specific ignore patterns are
   checked using absolute paths.

   The code here will just hide the ContainsVar error generated by the
   Squiz DoubleQuoteUsage sniff for files that match either of the two
   exclude patterns.
-->
<rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar">
   <exclude-pattern>*/tests/*</exclude-pattern>
   <exclude-pattern>*/data/*</exclude-pattern>
</rule>

We could update our ruleset.xml to do this, if there's consensus.

Event Timeline

polybuildr raised the priority of this task from to Needs Triage.
polybuildr updated the task description. (Show Details)
polybuildr added a subscriber: polybuildr.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 25 2015, 9:49 AM

Change 220728 had a related patch set uploaded (by Polybuildr):
Ignore languages/messages/Message*.php in line length sniff

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

Change 220728 abandoned by Polybuildr:
Ignore languages/messages/Message*.php in line length sniff

Reason:
Should be done in core.

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

https://gerrit.wikimedia.org/r/#/c/218388/ moved PHPCS configuration to phpcs.xml . So potentially we can port the CodeSniffer rule from https://gerrit.wikimedia.org/r/220728 to core.

hashar triaged this task as Normal priority.Aug 25 2015, 9:06 AM

Change 233836 had a related patch set uploaded (by Polybuildr):
Ignore languages/messages/Message*.php in line length sniff

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

Change 233836 merged by jenkins-bot:
Ignore languages/messages/Messages*.php in line length sniff

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

Umherirrender closed this task as Resolved.Sep 27 2015, 7:31 PM
Umherirrender set Security to None.