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

project: use swiftlint and fix triggered warnings #129

Merged
merged 6 commits into from
Sep 3, 2017

Conversation

r-mckay
Copy link
Contributor

@r-mckay r-mckay commented Sep 1, 2017

Hello!

This commit uses SwiftLint and fixes the warnings that were risen by the analysis. It uses the .swiftlint.yml file that was already available in the project.

Thank you!

@@ -26,7 +26,7 @@ open class LightboxImage {
imageView.image = image
completion?(image)
} else if let imageURL = imageURL {
LightboxConfig.loadImage(imageView, imageURL) { [weak self] error, image in
LightboxConfig.loadImage(imageView, imageURL) { [weak self] _, image in
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to draw your attention to the error variable here.
I wanted to do something with it, such as printing it or processing it, but I lack of any relevant ideas. Can we do something about it or is it okay to ignore it in this scope?
Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error should probably be passed to the completion so that the user has the chance of knowing what went wrong with loading the remote image.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can open an issue to improve the completion of addImageTo completion. It feels beyond scope for this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel the same about the outOfScope exception.
I'll open this issue for enhancement soon.
Thanks for your feedback.

@@ -212,9 +212,9 @@ open class LightboxController: UIViewController {
override open func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)

coordinator.animate(alongsideTransition: { (UIViewControllerTransitionCoordinatorContext) -> Void in
coordinator.animate(alongsideTransition: { (_) -> Void in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can replace (_) -> Void in with _ in.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@zenangst
Copy link
Contributor

zenangst commented Sep 1, 2017

@r-mckay nice maintenance PR!, could you have a look at the comment that I made in LightboxController. Other than that it looks good to me :)

This commit adds a build phase to the project to run SwiftLint. This new
phase follows the implementation made in the ImagePicker project [1].

This commit does not try to handle the eventual warning that could be
raised by the static code analysis.

[1] https://github.com/hyperoslo/ImagePicker
This commit solves the SwiftLint warning concerning the trailing spaces.
This commit aligns parameters in a call to fix a SwiftLint warning.
This commit takes care of fixing a SwiftLint Colon Violation in a file.
This commit fixes a SwiftLint Option Redondant Initialization warning in
a file.
This commit fixes several warnings concerning unused closure parameters.
@r-mckay r-mckay force-pushed the feature/useSwiftLint branch from c40a216 to f0825e0 Compare September 2, 2017 16:27
@r-mckay
Copy link
Contributor Author

r-mckay commented Sep 2, 2017

@zenangst Thank you for your review, the PR is now updated.

@zenangst
Copy link
Contributor

zenangst commented Sep 3, 2017

@r-mckay awesome, thank you so much for the PR. Keep rockin!

@zenangst zenangst merged commit ec1200f into hyperoslo:master Sep 3, 2017
@r-mckay r-mckay deleted the feature/useSwiftLint branch September 4, 2017 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants