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

Add legacy_multiple opt-in rule #2771

Merged
merged 1 commit into from
Jun 2, 2019
Merged

Add legacy_multiple opt-in rule #2771

merged 1 commit into from
Jun 2, 2019

Conversation

marcelofabri
Copy link
Collaborator

Fixes #2612

@SwiftLintBot
Copy link

SwiftLintBot commented May 26, 2019

18 Warnings
⚠️ This PR introduced a violation in Firefox: /Users/vsts/agent/2.150.3/work/1/s/osscheck/Firefox/Shared/Functions.swift:102:18: warning: Legacy Multiple Violation: Prefer using the isMultiple(of:) function instead of using the remainder operator (%). (legacy_multiple)
⚠️ This PR introduced a violation in Kickstarter: /Users/vsts/agent/2.150.3/work/1/s/osscheck/Kickstarter/Kickstarter-iOS/Views/Controllers/DebugPushNotificationsViewController.swift:25:68: warning: Legacy Multiple Violation: Prefer using the isMultiple(of:) function instead of using the remainder operator (%). (legacy_multiple)
⚠️ This PR introduced a violation in Realm: /Users/vsts/agent/2.150.3/work/1/s/osscheck/Realm/RealmSwift/Tests/PerformanceTests.swift:491:53: warning: Legacy Multiple Violation: Prefer using the isMultiple(of:) function instead of using the remainder operator (%). (legacy_multiple)
⚠️ This PR introduced a violation in Sourcery: /Users/vsts/agent/2.150.3/work/1/s/osscheck/Sourcery/SourceryRuntime/Sources/Extensions.swift:154:63: warning: Legacy Multiple Violation: Prefer using the isMultiple(of:) function instead of using the remainder operator (%). (legacy_multiple)
⚠️ This PR introduced a violation in Swift: /Users/vsts/agent/2.150.3/work/1/s/osscheck/Swift/stdlib/public/core/Diffing.swift:505:34: warning: Legacy Multiple Violation: Prefer using the isMultiple(of:) function instead of using the remainder operator (%). (legacy_multiple)
⚠️ This PR introduced a violation in Swift: /Users/vsts/agent/2.150.3/work/1/s/osscheck/Swift/stdlib/public/core/Diffing.swift:510:34: warning: Legacy Multiple Violation: Prefer using the isMultiple(of:) function instead of using the remainder operator (%). (legacy_multiple)
⚠️ This PR introduced a violation in Swift: /Users/vsts/agent/2.150.3/work/1/s/osscheck/Swift/stdlib/public/core/StringBreadcrumbs.swift:45:12: warning: Legacy Multiple Violation: Prefer using the isMultiple(of:) function instead of using the remainder operator (%). (legacy_multiple)
⚠️ This PR introduced a violation in Swift: /Users/vsts/agent/2.150.3/work/1/s/osscheck/Swift/stdlib/public/core/StringBreadcrumbs.swift:53:10: warning: Legacy Multiple Violation: Prefer using the isMultiple(of:) function instead of using the remainder operator (%). (legacy_multiple)
⚠️ This PR introduced a violation in Swift: /Users/vsts/agent/2.150.3/work/1/s/osscheck/Swift/stdlib/public/core/Integers.swift:3542:17: warning: Legacy Multiple Violation: Prefer using the isMultiple(of:) function instead of using the remainder operator (%). (legacy_multiple)
⚠️ This PR introduced a violation in Swift: /Users/vsts/agent/2.150.3/work/1/s/osscheck/Swift/stdlib/public/core/StringStorage.swift:345:27: warning: Legacy Multiple Violation: Prefer using the isMultiple(of:) function instead of using the remainder operator (%). (legacy_multiple)
⚠️ This PR introduced a violation in Swift: /Users/vsts/agent/2.150.3/work/1/s/osscheck/Swift/stdlib/public/core/StringStorage.swift:357:44: warning: Legacy Multiple Violation: Prefer using the isMultiple(of:) function instead of using the remainder operator (%). (legacy_multiple)
⚠️ This PR introduced a violation in Swift: /Users/vsts/agent/2.150.3/work/1/s/osscheck/Swift/stdlib/public/core/KeyPath.swift:147:43: warning: Legacy Multiple Violation: Prefer using the isMultiple(of:) function instead of using the remainder operator (%). (legacy_multiple)
⚠️ This PR introduced a violation in Swift: /Users/vsts/agent/2.150.3/work/1/s/osscheck/Swift/stdlib/public/Darwin/Foundation/Decimal.swift:378:28: warning: Legacy Multiple Violation: Prefer using the isMultiple(of:) function instead of using the remainder operator (%). (legacy_multiple)
⚠️ This PR introduced a violation in Swift: /Users/vsts/agent/2.150.3/work/1/s/osscheck/Swift/stdlib/private/StdlibCollectionUnittest/CheckMutableCollectionType.swift:72:44: warning: Legacy Multiple Violation: Prefer using the isMultiple(of:) function instead of using the remainder operator (%). (legacy_multiple)
⚠️ This PR introduced a violation in Swift: /Users/vsts/agent/2.150.3/work/1/s/osscheck/Swift/stdlib/private/StdlibCollectionUnittest/CheckMutableCollectionType.swift:73:44: warning: Legacy Multiple Violation: Prefer using the isMultiple(of:) function instead of using the remainder operator (%). (legacy_multiple)
⚠️ This PR introduced a violation in Swift: /Users/vsts/agent/2.150.3/work/1/s/osscheck/Swift/stdlib/private/StdlibCollectionUnittest/CheckMutableCollectionType.swift:74:44: warning: Legacy Multiple Violation: Prefer using the isMultiple(of:) function instead of using the remainder operator (%). (legacy_multiple)
⚠️ This PR introduced a violation in Swift: /Users/vsts/agent/2.150.3/work/1/s/osscheck/Swift/stdlib/private/StdlibCollectionUnittest/CheckSequenceType.swift:540:63: warning: Legacy Multiple Violation: Prefer using the isMultiple(of:) function instead of using the remainder operator (%). (legacy_multiple)
⚠️ This PR introduced a violation in Swift: /Users/vsts/agent/2.150.3/work/1/s/osscheck/Swift/stdlib/private/StdlibCollectionUnittest/CheckSequenceType.swift:554:51: warning: Legacy Multiple Violation: Prefer using the isMultiple(of:) function instead of using the remainder operator (%). (legacy_multiple)
12 Messages
📖 Linting Aerial with this PR took 3.68s vs 3.7s on master (0% faster)
📖 Linting Alamofire with this PR took 5.11s vs 5.07s on master (0% slower)
📖 Linting Firefox with this PR took 13.37s vs 13.43s on master (0% faster)
📖 Linting Kickstarter with this PR took 23.81s vs 24.11s on master (1% faster)
📖 Linting Moya with this PR took 2.61s vs 2.53s on master (3% slower)
📖 Linting Nimble with this PR took 2.25s vs 2.22s on master (1% slower)
📖 Linting Quick with this PR took 0.8s vs 0.81s on master (1% faster)
📖 Linting Realm with this PR took 3.85s vs 3.84s on master (0% slower)
📖 Linting SourceKitten with this PR took 1.49s vs 1.52s on master (1% faster)
📖 Linting Sourcery with this PR took 4.83s vs 4.87s on master (0% faster)
📖 Linting Swift with this PR took 37.38s vs 37.5s on master (0% faster)
📖 Linting WordPress with this PR took 30.09s vs 30.06s on master (0% slower)

Generated by 🚫 Danger

// MARK: - Rule

public func validate(file: File) -> [StyleViolation] {
let pattern = "(?!\\b\\s*)%\(RegexHelpers.variableOrNumber)==\\s*0\\b"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wonder if this should also catch != 0 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably could, yeah.

@marcelofabri marcelofabri merged commit 6be5bf7 into realm:master Jun 2, 2019
@marcelofabri marcelofabri deleted the marcelo/legacy-multiple branch June 2, 2019 05: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.

Rule Request: Legacy Multiple
3 participants