Skip to content

Commit

Permalink
style: Swiftlint Override Super Required (#1313)
Browse files Browse the repository at this point in the history
  • Loading branch information
philipphofmann authored Sep 3, 2021
1 parent 62a418f commit 90c7d80
Show file tree
Hide file tree
Showing 26 changed files with 43 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,18 @@ whitelist_rules:
- void_return
- weak_delegate
identifier_name:
allowed_symbols:
- i
- _
min_length:
- 2
- 1
force_try:
severity: warning
force_unwrapping:
severity: error
overridden_super_call:
severity: error
line_length:
- 220
type_name:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import XCTest
class LaunchUITests: XCTestCase {

override func setUpWithError() throws {
try super.setUpWithError()
continueAfterFailure = false
}

Expand Down
1 change: 1 addition & 0 deletions Samples/iOS-Swift/iOS-Swift/NibViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class NibViewController: UIViewController {
@IBOutlet var button: UIButton!

override func viewDidLoad() {
super.viewDidLoad()
button.backgroundColor = .systemPink
}
}
1 change: 1 addition & 0 deletions Samples/iOS-Swift/iOS-SwiftUITests/LaunchUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import XCTest
class LaunchUITests: XCTestCase {

override func setUpWithError() throws {
try super.setUpWithError()
continueAfterFailure = false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import XCTest
class LaunchUITests: XCTestCase {

override func setUpWithError() throws {
try super.setUpWithError()
continueAfterFailure = false
}

Expand Down
1 change: 1 addition & 0 deletions Samples/tvOS-Swift/tvOS-SwiftUITests/LaunchUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import XCTest
class LaunchUITests: XCTestCase {

override func setUpWithError() throws {
try super.setUpWithError()
continueAfterFailure = false
}

Expand Down
8 changes: 8 additions & 0 deletions Sentry.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
1 change: 1 addition & 0 deletions Tests/SentryTests/Helper/SentryLogTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import XCTest
class SentryLogTests: XCTestCase {

override func tearDown() {
super.tearDown()
// Set back to default
SentryLog.configure(true, diagnosticLevel: SentryLevel.error)
SentryLog.setLogOutput(nil)
Expand Down
1 change: 1 addition & 0 deletions Tests/SentryTests/Helper/SentrySysctlTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class SentrySysctlTests: XCTestCase {
private var sut: SentrySysctl!

override func setUp() {
super.setUp()
sut = SentrySysctl()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ class SentryAppStartTrackingIntegrationTests: XCTestCase {
private var sut: SentryAppStartTrackingIntegration!

override func setUp() {
super.setUp()
fixture = Fixture()
SentrySDK.setAppStartMeasurement(nil)
sut = SentryAppStartTrackingIntegration()
}

override func tearDown() {
super.tearDown()
fixture.fileManager.deleteAppState()
sut.stop()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ class SentryCrashScopeObserverTests: XCTestCase {
private let fixture = Fixture()

override func setUp() {
super.setUp()
sentrycrash_scopesync_reset()
SentryCrash.sharedInstance().userInfo = nil
}

override func tearDown() {
super.tearDown()
sentrycrash_scopesync_reset()
SentryCrash.sharedInstance().userInfo = nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class SentryFramesTrackerTests: XCTestCase {
private var fixture: Fixture!

override func setUp() {
super.setUp()
fixture = Fixture()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class SentryFramesTrackingIntegrationTests: XCTestCase {
private var sut: SentryFramesTrackingIntegration!

override func setUp() {
super.setUp()
sut = fixture.sut
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class SentryUIPerformanceTrackerTests: XCTestCase {
private var fixture: Fixture!

override func setUp() {
super.setUp()
fixture = Fixture()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class SentryConcurrentRateLimitsDictionaryTests: XCTestCase {
private var sut: SentryConcurrentRateLimitsDictionary!

override func setUp() {
super.setUp()
currentDateProvider = TestCurrentDateProvider()
sut = SentryConcurrentRateLimitsDictionary()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class SentryEnvelopeRateLimitTests: XCTestCase {
private var sut: EnvelopeRateLimit!

override func setUp() {
super.setUp()
rateLimits = TestRateLimits()
sut = EnvelopeRateLimit(rateLimits: rateLimits)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class SentryHttpDateParserTests: XCTestCase {
private var sut: HttpDateParser!

override func setUp() {
super.setUp()
currentDateProvider = TestCurrentDateProvider()
sut = HttpDateParser()
}
Expand Down
2 changes: 2 additions & 0 deletions Tests/SentryTests/Networking/SentryHttpTransportTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class SentryHttpTransportTests: XCTestCase {
private var sut: SentryHttpTransport!

override func setUp() {
super.setUp()
fixture = Fixture()
fixture.fileManager.deleteAllEnvelopes()
fixture.requestManager.returnResponse(response: HTTPURLResponse())
Expand All @@ -94,6 +95,7 @@ class SentryHttpTransportTests: XCTestCase {
}

override func tearDown() {
super.tearDown()
fixture.fileManager.deleteAllEnvelopes()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class SentryTransportInitializerTests: XCTestCase {
private var fileManager: SentryFileManager!

override func setUp() {
super.setUp()
do {
let options = Options()
options.dsn = SentryTransportInitializerTests.dsnAsString
Expand Down
2 changes: 2 additions & 0 deletions Tests/SentryTests/Protocol/SentryEnvelopeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ class SentryEnvelopeTests: XCTestCase {
private let fixture = Fixture()

override func setUp() {
super.setUp()
CurrentDate.setCurrentDateProvider(TestCurrentDateProvider())
}

override func tearDown() {
super.tearDown()
do {
let fileManager = FileManager.default
if fileManager.fileExists(atPath: fixture.path) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ class SentryCrashInstallationReporterTests: XCTestCase {
private var sut: SentryCrashInstallationReporter!

override func setUp() {
super.setUp()
sut = SentryCrashInstallationReporter(inAppLogic: SentryInAppLogic(inAppIncludes: [], inAppExcludes: []))
sut.install()
// Works only if SentryCrash is installed
sentrycrash_deleteAllReports()
}

override func tearDown() {
super.tearDown()
sentrycrash_deleteAllReports()
clearTestState()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class SentryCrashStackEntryMapperTests: XCTestCase {
private var sut: SentryCrashStackEntryMapper!

override func setUp() {
super.setUp()
sut = SentryCrashStackEntryMapper(inAppLogic: SentryInAppLogic(inAppIncludes: [bundleExecutable], inAppExcludes: []))
}

Expand Down
2 changes: 2 additions & 0 deletions Tests/SentryTests/SentryHubTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class SentryHubTests: XCTestCase {
private var sut: SentryHub!

override func setUp() {
super.setUp()
fixture = Fixture()
fixture.fileManager.deleteCurrentSession()
fixture.fileManager.deleteCrashedSession()
Expand All @@ -69,6 +70,7 @@ class SentryHubTests: XCTestCase {
}

override func tearDown() {
super.tearDown()
fixture.fileManager.deleteCurrentSession()
fixture.fileManager.deleteCrashedSession()
fixture.fileManager.deleteAppState()
Expand Down
1 change: 1 addition & 0 deletions Tests/SentryTests/SentrySDKTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class SentrySDKTests: XCTestCase {
private var fixture: Fixture!

override func setUp() {
super.setUp()
fixture = Fixture()
}

Expand Down
1 change: 1 addition & 0 deletions Tests/SentryTests/SentrySessionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class SentrySessionTestsSwift: XCTestCase {
private var currentDateProvider: TestCurrentDateProvider!

override func setUp() {
super.setUp()
currentDateProvider = TestCurrentDateProvider()
CurrentDate.setCurrentDateProvider(currentDateProvider)
}
Expand Down
1 change: 1 addition & 0 deletions Tests/SentryTests/SentrySpanTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class SentrySpanTests: XCTestCase {

private var fixture: Fixture!
override func setUp() {
super.setUp()
fixture = Fixture()
CurrentDate.setCurrentDateProvider(fixture.currentDateProvider)
}
Expand Down

0 comments on commit 90c7d80

Please sign in to comment.