diff options
Diffstat (limited to 'build/phpcs.xml')
-rw-r--r-- | build/phpcs.xml | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/build/phpcs.xml b/build/phpcs.xml new file mode 100644 index 00000000000..1e10be1a111 --- /dev/null +++ b/build/phpcs.xml @@ -0,0 +1,80 @@ +<?xml version="1.0"?> +<ruleset name="PHP_CodeSniffer"> + <description>The coding standard for PHP_CodeSniffer itself.</description> + <exclude-pattern>*/Tests/*</exclude-pattern> + <exclude-pattern>*/lib/MDB2/*</exclude-pattern> + <exclude-pattern>*/3rdparty/*</exclude-pattern> + <exclude-pattern>*.min.*</exclude-pattern> + <exclude-pattern>*/l10n/*</exclude-pattern> + <exclude-pattern>*/files_texteditor/js/aceeditor/*</exclude-pattern> + <exclude-pattern>*/files_pdfviewer/js/pdfjs/*</exclude-pattern> + <exclude-pattern>*/files_odfviewer/src/*</exclude-pattern> + <exclude-pattern>*/files_svgedit/svg-edit/*</exclude-pattern> + <exclude-pattern>*jquery-ui-1.8.16.custom.css</exclude-pattern> + <extensions>php</extensions> + + <!-- Include the whole PEAR standard --> + <rule ref="PEAR"> + <exclude name="PEAR.Commenting.FileComment.InvalidAuthors" /> + <exclude name="PEAR.Commenting.FileComment.TagIndent" /> + <exclude name="PEAR.Commenting.FileComment.MissingVersion" /> + <exclude name="PEAR.Commenting.FileComment.MissingTag" /> + <exclude name="PEAR.Commenting.ClassComment.TagIndent" /> + <!-- exclude name="PEAR.WhiteSpace.ScopeIndent.Incorrect" /--> + <exclude name="PEAR.Commenting.ClassComment.WrongTagOrder" /> + <exclude name="Generic.WhiteSpace.DisallowTabIndent.TabsUsed" /> + <exclude name="PEAR.Functions.FunctionCallSignature.SpaceBeforeOpenBracket" /> + <exclude name="PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket" /> + <exclude name="Generic.ControlStructures.InlineControlStructure.Discouraged" /> + <exclude name="PEAR.Commenting.FunctionComment.ParameterCommentsNotAligned" /> + <exclude name="PEAR.Commenting.FunctionComment.MissingParamTag" /> + <exclude name="PEAR.ControlStructures.ControlSignature" /> + + <!-- ident and alignment stuff --> + <!-- exclude name="PEAR.ControlStructures.MultiLineCondition.Alignment" /> + <exclude name="PEAR.WhiteSpace.ScopeClosingBrace.BreakIdent" / --> + + <!-- allow curly on classes and functions --> + <exclude name="PEAR.Functions.FunctionDeclaration.BraceOnSameLine" /> + <exclude name="PEAR.Classes.ClassDeclaration.OpenBraceNewLine" /> + + <exclude name="PEAR.NamingConventions.ValidFunctionName.PrivateNoUnderscore" /> + <exclude name="PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore" /> + <exclude name="PEAR.WhiteSpace.ScopeIndent"/> + </rule> + + <rule ref="Zend.Files.ClosingTag" /> + + <rule ref="Generic.WhiteSpace.ScopeIndent"> + <properties> + <property name="indent" value="4"/> + </properties> + </rule> + + <rule ref="Generic.Files.LineLength"> + <properties> + <property name="lineLimit" value="120"/> + <property name="absoluteLineLimit" value="160"/> + </properties> + </rule> + + <!-- Include most of the Squiz standard --> + <!-- rule ref="Squiz"> + <exclude name="Squiz.Classes.ClassFileName"/> + <exclude name="Squiz.Classes.ValidClassName"/> + <exclude name="Squiz.Commenting.ClassComment"/> + <exclude name="Squiz.Commenting.FileComment"/> + <exclude name="Squiz.Commenting.FunctionComment"/> + <exclude name="Squiz.Commenting.VariableComment"/> + <exclude name="Squiz.ControlStructures.SwitchDeclaration"/> + <exclude name="Squiz.Files.FileExtension"/> + <exclude name="Squiz.NamingConventions.ConstantCase"/> + <exclude name="Squiz.Operators.ComparisonOperatorUsage"/> +</rule --> + + <!-- We allow variables to be used inside double quoted strings --> + <!-- rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar"> + <severity>0</severity> + </rule --> + +</ruleset> |