Repository navigation
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
84 lines (77 loc) · 3.54 KB
/
Copy pathphpcs.xml.dist
File metadata and controls
84 lines (77 loc) · 3.54 KB
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
<?xml version="1.0"?>
<ruleset name="LS Plugin" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">
<description>PHP_CodeSniffer ruleset for the LightSpeed Site Plugin.</description>
<!-- PHP files only. The default extensions include js and css, which ran out of memory on the minified Swiper bundle. -->
<file>.</file>
<arg name="extensions" value="php"/>
<arg name="colors"/>
<arg value="ps"/>
<!-- Warnings are shown but do not fail the run, so legacy findings do not block commits. -->
<config name="ignore_warnings_on_exit" value="1"/>
<!-- build/ holds generated copies of src/ files. Check the source, not the copy. -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/build/*</exclude-pattern>
<rule ref="WordPress">
<!--
Formatting sniffs that the existing code breaks and that phpcbf can fix automatically.
Switched off so existing files can be edited and committed. Re-enable them one at a time
after running phpcbf in a separate cleanup.
-->
<exclude name="WordPress.Arrays.ArrayDeclarationSpacing"/>
<exclude name="Universal.Arrays.DisallowShortArraySyntax"/>
<exclude name="Squiz.WhiteSpace.SuperfluousWhitespace.EndLine"/>
<exclude name="Squiz.Commenting.FunctionComment.SpacingAfterParamType"/>
<exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket"/>
<exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine"/>
<exclude name="PSR2.Files.EndFileNewline.NoneFound"/>
<exclude name="PSR2.Classes.ClassDeclaration.CloseBraceAfterBody"/>
<exclude name="WordPress.WhiteSpace.OperatorSpacing.NoSpaceBefore"/>
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterEnd"/>
<exclude name="Squiz.Commenting.InlineComment.NoSpaceBefore"/>
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.SpaceAfterFunction"/>
<exclude name="Universal.ControlStructures.DisallowLonelyIf.Found"/>
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="ls-plugin"/>
</property>
</properties>
</rule>
<!--
Findings in the existing code that need a human decision rather than an automatic fix.
Reported as warnings so they stay visible without blocking a commit.
-->
<rule ref="WordPress.WP.I18n.MissingTranslatorsComment">
<type>warning</type>
</rule>
<rule ref="WordPress.WP.I18n.UnorderedPlaceholdersText">
<type>warning</type>
</rule>
<rule ref="Squiz.Commenting.InlineComment.InvalidEndChar">
<type>warning</type>
</rule>
<rule ref="Squiz.Commenting.FileComment.SpacingAfterOpen">
<type>warning</type>
</rule>
<rule ref="WordPress.PHP.YodaConditions.NotYoda">
<type>warning</type>
</rule>
<rule ref="WordPress.WP.GlobalVariablesOverride.Prohibited">
<type>warning</type>
</rule>
<rule ref="WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase">
<type>warning</type>
</rule>
<rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops.Found">
<type>warning</type>
</rule>
<!--
Security sniffs stay as errors everywhere, with no file-wide exclusions. The two known false
positives are suppressed inline with a reason, on those statements only:
- src/blocks/search-filter/render.php: get_block_wrapper_attributes() and
wp_interactivity_data_wp_context() return already escaped markup.
- inc/class-permalinks.php: the input is sanitised by sanitize_permalink_fields() on the next line.
-->
</ruleset>