Swift

Swift

Made by DeepSource

Generic type name should only contain alphanumeric characters, start with an uppercase character and span between 1 and 20 characters in length SW-C1002

Style
Minor

Generic type names should adhere to a specific naming convention in Swift. The name should only contain alphanumeric characters, start with an uppercase character, and span between 1 and 20 characters in length. This is important because it helps ensure consistency and clarity in code readability.

If a generic type name violates these conventions, it can make the code harder to read and understand. It can also be a source of confusion for other developers working on the project.

To fix this issue, choose a name that adheres to the naming conventions mentioned above. Here are some examples:

Bad Practice

struct my_generic_type<T: Equatable> {
    // ...
}

Recommended

struct MyGenericType<T: Equatable> {
    // ...
}