Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding SwiftLint 0.18.1 support #78

Merged
merged 1 commit into from
Apr 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions src/main/resources/com/sonar/sqale/swiftlint-model.xml
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,110 @@
<txt>min</txt>
</prop>
</chc>
<chc>
<rule-repo>SwiftLint</rule-repo>
<rule-key>discarded_notification_center_observer</rule-key>
<prop>
<key>remediationFunction</key>
<txt>CONSTANT_ISSUE</txt>
</prop>
<prop>
<key>offset</key>
<val>5</val>
<txt>min</txt>
</prop>
</chc>
<chc>
<rule-repo>SwiftLint</rule-repo>
<rule-key>explicit_type_interface</rule-key>
<prop>
<key>remediationFunction</key>
<txt>CONSTANT_ISSUE</txt>
</prop>
<prop>
<key>offset</key>
<val>5</val>
<txt>min</txt>
</prop>
</chc>
<chc>
<rule-repo>SwiftLint</rule-repo>
<rule-key>fatal_error_message</rule-key>
<prop>
<key>remediationFunction</key>
<txt>CONSTANT_ISSUE</txt>
</prop>
<prop>
<key>offset</key>
<val>5</val>
<txt>min</txt>
</prop>
</chc>
<chc>
<rule-repo>SwiftLint</rule-repo>
<rule-key>for_where</rule-key>
<prop>
<key>remediationFunction</key>
<txt>CONSTANT_ISSUE</txt>
</prop>
<prop>
<key>offset</key>
<val>5</val>
<txt>min</txt>
</prop>
</chc>
<chc>
<rule-repo>SwiftLint</rule-repo>
<rule-key>identifier_name</rule-key>
<prop>
<key>remediationFunction</key>
<txt>CONSTANT_ISSUE</txt>
</prop>
<prop>
<key>offset</key>
<val>5</val>
<txt>min</txt>
</prop>
</chc>
<chc>
<rule-repo>SwiftLint</rule-repo>
<rule-key>implicitly_unwrapped_optional</rule-key>
<prop>
<key>remediationFunction</key>
<txt>CONSTANT_ISSUE</txt>
</prop>
<prop>
<key>offset</key>
<val>5</val>
<txt>min</txt>
</prop>
</chc>
<chc>
<rule-repo>SwiftLint</rule-repo>
<rule-key>notification_center_detachment</rule-key>
<prop>
<key>remediationFunction</key>
<txt>CONSTANT_ISSUE</txt>
</prop>
<prop>
<key>offset</key>
<val>5</val>
<txt>min</txt>
</prop>
</chc>
<chc>
<rule-repo>SwiftLint</rule-repo>
<rule-key>redundant_discardable_let</rule-key>
<prop>
<key>remediationFunction</key>
<txt>CONSTANT_ISSUE</txt>
</prop>
<prop>
<key>offset</key>
<val>5</val>
<txt>min</txt>
</prop>
</chc>
</chc>
</chc>
<chc>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
<repositoryKey>SwiftLint</repositoryKey>
<key>cyclomatic_complexity</key>
</rule>
<rule>
<repositoryKey>SwiftLint</repositoryKey>
<key>discarded_notification_center_observer</key>
</rule>
<rule>
<repositoryKey>SwiftLint</repositoryKey>
<key>dynamic_inline</key>
Expand All @@ -75,6 +79,14 @@
<repositoryKey>SwiftLint</repositoryKey>
<key>explicit_init</key>
</rule>
<rule>
<repositoryKey>SwiftLint</repositoryKey>
<key>explicit_type_interface</key>
</rule>
<rule>
<repositoryKey>SwiftLint</repositoryKey>
<key>fatal_error_message</key>
</rule>
<rule>
<repositoryKey>SwiftLint</repositoryKey>
<key>file_header</key>
Expand All @@ -87,6 +99,10 @@
<repositoryKey>SwiftLint</repositoryKey>
<key>first_where</key>
</rule>
<rule>
<repositoryKey>SwiftLint</repositoryKey>
<key>for_where</key>
</rule>
<rule>
<repositoryKey>SwiftLint</repositoryKey>
<key>force_cast</key>
Expand All @@ -111,10 +127,18 @@
<repositoryKey>SwiftLint</repositoryKey>
<key>generic_type_name</key>
</rule>
<rule>
<repositoryKey>SwiftLint</repositoryKey>
<key>identifier_name</key>
</rule>
<rule>
<repositoryKey>SwiftLint</repositoryKey>
<key>implicit_getter</key>
</rule>
<rule>
<repositoryKey>SwiftLint</repositoryKey>
<key>implicitly_unwrapped_optional</key>
</rule>
<rule>
<repositoryKey>SwiftLint</repositoryKey>
<key>large_tuple</key>
Expand Down Expand Up @@ -159,6 +183,10 @@
<repositoryKey>SwiftLint</repositoryKey>
<key>nimble_operator</key>
</rule>
<rule>
<repositoryKey>SwiftLint</repositoryKey>
<key>notification_center_detachment</key>
</rule>
<rule>
<repositoryKey>SwiftLint</repositoryKey>
<key>number_separator</key>
Expand Down Expand Up @@ -195,6 +223,10 @@
<repositoryKey>SwiftLint</repositoryKey>
<key>prohibited_super_call</key>
</rule>
<rule>
<repositoryKey>SwiftLint</repositoryKey>
<key>redundant_discardable_let</key>
</rule>
<rule>
<repositoryKey>SwiftLint</repositoryKey>
<key>redundant_nil_coalescing</key>
Expand Down Expand Up @@ -283,10 +315,6 @@
<repositoryKey>SwiftLint</repositoryKey>
<key>valid_ibinspectable</key>
</rule>
<rule>
<repositoryKey>SwiftLint</repositoryKey>
<key>variable_name</key>
</rule>
<rule>
<repositoryKey>SwiftLint</repositoryKey>
<key>vertical_parameter_alignment</key>
Expand Down
67 changes: 58 additions & 9 deletions src/main/resources/org/sonar/plugins/swiftlint/rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@
"description": "Complexity of function bodies should be limited.",
"severity": "CRITICAL"
},
{
"key": "discarded_notification_center_observer",
"category": "SwiftLint",
"name": "Discarded Notification Center Observer",
"description": "When registing for a notification using a block, the opaque observer that is returned should be stored so it can be removed later.",
"severity": "MINOR"
},
{
"key": "dynamic_inline",
"category": "SwiftLint",
Expand Down Expand Up @@ -125,6 +132,20 @@
"description": "Explicitly calling .init() should be avoided.",
"severity": "MINOR"
},
{
"key": "explicit_type_interface",
"category": "SwiftLint",
"name": "Explicit Type Interface",
"description": "Properties should have a type interface",
"severity": "MINOR"
},
{
"key": "fatal_error_message",
"category": "SwiftLint",
"name": "Fatal Errror Message",
"description": "A fatalError call should have a message.",
"severity": "MINOR"
},
{
"key": "file_header",
"category": "SwiftLint",
Expand All @@ -146,6 +167,13 @@
"description": "Prefer using `.first(where:)` over `.filter { }.first` in collections.",
"severity": "MINOR"
},
{
"key": "for_where",
"category": "SwiftLint",
"name": "For Where",
"description": "`where` clauses are preferred over a single `if` inside a `for`.",
"severity": "MINOR"
},
{
"key": "force_cast",
"category": "SwiftLint",
Expand Down Expand Up @@ -188,13 +216,27 @@
"description": "Generic type name should only contain alphanumeric characters, start with an uppercase character and span between 1 and 20 characters in length.",
"severity": "MINOR"
},
{
"key": "identifier_name",
"category": "SwiftLint",
"name": "Identifier Name",
"description": "Identifier names should only contain alphanumeric characters and start with a lowercase character or should only contain capital letters. In an exception to the above, variable names may start with a capital letter when they are declared static and immutable. Variable names should not be too long or too short.",
"severity": "MINOR"
},
{
"key": "implicit_getter",
"category": "SwiftLint",
"name": "Implicit Getter",
"description": "Computed read-only properties should avoid using the get keyword.",
"severity": "MINOR"
},
{
"key": "implicitly_unwrapped_optional",
"category": "SwiftLint",
"name": "Implicitly Unwrapped Optional",
"description": "Implicitly unwrapped optionals should be avoided when possible.",
"severity": "MINOR"
},
{
"key": "large_tuple",
"category": "SwiftLint",
Expand Down Expand Up @@ -272,6 +314,13 @@
"description": "Prefer Nimble operator overloads over free matcher functions.",
"severity": "MINOR"
},
{
"key": "notification_center_detachment",
"category": "SwiftLint",
"name": "Notification Center Detachment",
"description": "An object should only remove itself as an observer in `deinit`.",
"severity": "MINOR"
},
{
"key": "number_separator",
"category": "SwiftLint",
Expand Down Expand Up @@ -335,11 +384,18 @@
"description": "Some methods should not call super",
"severity": "MINOR"
},
{
"key": "redundant_discardable_let",
"category": "SwiftLint",
"name": "Redundant Discardable Let",
"description": "Prefer `_ = foo()` over `let _ = foo()` when discarding a result from a function.",
"severity": "MINOR"
},
{
"key": "redundant_nil_coalescing",
"category": "SwiftLint",
"name": "Redundant Nil Coalescing",
"description": "nil coalescing operator is only evaluated if the lhs is nil , coalescing operator with nil as rhs is redundant",
"description": "nil coalescing operator is only evaluated if the lhs is nil, coalescing operator with nil as rhs is redundant",
"severity": "MINOR"
},
{
Expand Down Expand Up @@ -465,7 +521,7 @@
"key": "unused_enumerated",
"category": "SwiftLint",
"name": "Unused Enumerated",
"description": "When the index is not used, .enumerated() can be removed.",
"description": "When the index or the item is not used, `.enumerated()` can be removed.",
"severity": "MINOR"
},
{
Expand All @@ -489,13 +545,6 @@
"description": "@IBInspectable should be applied to variables only, have its type explicit and be of a supported type",
"severity": "MINOR"
},
{
"key": "variable_name",
"category": "SwiftLint",
"name": "Variable Name",
"description": "Variable names should only contain alphanumeric characters and start with a lowercase character or should only contain capital letters. In an exception to the above, variable names may start with a capital letter when they are declared static and immutable. Variable names should not be too long or too short.",
"severity": "CRITICAL"
},
{
"key": "vertical_parameter_alignment",
"category": "SwiftLint",
Expand Down