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

Fixed lint issues with SwiftLint 0.5.0 #2076

Merged
merged 1 commit into from
Nov 22, 2022
Merged
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
7 changes: 7 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ opt_in_rules:
- vertical_parameter_alignment
- vertical_parameter_alignment_on_call

disabled_rules:
- orphaned_doc_comment
Comment on lines +19 to +20
Copy link
Member

Choose a reason for hiding this comment

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

do we get false positives often enough that it's worth disabling at the project level rather than on a case-by-case basis?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We get a fair amount of internal declarations (though that should get fixed, but we also have some blocks of text like:

/**
Some explanation about a method
*/

let some = code()

I was disabling them individually, but after a while I realized that more docs are always better so not sure we get any benefit from the rule.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll get this merged and we can re-enable the rule when they fix that regression.

Copy link
Member

Choose a reason for hiding this comment

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

👍


custom_rules:
xctestcase_superclass:
included: ".*\\.swift"
Expand All @@ -29,5 +32,9 @@ identifier_name:
warning: 60
error: 80

large_tuple:
warning: 4
error: 5

missing_docs:
excludes_inherited_types: false
1 change: 0 additions & 1 deletion Sources/Purchasing/Purchases/Purchases.swift
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ public typealias StartPurchaseBlock = (@escaping PurchaseCompletedBlock) -> Void
trialOrIntroPriceEligibilityChecker: trialOrIntroPriceChecker)
}

// swiftlint:disable:next function_body_length
init(appUserID: String?,
requestFetcher: StoreKitRequestFetcher,
receiptFetcher: ReceiptFetcher,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ private extension StoreKit2TransactionListenerTests {
expect(line: line, unfinished).to(beEmpty())
}

// swiftlint:disable:next large_tuple
func purchase() async throws -> (
result: Product.PurchaseResult,
verificationResult: VerificationResult<Transaction>,
Expand Down
1 change: 0 additions & 1 deletion Tests/UnitTests/Mocks/MockCustomerInfoManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import Foundation
@testable import RevenueCat

// swiftlint:disable large_tuple
// swiftlint:disable line_length
// Note: this class is implicitly `@unchecked Sendable` through its parent
// even though it's not actually thread safe.
Expand Down
2 changes: 1 addition & 1 deletion Tests/UnitTests/Mocks/MockOfferingsManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import Foundation
@testable import RevenueCat

// swiftlint:disable identifier_name large_tuple
// swiftlint:disable identifier_name

// Note: this class is implicitly `@unchecked Sendable` through its parent
// even though it's not actually thread safe.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
@testable import RevenueCat

// swiftlint:disable identifier_name
// swiftlint:disable large_tuple
// swiftlint:disable line_length
class MockSubscriberAttributesManager: SubscriberAttributesManager {

Expand Down
2 changes: 1 addition & 1 deletion Tests/UnitTests/Networking/NetworkErrorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//
// Created by Nacho Soto on 4/7/22.

// swiftlint:disable multiline_parameters large_tuple
// swiftlint:disable multiline_parameters

import Nimble
@testable import RevenueCat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ extension BasePurchasesTests {

var invokedPostAttributionData = false
var invokedPostAttributionDataCount = 0
// swiftlint:disable:next large_tuple
var invokedPostAttributionDataParameters: (
data: [String: Any]?,
network: AttributionNetwork,
Expand Down