New Issue Checklist
Rule Request
The "idiomatically-correct" types of containers are ContainerType<ElementType[, ElementType...]>. While the Swift documentation states that the syntactic sugar versions are preferred, there are points in the code where the sugar versions do not work because the idiomatically-correct type is required (Array<Int>.Index is valid, [Int].Index is an error).
The existing rule for syntactic_sugar rule disallows these or simply doesn't check (on/off). There needs to be a new rule (that deprecates syntactic_sugar) that allows checking for idiomatically-correct, syntactic sugar, or off.
container_types **on** - type definitions of Array<Int> or Dictionary<String, Any> would pass, [Int] and [String: Any] would fail.
container_types **sugar** - type definitions of [Int] or [String: Any] would pass, Array<Int> and Dictionary<String, Any> would fail.
container_types **off** - type definitions of [Int], '[String: Any], Array, or Dictionary<String, Any>` would pass.
Default would be container_types sugar to match existing syntactic_sugar default of on. This would also require syntactic_sugar to be deprecated or mapped into this new rule as a synonym to 'sugar' or 'off'.
New Issue Checklist
Rule Request
The "idiomatically-correct" types of containers are ContainerType<ElementType[, ElementType...]>. While the Swift documentation states that the syntactic sugar versions are preferred, there are points in the code where the sugar versions do not work because the idiomatically-correct type is required (
Array<Int>.Indexis valid,[Int].Indexis an error).The existing rule for syntactic_sugar rule disallows these or simply doesn't check (on/off). There needs to be a new rule (that deprecates syntactic_sugar) that allows checking for idiomatically-correct, syntactic sugar, or off.
container_types **on**- type definitions ofArray<Int>orDictionary<String, Any>would pass,[Int]and[String: Any]would fail.container_types **sugar**- type definitions of[Int]or[String: Any]would pass,Array<Int>andDictionary<String, Any>would fail.container_types **off**- type definitions of[Int], '[String: Any],Array, orDictionary<String, Any>` would pass.Default would be
container_types sugarto match existingsyntactic_sugardefault ofon. This would also require syntactic_sugar to be deprecated or mapped into this new rule as a synonym to 'sugar' or 'off'.