FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ai/phpcs.xml.dist at develop · WordPress/ai · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
WordPress
/
ai
Public
Notifications
You must be signed in to change notification settings
Fork
177
Star
321
Code
Issues
51
Pull requests
32
Discussions
Actions
Projects
Security and quality
1
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
ai
/
phpcs.xml.dist
Copy path
More file actions
More file actions
Latest commit
History
History
History
208 lines (185 loc) · 8.52 KB
Breadcrumbs
ai
/
phpcs.xml.dist
Copy path
File metadata and controls
208 lines (185 loc) · 8.52 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<?
xml
version
=
"
1.0
"
?>
<
ruleset
name=
"
WPCS - Abilities API
"
xmlns:xsi=
"
http://www.w3.org/2001/XMLSchema-instance
"
xsi:noNamespaceSchemaLocation=
"
https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd
"
>
<
description
>Sniffs for the AI plugin</
description
>
<!--
What to scan: include any root-level PHP files, and the /inc folder
-->
<
file
>./includes/</
file
>
<
file
>./ai.php</
file
>
<
file
>./uninstall.php</
file
>
<!--
These are excluded from the above paths.
-->
<
exclude-pattern
>**/build/**</
exclude-pattern
>
<
exclude-pattern
>**/node_modules/**</
exclude-pattern
>
<
exclude-pattern
>**/vendor/**</
exclude-pattern
>
<!--
Vendored third-party code; kept close to upstream
-->
<
exclude-pattern
>*/includes/Vendor/*</
exclude-pattern
>
<!--
How to scan: include CLI args so you don't need to pass them manually
-->
<!--
Usage instructions: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Usage
-->
<!--
Annotated ruleset:
https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
-->
<!--
Show sniff and progress
-->
<
arg
value
=
"
sp
"
/>
<!--
Strip the file paths down to the relevant bit
-->
<
arg
name
=
"
basepath
"
value
=
"
./
"
/>
<!--
Enable colors in report
-->
<
arg
name
=
"
colors
"
/>
<!--
Only lint php files by default
-->
<
arg
name
=
"
extensions
"
value
=
"
php
"
/>
<!--
Whenever possible, cache the scan results and re-use those for unchanged files on the next
scan.
-->
<
arg
name
=
"
cache
"
value
=
"
tests/_output/phpcs-cache.json
"
/>
<!--
Enables parallel processing when available for faster results.
-->
<
arg
name
=
"
parallel
"
value
=
"
20
"
/>
<!--
Set severity to 1 to see everything that isn't effectively turned off.
-->
<
arg
name
=
"
severity
"
value
=
"
1
"
/>
<!--
Ruleset Config: set these to match your project constraints.
-->
<!--
Tests for PHP version compatibility.
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards#Recomended-additional-rulesets
-->
<
config
name
=
"
testVersion
"
value
=
"
7.4-
"
/>
<!--
Tests for WordPress version compatibility.
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties
-->
<
config
name
=
"
minimum_wp_version
"
value
=
"
7.0
"
/>
<!--
Load WordPress VIP Go standards
We do this first, since we don't trust them to disable rules that we want to use.
@see: https://docs.wpvip.com/technical-references/vip-code-analysis-bot/phpcs-report/
-->
<
rule
ref
=
"
WordPress-VIP-Go
"
>
<!--
Deprecated: @todo remove in PHPCS 4.0
-->
<
exclude
name
=
"
WordPressVIPMinimum.JS
"
/>
</
rule
>
<
rule
ref
=
"
WordPress-Core
"
>
<
exclude
name
=
"
Generic.Files.OneObjectStructurePerFile
"
/>
<
exclude
name
=
"
Universal.Files.SeparateFunctionsFromOO
"
/>
</
rule
>
<
rule
ref
=
"
WordPress-Extra
"
>
<
exclude
name
=
"
WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedNamespaceFound
"
/>
<
exclude
name
=
"
WordPress.NamingConventions.PrefixAllGlobals.ShortPrefixPassed
"
/>
<
exclude
name
=
"
WordPress.Files.FileName
"
/>
<
exclude
name
=
"
WordPress.WP.I18n.MissingArgDomain
"
/>
<!--
Needed to typehint, see: https://github.com/WordPress/WordPress-Coding-Standards/issues/403
-->
<
exclude
name
=
"
Generic.Commenting.DocComment.MissingShort
"
/>
</
rule
>
<!--
Load PHPCompatibility & PHPCompatibilityWP
@see: https://github.com/PHPCompatibility/PHPCompatibilityWP
-->
<
rule
ref
=
"
PHPCompatibilityWP
"
/>
<!--
Check for superfluous whitespace - These get suppressed in VIP-GO.
-->
<
rule
ref
=
"
Squiz.WhiteSpace.SuperfluousWhitespace
"
>
<
severity
>5</
severity
>
</
rule
>
<
rule
ref
=
"
Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines
"
>
<
severity
>5</
severity
>
</
rule
>
<
rule
ref
=
"
Squiz.WhiteSpace.SuperfluousWhitespace.EndLine
"
>
<
severity
>5</
severity
>
</
rule
>
<
rule
ref
=
"
WordPress.WhiteSpace.ControlStructureSpacing
"
>
<
properties
>
<
property
name
=
"
blank_line_check
"
value
=
"
true
"
/>
</
properties
>
</
rule
>
<!--
Slevomat Coding Standards to keep our code clean and modern.
See: https://github.com/slevomat/coding-standard/tree/master#alphabetical-list-of-sniffs
-->
<
rule
ref
=
"
SlevomatCodingStandard.Arrays.ArrayAccess
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.Arrays.MultiLineArrayEndBracketPlacement
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.Classes.ClassConstantVisibility
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.Classes.DisallowConstructorPropertyPromotion
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.Classes.DisallowMultiConstantDefinition
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.Classes.DisallowMultiPropertyDefinition
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.Classes.DisallowStringExpressionPropertyFetch
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.Classes.ModernClassNameReference
"
>
<
properties
>
<!--
Doesn't use PHPCompatibility
-->
<
property
name
=
"
enableOnObjects
"
value
=
"
false
"
/>
</
properties
>
</
rule
>
<
rule
ref
=
"
SlevomatCodingStandard.Classes.RequireSelfReference
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.Classes.UselessLateStaticBinding
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.ControlStructures.DisallowContinueWithoutIntegerOperandInSwitch
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.ControlStructures.EarlyExit
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.ControlStructures.NewWithParentheses
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.ControlStructures.UselessTernaryOperator
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.Exceptions.DeadCatch
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.Exceptions.DisallowNonCapturingCatch
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.Functions.StaticClosure
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.Functions.UselessParameterDefaultValue
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses
"
>
<
properties
>
<
property
name
=
"
caseSensitive
"
value
=
"
true
"
/>
</
properties
>
</
rule
>
<
rule
ref
=
"
SlevomatCodingStandard.Namespaces.DisallowGroupUse
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation
"
>
<
properties
>
<!--
Support PHPStan annotations
-->
<
property
name
=
"
ignoredAnnotationNames
"
type
=
"
array
"
>
<
element
value
=
"
@phpstan-import-type
"
/>
<
element
value
=
"
@phpstan-param
"
/>
<
element
value
=
"
@phpstan-return
"
/>
<
element
value
=
"
@phpstan-template
"
/>
<
element
value
=
"
@phpstan-type
"
/>
<
element
value
=
"
@phpstan-var
"
/>
</
property
>
</
properties
>
</
rule
>
<
rule
ref
=
"
SlevomatCodingStandard.Namespaces.UnusedUses
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.Namespaces.UseFromSameNamespace
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.PHP.DisallowDirectMagicInvokeCall
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.PHP.OptimizedFunctionsWithoutUnpacking
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.PHP.ShortList
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.PHP.TypeCast
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.PHP.UselessParentheses
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.PHP.UselessSemicolon
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.TypeHints.LongTypeHints
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.Variables.DisallowVariableVariable
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable
"
/>
<
rule
ref
=
"
SlevomatCodingStandard.Variables.UnusedVariable
"
>
<
properties
>
<
property
name
=
"
ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach
"
value
=
"
true
"
/>
</
properties
>
</
rule
>
<
rule
ref
=
"
SlevomatCodingStandard.Variables.UselessVariable
"
/>
<!--
Do not apply filename rules for unit tests
-->
<
rule
ref
=
"
WordPress.Files.FileName.NotHyphenatedLowercase
"
>
<
exclude-pattern
>tests/*</
exclude-pattern
>
</
rule
>
<
rule
ref
=
"
WordPress.Files.FileName.InvalidClassFileName
"
>
<
exclude-pattern
>tests/*</
exclude-pattern
>
</
rule
>
<!--
Plugin-specific rule configs
-->
<
rule
ref
=
"
WordPress.NamingConventions.PrefixAllGlobals
"
>
<
properties
>
<
property
name
=
"
prefixes
"
type
=
"
array
"
>
<
element
value
=
"
WPAI
"
/>
<!--
Constant
-->
<
element
value
=
"
WordPress\AI
"
/>
<!--
Namespace
-->
<
element
value
=
"
wpai_
"
/>
<!--
Function and variable prefix
-->
</
property
>
</
properties
>
</
rule
>
<
rule
ref
=
"
WordPress.WP.I18n
"
>
<
properties
>
<
property
name
=
"
text_domain
"
type
=
"
array
"
>
<!--
If flagged, remove the text-domain entirely.
-->
<
element
value
=
"
ai
"
/>
</
property
>
</
properties
>
</
rule
>
</
ruleset
>
Back
|
FazBrowse Home
|
New Git URL