Skip to content

Commit

Permalink
Issue CollaboraOnline#43: Add customized phpcs.xml that passes.
Browse files Browse the repository at this point in the history
  • Loading branch information
donquixote committed Nov 8, 2024
1 parent abfe938 commit d56ce22
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="DrupalCollaboraOnline">
<description>Modified PHP CodeSniffer configuration based on Drupal.</description>

<arg name="extensions" value="inc,install,module,php,theme,yml,json"/>

<exclude-pattern>./vendor/*</exclude-pattern>
<exclude-pattern>./web/*</exclude-pattern>
<file>.</file>

<rule ref="vendor/drupal/coder/coder_sniffer/Drupal/ruleset.xml">
<!-- Accept 4 spaces of indentation for now. -->
<exclude name="Drupal.WhiteSpace.ScopeIndent"/>
<exclude name="Drupal.Arrays.Array.ArrayIndentation"/>
<exclude name="Drupal.Functions.MultiLineFunctionDeclaration.Indent"/>
<exclude name="Drupal.WhiteSpace.ScopeClosingBrace.BreakIndent"/>
<exclude name="Drupal.WhiteSpace.ScopeClosingBrace.Indent"/>
<exclude name="Drupal.WhiteSpace.ObjectOperatorIndent.Indent"/>
<!-- Accept file doc comment with copyright. -->
<exclude name="Drupal.Commenting.FileComment.NamespaceNoFileDoc"/>
<exclude name="Drupal.Commenting.FileComment.WrongStyle"/>
<!-- Accept imports order from PhpStorm. -->
<exclude name="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses"/>
<!-- Keep existing identifiers, as renaming would be disruptive. -->
<exclude name="Drupal.NamingConventions.ValidFunctionName.InvalidName"/>
<exclude name="Drupal.NamingConventions.ValidVariableName.LowerCamelName"/>
<exclude name="Drupal.NamingConventions.ValidFunctionName.ScopeNotCamelCaps"/>

<!-- Fix translatable strings later. -->
<exclude name="Drupal.Semantics.FunctionT.WhiteSpace"/>
</rule>
</ruleset>

0 comments on commit d56ce22

Please sign in to comment.