Kinvey/swift-sdk

View on GitHub
Kinvey/KinveyAppUITests/KinveyAppUITests.swift

Summary

Maintainability
D
2 days
Test Coverage

Function testMICLoginSafariAuthenticationSession has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    func testMICLoginSafariAuthenticationSession() {
        let app = XCUIApplication()
        let kid = "_kid_"
        let port: in_port_t = 8080
        app.launchEnvironment = [
Severity: Major
Found in Kinvey/KinveyAppUITests/KinveyAppUITests.swift - About 3 hrs to fix

    Function testMICLoginWKWebView has 74 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        func testMICLoginWKWebView() {
            let app = XCUIApplication()
            let kid = "_kid_"
            let port: in_port_t = 8080
            app.launchEnvironment = [
    Severity: Major
    Found in Kinvey/KinveyAppUITests/KinveyAppUITests.swift - About 2 hrs to fix

      Avoid too many return statements within this function.
      Open

                  return .notFound
      Severity: Major
      Found in Kinvey/KinveyAppUITests/KinveyAppUITests.swift - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                        return true
        Severity: Major
        Found in Kinvey/KinveyAppUITests/KinveyAppUITests.swift - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return .ok(.json(json as AnyObject))
          Severity: Major
          Found in Kinvey/KinveyAppUITests/KinveyAppUITests.swift - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return true
            Severity: Major
            Found in Kinvey/KinveyAppUITests/KinveyAppUITests.swift - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                              return .ok(.json(json as AnyObject))
              Severity: Major
              Found in Kinvey/KinveyAppUITests/KinveyAppUITests.swift - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                return .notFound
                Severity: Major
                Found in Kinvey/KinveyAppUITests/KinveyAppUITests.swift - About 30 mins to fix

                  Function testMICLoginSafariAuthenticationSession has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      func testMICLoginSafariAuthenticationSession() {
                          let app = XCUIApplication()
                          let kid = "_kid_"
                          let port: in_port_t = 8080
                          app.launchEnvironment = [
                  Severity: Minor
                  Found in Kinvey/KinveyAppUITests/KinveyAppUITests.swift - About 25 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                              server["/:v/oauth/token"] = { request in
                                  XCTAssertEqual(request.params[":v"], "v3")
                                  if let (_, _code) = request.parseUrlencodedForm().filter({ key, value in key == "code" }).first, code == _code {
                                      return .ok(.json([
                                          "access_token" : UUID().uuidString,
                  Severity: Major
                  Found in Kinvey/KinveyAppUITests/KinveyAppUITests.swift and 1 other location - About 2 hrs to fix
                  Kinvey/KinveyAppUITests/KinveyAppUITests.swift on lines 189..200

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 133.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                          server["/:v/oauth/token"] = { request in
                              XCTAssertEqual(request.params[":v"], "v3")
                              if let (_, _code) = request.parseUrlencodedForm().filter({ key, value in key == "code" }).first, code == _code {
                                  return .ok(.json([
                                      "access_token" : UUID().uuidString,
                  Severity: Major
                  Found in Kinvey/KinveyAppUITests/KinveyAppUITests.swift and 1 other location - About 2 hrs to fix
                  Kinvey/KinveyAppUITests/KinveyAppUITests.swift on lines 94..105

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 133.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                          server["/:v/oauth/auth"] = { request in
                              XCTAssertEqual(request.params[":v"], "v3")
                              if let (_, redirectUri) = request.queryParams.filter({ key, value in key == "redirect_uri" }).first {
                                  return HttpResponse.raw(302, "Found", ["Location" : "\(redirectUri)?code=\(code)"], { bodyWriter in
                                      try! bodyWriter.write("Redirecting...".data(using: .utf8)!)
                  Severity: Major
                  Found in Kinvey/KinveyAppUITests/KinveyAppUITests.swift and 1 other location - About 1 hr to fix
                  Kinvey/KinveyAppUITests/KinveyAppUITests.swift on lines 85..93

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 125.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                              server["/:v/oauth/auth"] = { request in
                                  XCTAssertEqual(request.params[":v"], "v3")
                                  if let (_, redirectUri) = request.queryParams.filter({ key, value in key == "redirect_uri" }).first {
                                      return HttpResponse.raw(302, "Found", ["Location" : "\(redirectUri)?code=\(code)"], { bodyWriter in
                                          try! bodyWriter.write("Redirecting...".data(using: .utf8)!)
                  Severity: Major
                  Found in Kinvey/KinveyAppUITests/KinveyAppUITests.swift and 1 other location - About 1 hr to fix
                  Kinvey/KinveyAppUITests/KinveyAppUITests.swift on lines 180..188

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 125.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                          let json = [
                              "_id" : userId,
                              "username" : UUID().uuidString,
                              "_kmd" : [
                                  "lmt" : "2017-09-05T16:48:35.667Z",
                  Severity: Major
                  Found in Kinvey/KinveyAppUITests/KinveyAppUITests.swift and 1 other location - About 1 hr to fix
                  Kinvey/KinveyAppUITests/KinveyAppUITests.swift on lines 166..177

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 72.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                          let json = [
                              "_id" : userId,
                              "username" : UUID().uuidString,
                              "_kmd" : [
                                  "lmt" : "2017-09-05T16:48:35.667Z",
                  Severity: Major
                  Found in Kinvey/KinveyAppUITests/KinveyAppUITests.swift and 1 other location - About 1 hr to fix
                  Kinvey/KinveyAppUITests/KinveyAppUITests.swift on lines 70..81

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 72.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                              server.post["/user/:kid/login"] = { request in
                                  XCTAssertEqual(request.params[":kid"], kid)
                                  return .ok(.json(json as AnyObject))
                              }
                  Severity: Minor
                  Found in Kinvey/KinveyAppUITests/KinveyAppUITests.swift and 1 other location - About 45 mins to fix
                  Kinvey/KinveyAppUITests/KinveyAppUITests.swift on lines 201..204

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 56.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                          server.post["/user/:kid/login"] = { request in
                              XCTAssertEqual(request.params[":kid"], kid)
                              return .ok(.json(json as AnyObject))
                          }
                  Severity: Minor
                  Found in Kinvey/KinveyAppUITests/KinveyAppUITests.swift and 1 other location - About 45 mins to fix
                  Kinvey/KinveyAppUITests/KinveyAppUITests.swift on lines 106..109

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 56.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          XCTContext.runActivity(named: "Tap SFAuthenticationSession switcher") { activity in
                              app.switches["SFAuthenticationSession"].tap()
                              activity.add(XCTAttachment(screenshot: app.screenshot()))
                          }
                  Severity: Minor
                  Found in Kinvey/KinveyAppUITests/KinveyAppUITests.swift and 1 other location - About 35 mins to fix
                  Kinvey/KinveyAppUITests/KinveyAppUITests.swift on lines 58..61

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 47.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          XCTContext.runActivity(named: "Open MIC Login") { activity in
                              app.staticTexts["MIC Login"].tap()
                              activity.add(XCTAttachment(screenshot: app.screenshot()))
                          }
                  Severity: Minor
                  Found in Kinvey/KinveyAppUITests/KinveyAppUITests.swift and 1 other location - About 35 mins to fix
                  Kinvey/KinveyAppUITests/KinveyAppUITests.swift on lines 63..66

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 47.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Colon at column 24 should have no spaces before it
                  Open

                              "username" : UUID().uuidString,

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Colon at column 20 should have no spaces before it
                  Open

                              "_kmd" : [

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Constant should be lowerCamelCase
                  Open

                                  if let (_, _code) = request.parseUrlencodedForm().filter({ key, value in key == "code" }).first, code == _code {

                  constant-naming

                  Global constants should follow either UpperCamelCase or lowerCamelCase naming conventions. Local constants should follow lowerCamelCase naming conventions.

                  Preferred

                  let MaxHeight = 42
                  let maxHeight = 42

                  Not Preferred

                  let max_height = 42

                  Colon at column 41 should have no spaces before it
                  Open

                                          "refresh_token" : UUID().uuidString

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Colon at column 35 should have no spaces before it
                  Open

                              "KINVEY_MIC_AUTH_URL" : "http://localhost:\(port)",

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Colon at column 20 should have no spaces before it
                  Open

                              "_kmd" : [

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Line should not have any trailing whitespace
                  Open

                      

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Colon at column 29 should have no spaces before it
                  Open

                                  "authtoken" : UUID().uuidString

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Colon at column 20 should have no spaces before it
                  Open

                              "_acl" : [

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Line should not have any trailing whitespace
                  Open

                          

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Line should not have any trailing whitespace
                  Open

                          

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Colon at column 23 should have no spaces before it
                  Open

                                  "lmt" : "2017-09-05T16:48:35.667Z",

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Line should not have any trailing whitespace
                  Open

                          

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Colon at column 29 should have no spaces before it
                  Open

                                  "authtoken" : UUID().uuidString

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Line should not have any trailing whitespace
                  Open

                          

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Line should not have any trailing whitespace
                  Open

                          

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Colon at column 27 should have no spaces before it
                  Open

                                  "creator" : UUID().uuidString

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Line should not have any trailing whitespace
                  Open

                          

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Colon at column 23 should have no spaces before it
                  Open

                                  "ect" : "2017-09-05T16:48:35.667Z",

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Line should not have any trailing whitespace
                  Open

                          

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Colon at column 20 should have no spaces before it
                  Open

                              "_acl" : [

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Line should not have any trailing whitespace
                  Open

                              

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Line should not have any trailing whitespace
                  Open

                      

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Colon at column 27 should have no spaces before it
                  Open

                                  "creator" : UUID().uuidString

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Colon at column 34 should have no spaces before it
                  Open

                              "KINVEY_MIC_APP_KEY" : kid,

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Colon at column 34 should have no spaces before it
                  Open

                              "KINVEY_MIC_API_URL" : "http://localhost:\(port)",

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Line should not have any trailing whitespace
                  Open

                          

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Line should not have any trailing whitespace
                  Open

                          

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Line should not have any trailing whitespace
                  Open

                          

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Line should not have any trailing whitespace
                  Open

                          

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Line should not have any trailing whitespace
                  Open

                              

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Closure is the function's final argument and may be passed as a trailing closure instead
                  Open

                                  return HttpResponse.raw(302, "Found", ["Location" : "\(redirectUri)?code=\(code)"], { bodyWriter in

                  trailing-closure

                  Closures that are the last argument of a function should be passed into the function using trailing closure syntax.

                  Preferred

                  reversed = names.sort { s1, s2 in return s1 > s2 }

                  Not Preferred

                  reversed = names.sort({ s1, s2 in return s1 > s2 })

                  Line should not have any trailing whitespace
                  Open

                              

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Colon at column 37 should have no spaces before it
                  Open

                                      "refresh_token" : UUID().uuidString

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Colon at column 34 should have no spaces before it
                  Open

                                      "token_type" : "Bearer",

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Line should not have any trailing whitespace
                  Open

                          

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Colon at column 36 should have no spaces before it
                  Open

                                      "access_token" : UUID().uuidString,

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Colon at column 37 should have no spaces before it
                  Open

                              "KINVEY_MIC_APP_SECRET" : "_secret_",

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Colon at column 34 should have no spaces before it
                  Open

                              "KINVEY_MIC_API_URL" : "http://localhost:\(port)",

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Constant should be lowerCamelCase
                  Open

                              if let (_, _code) = request.parseUrlencodedForm().filter({ key, value in key == "code" }).first, code == _code {

                  constant-naming

                  Global constants should follow either UpperCamelCase or lowerCamelCase naming conventions. Local constants should follow lowerCamelCase naming conventions.

                  Preferred

                  let MaxHeight = 42
                  let maxHeight = 42

                  Not Preferred

                  let max_height = 42

                  Colon at column 40 should have no spaces before it
                  Open

                                          "access_token" : UUID().uuidString,

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Colon at column 22 should have no spaces before it
                  Open

                          ] as [String : Any]

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Line should not have any trailing whitespace
                  Open

                          

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Colon at column 38 should have no spaces before it
                  Open

                                          "token_type" : "Bearer",

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Line should not have any trailing whitespace
                  Open

                              

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Line should not have any trailing whitespace
                  Open

                          

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Line should not have any trailing whitespace
                  Open

                          

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Colon at column 37 should have no spaces before it
                  Open

                              "KINVEY_MIC_APP_SECRET" : "_secret_",

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Colon at column 23 should have no spaces before it
                  Open

                                  "ect" : "2017-09-05T16:48:35.667Z",

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Colon at column 22 should have no spaces before it
                  Open

                          ] as [String : Any]

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Colon at column 19 should have no spaces before it
                  Open

                              "_id" : userId,

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Colon at column 19 should have no spaces before it
                  Open

                              "_id" : userId,

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Colon at column 67 should have no spaces before it
                  Open

                                  return HttpResponse.raw(302, "Found", ["Location" : "\(redirectUri)?code=\(code)"], { bodyWriter in

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Line should not have any trailing whitespace
                  Open

                          

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Colon at column 34 should have no spaces before it
                  Open

                              "KINVEY_MIC_APP_KEY" : kid,

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Colon at column 38 should have no spaces before it
                  Open

                                          "expires_in" : 3599,

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Line should not have any trailing whitespace
                  Open

                      

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Line should not have any trailing whitespace
                  Open

                          

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Line should not have any trailing whitespace
                  Open

                      

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Line should not have any trailing whitespace
                  Open

                      

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Line should not have any trailing whitespace
                  Open

                          

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Colon at column 71 should have no spaces before it
                  Open

                                      return HttpResponse.raw(302, "Found", ["Location" : "\(redirectUri)?code=\(code)"], { bodyWriter in

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Closure is the function's final argument and may be passed as a trailing closure instead
                  Open

                                      return HttpResponse.raw(302, "Found", ["Location" : "\(redirectUri)?code=\(code)"], { bodyWriter in

                  trailing-closure

                  Closures that are the last argument of a function should be passed into the function using trailing closure syntax.

                  Preferred

                  reversed = names.sort { s1, s2 in return s1 > s2 }

                  Not Preferred

                  reversed = names.sort({ s1, s2 in return s1 > s2 })

                  Colon at column 35 should have no spaces before it
                  Open

                              "KINVEY_MIC_AUTH_URL" : "http://localhost:\(port)",

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Colon at column 24 should have no spaces before it
                  Open

                              "username" : UUID().uuidString,

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Line should not have any trailing whitespace
                  Open

                          

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  Colon at column 23 should have no spaces before it
                  Open

                                  "lmt" : "2017-09-05T16:48:35.667Z",

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Colon at column 34 should have no spaces before it
                  Open

                                      "expires_in" : 3599,

                  colon-whitespace

                  There should be no whitespace preceding the colon, exactly one whitespace after the colon for: * var, class, struct, protocol, extension, func, and tuple declarations * dict literals and types * case statements

                  However, for conditional expressions there should be a single whitespace before and after the colon.

                  Variable declarations

                  Preferred

                  var x: Int = 2

                  Not Preferred

                  var x : Int
                  var y:   String

                  Dictionary literals and types

                  Preferred

                  var x = [ 'key1': 1, 'key2': 2 ]
                  var y: [ Int: String ]

                  Not Preferred

                  var x = [ 'key1' : 1, 'key2':  3]
                  var y: [ Int :    String ]

                  Case statements

                  Preferred

                  switch character {
                  case "a": doSomething(a);
                  default: alert();
                  }

                  Not Preferred

                  switch character {
                  case "a" : doSomething(a);
                  default:     alert();
                  }

                  Class, Struct, Protocol, and Extension declarations

                  Preferred

                  class ClassName: BaseClass {
                  }
                  
                  struct StructName: BaseStruct {
                  }
                  
                  protocol ProtocolName: AnotherProtocol {
                  }
                  
                  extension TypeName: ProtocolName {
                  }

                  Not Preferred

                  class ClassName : BaseClass {
                  }
                  
                  struct StructName:  BaseStruct {
                  }
                  
                  protocol ProtocolName:AnotherProtocol {
                  }
                  
                  extension TypeName : ProtocolName {
                  }

                  Tuple declarations

                  Preferred

                  var y = (key: 1, value: 2)

                  Not Preferred

                  var y = (key:1, value : 2)

                  Function declarations

                  Preferred

                  func someFunction<t: someclass u: someprotocol>(someT: T, someU: U) {
                  }</t:>

                  Not Preferred

                  func someFunction<t : someclass u:someprotocol>(someT: T, someU: U) {
                  }</t>

                  Conditional expressions

                  Preferred

                  var x = condition ? a : b

                  Not Preferred

                  var x = condition ? a: b
                  var x = condition ? a   : b

                  Line should not have any trailing whitespace
                  Open

                      

                  trailing-whitespace

                  Flag whitespace after the last non-whitespace character on each line until the newline.

                  Preferred

                  let number = 42¬

                  Not Preferred

                  let number = 42••¬

                  There are no issues that match your filters.

                  Category
                  Status