Skip to content

Instantly share code, notes, and snippets.

@JLuc JLuc/phpcs.xml forked from marcimat/phpcs.xml
Created May 17, 2019

Embed
What would you like to do?
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 type="relative">^/config/*</exclude-pattern>
<exclude-pattern type="relative">^/IMG/*</exclude-pattern>
<exclude-pattern type="relative">^/lib/*</exclude-pattern>
<exclude-pattern type="relative">^/local/*</exclude-pattern>
<exclude-pattern type="relative">^/plugins/*</exclude-pattern>
<exclude-pattern type="relative">^/squelettes/*</exclude-pattern>
<exclude-pattern type="relative">^/tmp/*</exclude-pattern>
<exclude-pattern>*/lang/*</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" />
<!-- Désactiver mauvaise la vérification sur les if (\n multilignes ) -->
<exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace"/>
<!-- Désactiver la vérification du SideEffect : le test sur _ECRIRE_INC_VERSION le choppe tout le temps -->
<exclude name="PSR1.Files.SideEffects"/>
</rule>
<!-- Tabulations pour l'indentation -->
<arg name="tab-width" value="4"/>
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="exact" value="false"/><!-- ajouté JLuc -->
<property name="indent" value="4"/>
<property name="tabIndent" value="true"/>
<property name="ignoreIndentationTokens" type="array">
<element value="T_HEREDOC"/>
<element value="T_NOWDOC"/>
<element value="T_INLINE_HTML"/>
</property>
</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>5</severity> <!-- améliore la correction du oneliner : if($t) doit(); -->
</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
You can’t perform that action at this time.