-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Codable protocol #23
base: master
Are you sure you want to change the base?
Codable protocol #23
Conversation
switch result { | ||
case .failure(let error): | ||
print(error) | ||
XCTFail() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XCTFail Message Violation: An XCTFail call should include a description of the assertion. (xctfail_message)
WebRequest.request( | ||
path: path, | ||
method: method, | ||
accessToken: accessToken) { data, error in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused Closure Parameter Violation: Unused parameter "data" in a closure should be replaced with _. (unused_closure_parameter)
Unused Closure Parameter Violation: Unused parameter "error" in a closure should be replaced with _. (unused_closure_parameter)
case centerDisplayState = "center_display_state" | ||
case apiVersion = "api_version" | ||
case remoteStart = "remote_start" | ||
case ft |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Enum element name should be between 3 and 40 characters long: 'ft' (identifier_name)
case rearSeatHeaters = "rear_seat_heaters" | ||
case valetMode = "valet_mode" | ||
case calendarSupported = "calendar_supported" | ||
case dr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Enum element name should be between 3 and 40 characters long: 'dr' (identifier_name)
case homelinkNearby = "homelink_nearby" | ||
case valetPinNeeded = "valet_pin_needed" | ||
case notificationsSupported = "notifications_supported" | ||
case pr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Enum element name should be between 3 and 40 characters long: 'pr' (identifier_name)
let homelinkNearby: Double | ||
let valetPinNeeded: Double | ||
let notificationsSupported: Double | ||
let pr: Double |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'pr' (identifier_name)
let carType: String | ||
let remoteStartSupported: Double | ||
let hasSpoiler: Double | ||
let pf: Double |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'pf' (identifier_name)
let rt: Double | ||
let carVersion: String | ||
let rearSeatType: Double | ||
let df: Double |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'df' (identifier_name)
public struct VehicleState: Codable { | ||
let parsedCalendarSupported: Double | ||
let spoilerType: String | ||
let rt: Double |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'rt' (identifier_name)
Source/Models/Vehicle.swift
Outdated
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Newline Violation: Files should have a single trailing newline. (trailing_newline)
Good bot. |
Hey man! Awesome repo! Keep up the good work! Just a thought, you should really wait for the new awesome features in codoable of Swift 4.1 before continuing with this. It'll for instance have native support for snake_case unwrapping! Source: https://www.hackingwithswift.com/articles/50/whats-new-in-swift-4-1 |
@westerlund DAYUM! Yeah, will do that bro! :) |
DispatchQueue.main.async { | ||
completion(Result.success(vehicleStateResponse.response)) | ||
} | ||
} catch (let error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Control Statement Violation: if,for,while,do,catch statements shouldn't wrap their conditionals or arguments in parentheses. (control_statement)
DispatchQueue.main.async { | ||
completion(Result.success(vehicleStateResponse.response)) | ||
} | ||
} catch (let error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Control Statement Violation: if,for,while,do,catch statements shouldn't wrap their conditionals or arguments in parentheses. (control_statement)
Would it be nice to use the Codable protocol on our models instead? No idea. Let's find out :D