Search code examples
swiftalamofire

Swift Alamofire building error Identifier Name Violation


Trying to build Alamofire, but get a error Identifier Name Violation: Variable name should start with a lowercase character: 'W' (identifier_name) in this function

var readableDescription: String {
        let W = isCellular ? "W" : "-"
        let R = isReachable ? "R" : "-"
        let c = isConnectionRequired ? "c" : "-"
        let t = contains(.transientConnection) ? "t" : "-"
        let i = contains(.interventionRequired) ? "i" : "-"
        let C = contains(.connectionOnTraffic) ? "C" : "-"
        let D = contains(.connectionOnDemand) ? "D" : "-"
        let l = contains(.isLocalAddress) ? "l" : "-"
        let d = contains(.isDirect) ? "d" : "-"
        let a = contains(.connectionAutomatic) ? "a" : "-"

        return "\(W)\(R) \(c)\(t)\(i)\(C)\(D)\(l)\(d)\(a)"
    }

and few this error Type Name Violation: Type name should only contain alphanumeric characters: '_URLEncodedFormEncoder' (type_name) in name final class _URLEncodedFormEncoder

maybe i something disable in project ? before i didnt saw this errors


Solution

  • You usually want to ignore your dependencies in your formatting and listing tools. To do so for SwiftLint, add your dependency directory to your SwiftLint excluded list. For example, if you're using CocoaPods:

    excluded: # paths to ignore during linting. Takes precedence over `included`.
       - Pods