Skip to content

Commit 395995a

Browse files
authored
feat(Swiftlint): new rules added (from SwiftLint 0.50.0) (#45)
feat(Swiftlint): new rules added (from SwiftLint 0.50.0)
1 parent 87c203d commit 395995a

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

swift-lang/src/main/resources/swiftlint-rules.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2352,5 +2352,60 @@
23522352
"offset": "5min",
23532353
"function": "CONSTANT_ISSUE"
23542354
}
2355+
},
2356+
{
2357+
"key": "accessibility_trait_for_button",
2358+
"name": "Accessibility Trait for Button",
2359+
"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.",
2360+
"severity": "MINOR",
2361+
"type": "CODE_SMELL",
2362+
"debt": {
2363+
"offset": "5min",
2364+
"function": "CONSTANT_ISSUE"
2365+
}
2366+
},
2367+
{
2368+
"key": "no_magic_numbers",
2369+
"name": "No Magic Numbers",
2370+
"description": "Magic numbers should be replaced by named constants.",
2371+
"severity": "MINOR",
2372+
"type": "CODE_SMELL",
2373+
"debt": {
2374+
"offset": "5min",
2375+
"function": "CONSTANT_ISSUE"
2376+
}
2377+
},
2378+
{
2379+
"key": "ns_number_init_as_function_reference",
2380+
"name": "NSNumber Init as Function Reference",
2381+
"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.",
2382+
"severity": "MAJOR",
2383+
"type": "BUG",
2384+
"debt": {
2385+
"offset": "5min",
2386+
"function": "CONSTANT_ISSUE"
2387+
}
2388+
},
2389+
{
2390+
"key": "self_binding",
2391+
"name": "Self Binding",
2392+
"description": "Re-bind `self` to a consistent identifier name.",
2393+
"severity": "MINOR",
2394+
"type": "CODE_SMELL",
2395+
"debt": {
2396+
"offset": "5min",
2397+
"function": "CONSTANT_ISSUE"
2398+
}
2399+
},
2400+
{
2401+
"key": "shorthand_optional_binding",
2402+
"name": "Shorthand Optional Binding",
2403+
"description": "Use shorthand syntax for optional binding",
2404+
"severity": "MINOR",
2405+
"type": "CODE_SMELL",
2406+
"debt": {
2407+
"offset": "5min",
2408+
"function": "CONSTANT_ISSUE"
2409+
}
23552410
}
23562411
]

0 commit comments

Comments
 (0)