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

Fixed lint issues with SwiftLint 0.5.0 #2076

merged 1 commit into from
Nov 22, 2022

Conversation

NachoSoto
Copy link
Contributor

The new release is much faster as it uses the new SwiftParser.

Changes:

  • Disabled orphaned_doc_comment: it provides warnings for non-public declarations (see False positive with orphaned_doc_comment realm/SwiftLint#4573 (comment)), but those are still useful for us.
  • function_body_length has a new logic
  • large_tuple seems to have new default thresholds, so I've specified them in .swiftlint to relax them. Tuples will most likely even become Equatable soon in Swift 6.0 so they're here to stay.

[The new release](https://github.com/realm/SwiftLint/releases/tag/0.50.0) is much faster as [it uses](realm/SwiftLint#4216) the [new SwiftParser](https://github.com/apple/swift-syntax).

### Changes:
- Disabled `orphaned_doc_comment`: it provides warnings for non-public declarations (see realm/SwiftLint#4573 (comment)), but those are still useful for us.
- `function_body_length` has a new logic
- `large_tuple` seems to have new default thresholds, so I've specified them in `.swiftlint` to relax them. Tuples will most likely even become `Equatable` soon in Swift 6.0 so they're here to stay.
@NachoSoto NachoSoto requested a review from a team November 21, 2022 18:56
Comment on lines +19 to +20
disabled_rules:
- orphaned_doc_comment
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.

👍

@NachoSoto NachoSoto merged commit 0c692c7 into main Nov 22, 2022
@NachoSoto NachoSoto deleted the swiftlint-0.5.0 branch November 22, 2022 19:05
NachoSoto added a commit that referenced this pull request Nov 23, 2022
**This is an automatic release.**

### Bugfixes
* Changed default `UserDefaults` from `.standard` to our own Suite
(#2046) via NachoSoto (@NachoSoto)
### Other Changes
* `Logging`: added log when configuring SDK in observer mode (#2065) via
NachoSoto (@NachoSoto)
* `PurchaseTesterSwiftUI`: added observer mode setting (#2052) via
NachoSoto (@NachoSoto)
* Exposed `SystemInfo.observerMode` to simplify code (#2064) via
NachoSoto (@NachoSoto)
* `Result.init(catching:)` with `async` method (#2060) via NachoSoto
(@NachoSoto)
* Updated schemes and project for Xcode 14.1 (#2081) via NachoSoto
(@NachoSoto)
* `PurchasesSubscriberAttributesTests`: simplified tests (#2056) via
NachoSoto (@NachoSoto)
* `DeviceCache`: removed `fatalError` for users not overriding
`UserDefaults` (#2079) via NachoSoto (@NachoSoto)
* `DeviceCache`: changed `NotificationCenter` observation to be received
on posting thread (#2078) via NachoSoto (@NachoSoto)
* `StoreKit1Wrapper`: added instance address when detecting transactions
(#2055) via NachoSoto (@NachoSoto)
* Fixed lint issues with `SwiftLint 0.5.0` (#2076) via NachoSoto
(@NachoSoto)
* `NSData+RCExtensionsTests`: improved errors (#2043) via NachoSoto
(@NachoSoto)
* `APITester`: fixed warning in `SubscriptionPeriodAPI` (#2054) via
NachoSoto (@NachoSoto)
* `Integration Tests`: always run them in random order locally (#2068)
via NachoSoto (@NachoSoto)

Co-authored-by: NachoSoto <ignaciosoto90@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants