Skip to content

Commit

Permalink
Fix swiftlint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Clstroud committed Mar 26, 2021
1 parent 5400ff4 commit a5080c8
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 13 deletions.
1 change: 0 additions & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ excluded:
- Carthage
- Pods
- SwiftLint/Common/3rdPartyLib
force_cast: warning
line_length:
warning: 250
error: 300
Expand Down
2 changes: 1 addition & 1 deletion Vocable/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
get {
gazeableWindow
}
//swiftlint:disable unused_setter_value
// swiftlint:disable unused_setter_value
set {

}
Expand Down
2 changes: 1 addition & 1 deletion Vocable/Common/ToastContainerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ToastContainerViewController: UIViewController {
}
}

//In the future we should get away from manipulating the window here.
// In the future we should get away from manipulating the window here.
func handlePhraseSaved(toastLabelText: String) {
if phraseSavedView == nil {
let phraseSavedView = UINib(nibName: "ToastView", bundle: .main).instantiate(withOwner: nil, options: nil).first as! ToastView
Expand Down
2 changes: 1 addition & 1 deletion Vocable/Extensions/Array+Split.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extension Collection {
return indices.contains(index) ? self[index] : nil
}

func dropNils<T>() -> [T] where Element == Optional<T> {
func dropNils<T>() -> [T] where Element == T? {
return self.compactMap({$0})
}
}
2 changes: 1 addition & 1 deletion Vocable/Extensions/VectorUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ extension SCNVector3 {
}

func angleToReach(_ vectorB: SCNVector3) -> SCNFloat {
//cos(angle) = (A.B)/(|A||B|)
// cos(angle) = (A.B)/(|A||B|)
let cosineAngle = (dot(vector: vectorB) / (magnitude * vectorB.magnitude))
return SCNFloat(acos(cosineAngle))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ final class EditCategoriesViewController: PagingCarouselViewController, NSFetche
return .none
}

//Check if the cell below the current one is hidden, disable down button if needed.
// Check if the cell below the current one is hidden, disable down button if needed.
if indexPath.row + 1 < fetchResultsController.fetchedObjects?.count ?? 0 {
let nextIndex = IndexPath(row: indexPath.row + 1, section: indexPath.section)
if fetchResultsController.object(at: nextIndex).isHidden {
Expand Down
3 changes: 0 additions & 3 deletions Vocable/Features/Voice/ListeningResponseViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ final class ListeningResponseViewController: VocableViewController {
private let synthesizedSpeechQueue = DispatchQueue(label: "speech_synthesis_queue", qos: .userInitiated)
let classifier = VLClassifier()

private let feelingsResponses = ["Okay", "Good", "Bad"]
private let prefixes = ["Would you like", "Do you want"]

@PublishedValue private(set) var lastUtterance: String?

private var content: Content = .empty(.listeningResponse)
Expand Down
2 changes: 1 addition & 1 deletion Vocable/HeadTracking/HeadGazeTrackingInterpolator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class HeadGazeTrackingInterpolator {
let scale = getFaceScale()
let mtx = getFaceTransformationMatrix()
var (c0, c1, c2, c3) = mtx.columns
c3 = simd_float4(0, 0, 0, 1) //zero out translation components
c3 = simd_float4(0, 0, 0, 1) // zero out translation components
c0 /= scale[0]
c1 /= scale[1]
c2 /= scale[2]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class TunningView: UIView {
@objc func buttonPressed() {
switch visibilityState {
case .fullyVisible:
visibilityState = .notVisible//.graphOnly
visibilityState = .notVisible // .graphOnly
case .graphOnly:
visibilityState = .notVisible
case .notVisible:
Expand Down
4 changes: 2 additions & 2 deletions Vocable/HeadTracking/UIHeadGaze.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class UIHeadGaze: UITouch {

private weak var _window: UIWindow?
private let _receiver: UIView
private let _position: CGPoint //NDC coordinates [0,1] x [0,1], origin is lower left corner of the screen
private let _previousPosition: CGPoint //NDC coordinates [0,1] x [0,1], origin is lower left corner of the screen
private let _position: CGPoint // NDC coordinates [0,1] x [0,1], origin is lower left corner of the screen
private let _previousPosition: CGPoint // NDC coordinates [0,1] x [0,1], origin is lower left corner of the screen

/**
The time when the event occurred
Expand Down

0 comments on commit a5080c8

Please sign in to comment.