From 24fd208d5b9d52db40c601802813d977fc6a6215 Mon Sep 17 00:00:00 2001 From: Merrick Sapsford Date: Sat, 9 Feb 2019 14:23:24 +0100 Subject: [PATCH 1/2] Add Swiftlint config file to Danger --- Dangerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dangerfile b/Dangerfile index f9b252e6..763ce104 100644 --- a/Dangerfile +++ b/Dangerfile @@ -16,4 +16,5 @@ if (has_source_changes && ! has_tests_changes) warn("Looks like you changed some source files, should there have been some tests added?") end +swiftlint.config_file = 'Sources/.swiftlint.yml' swiftlint.lint_files \ No newline at end of file From 5fcac4f62cb716db1be38d479386166669a45454 Mon Sep 17 00:00:00 2001 From: Merrick Sapsford Date: Sat, 9 Feb 2019 14:29:32 +0100 Subject: [PATCH 2/2] Fix linter errors --- .../Pageboy/PageboyViewController+Management.swift | 14 +++++++------- .../Pageboy/PageboyViewController+Updating.swift | 3 ++- Sources/Pageboy/PageboyViewController.swift | 2 ++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Sources/Pageboy/PageboyViewController+Management.swift b/Sources/Pageboy/PageboyViewController+Management.swift index e59c7034..5ceb09de 100644 --- a/Sources/Pageboy/PageboyViewController+Management.swift +++ b/Sources/Pageboy/PageboyViewController+Management.swift @@ -105,13 +105,13 @@ internal extension PageboyViewController { } private func _updateViewControllers(to viewControllers: [UIViewController], - from fromIndex: PageIndex = 0, - to toIndex: PageIndex = 0, - direction: NavigationDirection = .forward, - animated: Bool, - async: Bool, - force: Bool, - completion: TransitionOperation.Completion?) { + from fromIndex: PageIndex = 0, + to toIndex: PageIndex = 0, + direction: NavigationDirection = .forward, + animated: Bool, + async: Bool, + force: Bool, + completion: TransitionOperation.Completion?) { assert(Thread.isMainThread) diff --git a/Sources/Pageboy/PageboyViewController+Updating.swift b/Sources/Pageboy/PageboyViewController+Updating.swift index 5a8ca42a..38f6af39 100644 --- a/Sources/Pageboy/PageboyViewController+Updating.swift +++ b/Sources/Pageboy/PageboyViewController+Updating.swift @@ -80,7 +80,8 @@ extension PageboyViewController { case .scrollTo(let index): scrollToPage(.at(index: index), animated: true) - default: break + default: + break } } diff --git a/Sources/Pageboy/PageboyViewController.swift b/Sources/Pageboy/PageboyViewController.swift index bda006f4..d60a6605 100644 --- a/Sources/Pageboy/PageboyViewController.swift +++ b/Sources/Pageboy/PageboyViewController.swift @@ -323,6 +323,8 @@ public extension PageboyViewController { } } + //swiftlint:disable function_body_length + /// Scroll the page view controller to a new page. /// /// - parameter page: The index of the new page.