Commit 3a18d596 authored by catch's avatar catch

Issue #2666172 by alexpott: PHPCS configuration should include rules and not exclude them

parent c735b827
......@@ -26,7 +26,7 @@ class RegexDirectoryIterator extends \FilterIterator {
* The path to scan.
* @param string $regex
* The regular expression to match, including delimiters. For example,
/\.yml$/ would list only files ending in .yml.
* /\.yml$/ would list only files ending in .yml.
*/
public function __construct($path, $regex) {
// Use FilesystemIterator to not iterate over the the . and .. directories.
......
......@@ -10,67 +10,34 @@
<!--Exclude test files that are intentionally empty, or intentionally violate coding standards.-->
<exclude-pattern>./modules/system/tests/fixtures/HtaccessTest</exclude-pattern>
<!--Blacklist of coding standard rules that are not yet fixed. Ref. https://www.drupal.org/node/2571965-->
<rule ref="Drupal">
<exclude name="Drupal.Array.Array"/>
<exclude name="Drupal.Classes.ClassCreateInstance"/>
<exclude name="Drupal.Classes.ClassDeclaration"/>
<exclude name="Drupal.Classes.InterfaceName"/>
<exclude name="Drupal.Classes.UnusedUseStatement"/>
<exclude name="Drupal.Commenting.ClassComment"/>
<exclude name="Drupal.Commenting.DocComment"/>
<exclude name="Drupal.Commenting.FunctionComment"/>
<exclude name="Drupal.Commenting.HookComment"/>
<exclude name="Drupal.Commenting.InlineComment"/>
<exclude name="Drupal.Commenting.PostStatementComment"/>
<exclude name="Drupal.ControlStructures.ControlSignature"/>
<exclude name="Drupal.ControlStructures.InlineControlStructure"/>
<exclude name="Drupal.Files.EndFileNewline"/>
<exclude name="Drupal.Files.LineLength"/>
<exclude name="Drupal.Formatting.MultiLineAssignment"/>
<exclude name="Drupal.Formatting.SpaceInlineIf"/>
<exclude name="Drupal.Formatting.SpaceUnaryOperator"/>
<exclude name="Drupal.Functions.FunctionDeclaration"/>
<exclude name="Drupal.NamingConventions.ValidClassName"/>
<exclude name="Drupal.NamingConventions.ValidFunctionName"/>
<exclude name="Drupal.NamingConventions.ValidGlobal"/>
<exclude name="Drupal.NamingConventions.ValidVariableName"/>
<exclude name="Drupal.Semantics.ConstantName"/>
<exclude name="Drupal.Semantics.FunctionAlias"/>
<exclude name="Drupal.Semantics.FunctionT"/>
<exclude name="Drupal.Semantics.RemoteAddress"/>
<exclude name="Drupal.Strings.UnnecessaryStringConcat"/>
<exclude name="Drupal.WhiteSpace.CloseBracketSpacing"/>
<exclude name="Drupal.WhiteSpace.EmptyLines"/>
<exclude name="Drupal.WhiteSpace.ObjectOperatorSpacing"/>
<exclude name="Drupal.WhiteSpace.OpenBracketSpacing"/>
<exclude name="Drupal.WhiteSpace.OperatorSpacing"/>
<exclude name="Drupal.WhiteSpace.ScopeClosingBrace"/>
<exclude name="Drupal.WhiteSpace.ScopeIndent"/>
<exclude name="Generic.Formatting.SpaceAfterCast"/>
<exclude name="Generic.Functions.FunctionCallArgumentSpacing"/>
<exclude name="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/>
<exclude name="Generic.NamingConventions.ConstructorName"/>
<exclude name="Generic.PHP.UpperCaseConstant"/>
<exclude name="Internal.NoCodeFound"/>
<exclude name="PEAR.Functions.FunctionCallSignature"/>
<exclude name="PEAR.Functions.ValidDefaultValue"/>
<exclude name="PSR2.Classes.PropertyDeclaration"/>
<exclude name="Squiz.Arrays.ArrayBracketSpacing"/>
<exclude name="Squiz.Arrays.ArrayDeclaration"/>
<exclude name="Squiz.Classes.LowercaseClassKeywords"/>
<exclude name="Squiz.Commenting.DocCommentAlignment"/>
<exclude name="Squiz.Commenting.PostStatementComment"/>
<exclude name="Squiz.ControlStructures.ForEachLoopDeclaration"/>
<exclude name="Squiz.ControlStructures.ForLoopDeclaration"/>
<exclude name="Squiz.ControlStructures.SwitchDeclaration"/>
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing"/>
<exclude name="Squiz.PHP.LowercasePHPFunctions"/>
<exclude name="Squiz.PHP.NonExecutableCode"/>
<exclude name="Squiz.Scope.MethodScope"/>
<exclude name="Squiz.Strings.ConcatenationSpacing"/>
<exclude name="Squiz.WhiteSpace.LanguageConstructSpacing"/>
<exclude name="Squiz.WhiteSpace.SemicolonSpacing"/>
<exclude name="Squiz.WhiteSpace.SuperfluousWhitespace"/>
</rule>
<!-- Only include specific sniffs that pass. This ensures that, if new sniffs are added, HEAD does not fail.-->
<!-- Drupal sniffs -->
<rule ref="Drupal.CSS.ClassDefinitionNameSpacing"/>
<rule ref="Drupal.CSS.ColourDefinition"/>
<rule ref="Drupal.Commenting.DocCommentStar"/>
<rule ref="Drupal.Commenting.FileComment"/>
<rule ref="Drupal.ControlStructures.ElseIf"/>
<rule ref="Drupal.Files.TxtFileLineLength"/>
<rule ref="Drupal.Functions.DiscouragedFunctions"/>
<rule ref="Drupal.InfoFiles.AutoAddedKeys"/>
<rule ref="Drupal.InfoFiles.ClassFiles"/>
<rule ref="Drupal.InfoFiles.DuplicateEntry"/>
<rule ref="Drupal.InfoFiles.Required"/>
<rule ref="Drupal.Semantics.EmptyInstall"/>
<rule ref="Drupal.Semantics.FunctionWatchdog"/>
<rule ref="Drupal.Semantics.InstallHooks"/>
<rule ref="Drupal.Semantics.LStringTranslatable"/>
<rule ref="Drupal.Semantics.PregSecurity"/>
<rule ref="Drupal.Semantics.TInHookMenu"/>
<rule ref="Drupal.Semantics.TInHookSchema"/>
<rule ref="Drupal.WhiteSpace.Comma"/>
<rule ref="Drupal.WhiteSpace.ObjectOperatorIndent"/>
<!-- Generic sniffs -->
<rule ref="Generic.Files.LineEndings"/>
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
<rule ref="Generic.PHP.DeprecatedFunctions"/>
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
</ruleset>
......@@ -159,7 +159,7 @@ public function testGetEntityFromRouteMatchEditDelete() {
public function testGetEntityFromRouteMatchAdd() {
$entity = $this->prophesize(EntityInterface::class)->reveal();
$this->setUpStorage()->create([])->willReturn($entity);
$route_match = new RouteMatch('test_route', new Route('/entity-test/add'));
$route_match = new RouteMatch('test_route', new Route('/entity-test/add'));
$actual = $this->entityForm->getEntityFromRouteMatch($route_match, $this->entityType->id());
$this->assertEquals($entity, $actual);
}
......@@ -178,7 +178,7 @@ public function testGetEntityFromRouteMatchAddStatic() {
// Test without a bundle parameter in the route.
$storage->create([])->willReturn($entity);
$route_match = new RouteMatch('test_route', new Route('/entity-test/add'));
$route_match = new RouteMatch('test_route', new Route('/entity-test/add'));
$actual = $this->entityForm->getEntityFromRouteMatch($route_match, $this->entityType->id());
$this->assertEquals($entity, $actual);
......@@ -208,7 +208,7 @@ public function testGetEntityFromRouteMatchAddEntity() {
// Test without a bundle parameter in the route.
$storage->create([])->willReturn($entity);
$route_match = new RouteMatch('test_route', new Route('/entity-test/add'));
$route_match = new RouteMatch('test_route', new Route('/entity-test/add'));
$actual = $this->entityForm->getEntityFromRouteMatch($route_match, $this->entityType->id());
$this->assertEquals($entity, $actual);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment