Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Codable protocol #23

wants to merge 2 commits into from

Conversation

JagCesar
Copy link
Owner

Would it be nice to use the Codable protocol on our models instead? No idea. Let's find out :D

switch result {
case .failure(let error):
print(error)
XCTFail()

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

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

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

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

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

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

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

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

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)

}
}

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)

@JagCesar
Copy link
Owner Author

Good bot.

@westerlund
Copy link
Collaborator

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

@JagCesar
Copy link
Owner Author

@westerlund DAYUM! Yeah, will do that bro! :)

DispatchQueue.main.async {
completion(Result.success(vehicleStateResponse.response))
}
} catch (let error) {

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) {

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants