Skip to content

Commit 94173f9

Browse files
authored
Merge pull request #148 from gaelfoppolo/update-swiftlint
SwiftLint 0.26.0 support
2 parents cfeb256 + c823caa commit 94173f9

File tree

3 files changed

+317
-5
lines changed

3 files changed

+317
-5
lines changed

sonar-swift-plugin/src/main/resources/com/sonar/sqale/swiftlint-model.xml

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,58 @@
825825
<txt>min</txt>
826826
</prop>
827827
</chc>
828+
<chc>
829+
<rule-repo>SwiftLint</rule-repo>
830+
<rule-key>file_name</rule-key>
831+
<prop>
832+
<key>remediationFunction</key>
833+
<txt>CONSTANT_ISSUE</txt>
834+
</prop>
835+
<prop>
836+
<key>offset</key>
837+
<val>5</val>
838+
<txt>min</txt>
839+
</prop>
840+
</chc>
841+
<chc>
842+
<rule-repo>SwiftLint</rule-repo>
843+
<rule-key>function_default_parameter_at_end</rule-key>
844+
<prop>
845+
<key>remediationFunction</key>
846+
<txt>CONSTANT_ISSUE</txt>
847+
</prop>
848+
<prop>
849+
<key>offset</key>
850+
<val>5</val>
851+
<txt>min</txt>
852+
</prop>
853+
</chc>
854+
<chc>
855+
<rule-repo>SwiftLint</rule-repo>
856+
<rule-key>redundant_set_access_control</rule-key>
857+
<prop>
858+
<key>remediationFunction</key>
859+
<txt>CONSTANT_ISSUE</txt>
860+
</prop>
861+
<prop>
862+
<key>offset</key>
863+
<val>5</val>
864+
<txt>min</txt>
865+
</prop>
866+
</chc>
867+
<chc>
868+
<rule-repo>SwiftLint</rule-repo>
869+
<rule-key>untyped_error_in_catch</rule-key>
870+
<prop>
871+
<key>remediationFunction</key>
872+
<txt>CONSTANT_ISSUE</txt>
873+
</prop>
874+
<prop>
875+
<key>offset</key>
876+
<val>5</val>
877+
<txt>min</txt>
878+
</prop>
879+
</chc>
828880
</chc>
829881
<chc>
830882
<key>UNDERSTANDABILITY</key>
@@ -1336,6 +1388,97 @@
13361388
<txt>min</txt>
13371389
</prop>
13381390
</chc>
1391+
<chc>
1392+
<rule-repo>SwiftLint</rule-repo>
1393+
<rule-key>convenience_type</rule-key>
1394+
<prop>
1395+
<key>remediationFunction</key>
1396+
<txt>CONSTANT_ISSUE</txt>
1397+
</prop>
1398+
<prop>
1399+
<key>offset</key>
1400+
<val>5</val>
1401+
<txt>min</txt>
1402+
</prop>
1403+
</chc>
1404+
<chc>
1405+
<rule-repo>SwiftLint</rule-repo>
1406+
<rule-key>discouraged_optional_collection</rule-key>
1407+
<prop>
1408+
<key>remediationFunction</key>
1409+
<txt>CONSTANT_ISSUE</txt>
1410+
</prop>
1411+
<prop>
1412+
<key>offset</key>
1413+
<val>5</val>
1414+
<txt>min</txt>
1415+
</prop>
1416+
</chc>
1417+
<chc>
1418+
<rule-repo>SwiftLint</rule-repo>
1419+
<rule-key>empty_string</rule-key>
1420+
<prop>
1421+
<key>remediationFunction</key>
1422+
<txt>CONSTANT_ISSUE</txt>
1423+
</prop>
1424+
<prop>
1425+
<key>offset</key>
1426+
<val>5</val>
1427+
<txt>min</txt>
1428+
</prop>
1429+
</chc>
1430+
<chc>
1431+
<rule-repo>SwiftLint</rule-repo>
1432+
<rule-key>empty_xctest_method</rule-key>
1433+
<prop>
1434+
<key>remediationFunction</key>
1435+
<txt>CONSTANT_ISSUE</txt>
1436+
</prop>
1437+
<prop>
1438+
<key>offset</key>
1439+
<val>5</val>
1440+
<txt>min</txt>
1441+
</prop>
1442+
</chc>
1443+
<chc>
1444+
<rule-repo>SwiftLint</rule-repo>
1445+
<rule-key>modifier_order</rule-key>
1446+
<prop>
1447+
<key>remediationFunction</key>
1448+
<txt>CONSTANT_ISSUE</txt>
1449+
</prop>
1450+
<prop>
1451+
<key>offset</key>
1452+
<val>5</val>
1453+
<txt>min</txt>
1454+
</prop>
1455+
</chc>
1456+
<chc>
1457+
<rule-repo>SwiftLint</rule-repo>
1458+
<rule-key>multiline_function_chains</rule-key>
1459+
<prop>
1460+
<key>remediationFunction</key>
1461+
<txt>CONSTANT_ISSUE</txt>
1462+
</prop>
1463+
<prop>
1464+
<key>offset</key>
1465+
<val>5</val>
1466+
<txt>min</txt>
1467+
</prop>
1468+
</chc>
1469+
<chc>
1470+
<rule-repo>SwiftLint</rule-repo>
1471+
<rule-key>no_fallthrough_only</rule-key>
1472+
<prop>
1473+
<key>remediationFunction</key>
1474+
<txt>CONSTANT_ISSUE</txt>
1475+
</prop>
1476+
<prop>
1477+
<key>offset</key>
1478+
<val>5</val>
1479+
<txt>min</txt>
1480+
</prop>
1481+
</chc>
13391482
</chc>
13401483
</chc>
13411484
<chc>
@@ -1344,6 +1487,19 @@
13441487
<chc>
13451488
<key>API_ABUSE</key>
13461489
<name>API abuse</name>
1490+
<chc>
1491+
<rule-repo>SwiftLint</rule-repo>
1492+
<rule-key>unavailable_function</rule-key>
1493+
<prop>
1494+
<key>remediationFunction</key>
1495+
<txt>CONSTANT_ISSUE</txt>
1496+
</prop>
1497+
<prop>
1498+
<key>offset</key>
1499+
<val>5</val>
1500+
<txt>min</txt>
1501+
</prop>
1502+
</chc>
13471503
</chc>
13481504
<chc>
13491505
<key>ERRORS</key>
@@ -1421,6 +1577,19 @@
14211577
<txt>min</txt>
14221578
</prop>
14231579
</chc>
1580+
<chc>
1581+
<rule-repo>SwiftLint</rule-repo>
1582+
<rule-key>lower_acl_than_parent</rule-key>
1583+
<prop>
1584+
<key>remediationFunction</key>
1585+
<txt>CONSTANT_ISSUE</txt>
1586+
</prop>
1587+
<prop>
1588+
<key>offset</key>
1589+
<val>5</val>
1590+
<txt>min</txt>
1591+
</prop>
1592+
</chc>
14241593
</chc>
14251594
</chc>
14261595
<chc>

sonar-swift-plugin/src/main/resources/org/sonar/plugins/swiftlint/profile-swiftlint.xml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
<repositoryKey>SwiftLint</repositoryKey>
6060
<key>control_statement</key>
6161
</rule>
62+
<rule>
63+
<repositoryKey>SwiftLint</repositoryKey>
64+
<key>convenience_type</key>
65+
</rule>
6266
<rule>
6367
<repositoryKey>SwiftLint</repositoryKey>
6468
<key>custom_rules</key>
@@ -83,6 +87,10 @@
8387
<repositoryKey>SwiftLint</repositoryKey>
8488
<key>discouraged_optional_boolean</key>
8589
</rule>
90+
<rule>
91+
<repositoryKey>SwiftLint</repositoryKey>
92+
<key>discouraged_optional_collection</key>
93+
</rule>
8694
<rule>
8795
<repositoryKey>SwiftLint</repositoryKey>
8896
<key>dynamic_inline</key>
@@ -103,6 +111,14 @@
103111
<repositoryKey>SwiftLint</repositoryKey>
104112
<key>empty_parentheses_with_trailing_closure</key>
105113
</rule>
114+
<rule>
115+
<repositoryKey>SwiftLint</repositoryKey>
116+
<key>empty_string</key>
117+
</rule>
118+
<rule>
119+
<repositoryKey>SwiftLint</repositoryKey>
120+
<key>empty_xctest_method</key>
121+
</rule>
106122
<rule>
107123
<repositoryKey>SwiftLint</repositoryKey>
108124
<key>explicit_acl</key>
@@ -143,6 +159,10 @@
143159
<repositoryKey>SwiftLint</repositoryKey>
144160
<key>file_length</key>
145161
</rule>
162+
<rule>
163+
<repositoryKey>SwiftLint</repositoryKey>
164+
<key>file_name</key>
165+
</rule>
146166
<rule>
147167
<repositoryKey>SwiftLint</repositoryKey>
148168
<key>first_where</key>
@@ -167,6 +187,10 @@
167187
<repositoryKey>SwiftLint</repositoryKey>
168188
<key>function_body_length</key>
169189
</rule>
190+
<rule>
191+
<repositoryKey>SwiftLint</repositoryKey>
192+
<key>function_default_parameter_at_end</key>
193+
</rule>
170194
<rule>
171195
<repositoryKey>SwiftLint</repositoryKey>
172196
<key>function_parameter_count</key>
@@ -235,14 +259,26 @@
235259
<repositoryKey>SwiftLint</repositoryKey>
236260
<key>literal_expression_end_indentation</key>
237261
</rule>
262+
<rule>
263+
<repositoryKey>SwiftLint</repositoryKey>
264+
<key>lower_acl_than_parent</key>
265+
</rule>
238266
<rule>
239267
<repositoryKey>SwiftLint</repositoryKey>
240268
<key>mark</key>
241269
</rule>
270+
<rule>
271+
<repositoryKey>SwiftLint</repositoryKey>
272+
<key>modifier_order</key>
273+
</rule>
242274
<rule>
243275
<repositoryKey>SwiftLint</repositoryKey>
244276
<key>multiline_arguments</key>
245277
</rule>
278+
<rule>
279+
<repositoryKey>SwiftLint</repositoryKey>
280+
<key>multiline_function_chains</key>
281+
</rule>
246282
<rule>
247283
<repositoryKey>SwiftLint</repositoryKey>
248284
<key>multiline_parameters</key>
@@ -263,6 +299,10 @@
263299
<repositoryKey>SwiftLint</repositoryKey>
264300
<key>no_extension_access_modifier</key>
265301
</rule>
302+
<rule>
303+
<repositoryKey>SwiftLint</repositoryKey>
304+
<key>no_fallthrough_only</key>
305+
</rule>
266306
<rule>
267307
<repositoryKey>SwiftLint</repositoryKey>
268308
<key>no_grouping_extension</key>
@@ -355,6 +395,10 @@
355395
<repositoryKey>SwiftLint</repositoryKey>
356396
<key>redundant_optional_initialization</key>
357397
</rule>
398+
<rule>
399+
<repositoryKey>SwiftLint</repositoryKey>
400+
<key>redundant_set_access_control</key>
401+
</rule>
358402
<rule>
359403
<repositoryKey>SwiftLint</repositoryKey>
360404
<key>redundant_string_enum_value</key>
@@ -443,6 +487,10 @@
443487
<repositoryKey>SwiftLint</repositoryKey>
444488
<key>type_name</key>
445489
</rule>
490+
<rule>
491+
<repositoryKey>SwiftLint</repositoryKey>
492+
<key>unavailable_function</key>
493+
</rule>
446494
<rule>
447495
<repositoryKey>SwiftLint</repositoryKey>
448496
<key>unneeded_break_in_switch</key>
@@ -451,6 +499,10 @@
451499
<repositoryKey>SwiftLint</repositoryKey>
452500
<key>unneeded_parentheses_in_closure_argument</key>
453501
</rule>
502+
<rule>
503+
<repositoryKey>SwiftLint</repositoryKey>
504+
<key>untyped_error_in_catch</key>
505+
</rule>
454506
<rule>
455507
<repositoryKey>SwiftLint</repositoryKey>
456508
<key>unused_closure_parameter</key>

0 commit comments

Comments
 (0)