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

Lowercase imports before sorting #1218

Merged
merged 1 commit into from
Mar 23, 2017
Merged

Lowercase imports before sorting #1218

merged 1 commit into from
Mar 23, 2017

Conversation

keith
Copy link
Collaborator

@keith keith commented Jan 19, 2017

Currently if you have imports that differ in case, they are not sorted
as you would expect.

Fixes #1185

@SwiftLintBot
Copy link

SwiftLintBot commented Jan 19, 2017

27 Warnings
⚠️ This PR introduced a violation in WordPress-iOS: /WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationsViewController.swift#L5:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in swift: /stdlib/public/SDK/Foundation/Calendar.swift#L14:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in swift: /stdlib/public/SDK/Foundation/Date.swift#L15:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in swift: /stdlib/public/SDK/Foundation/DateInterval.swift#L14:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in swift: /stdlib/public/SDK/Foundation/Decimal.swift#L14:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in swift: /stdlib/public/SDK/Foundation/FileManager.swift#L14:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in swift: /stdlib/public/SDK/Foundation/Data.swift#L34:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in swift: /stdlib/public/SDK/Foundation/Locale.swift#L14:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in swift: /stdlib/public/SDK/Foundation/Measurement.swift#L14:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in swift: /stdlib/public/SDK/Foundation/IndexSet.swift#L14:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in swift: /stdlib/public/SDK/Foundation/NSCoder.swift#L14:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in swift: /stdlib/public/SDK/Foundation/NSDictionary.swift#L14:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in swift: /stdlib/public/SDK/Foundation/NSUndoManager.swift#L14:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in swift: /stdlib/public/SDK/Dispatch/Dispatch.swift#L14:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in swift: /stdlib/public/SDK/Foundation/TimeZone.swift#L14:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in swift: /stdlib/public/SDK/Foundation/UUID.swift#L15:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in swift: /stdlib/public/SDK/ObjectiveC/ObjectiveC.swift#L15:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in swift: /stdlib/public/SDK/SafariServices/SafariServices.swift#L14:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in swift: /stdlib/public/SDK/SpriteKit/SpriteKit.swift#L14:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in swift: /stdlib/public/SDK/XPC/XPC.swift#L14:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in swift: /stdlib/public/SDK/XCTest/XCTest.swift#L16:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in SourceKitten: /Source/SourceKittenFramework/File.swift#L12:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in firefox-ios: /ReadingList/ReadingListSQLStorage.swift#L8:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in firefox-ios: /SharedTests/PhoneNumberFormatterTests.swift#L8:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in WordPress-iOS: /WordPress/Classes/ViewRelated/Me/AboutViewController.swift#L4:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in WordPress-iOS: /WordPress/Classes/ViewRelated/Me/GravatarPickerViewController.swift#L3:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in swift: /stdlib/public/SDK/Foundation/NSError.swift#L16:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
76 Messages
📖 Linting WordPress-iOS with this PR took 16.88s vs 17.63s on master (4% faster)
📖 This PR fixed a violation in firefox-ios: /Client/Frontend/Widgets/HighlightCell.swift#L176:65: warning: Unused Closure Parameter Violation: Unused parameter “url” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in firefox-ios: /Client/Frontend/Widgets/SimpleHighlightCell.swift#L129:65: warning: Unused Closure Parameter Violation: Unused parameter “url” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in firefox-ios: /ClientTests/TestFavicons.swift#L37:161: warning: Unused Closure Parameter Violation: Unused parameter “url” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in firefox-ios: /ClientTests/WebServerTests.swift#L17:102: warning: Unused Closure Parameter Violation: Unused parameter “request” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in firefox-ios: /Storage/SQL/SQLiteHistory.swift#L716:52: warning: Unused Closure Parameter Violation: Unused parameter “err” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in firefox-ios: /StorageTests/TestFaviconsTable.swift#L77:90: warning: Unused Closure Parameter Violation: Unused parameter “err” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in firefox-ios: /StorageTests/TestTableTable.swift#L23:61: warning: Unused Closure Parameter Violation: Unused parameter “err” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in firefox-ios: /StorageTests/TestTableTable.swift#L35:57: warning: Unused Closure Parameter Violation: Unused parameter “err” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in firefox-ios: /StorageTests/TestSQLiteHistory.swift#L982:72: warning: Unused Closure Parameter Violation: Unused parameter “err” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in firefox-ios: /SyncTests/MockSyncServer.swift#L311:111: warning: Unused Closure Parameter Violation: Unused parameter “request” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in firefox-ios: /UITests/ClearPrivateDataTests.swift#L212:113: warning: Unused Closure Parameter Violation: Unused parameter “request” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in firefox-ios: /UITests/Global.swift#L425:106: warning: Unused Closure Parameter Violation: Unused parameter “request” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in firefox-ios: /UITests/Global.swift#L431:113: warning: Unused Closure Parameter Violation: Unused parameter “request” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in firefox-ios: /UITests/Global.swift#L453:115: warning: Unused Closure Parameter Violation: Unused parameter “request” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Extensions/NSURL+Exporters.swift#L156:124: warning: Unused Closure Parameter Violation: Unused parameter “time” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Extensions/UIImageView+Networking.swift#L30:18: warning: Unused Closure Parameter Violation: Unused parameter “request” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Extensions/UIImageView+Networking.swift#L42:37: warning: Unused Closure Parameter Violation: Unused parameter “response” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/AccountSettingsRemote.swift#L46:35: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/AccountSettingsRemote.swift#L63:31: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/NotificationSettingsServiceRemote.swift#L37:41: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/NotificationSettingsServiceRemote.swift#L61:41: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/NotificationSettingsServiceRemote.swift#L106:41: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/NotificationSettingsServiceRemote.swift#L128:41: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/PeopleRemote.swift#L54:31: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/PeopleRemote.swift#L95:31: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/PeopleRemote.swift#L135:31: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/PeopleRemote.swift#L171:36: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/PeopleRemote.swift#L202:31: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/PeopleRemote.swift#L231:31: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/PeopleRemote.swift#L272:31: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/PeopleRemote.swift#L316:31: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/PushAuthenticationServiceRemote.swift#L27:62: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/SiteManagementServiceRemote.swift#L36:31: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/SiteManagementServiceRemote.swift#L73:31: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/SiteManagementServiceRemote.swift#L100:31: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/SharingServiceRemote.swift#L88:41: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/SharingServiceRemote.swift#L141:41: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in ios-oss: /Kickstarter-iOS/Views/Controllers/ThanksViewController.swift#L195:37: warning: Unused Closure Parameter Violation: Unused parameter “action” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/SharingServiceRemote.swift#L244:45: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/SharingServiceRemote.swift#L289:45: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/SharingServiceRemote.swift#L330:45: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/SharingServiceRemote.swift#L353:41: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/SharingServiceRemote.swift#L431:41: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/SharingServiceRemote.swift#L468:41: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/ViewRelated/Media/MediaLibraryViewController.swift#L3:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationsViewController.swift#L6:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/ViewRelated/Post/PostPostViewController.swift#L122:15: warning: Unused Closure Parameter Violation: Unused parameter “context” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/ViewRelated/Post/AztecPostViewController.swift#L1645:15: warning: Unused Closure Parameter Violation: Unused parameter “request” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/ViewRelated/Post/AztecPostViewController.swift#L1645:24: warning: Unused Closure Parameter Violation: Unused parameter “response” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/WordPressApi/WordPressComOAuthClient.swift#L89:28: warning: Unused Closure Parameter Violation: Unused parameter “task” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/WordPressApi/WordPressComOAuthClient.swift#L118:28: warning: Unused Closure Parameter Violation: Unused parameter “task” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/WordPressTest/MediaPicker/MediaLibraryPickerDataSourceTests.swift#L159:90: warning: Unused Closure Parameter Violation: Unused parameter “url” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/WordPressTest/MediaPicker/MediaLibraryPickerDataSourceTests.swift#L3:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/WordPressTest/WordPressAPI/WordPressOrgXMLRPCApiTests.swift#L35:35: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/WordPressTest/WordPressAPI/WordPressComRestApiTests.swift#L45:35: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/WordPressTest/WordPressAPI/WordPressComRestApiTests.swift#L64:35: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/WordPressTest/WordPressAPI/WordPressComRestApiTests.swift#L82:35: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/WordPressTest/WordPressAPI/WordPressComRestApiTests.swift#L100:35: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/WordPressTest/WordPressAPI/WordPressComRestApiTests.swift#L118:35: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/WordPressTest/WordPressAPI/WordPressComRestApiTests.swift#L136:35: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/WordPressTest/WordPressAPI/WordPressComRestApiTests.swift#L188:35: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/WordPressTest/WordPressAPI/WordPressComRestApiTests.swift#L211:35: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/WordPressTest/WordPressAPI/WordPressComRestApiTests.swift#L221:35: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)
📖 Linting Alamofire with this PR took 4.32s vs 4.44s on master (2% faster)
📖 Linting swift with this PR took 15.32s vs 15.63s on master (1% faster)
📖 Linting Aerial with this PR took 0.56s vs 0.56s on master (0% slower)
📖 Linting SourceKitten with this PR took 1.62s vs 1.7s on master (4% faster)
📖 Linting Sourcery with this PR took 3.73s vs 3.86s on master (3% faster)
📖 Linting ios-oss with this PR took 22.78s vs 23.77s on master (4% faster)
📖 Linting Moya with this PR took 0.55s vs 0.58s on master (5% faster)
📖 Linting firefox-ios with this PR took 24.44s vs 25.24s on master (3% faster)
📖 Linting Nimble with this PR took 2.46s vs 2.55s on master (3% faster)
📖 Linting Quick with this PR took 0.75s vs 0.75s on master (0% slower)
📖 Linting realm-cocoa with this PR took 3.89s vs 3.91s on master (0% faster)
📖 This PR fixed a violation in WordPress-iOS: /WordPress/Classes/Networking/SharingServiceRemote.swift#L200:41: warning: Unused Closure Parameter Violation: Unused parameter “httpResponse” in a closure should be replaced with _. (unused_closure_parameter)

