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

Build is failing due to SwiftLint rule 'shorthand_operator' #412

Open
mmysliwiec opened this issue Aug 27, 2021 · 0 comments
Open

Build is failing due to SwiftLint rule 'shorthand_operator' #412

mmysliwiec opened this issue Aug 27, 2021 · 0 comments

Comments

@mmysliwiec
Copy link

The latest version 7.0.0 is failing to build with Carthage due to SwiftLint 0.43.1 rule 'shorthand_operator'. File SKZoomingScrollView.swift at line 154 have this code:

maxScale = maxScale / scale

And it's causing the SwiftLint to generate error:
Shorthand Operator Violation: Prefer shorthand operators (+=, -=, *=, /=) over doing the operation and assigning. (shorthand_operator)

I can see three possible solutions:

  1. Fix the source code to maxScale /= scale (I've tested it and this fix the issue)
  2. Add comment to remove this particular rule for this line // swiftlint:disable:next shorthand_operator
  3. Exclude the shorthand_operator rule with .swiftlint.yml configuration file.

Which one do you prefer? I can make a PR for any of proposed solutions.

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

No branches or pull requests

1 participant