summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/phpcs.xml
blob: 960d4782b03841d0d8d28a7cd638a65887854525 (plain)
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
<?xml version="1.0"?>
<!--
	- https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
	- https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards
-->
<ruleset name="MediaWiki">
    <rule ref="Generic.Classes" />
    <rule ref="Generic.CodeAnalysis" />
    <rule ref="Generic.ControlStructures" />

    <rule ref="Generic.Files.ByteOrderMark" />
    <rule ref="Generic.Files.EndFileNewline" />
    <rule ref="Generic.Files.LineEndings" />
    <rule ref="Generic.Files.LineLength">
        <properties>
            <property name="lineLimit" value="180" />
            <property name="absoluteLineLimit" value="180" />
        </properties>
    </rule>
    <rule ref="Generic.Files.OneClassPerFile" />

    <rule ref="Generic.Formatting.DisallowMultipleStatements" />

    <rule ref="Generic.Functions.CallTimePassByReference" />
    <rule ref="Generic.Functions.FunctionCallArgumentSpacing" />
    <rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie" />

    <rule ref="Generic.Metrics.NestingLevel">
        <properties>
            <property name="nestingLevel" value="3" />
            <property name="absoluteNestingLevel" value="3" />
        </properties>
    </rule>

    <rule ref="Generic.Metrics.CyclomaticComplexity">
        <properties>
            <property name="complexity" value="10" />
            <property name="absoluteComplexity" value="10" />
        </properties>
    </rule>

    <rule ref="Generic.NamingConventions" />
    <!-- TODO: create variation of this sniff that allows underscores in test methods -->
    <rule ref="Generic.NamingConventions.CamelCapsFunctionName.ScopeNotCamelCaps">
        <severity>0</severity>
    </rule>

    <rule ref="Generic.PHP.CharacterBeforePHPOpeningTag" />
    <rule ref="Generic.PHP.DeprecatedFunctions" />
    <rule ref="Generic.PHP.DisallowShortOpenTag" />
    <rule ref="Generic.PHP.ForbiddenFunctions" />
    <rule ref="Generic.PHP.LowerCaseConstant" />
    <rule ref="Generic.PHP.LowerCaseKeyword" />
    <rule ref="Generic.PHP.NoSilencedErrors" />
    <rule ref="Generic.PHP.SAPIUsage" />

    <rule ref="Generic.WhiteSpace.DisallowSpaceIndent" />

    <rule ref="PSR1" />
    <!-- TODO: create variation of this sniff that allows underscores in test methods -->
    <rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
        <severity>0</severity>
    </rule>

    <rule ref="PSR2.Classes.PropertyDeclaration" />
    <rule ref="PSR2.ControlStructures.ElseIfDeclaration" />
    <rule ref="PSR2.Namespaces" />

    <rule ref="Squiz.Arrays.ArrayBracketSpacing" />
    <rule ref="Squiz.CSS.SemicolonSpacing" />
    <rule ref="Squiz.Classes.DuplicateProperty" />
    <rule ref="Squiz.Classes.SelfMemberReference" />
    <rule ref="Squiz.Classes.ValidClassName" />
    <rule ref="Squiz.Functions.FunctionDuplicateArgument" />
    <rule ref="Squiz.Functions.GlobalFunction" />
    <rule ref="Squiz.Scope" />
    <rule ref="Squiz.WhiteSpace.CastSpacing" />
    <rule ref="Squiz.WhiteSpace.LanguageConstructSpacing" />
    <rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing" />

    <!-- https://github.com/squizlabs/PHP_CodeSniffer/issues/348 -->
    <!--<rule ref="Squiz.WhiteSpace.OperatorSpacing" />-->

    <rule ref="Squiz.WhiteSpace.ScopeClosingBrace" />
    <rule ref="Squiz.WhiteSpace.ScopeKeywordSpacing" />
    <rule ref="Squiz.WhiteSpace.SemicolonSpacing" />
    <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace" />
    <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines">
        <severity>0</severity>
    </rule>

    <rule ref="Zend.Files.ClosingTag" />
</ruleset>