TrailingCommaPostFormatProcessor: improve findInvalidCommas

Add case for line break between argument and comma
#KT-34744
This commit is contained in:
Dmitry Gridin
2020-01-23 00:24:55 +07:00
parent ca1aa6ed4e
commit 63ee723928
10 changed files with 1848 additions and 24 deletions
@@ -275,6 +275,18 @@
<offset>33</offset>
<length>1</length>
</problem>
<problem>
<file>ArgumentList.kt</file>
<line>208</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="ArgumentList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>8</offset>
<length>1</length>
</problem>
<problem>
<file>ArgumentList.kt</file>
<line>207</line>
@@ -311,6 +323,18 @@
<offset>15</offset>
<length>1</length>
</problem>
<problem>
<file>ArgumentList.kt</file>
<line>214</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="ArgumentList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>8</offset>
<length>1</length>
</problem>
<problem>
<file>ArgumentList.kt</file>
<line>213</line>
@@ -803,6 +827,18 @@
<offset>18</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>46</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="ParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>8</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>46</line>
@@ -827,6 +863,18 @@
<offset>18</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>108</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="ParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>8</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>108</line>
@@ -863,6 +911,18 @@
<offset>18</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>145</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="ParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>8</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>145</line>
@@ -899,6 +959,18 @@
<offset>18</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>194</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="ParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>194</line>
@@ -923,6 +995,18 @@
<offset>18</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>217</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="ParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>217</line>
@@ -947,6 +1031,18 @@
<offset>18</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>232</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="ParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>232</line>
@@ -971,6 +1067,18 @@
<offset>21</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>255</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="ParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>255</line>
@@ -983,6 +1091,18 @@
<offset>8</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>260</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="ParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>260</line>
@@ -1031,6 +1151,18 @@
<offset>17</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>338</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="ParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>17</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>337</line>
@@ -1067,6 +1199,18 @@
<offset>14</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>357</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="ParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>357</line>
@@ -1091,6 +1235,18 @@
<offset>14</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>380</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="ParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>380</line>
@@ -1115,6 +1271,18 @@
<offset>14</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>395</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="ParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>395</line>
@@ -1127,6 +1295,18 @@
<offset>5</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>399</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="ParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>410</line>
@@ -1151,6 +1331,18 @@
<offset>20</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>418</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="ParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>418</line>
@@ -1199,6 +1391,18 @@
<offset>8</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>454</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="ParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>ParameterList.kt</file>
<line>454</line>
@@ -1535,6 +1739,18 @@
<offset>38</offset>
<length>1</length>
</problem>
<problem>
<file>LambdaParameterList.kt</file>
<line>33</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="LambdaParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>LambdaParameterList.kt</file>
<line>33</line>
@@ -1559,6 +1775,18 @@
<offset>14</offset>
<length>1</length>
</problem>
<problem>
<file>LambdaParameterList.kt</file>
<line>64</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="LambdaParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>LambdaParameterList.kt</file>
<line>64</line>
@@ -1583,6 +1811,18 @@
<offset>13</offset>
<length>1</length>
</problem>
<problem>
<file>LambdaParameterList.kt</file>
<line>87</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="LambdaParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>LambdaParameterList.kt</file>
<line>87</line>
@@ -1607,6 +1847,18 @@
<offset>17</offset>
<length>1</length>
</problem>
<problem>
<file>LambdaParameterList.kt</file>
<line>115</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="LambdaParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>LambdaParameterList.kt</file>
<line>115</line>
@@ -1619,6 +1871,18 @@
<offset>8</offset>
<length>1</length>
</problem>
<problem>
<file>LambdaParameterList.kt</file>
<line>122</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="LambdaParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>LambdaParameterList.kt</file>
<line>122</line>
@@ -1679,6 +1943,18 @@
<offset>8</offset>
<length>1</length>
</problem>
<problem>
<file>LambdaParameterList.kt</file>
<line>182</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="LambdaParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>LambdaParameterList.kt</file>
<line>182</line>
@@ -1703,6 +1979,18 @@
<offset>14</offset>
<length>1</length>
</problem>
<problem>
<file>TypeParameterList.kt</file>
<line>23</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="TypeParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>TypeParameterList.kt</file>
<line>23</line>
@@ -1727,6 +2015,18 @@
<offset>14</offset>
<length>1</length>
</problem>
<problem>
<file>TypeParameterList.kt</file>
<line>46</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="TypeParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>TypeParameterList.kt</file>
<line>46</line>
@@ -1751,6 +2051,18 @@
<offset>14</offset>
<length>1</length>
</problem>
<problem>
<file>TypeParameterList.kt</file>
<line>61</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="TypeParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>TypeParameterList.kt</file>
<line>61</line>
@@ -1775,6 +2087,18 @@
<offset>17</offset>
<length>1</length>
</problem>
<problem>
<file>TypeParameterList.kt</file>
<line>84</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="TypeParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>TypeParameterList.kt</file>
<line>84</line>
@@ -1787,6 +2111,18 @@
<offset>8</offset>
<length>1</length>
</problem>
<problem>
<file>TypeParameterList.kt</file>
<line>89</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="TypeParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>TypeParameterList.kt</file>
<line>89</line>
@@ -1823,6 +2159,18 @@
<offset>14</offset>
<length>1</length>
</problem>
<problem>
<file>TypeParameterList.kt</file>
<line>115</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="TypeParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>TypeParameterList.kt</file>
<line>115</line>
@@ -1847,6 +2195,18 @@
<offset>14</offset>
<length>1</length>
</problem>
<problem>
<file>TypeParameterList.kt</file>
<line>138</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="TypeParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>TypeParameterList.kt</file>
<line>138</line>
@@ -1871,6 +2231,18 @@
<offset>14</offset>
<length>1</length>
</problem>
<problem>
<file>TypeParameterList.kt</file>
<line>153</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="TypeParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>TypeParameterList.kt</file>
<line>153</line>
@@ -1883,6 +2255,18 @@
<offset>5</offset>
<length>1</length>
</problem>
<problem>
<file>TypeParameterList.kt</file>
<line>157</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="TypeParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>TypeParameterList.kt</file>
<line>168</line>
@@ -1907,6 +2291,18 @@
<offset>20</offset>
<length>1</length>
</problem>
<problem>
<file>TypeParameterList.kt</file>
<line>176</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="TypeParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>TypeParameterList.kt</file>
<line>176</line>
@@ -1967,6 +2363,18 @@
<offset>8</offset>
<length>1</length>
</problem>
<problem>
<file>TypeParameterList.kt</file>
<line>223</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="TypeParameterList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>4</offset>
<length>1</length>
</problem>
<problem>
<file>TypeParameterList.kt</file>
<line>223</line>
@@ -2123,6 +2531,18 @@
<offset>56</offset>
<length>1</length>
</problem>
<problem>
<file>TypeArgumentList.kt</file>
<line>41</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="TypeArgumentList.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>12</offset>
<length>1</length>
</problem>
<problem>
<file>TypeArgumentList.kt</file>
<line>40</line>
@@ -2423,6 +2843,18 @@
<offset>42</offset>
<length>1</length>
</problem>
<problem>
<file>IndicesAccess.kt</file>
<line>75</line>
<module>testProject</module>
<package>light_idea_test_case</package>
<entry_point TYPE="file" FQNAME="IndicesAccess.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Trailing comma recommendations</problem_class>
<description>Comma loses the advantages in this position</description>
<highlighted_element>,</highlighted_element>
<offset>12</offset>
<length>1</length>
</problem>
<problem>
<file>IndicesAccess.kt</file>
<line>74</line>