-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy path.phpcs.xml.dist
97 lines (93 loc) · 4.97 KB
/
.phpcs.xml.dist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards based custom ruleset for your plugin">
<description>Generally-applicable sniffs for WordPress plugins.</description>
<!-- What to scan -->
<file>./classes</file>
<file>./tests</file>
<file>./matomo.php</file>
<file>./shared.php</file>
<file>./uninstall.php</file>
<exclude-pattern>/classes/WpMatomo/Db/*.php</exclude-pattern>
<exclude-pattern>/classes/WpMatomo/AjaxTracker.php</exclude-pattern>
<!-- How to scan -->
<!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
<!-- Annotated ruleset: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
<arg value="sp"/> <!-- Show sniff and progress -->
<arg name="basepath" value="./"/><!-- Strip the file paths down to the relevant bit -->
<arg name="colors"/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="8"/><!-- Enables parallel processing when available for faster results. -->
<!-- Rules: Check PHP version compatibility -->
<!-- https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions -->
<config name="testVersion" value="5.5-"/>
<!-- https://github.com/PHPCompatibility/PHPCompatibilityWP -->
<rule ref="PHPCompatibilityWP"/>
<!-- Rules: WordPress Coding Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
<config name="minimum_supported_wp_version" value="4.8"/>
<rule ref="WordPress">
<exclude name="Generic.Commenting.DocComment.SpacingAfterTagGroup"/>
<exclude name="Generic.Commenting.DocComment.SpacingAfter"/>
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
<exclude name="Generic.Commenting.DocComment.MissingShort"/>
<exclude name="Squiz.Commenting.FunctionComment.Missing"/>
<exclude name="Generic.Commenting.DocComment.MissingShort"/>
<exclude name="Squiz.Commenting.ClassComment.Missing"/>
<exclude name="Squiz.Commenting.FunctionComment.MissingParamTag"/>
<exclude name="Generic.Files.OneObjectStructurePerFile.MultipleFound"/>
<exclude name="Squiz.Commenting.VariableComment.Missing"/>
<exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullStop"/>
<exclude name="Squiz.Commenting.FunctionComment.MissingParamComment"/>
<exclude name="Squiz.Commenting.FunctionComment.MissingParamName"/>
<exclude name="Squiz.Commenting.FileComment.SpacingAfterComment"/>
<exclude name="WordPress.WhiteSpace.PrecisionAlignment.Found"/>
<exclude name="Generic.Commenting.DocComment.ShortNotCapital"/>
<exclude name="Squiz.Commenting.FileComment.Missing"/>
<exclude name="WordPress.Security.NonceVerification.Recommended"/>
<exclude name="WordPress.PHP.DevelopmentFunctions.error_log_error_log"/>
<exclude name="WordPress.PHP.DevelopmentFunctions.error_log_print_r"/>
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedNamespaceFound"/>
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound"/>
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar"/>
<exclude name="WordPress.WP.I18n.MissingTranslatorsComment"/>
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found"/>
<exclude name="PHPCompatibility.Lists.NewShortList.Found"/>
<exclude name="PHPCompatibility.Classes.NewAnonymousClasses.Found"/>
<exclude name="PHPCompatibility.InitialValue.NewConstantScalarExpressions.constFound"/>
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch"/>
<exclude name="WordPress.PHP.IniSet.Risky"/>
</rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<!-- Value: replace the function, class, and variable prefixes used. Separate multiple prefixes with a comma. -->
<property name="prefixes" type="array" value="matomo,wpmatomo"/>
</properties>
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="matomo"/>
</properties>
</rule>
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing">
<properties>
<property name="blank_line_check" value="true"/>
</properties>
</rule>
<rule ref="WordPress.PHP.DevelopmentFunctions.prevent_path_disclosure_error_reporting">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.voidFound">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.PHP.DiscouragedPHPFunctions.system_calls_exec">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.PHP.DevelopmentFunctions.error_log_var_export">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
</ruleset>