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

Make for_where independent of order in structure dictionary #3979

Merged
merged 1 commit into from
Jun 14, 2022

Conversation

SimplyDanny
Copy link
Collaborator

The order of elements in the dictionaries changed from Xcode 13.2.1 to 13.3.1. The implementation should not rely on a fixed order.

This fixes one of the findings in #3975.

@SwiftLintBot
Copy link

SwiftLintBot commented May 15, 2022

77 Warnings
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/ManifestLoader.swift:956:25: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/VideoList.swift:330:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/VideoList.swift:370:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/DisplayView.swift:249:17: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /Client/Frontend/Browser/Punycode.swift:178:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /Client/Frontend/Browser/Punycode.swift:190:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /Client/Frontend/Browser/SearchViewController.swift:426:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /Client/Frontend/Browser/Tab.swift:767:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /Client/Frontend/Library/DownloadsPanel.swift:337:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /Client/Frontend/Library/HistoryPanel/HistoryPanel.swift:297:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /Client/Frontend/Library/ReaderPanel.swift:132:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /Shared/Extensions/ArrayExtensions.swift:23:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /Shared/Extensions/ArrayExtensions.swift:32:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /Shared/Extensions/ArrayExtensions.swift:74:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /Shared/Functions.swift:208:9: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /Shared/NSUserDefaultsPrefs.swift:131:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /SharedTests/FeatureSwitchTests.swift:17:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /Storage/SQL/BrowserSchema.swift:177:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /Storage/SQL/BrowserSchema.swift:186:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /Storage/SQL/ReadingListSchema.swift:76:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /StorageTests/TestSQLiteHistory.swift:69:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /Sync/State.swift:256:21: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /Sync/State.swift:261:21: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /Sync/State.swift:269:21: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /Sync/State.swift:274:21: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /content-blocker-lib-ios/src/ContentBlocker.swift:258:17: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /content-blocker-lib-ios/src/TrackingProtectionPageStats.swift:201:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /content-blocker-lib-ios/src/TrackingProtectionPageStats.swift:204:21: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Firefox: /content-blocker-lib-ios/src/TrackingProtectionPageStats.swift:212:25: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Kickstarter: /Kickstarter-iOS/DataSources/ProjectPageViewControllerDataSource.swift:281:11: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Kickstarter: /Kickstarter-iOS/DataSources/ProjectPageViewControllerDataSource.swift:306:11: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Kickstarter: /Kickstarter-iOS/DataSources/ProjectPageViewControllerDataSource.swift:355:7: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Nimble: /Sources/Nimble/Matchers/BeCloseTo.swift:114:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Nimble: /Sources/Nimble/Matchers/ContainElementSatisfying.swift:14:17: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Realm: /RealmSwift/Tests/PrimitiveMapTests.swift:67:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in SourceKitten: /Source/SourceKittenFramework/StringView+SourceKitten.swift:39:17: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/AST/Type.swift:212:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Sourcery: /SourceryTests/Stub/Performance-Code/Kiosk/App/UIViewControllerExtensions.swift:28:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Sourcery: /SourceryTests/Stub/Performance-Code/Kiosk/Bid Fulfillment/ConfirmYourBidArtsyLoginViewController.swift:171:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Swift: /benchmark/single-source/DictTest.swift:155:7: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Swift: /benchmark/single-source/DictTest.swift:208:7: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Swift: /benchmark/single-source/ExistentialPerformance.swift:470:5: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Swift: /benchmark/single-source/ExistentialPerformance.swift:489:5: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Swift: /benchmark/single-source/ExistentialPerformance.swift:499:5: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Swift: /benchmark/single-source/ExistentialPerformance.swift:508:5: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Swift: /benchmark/single-source/ExistentialPerformance.swift:535:7: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Swift: /benchmark/single-source/ExistentialPerformance.swift:557:7: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Swift: /benchmark/single-source/Hash.swift:567:5: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Swift: /benchmark/single-source/RangeOverlaps.swift:47:9: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Swift: /benchmark/single-source/RangeOverlaps.swift:60:9: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Swift: /benchmark/single-source/RangeOverlaps.swift:73:9: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Swift: /benchmark/single-source/RecursiveOwnedParameter.swift:56:5: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Swift: /benchmark/single-source/RemoveWhere.swift:36:7: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Swift: /benchmark/single-source/SubstringTest.swift:235:4: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in Swift: /benchmark/single-source/SubstringTest.swift:266:3: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in WordPress: /WordPress/Classes/Extensions/PHAsset+Metadata.swift:17:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in WordPress: /WordPress/Classes/Extensions/PHAsset+Metadata.swift:33:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in WordPress: /WordPress/Classes/Services/NotificationSettingsService.swift:91:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in WordPress: /WordPress/Classes/Services/SharingService.swift:336:17: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in WordPress: /WordPress/Classes/Services/SharingService.swift:460:17: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in WordPress: /WordPress/Classes/Services/SharingService.swift:604:17: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in WordPress: /WordPress/Classes/Utility/PushNotificationsManager.swift:188:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in WordPress: /WordPress/Classes/Utility/ZendeskUtils.swift:977:17: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in WordPress: /WordPress/Classes/Utility/ZendeskUtils.swift:988:17: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in WordPress: /WordPress/Classes/ViewRelated/Aztec/ViewControllers/AztecPostViewController.swift:1727:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in WordPress: /WordPress/Classes/ViewRelated/Aztec/ViewControllers/AztecPostViewController.swift:2075:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in WordPress: /WordPress/Classes/ViewRelated/Blog/SharingAccountViewController.swift:105:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in WordPress: /WordPress/Classes/ViewRelated/Blog/SharingAuthorizationWebViewController.swift:92:17: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in WordPress: /WordPress/Classes/ViewRelated/Domains/Domain registration/RegisterDomainDetails/ViewModel/RegisterDomainDetailsViewModel.swift:169:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in WordPress: /WordPress/Classes/ViewRelated/Gutenberg/Layout Picker/FilterableCategoriesViewController.swift:225:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in WordPress: /WordPress/Classes/ViewRelated/Gutenberg/Layout Picker/FilterableCategoriesViewController.swift:271:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in WordPress: /WordPress/Classes/ViewRelated/NUX/LoginEpilogueTableViewController.swift:86:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in WordPress: /WordPress/Classes/ViewRelated/Post/PostListFilterSettings.swift:55:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in WordPress: /WordPress/WordPressShareExtension/ShareExtensionAbstractViewController.swift:153:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in WordPress: /WordPress/WordPressShareExtension/ShareExtensionEditorViewController.swift:668:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in WordPress: /WordPress/WordPressShareExtension/ShareExtensionEditorViewController.swift:828:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
⚠️ This PR introduced a violation in WordPress: /WordPress/WordPressShareExtension/ShareMediaFileManager.swift:59:13: warning: For Where Violation: where clauses are preferred over a single if inside a for. (for_where)
12 Messages
📖 Linting Aerial with this PR took 0.32s vs 0.3s on master (6% slower)
📖 Linting Alamofire with this PR took 0.31s vs 0.3s on master (3% slower)
📖 Linting Firefox with this PR took 1.42s vs 1.41s on master (0% slower)
📖 Linting Kickstarter with this PR took 2.13s vs 2.13s on master (0% slower)
📖 Linting Moya with this PR took 0.14s vs 0.14s on master (0% slower)
📖 Linting Nimble with this PR took 0.15s vs 0.15s on master (0% slower)
📖 Linting Quick with this PR took 0.08s vs 0.08s on master (0% slower)
📖 Linting Realm with this PR took 1.04s vs 1.05s on master (0% faster)
📖 Linting SourceKitten with this PR took 0.13s vs 0.13s on master (0% slower)
📖 Linting Sourcery with this PR took 0.43s vs 0.44s on master (2% faster)
📖 Linting Swift with this PR took 0.9s vs 0.92s on master (2% faster)
📖 Linting WordPress with this PR took 2.4s vs 2.36s on master (1% slower)

