2 <ruleset name="Nominatim Standard">
4 <description>Nominatim coding standard</description>
6 <!-- based on another standard, you can find it here -->
7 <!-- /usr/share/php/PHP/CodeSniffer/Standards/PSR2/ruleset.xml -->
8 <!-- https://github.com/squizlabs/PHP_CodeSniffer/blob/master/CodeSniffer/Standards/PSR2/ruleset.xml -->
14 <!-- currently 300 warnings, we set a limit later -->
15 <rule ref="Generic.Files.LineLength">
17 <property name="lineLimit" value="9999"/>
18 <property name="absoluteLineLimit" value="0"/>
24 <!-- **************************************************************
26 ************************************************************** -->
28 <rule ref="PEAR.Commenting.FileComment.Missing">
29 <severity>0</severity>
31 <rule ref="PEAR.Commenting.ClassComment.Missing">
32 <severity>0</severity>
34 <rule ref="PEAR.Commenting.FunctionComment.Missing">
35 <severity>0</severity>
41 <!-- **************************************************************
43 ************************************************************** -->
45 <!-- We allow comments after statements -->
46 <rule ref="Squiz.Commenting.PostStatementComment.Found">
47 <severity>0</severity>
49 <!-- ... even without space e.g. //some words -->
50 <rule ref="Squiz.Commenting.InlineComment.NoSpaceBefore">
51 <severity>0</severity>
54 <!-- Comments don't have to start uppercase -->
55 <rule ref="Squiz.Commenting.InlineComment.NotCapital">
56 <severity>0</severity>
58 <!-- Comments don't have to end with one of .!? -->
59 <rule ref="Squiz.Commenting.InlineComment.InvalidEndChar">
60 <severity>0</severity>
63 <!-- we don't need '} // functionname()' at end of large blocks -->
64 <rule ref="Squiz.Commenting.ClosingDeclarationComment.Missing">
65 <severity>0</severity>
67 <!-- .. same for conditions -->
68 <rule ref="Squiz.Commenting.LongConditionClosingComment.Missing">
69 <severity>0</severity>
76 <!-- **************************************************************
78 ************************************************************** -->
81 <rule ref="Generic.WhiteSpace.DisallowTabIndent.TabsUsed">
82 <severity>0</severity>
85 <!-- We don't need 2 blank lines after function -->
86 <rule ref="Squiz.WhiteSpace.FunctionSpacing.After">
87 <severity>0</severity>
90 <!-- Aligned looks nicer, but causes too many warnings currently -->
91 <rule ref="Generic.Formatting.MultipleStatementAlignment.NotSame">
92 <severity>0</severity>
95 <!-- Aligned looks nicer, but causes too many warnings currently -->
96 <rule ref="Squiz.Arrays.ArrayDeclaration.DoubleArrowNotAligned">
97 <severity>0</severity>
106 <!-- **************************************************************
108 ************************************************************** -->
110 <!-- CONST_this_var is fine, we don't need ConstThisVar -->
111 <rule ref="Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase">
112 <severity>0</severity>
115 <!-- simply disagree with "Each line in an array declaration must end in a comma" -->
116 <rule ref="Squiz.Arrays.ArrayDeclaration.NoCommaAfterLast">
117 <severity>0</severity>
119 <rule ref="Squiz.Arrays.ArrayDeclaration.NoComma">
120 <severity>0</severity>
123 <!-- We allow "$abc = array($aPoint[1], $aPoint[2])" -->
124 <rule ref="Squiz.Arrays.ArrayDeclaration.SingleLineNotAllowed">
125 <severity>0</severity>
131 <!-- **************************************************************
133 ************************************************************** -->
135 <!-- we allow "if (a) echo 'b'" without brackets -->
136 <rule ref="Generic.ControlStructures.InlineControlStructure.NotAllowed">
137 <severity>0</severity>
139 <rule ref="Generic.ControlStructures.InlineControlStructure.Discouraged">
140 <severity>0</severity>
142 <rule ref="Squiz.PHP.DisallowInlineIf.Found">
143 <severity>0</severity>
146 <!-- We allow "if (a)". No need for "if (a === TRUE)" -->
147 <rule ref="Squiz.Operators.ComparisonOperatorUsage.ImplicitTrue">
148 <severity>0</severity>
150 <!-- ... same for "if (!a)" -->
151 <rule ref="Squiz.Operators.ComparisonOperatorUsage.NotAllowed">
152 <severity>0</severity>
159 <rule ref="PEAR.ControlStructures.MultiLineCondition.NewlineBeforeOpenBrace">
160 <severity>0</severity>
163 <rule ref="Squiz.WhiteSpace.ControlStructureSpacing.NoLineAfterClose">
164 <severity>0</severity>
166 <!-- ... same for foreach/while etc -->
167 <rule ref="PEAR.ControlStructures.ControlSignature">
168 <severity>0</severity>
171 <rule ref="Squiz.WhiteSpace.FunctionClosingBraceSpace.SpacingBeforeClose">
172 <severity>0</severity>