Skip to content

Commit 84660f4

Browse files
edgardmessiassamdark
authored andcommitted
Added ignored rules for migrations and tests (#29)
* Tabs replaced by spaces * Added ignored rules for migrations. See #14 * Added ignored rules for tests
1 parent c3789d8 commit 84660f4

File tree

1 file changed

+51
-30
lines changed

1 file changed

+51
-30
lines changed

Yii2/ruleset.xml

Lines changed: 51 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,65 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ruleset name="Yii2">
3-
<description>Yii 2 Web Application Framework Coding Standard</description>
3+
<description>Yii 2 Web Application Framework Coding Standard</description>
44

5-
<rule ref="PSR2">
6-
<!-- Property names MUST start with an initial underscore if they are private. -->
7-
<exclude name="PSR2.Classes.PropertyDeclaration.Underscore"/>
5+
<rule ref="PSR2">
6+
<!-- Property names MUST start with an initial underscore if they are private. -->
7+
<exclude name="PSR2.Classes.PropertyDeclaration.Underscore"/>
88

9-
<!-- Opening parenthesis of a multi-line function call must be the last content on the line. -->
10-
<!-- Closing parenthesis of a multi-line function call must be on a line by itself. -->
11-
<!-- Only one argument is allowed per line in a multi-line function call. -->
12-
<exclude name="PEAR.Functions.FunctionCallSignature"/>
9+
<!-- Opening parenthesis of a multi-line function call must be the last content on the line. -->
10+
<!-- Closing parenthesis of a multi-line function call must be on a line by itself. -->
11+
<!-- Only one argument is allowed per line in a multi-line function call. -->
12+
<exclude name="PEAR.Functions.FunctionCallSignature"/>
1313

14-
<!-- We don't have line length (line width) limits. -->
15-
<exclude name="Generic.Files.LineLength"/>
14+
<!-- We don't have line length (line width) limits. -->
15+
<exclude name="Generic.Files.LineLength"/>
1616

17-
<!-- CASE keyword must be indented 4 spaces from SWITCH keyword. -->
18-
<exclude name="PSR2.ControlStructures.SwitchDeclaration"/>
19-
</rule>
17+
<!-- CASE keyword must be indented 4 spaces from SWITCH keyword. -->
18+
<exclude name="PSR2.ControlStructures.SwitchDeclaration"/>
19+
</rule>
2020

21-
<!-- Property declaration rules. -->
22-
<!-- TODO: -->
21+
<!-- Property declaration rules. -->
22+
<!-- TODO: -->
2323

24-
<!-- Function call signature. -->
25-
<!-- TODO: -->
24+
<!-- Function call signature. -->
25+
<!-- TODO: -->
2626

27-
<!-- Switch declaration. -->
28-
<!-- TODO: -->
27+
<!-- Switch declaration. -->
28+
<!-- TODO: -->
2929

30-
<!-- ... other Yii2 specific rules. -->
31-
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
30+
<!-- ... other Yii2 specific rules. -->
31+
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
3232

33-
<!-- If string doesn't contain variables or single quotes, use single quotes. -->
34-
<rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar">
35-
<!-- Not check variable substitution -->
36-
<severity>0</severity>
37-
</rule>
33+
<!-- If string doesn't contain variables or single quotes, use single quotes. -->
34+
<rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar">
35+
<!-- Not check variable substitution -->
36+
<severity>0</severity>
37+
</rule>
3838

39-
<exclude-pattern>*/i18n/data/*</exclude-pattern>
40-
<exclude-pattern>*/views/errorHandler/*</exclude-pattern>
41-
<exclude-pattern>*/requirements/*</exclude-pattern>
39+
<!-- Ignore for migrations. -->
40+
<!-- Ignore missing namespace for migrations -->
41+
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
42+
<exclude-pattern>m\d{6}_\d{6}_.+\.php$</exclude-pattern>
43+
</rule>
44+
<!-- Ignore camel caps format for class name of migrations -->
45+
<rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
46+
<exclude-pattern>m\d{6}_\d{6}_.+\.php$</exclude-pattern>
47+
</rule>
4248

43-
<exclude-pattern>ProfileTarget.php</exclude-pattern>
49+
<!-- Ignore for tests. -->
50+
<!-- Ignore method name prefixed with underscore to indicate visibility -->
51+
<rule ref="PSR2.Methods.MethodDeclaration.Underscore">
52+
<exclude-pattern>tests?/*(Cest|Test).php$</exclude-pattern>
53+
</rule>
54+
<!-- Ignore declare new symbols and execute logic with side effects same file -->
55+
<rule ref="PSR1.Files.SideEffects.FoundWithSymbols">
56+
<exclude-pattern>/tests?*/_bootstrap.php$</exclude-pattern>
57+
<exclude-pattern>/web/(index|index-test).php$</exclude-pattern>
58+
</rule>
59+
60+
<exclude-pattern>*/i18n/data/*</exclude-pattern>
61+
<exclude-pattern>*/views/errorHandler/*</exclude-pattern>
62+
<exclude-pattern>*/requirements/*</exclude-pattern>
63+
64+
<exclude-pattern>ProfileTarget.php</exclude-pattern>
4465
</ruleset>

0 commit comments

Comments
 (0)