Generated by 🚫 Danger

@SimplyDanny SimplyDanny requested a review from marcelofabri May 15, 2022 14:22
@SimplyDanny
Copy link
Collaborator Author

The reported violations all seem to be valid.

@codecov-commenter
Copy link

Codecov Report

Merging #3979 (a949caf) into master (809dcc6) will increase coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #3979      +/-   ##
==========================================
+ Coverage   92.49%   92.56%   +0.06%     
==========================================
  Files         446      446              
  Lines       22491    22491              
==========================================
+ Hits        20804    20818      +14     
+ Misses       1687     1673      -14     
Impacted Files Coverage Δ
...ftLintFramework/Rules/Idiomatic/ForWhereRule.swift 92.30% <100.00%> (+1.92%) ⬆️
Source/SwiftLintFramework/Helpers/Glob.swift 89.47% <0.00%> (+22.80%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@SimplyDanny SimplyDanny force-pushed the order-independent-for-where branch from a949caf to 70e6592 Compare June 14, 2022 17:25
@SimplyDanny SimplyDanny enabled auto-merge (squash) June 14, 2022 17:26
@SimplyDanny SimplyDanny merged commit 323a249 into realm:master Jun 14, 2022
@SimplyDanny SimplyDanny deleted the order-independent-for-where branch June 14, 2022 18:06
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.

4 participants