From cb82edfe94fcee43fd4cee67b12eeb4dbe49a72c Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Mon, 1 Jun 2015 18:43:52 -0700 Subject: [PATCH] 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 --- .gitignore | 2 ++ composer.json | 6 ++++-- phpcs.xml | 25 +++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 phpcs.xml diff --git a/.gitignore b/.gitignore index c71739dd9..6690d5928 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ node_modules/ scripts/remotes/ tests/browser/screenshots +/vendor +composer.lock diff --git a/composer.json b/composer.json index f2883f7a0..02ceaea48 100644 --- a/composer.json +++ b/composer.json @@ -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" ] } } diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 000000000..d7ede6bb3 --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,25 @@ + + + . + + + + + + + + + + + + + + + + + + + + + vendor +