Run phpcs through "composer test", disabling failing rules

Disabling:
* Generic.Files.LineLength
* Generic.Functions.FunctionCallArgumentSpacing.SpaceBeforeComma
* Generic.PHP.ForbiddenFunctions.FoundWithAlternative
* MediaWiki.NamingConventions.PrefixedGlobalFunctions.wfPrefix
* MediaWiki.Usage.DirUsage.FunctionFound
* MediaWiki.VariableAnalysis.UnusedGlobalVariables
* MediaWiki.WhiteSpace.SpaceAfterControlStructure.Incorrect
* MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment
* PSR2.Classes.PropertyDeclaration.ScopeMissing
* PSR2.Classes.PropertyDeclaration.VarUsed
* PSR2.Methods.MethodDeclaration.AbstractAfterVisibility
* PSR2.Methods.MethodDeclaration.StaticBeforeVisibility
* Squiz.Classes.ValidClassName.NotCamelCaps
* Squiz.WhiteSpace.LanguageConstructSpacing.Incorrect

Disabled rules will be enabled individually in follow-up patches.

Bug: T101074
Change-Id: I1d52d891eb8e4f5877d1f1f3fa3aa9fc28dff004
This commit is contained in:
Kunal Mehta 2015-06-01 18:43:52 -07:00 committed by James D. Forrester
parent e174fdf91b
commit cb82edfe94
3 changed files with 31 additions and 2 deletions

2
.gitignore vendored
View file

@ -5,3 +5,5 @@
node_modules/
scripts/remotes/
tests/browser/screenshots
/vendor
composer.lock

View file

@ -1,10 +1,12 @@
{
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9"
"jakub-onderka/php-parallel-lint": "0.9",
"mediawiki/mediawiki-codesniffer": "0.5.0"
},
"scripts": {
"test": [
"parallel-lint . --exclude vendor"
"parallel-lint . --exclude vendor --exclude includes/iterator/CallbackFilterIterator.php",
"phpcs"
]
}
}

25
phpcs.xml Normal file
View file

@ -0,0 +1,25 @@
<?xml version="1.0"?>
<ruleset name="MediaWiki">
<file>.</file>
<rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
<exclude name="Generic.Files.LineLength"/>
<exclude name="Generic.Functions.FunctionCallArgumentSpacing.SpaceBeforeComma"/>
<exclude name="Generic.PHP.ForbiddenFunctions.FoundWithAlternative"/>
<exclude name="MediaWiki.NamingConventions.PrefixedGlobalFunctions.wfPrefix"/>
<exclude name="MediaWiki.Usage.DirUsage.FunctionFound"/>
<exclude name="MediaWiki.VariableAnalysis.UnusedGlobalVariables"/>
<exclude name="MediaWiki.WhiteSpace.SpaceAfterControlStructure.Incorrect"/>
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment"/>
<exclude name="PSR2.Classes.PropertyDeclaration.ScopeMissing"/>
<exclude name="PSR2.Classes.PropertyDeclaration.VarUsed"/>
<exclude name="PSR2.Methods.MethodDeclaration.AbstractAfterVisibility"/>
<exclude name="PSR2.Methods.MethodDeclaration.StaticBeforeVisibility"/>
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps"/>
<exclude name="Squiz.WhiteSpace.LanguageConstructSpacing.Incorrect"/>
</rule>
<arg name="encoding" value="utf8"/>
<arg name="extensions" value="php,php5,inc"/>
<arg name="colors"/>
<arg value="p"/>
<exclude-pattern>vendor</exclude-pattern>
</ruleset>