forked from polylang/polylang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml.dist
139 lines (121 loc) · 6.52 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?xml version="1.0"?>
<ruleset name="Polylang">
<description>Coding standards for Polylang</description>
<rule ref="PHPCompatibilityWP">
<config name="testVersion" value="5.6-"/>
</rule>
<rule ref="WordPressVIPMinimum">
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude name="WordPressVIPMinimum.Files.IncludingFile.UsingCustomConstant"/>
<exclude name="WordPressVIPMinimum.Functions.CheckReturnValue.NonCheckedVariable"/>
<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.cookies_setcookie"/>
<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.flush_rewrite_rules_flush_rewrite_rules"/>
<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.get_posts_get_posts"/>
<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.switch_to_blog_switch_to_blog"/>
<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.term_exists_term_exists"/>
<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.user_meta_delete_user_meta"/>
<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.user_meta_get_user_meta"/>
<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.user_meta_update_user_meta"/>
<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get"/>
<exclude name="WordPressVIPMinimum.Hooks.PreGetPosts.PreGetPosts"/>
<exclude name="WordPressVIPMinimum.Performance.BatcacheWhitelistedParams.StrippedGetParam"/>
<exclude name="WordPressVIPMinimum.Performance.FetchingRemoteData.FileGetContentsUnknown"/>
<exclude name="WordPressVIPMinimum.Performance.NoPaging.nopaging_nopaging"/>
<exclude name="WordPressVIPMinimum.Performance.TaxonomyMetaInOptions.PossibleTermMetaInOptions"/>
<exclude name="WordPressVIPMinimum.Variables.RestrictedVariables.cache_constraints___COOKIE"/>
<exclude name="WordPressVIPMinimum.Variables.RestrictedVariables.user_meta__wpdb__usermeta"/>
</rule>
<rule ref="WordPress">
<exclude name="Generic.Classes.DuplicateClassName.Found"/>
<exclude name="Generic.Commenting.Fixme.TaskFound"/>
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning"/>
<exclude name="PSR2.Classes.PropertyDeclaration.Multiple"/>
<exclude name="PSR2.Methods.MethodDeclaration.Underscore"/>
<exclude name="Squiz.Commenting.FileComment.Missing"/>
<exclude name="Squiz.Commenting.FileComment.MissingPackageTag"/>
<exclude name="Squiz.Commenting.FileComment.SpacingAfterOpen"/>
<exclude name="Squiz.Commenting.FileComment.WrongStyle"/>
<exclude name="Squiz.Commenting.FunctionComment.MissingParamComment"/>
<exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullStop"/>
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar"/>
<exclude name="Squiz.Commenting.InlineComment.SpacingAfter"/>
<exclude name="Squiz.Commenting.VariableComment.Missing"/>
<exclude name="Squiz.Commenting.VariableComment.WrongStyle"/>
<exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace"/>
<exclude name="Squiz.PHP.DisallowMultipleAssignments.Found"/>
<exclude name="Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure"/>
<exclude name="WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound"/>
<exclude name="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned"/>
<exclude name="WordPress.CodeAnalysis.AssignmentInCondition.Found"/>
<exclude name="WordPress.CodeAnalysis.AssignmentInCondition.FoundInTernaryCondition"/>
<exclude name="WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition"/>
<exclude name="WordPress.DB.DirectDatabaseQuery.DirectQuery"/>
<exclude name="WordPress.DB.DirectDatabaseQuery.NoCaching"/>
<exclude name="WordPress.DB.SlowDBQuery.slow_db_query_meta_key"/>
<exclude name="WordPress.DB.SlowDBQuery.slow_db_query_tax_query"/>
<exclude name="WordPress.Files.FileName"/>
<exclude name="WordPress.NamingConventions.ValidHookName.UseUnderscores"/>
<exclude name="WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode" />
<exclude name="WordPress.PHP.StrictInArray.MissingTrueStrict" />
<exclude name="WordPress.PHP.StrictComparisons.LooseComparison" />
<exclude name="WordPress.WP.EnqueuedResources.NonEnqueuedScript" />
<exclude name="WordPress.WP.EnqueuedResourceParameters.NotInFooter" />
<exclude name="WordPress.WP.GlobalVariablesOverride.Prohibited" />
<exclude name="WordPress.WP.PostsPerPage.posts_per_page_posts_per_page" />
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="polylang"/>
<element value="polylang-pro"/>
</property>
</properties>
</rule>
<rule ref="Generic.Commenting.Fixme.CommentFound" >
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Generic.Files.OneObjectStructurePerFile.MultipleFound" >
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="PSR2.Classes.PropertyDeclaration.ScopeMissing" >
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.ClassComment.Missing" >
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.EmptyThrows" >
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.Missing" >
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.WrongStyle" >
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.PHP.CommentedOutCode.Found" >
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Scope.MemberVarScope.Missing" >
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.Scope.MethodScope" >
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.PHP.NoSilencedErrors.Discouraged" >
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.Security" >
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<exclude-pattern>coverage/*</exclude-pattern>
<exclude-pattern>tests/phpunit/includes/speed-trap-listener.php</exclude-pattern>
<exclude-pattern>js/*.min.js</exclude-pattern>
<exclude-pattern>node_modules/*</exclude-pattern>
<exclude-pattern>webpack.config.js</exclude-pattern>
<exclude-pattern>bin/*</exclude-pattern>
<!-- Because files are built with Webpack/babel. It doesn't make sense to scan these files -->
<exclude-pattern>modules/block-editor/build/*</exclude-pattern>
<!-- Specific to Polylang -->
<exclude-pattern>install/plugin-updater.php</exclude-pattern>
<exclude-pattern>include/widget-calendar.php</exclude-pattern>
</ruleset>