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

Upgrade Swiftlint to 0.41.0 #6956

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .hound.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
swiftlint:
config_file: .swiftlint.yml
version: 0.43.1
ruby:
enabled: false

Expand Down
2 changes: 1 addition & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ included:
- Yosemite

# Rules
whitelist_rules:
only_rules:
# Closing brace with closing parenthesis should not have any whitespaces in
# the middle.
# - closing_brace
Expand Down
4 changes: 2 additions & 2 deletions Networking/Networking/Network/AlamofireNetwork.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ public class AlamofireNetwork: Network {
}


/// MARK: - Alamofire.DataResponse: Private Methods
///
// MARK: - Alamofire.DataResponse: Private Methods
//
private extension Alamofire.DataResponse {

/// Returns the Networking Layer Error (if any):
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

SWIFTLINT_VERSION = '0.27.0'
SWIFTLINT_VERSION = '0.43.1'
XCODE_WORKSPACE = 'WooCommerce.xcworkspace'
XCODE_SCHEME = 'WooCommerce'
XCODE_CONFIGURATION = 'Debug'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ private extension ManagedObjectModelsInventory {
}
}

/// MARK: - Sorting
// MARK: - Sorting

private extension Array where Element == ManagedObjectModelsInventory.ModelVersion {
/// Sort the `ModelVersion` based on the convention that model versions are incremented
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ final class BillingAddressTableViewCell: UITableViewCell {
}
}

/// MARK: - Private Methods
///
// MARK: - Private Methods
//
private extension BillingAddressTableViewCell {

func configureBackground() {
Expand All @@ -96,7 +96,7 @@ private extension BillingAddressTableViewCell {
}
}

/// MARK: - Testability
// MARK: - Testability
extension BillingAddressTableViewCell {

func getNameLabel() -> UILabel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private extension CustomerInfoTableViewCell {
}
}

/// MARK: - Testability
// MARK: - Testability
extension CustomerInfoTableViewCell {
func getTitleLabel() -> UILabel {
return titleLabel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ private extension CustomerNoteTableViewCell {
}


/// MARK: - Testability
// MARK: - Testability
extension CustomerNoteTableViewCell {
func getHeadlineLabel() -> UILabel {
return headlineLabel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ private extension SummaryTableViewCell {
}


/// MARK: - VoiceOver
///
// MARK: - VoiceOver
//
private extension SummaryTableViewCell {
func configureIconForVoiceOver() {
updateStatusButton.accessibilityLabel = NSLocalizedString("Update Order Status",
Expand All @@ -187,7 +187,7 @@ private extension SummaryTableViewCell {
}
}

/// MARK: - Localization
// MARK: - Localization

private extension SummaryTableViewCellViewModel {
enum Localization {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ final class PickListTableViewCell: UITableViewCell {
}


/// MARK: - Public Methods
///
// MARK: - Public Methods
//
extension PickListTableViewCell {
/// Configure a pick list cell
///
Expand All @@ -123,8 +123,8 @@ extension PickListTableViewCell {
}
}

/// MARK: - Private Methods
///
// MARK: - Private Methods
//
private extension PickListTableViewCell {

func configureBackground() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,16 @@ final class OrderTrackingTableViewCell: UITableViewCell {
}


/// MARK: - Actions
// MARK: - Actions
private extension OrderTrackingTableViewCell {
@objc func iconTapped() {
onEllipsisTouchUp?()
}
}


/// MARK: - Accessibility
///
// MARK: - Accessibility
//
private extension OrderTrackingTableViewCell {
func configureTopLineForVoiceOver() {
topLine.accessibilityLabel = String.localizedStringWithFormat(
Expand Down Expand Up @@ -126,8 +126,8 @@ private extension OrderTrackingTableViewCell {
}
}

/// MARK: - Expose private outlets for tests
///
// MARK: - Expose private outlets for tests
//
extension OrderTrackingTableViewCell {
func getTopLabel() -> UILabel {
return topLine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class MockSwitchStoreUseCase: SwitchStoreUseCaseProtocol {
private(set) var destinationStoreIDs = [Int64]()
}

/// MARK: - SwitchStoreUseCaseProtocol
// MARK: - SwitchStoreUseCaseProtocol
extension MockSwitchStoreUseCase {

func switchStore(with storeID: Int64, onCompletion: @escaping (Bool) -> Void) {
Expand Down
4 changes: 2 additions & 2 deletions Yosemite/Yosemite/Stores/AvailabilityStore.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Networking
import Storage

/// MARK: AvailabilityStore
///
// MARK: AvailabilityStore
//
final public class AvailabilityStore: Store {
private let orderStatsRemote: OrderStatsRemoteV4

Expand Down
4 changes: 2 additions & 2 deletions Yosemite/Yosemite/Stores/CardPresentPaymentStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import Combine



/// MARK: CardPresentPaymentStore
///
// MARK: CardPresentPaymentStore
//
public final class CardPresentPaymentStore: Store {
// Retaining the reference to the card reader service might end up being problematic.
// At this point though, the ServiceLocator is part of the WooCommerce binary, so this is a good starting point.
Expand Down
4 changes: 2 additions & 2 deletions Yosemite/Yosemite/Stores/SitePostStore.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Networking
import Storage

/// MARK: SitePostStore
///
// MARK: SitePostStore
//
final public class SitePostStore: Store {
private let remote: SitePostsRemote

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct LeaderboardStatsConverter {
}
}

/// MARK: Private helpers
// MARK: Private helpers
private extension LeaderboardStatsConverter {

/// Infers a product-id from an specific html string type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ final class LeaderboardStatsConverterTest: XCTestCase {
}
}

/// MARK: Test functions to generate sample data
///
// MARK: Test functions to generate sample data
//
private extension LeaderboardStatsConverterTest {

func sampleLeaderboard(productIDs: [Int64]) -> Leaderboard {
Expand Down