Generated by 🚫 danger

@keith
Copy link
Collaborator Author

keith commented Jan 19, 2017

Hmmm. These numbers seem to be a little more than I would expect..

@jpsim
Copy link
Collaborator

jpsim commented Jan 19, 2017

The longer benchmarks are more reliable and well within margins (3% for swift stdlib, 6% for Realm), so I'm not concerned about those.

@keith
Copy link
Collaborator Author

keith commented Jan 19, 2017

I can fix the new issue by bumping that up a line if that works for this fix?

@codecov-io
Copy link

codecov-io commented Jan 20, 2017

Codecov Report

Merging #1218 into master will not change coverage.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master    #1218   +/-   ##
=======================================
  Coverage   81.89%   81.89%           
=======================================
  Files         175      175           
  Lines        8898     8898           
=======================================
  Hits         7287     7287           
  Misses       1611     1611
Impacted Files Coverage Δ
...e/SwiftLintFramework/Rules/SortedImportsRule.swift 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 80c3050...0303a8e. Read the comment docs.

@keith
Copy link
Collaborator Author

keith commented Jan 23, 2017

The simple fix for this case would be to sort those SourceKitten imports like this:

import Foundation
#if SWIFT_PACKAGE
import SourceKit
#endif
import SWXMLHash

@jpsim
Copy link
Collaborator

