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 ************************************************************** -->
80 <!-- We don't need 2 blank lines after function -->
81 <rule ref="Squiz.WhiteSpace.FunctionSpacing.After">
82 <severity>0</severity>
85 <!-- Aligned looks nicer, but causes too many warnings currently -->
86 <rule ref="Generic.Formatting.MultipleStatementAlignment.NotSame">
87 <severity>0</severity>
90 <!-- Aligned looks nicer, but causes too many warnings currently -->
91 <rule ref="Squiz.Arrays.ArrayDeclaration.DoubleArrowNotAligned">
92 <severity>0</severity>
101 <!-- **************************************************************
103 ************************************************************** -->
105 <!-- CONST_this_var is fine, we don't need ConstThisVar -->
106 <rule ref="Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase">
107 <severity>0</severity>
110 <!-- simply disagree with "Each line in an array declaration must end in a comma" -->
111 <rule ref="Squiz.Arrays.ArrayDeclaration.NoCommaAfterLast">
112 <severity>0</severity>
114 <rule ref="Squiz.Arrays.ArrayDeclaration.NoComma">
115 <severity>0</severity>
118 <!-- We allow "$abc = array($aPoint[1], $aPoint[2])" -->
119 <rule ref="Squiz.Arrays.ArrayDeclaration.SingleLineNotAllowed">
120 <severity>0</severity>
126 <!-- **************************************************************
128 ************************************************************** -->
130 <!-- we allow "if (a) echo 'b'" without brackets -->
131 <rule ref="Generic.ControlStructures.InlineControlStructure.NotAllowed">
132 <severity>0</severity>
134 <rule ref="Generic.ControlStructures.InlineControlStructure.Discouraged">
135 <severity>0</severity>
137 <rule ref="Squiz.PHP.DisallowInlineIf.Found">
138 <severity>0</severity>
141 <!-- We allow "if (a)". No need for "if (a === TRUE)" -->
142 <rule ref="Squiz.Operators.ComparisonOperatorUsage.ImplicitTrue">
143 <severity>0</severity>
145 <!-- ... same for "if (!a)" -->
146 <rule ref="Squiz.Operators.ComparisonOperatorUsage.NotAllowed">
147 <severity>0</severity>
154 <rule ref="PEAR.ControlStructures.MultiLineCondition.NewlineBeforeOpenBrace">
155 <severity>0</severity>
158 <rule ref="Squiz.WhiteSpace.ControlStructureSpacing.NoLineAfterClose">
159 <severity>0</severity>
161 <!-- ... same for foreach/while etc -->
162 <rule ref="PEAR.ControlStructures.ControlSignature">
163 <severity>0</severity>
166 <rule ref="Squiz.WhiteSpace.FunctionClosingBraceSpace.SpacingBeforeClose">
167 <severity>0</severity>