Skip to content

Commit

Permalink
feat(Swiftlint): new rules added (from SwiftLint 0.50.0) (#45)
Browse files Browse the repository at this point in the history
 feat(Swiftlint): new rules added (from SwiftLint 0.50.0)
  • Loading branch information
zippy1978 authored Nov 28, 2022
1 parent 87c203d commit 395995a
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions swift-lang/src/main/resources/swiftlint-rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -2352,5 +2352,60 @@
"offset": "5min",
"function": "CONSTANT_ISSUE"
}
},
{
"key": "accessibility_trait_for_button",
"name": "Accessibility Trait for Button",
"description": "All views with tap gestures added should include the .isButton accessibility trait. If a tap opens an external link the .isLink trait should be used instead.",
"severity": "MINOR",
"type": "CODE_SMELL",
"debt": {
"offset": "5min",
"function": "CONSTANT_ISSUE"
}
},
{
"key": "no_magic_numbers",
"name": "No Magic Numbers",
"description": "Magic numbers should be replaced by named constants.",
"severity": "MINOR",
"type": "CODE_SMELL",
"debt": {
"offset": "5min",
"function": "CONSTANT_ISSUE"
}
},
{
"key": "ns_number_init_as_function_reference",
"name": "NSNumber Init as Function Reference",
"description": "Passing `NSNumber.init` or `NSDecimalNumber.init` as a function reference is dangerous as it can cause the wrong initializer to be used, causing crashes. Use `.init(value:)` instead.",
"severity": "MAJOR",
"type": "BUG",
"debt": {
"offset": "5min",
"function": "CONSTANT_ISSUE"
}
},
{
"key": "self_binding",
"name": "Self Binding",
"description": "Re-bind `self` to a consistent identifier name.",
"severity": "MINOR",
"type": "CODE_SMELL",
"debt": {
"offset": "5min",
"function": "CONSTANT_ISSUE"
}
},
{
"key": "shorthand_optional_binding",
"name": "Shorthand Optional Binding",
"description": "Use shorthand syntax for optional binding",
"severity": "MINOR",
"type": "CODE_SMELL",
"debt": {
"offset": "5min",
"function": "CONSTANT_ISSUE"
}
}
]

0 comments on commit 395995a

Please sign in to comment.