jpsim commented Jan 25, 2017

I'm uneasy about this, since it changes our definition of what is "sorted".

Going back to the conversation in Slack:

it's always important to keep in mind why these rules exist. In this case, sorting imports helps find out if a file imports a module, which is served just as well if it's case insensitive, and gets in the way of the user less

Although I can see how this can be interpreted as being okay with changing the definition of what sorted means, what I actually meant was that we should consider a list that's sorted either case sensitive or case insensitive to be sorted, and the rule still serves its purpose.

@keith
Copy link
Collaborator Author

keith commented Jan 25, 2017

But I guess the problem here is that allowing both would mean that it would be acceptable for your imports to not be "sorted" for the way you wanted. It doesn't seem like a single consumer would want both ascii sorting, and "normal" sorting to be acceptable.

@jpsim
Copy link
Collaborator

jpsim commented Jan 25, 2017

so maybe it's a matter of adding a case_insensitive: true key to the rule's configuration?

@keith
Copy link
Collaborator Author

keith commented Jan 25, 2017

I'm happy to do that if that's the way you want to go, but besides backwards compatibility I do think it's strange to even allow "sorting" to be determined by the ascii order of characters for this use case.

@keith
Copy link
Collaborator Author

keith commented Mar 6, 2017

@jpsim any solution here you'd be happy with?

@jpsim
Copy link
Collaborator

jpsim commented Mar 10, 2017

Alright, let's do this as-is. Could you please just update the changelog and merge?

@keith
Copy link
Collaborator Author

keith commented Mar 11, 2017

Changelog is updated here? Did you want me to add something else?

Currently if you have imports that differ in case, they are not sorted
as you would expect.
@keith
Copy link
Collaborator Author

keith commented Mar 12, 2017

Moved it to the breaking section in the changelog

@marcelofabri marcelofabri merged commit a3547aa into realm:master Mar 23, 2017
@keith keith deleted the ks/sorted-imports-lowercase branch March 23, 2017 16:31
@keith
Copy link
Collaborator Author

keith commented Mar 23, 2017

Thanks!

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.

5 participants