Skip to content

Instantly share code, notes, and snippets.

@kent1D
Forked from brunob/phpcs.xml
Last active September 18, 2017 13:31
Show Gist options
  • Save kent1D/b0c8d5aa1cd447650056f7d9b82aac2f to your computer and use it in GitHub Desktop.
Save kent1D/b0c8d5aa1cd447650056f7d9b82aac2f to your computer and use it in GitHub Desktop.
PHP_CodeSniffer pour SPIP
<?xml version="1.0"?>
<ruleset name="SPIP">
<!--
Liens utiles
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
https://github.com/ucfcdl/fuelphp-phpcs/tree/master/Standards/FuelPHP
https://github.com/vanilla/addons/tree/master/standards/Vanilla
-->
<description>Coding rules for SPIP</description>
<exclude-pattern>config/*</exclude-pattern>
<exclude-pattern>IMG/*</exclude-pattern>
<exclude-pattern>lib/*</exclude-pattern>
<exclude-pattern>local/*</exclude-pattern>
<exclude-pattern>plugins/*</exclude-pattern>
<exclude-pattern>squelettes/*</exclude-pattern>
<exclude-pattern>tmp/*</exclude-pattern>
<exclude-pattern>branches/*</exclude-pattern>
<!-- Appliquer PSR-2 moins nos exceptions -->
<rule ref="PSR2" >
<!-- Désactiver la vérification sur les noms de classes/fonctions -->
<exclude name="Squiz.Classes.ValidClassName" />
<!-- Désactiver la vérification sur l'indentation -->
<exclude name="Generic.WhiteSpace.ScopeIndent" />
<exclude name="Generic.WhiteSpace.DisallowTabIndent" />
<!-- Désactiver la vérification sur les accolades -->
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine" />
<exclude name="PSR2.Classes.ClassDeclaration.OpenBraceNewLine" />
<exclude name="PSR2.Classes.PropertyDeclaration" />
<!-- Désactiver les camel caps sur les fonctions -->
<exclude name="Generic.NamingConventions.CamelCapsFunctionName" />
</rule>
<!-- Tabulations pour l'indentation -->
<arg name="tab-width" value="4"/>
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="4"/>
<property name="tabIndent" value="true"/>
</properties>
</rule>
<!-- Accolades -->
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/>
<rule ref="Generic.ControlStructures.InlineControlStructure" />
<rule ref="Squiz.ControlStructures.ControlSignature" />
<rule ref="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace">
<severity>0</severity>
</rule>
<!-- Guillemets doubles -->
<rule ref="Squiz.Strings.DoubleQuoteUsage"/>
<rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar">
<severity>0</severity>
</rule>
<!-- Constantes en majuscules -->
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
</ruleset>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment