Skip to content

Commit e098630

Browse files
committed
ci: update Swiftlint rules
1 parent 328429f commit e098630

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

.swiftlint.yml

+8-11
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@ included:
22
- Sources
33
- Tests
44

5-
disabled_rules:
6-
- identifier_name
7-
- nesting
8-
95
opt_in_rules:
106
- empty_count
117
- empty_string
128

13-
excluded:
14-
- Carthage
15-
- Pods
16-
- SwiftLint/Common/3rdPartyLib
9+
disabled_rules:
10+
- nesting
11+
- todo
12+
- identifier_name
1713

1814
line_length:
1915
warning: 150
@@ -40,11 +36,12 @@ file_length:
4036
ignore_comment_only_lines: true
4137

4238
cyclomatic_complexity:
43-
warning: 15
39+
warning: 25
4440
error: 25
4541

4642
large_tuple:
47-
warning: 4
48-
error: 4
43+
warning: 3
44+
error: 3
4945

5046
reporter: "xcode"
47+

Podfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use_frameworks!
88
target 'Tests' do
99
pod 'Quick', '~> 5.0'
1010
pod 'Nimble'
11-
pod 'SwiftLint', '~> 0.48.0' # Version 0.49+ requires macOS 12 and Swift 5.6
11+
pod 'SwiftLint', '~> 0.50'
1212
pod 'RSDKUtils', :path => './RSDKUtils.podspec'
1313
pod 'RSDKUtils/TestHelpers', :path => './RSDKUtils.podspec'
1414
pod 'RSDKUtils/Nimble', :path => './RSDKUtils.podspec'

Podfile.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ PODS:
1111
- RSDKUtils/RLogger (4.0.0)
1212
- RSDKUtils/TestHelpers (4.0.0):
1313
- RSDKUtils/Main
14-
- SwiftLint (0.48.0)
14+
- SwiftLint (0.51.0)
1515

1616
DEPENDENCIES:
1717
- Nimble
@@ -20,7 +20,7 @@ DEPENDENCIES:
2020
- RSDKUtils/Nimble (from `./RSDKUtils.podspec`)
2121
- RSDKUtils/RLogger (from `./RSDKUtils.podspec`)
2222
- RSDKUtils/TestHelpers (from `./RSDKUtils.podspec`)
23-
- SwiftLint (~> 0.48.0)
23+
- SwiftLint (~> 0.50)
2424

2525
SPEC REPOS:
2626
trunk:
@@ -36,8 +36,8 @@ SPEC CHECKSUMS:
3636
Nimble: 5316ef81a170ce87baf72dd961f22f89a602ff84
3737
Quick: 749aa754fd1e7d984f2000fe051e18a3a9809179
3838
RSDKUtils: e2a63eb729298706abe02e735436a2586c65e164
39-
SwiftLint: 284cea64b6187c5d6bd83e9a548a64104d546447
39+
SwiftLint: 1b7561918a19e23bfed960e40759086e70f4dba5
4040

41-
PODFILE CHECKSUM: 01c054113b493e5c0ad989d688e456e75430caaa
41+
PODFILE CHECKSUM: f6ba2f14867e1900fb90942ba329b080648b55b0
4242

43-
COCOAPODS: 1.11.3
43+
COCOAPODS: 1.12.1

RSDKUtils.xcodeproj/project.pbxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@
291291
);
292292
runOnlyForDeploymentPostprocessing = 0;
293293
shellPath = /bin/sh;
294-
shellScript = "\"${PODS_ROOT}/SwiftLint/swiftlint\" lint --config \"${SRCROOT}/.swiftlint.yml\" --strict\n";
294+
shellScript = "\"${PODS_ROOT}/SwiftLint/swiftlint\" lint --strict\n";
295295
};
296296
/* End PBXShellScriptBuildPhase section */
297297

Sources/RSDKUtilsMain/Extensions/UIColor+Extensions.swift

+4-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ public extension UIColor {
5050
/// - Parameter anotherColor: A color to compare with.
5151
/// - Returns: `true` if both colors have the same RGBA values.
5252
func isRGBAEqual(to anotherColor: UIColor) -> Bool {
53-
var rgba1: (r: CGFloat, g: CGFloat, b: CGFloat, a: CGFloat) = (0, 0, 0, 0)
54-
var rgba2: (r: CGFloat, g: CGFloat, b: CGFloat, a: CGFloat) = (0, 0, 0, 0)
53+
// swiftlint:disable:next large_tuple
54+
typealias RGBA = (r: CGFloat, g: CGFloat, b: CGFloat, a: CGFloat)
55+
var rgba1 = RGBA(0, 0, 0, 0)
56+
var rgba2 = RGBA(0, 0, 0, 0)
5557

5658
getRed(&rgba1.r, green: &rgba1.g, blue: &rgba1.b, alpha: &rgba1.a)
5759
anotherColor.getRed(&rgba2.r, green: &rgba2.g, blue: &rgba2.b, alpha: &rgba2.a)

Tests/.swiftlint.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
disabled_rules:
2+
- force_cast

Tests/Tests/NSObjectExtensionsSpec.swift

-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ class NSObjectExtensionsSpec: QuickSpec {
6767
#if os(iOS)
6868
it("will return true for private apple class instance") {
6969
let window = UIWindow()
70-
// swiftlint:disable:next force_cast
7170
let object = window.value(forKey: "_systemGestureGateForGestures") as! NSObject // _UISystemGestureGateGestureRecognizer
7271
expect(object.isApplePrivateClass()).to(beTrue())
7372
}

0 commit comments

Comments
 (0)