Skip to content

Codable protocol - #23

Open
JagCesar wants to merge 2 commits into
masterfrom
codable-models
Open

Codable protocol#23
JagCesar wants to merge 2 commits into
masterfrom
codable-models

Conversation

@JagCesar

Copy link
Copy Markdown
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()

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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)

Comment threadSource/Models/Vehicle.swift Outdated
// case state
}
}

Copy link
Copy Markdown

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
Copy Markdown
OwnerAuthor

Good bot.

@westerlund

Copy link
Copy Markdown
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
Copy Markdown
OwnerAuthor

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

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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 freeto 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

@JagCesar@westerlund@houndci-bot