Skip to content

Commit 679f112

Browse files
committed
merge Update to support SwiftLint 0.27.0.
1 parent 84fa44c commit 679f112

File tree

3 files changed

+60
-1
lines changed

3 files changed

+60
-1
lines changed

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,19 @@
877877
<txt>min</txt>
878878
</prop>
879879
</chc>
880+
<chc>
881+
<rule-repo>SwiftLint</rule-repo>
882+
<rule-key>anyobject_protocol</rule-key>
883+
<prop>
884+
<key>remediationFunction</key>
885+
<txt>CONSTANT_ISSUE</txt>
886+
</prop>
887+
<prop>
888+
<key>offset</key>
889+
<val>5</val>
890+
<txt>min</txt>
891+
</prop>
892+
</chc>
880893
</chc>
881894
<chc>
882895
<key>UNDERSTANDABILITY</key>
@@ -1479,6 +1492,19 @@
14791492
<txt>min</txt>
14801493
</prop>
14811494
</chc>
1495+
<chc>
1496+
<rule-repo>SwiftLint</rule-repo>
1497+
<rule-key>missing_docs</rule-key>
1498+
<prop>
1499+
<key>remediationFunction</key>
1500+
<txt>CONSTANT_ISSUE</txt>
1501+
</prop>
1502+
<prop>
1503+
<key>offset</key>
1504+
<val>5</val>
1505+
<txt>min</txt>
1506+
</prop>
1507+
</chc>
14821508
</chc>
14831509
</chc>
14841510
<chc>

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
<name>SwiftLint</name>
44
<language>swift</language>
55
<rules>
6+
<rule>
7+
<repositoryKey>SwiftLint</repositoryKey>
8+
<key>anyobject_protocol</key>
9+
</rule>
610
<rule>
711
<repositoryKey>SwiftLint</repositoryKey>
812
<key>array_init</key>
@@ -267,6 +271,10 @@
267271
<repositoryKey>SwiftLint</repositoryKey>
268272
<key>mark</key>
269273
</rule>
274+
<rule>
275+
<repositoryKey>SwiftLint</repositoryKey>
276+
<key>missing_docs</key>
277+
</rule>
270278
<rule>
271279
<repositoryKey>SwiftLint</repositoryKey>
272280
<key>modifier_order</key>
@@ -403,6 +411,10 @@
403411
<repositoryKey>SwiftLint</repositoryKey>
404412
<key>redundant_string_enum_value</key>
405413
</rule>
414+
<rule>
415+
<repositoryKey>SwiftLint</repositoryKey>
416+
<key>redundant_type_annotation</key>
417+
</rule>
406418
<rule>
407419
<repositoryKey>SwiftLint</repositoryKey>
408420
<key>redundant_void_return</key>

swiftlang/src/main/resources/org/sonar/plugins/swiftlint/rules.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
[
2+
{
3+
"key": "anyobject_protocol",
4+
"category": "SwiftLint",
5+
"name": "AnyObject Protocol",
6+
"description": "Prefer using `AnyObject` over `class` for class-only protocols.",
7+
"severity": "MINOR"
8+
},
29
{
310
"key": "array_init",
411
"category": "SwiftLint",
@@ -94,7 +101,7 @@
94101
"key": "control_statement",
95102
"category": "SwiftLint",
96103
"name": "Control Statement",
97-
"description": "if,for,while,do,catch statements shouldn't wrap their conditionals or arguments in parentheses.",
104+
"description": "`if`, `for`, `guard`, `switch`, `while`, and `catch` statements shouldn't unnecessarily wrap their conditionals or arguments in parentheses.",
98105
"severity": "MINOR"
99106
},
100107
{
@@ -461,6 +468,13 @@
461468
"description": "MARK comment should be in valid format. e.g. '// MARK: ...' or '// MARK: - ...'",
462469
"severity": "MINOR"
463470
},
471+
{
472+
"key": "missing_docs",
473+
"category": "SwiftLint",
474+
"name": "Missing Docs",
475+
"description": "Declarations should be documented.",
476+
"severity": "MINOR"
477+
},
464478
{
465479
"key": "modifier_order",
466480
"category": "SwiftLint",
@@ -699,6 +713,13 @@
699713
"description": "String enum values can be omitted when they are equal to the enumcase name.",
700714
"severity": "MINOR"
701715
},
716+
{
717+
"key": "redundant_type_annotation",
718+
"category": "SwiftLint",
719+
"name": "Redundant Type Annotation",
720+
"description": "Variables should not have redundant type annotation",
721+
"severity": "MINOR"
722+
},
702723
{
703724
"key": "redundant_void_return",
704725
"category": "SwiftLint",

0 commit comments

Comments
 (0)