Skip to content

Commit d452bba

Browse files
authored
chore: Add Swiftlint analyzer to lint CI job (#1999)
1 parent 97fd315 commit d452bba

File tree

15 files changed

+19
-27
lines changed

15 files changed

+19
-27
lines changed

.github/workflows/lint.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,26 @@ jobs:
1818

1919
swiftlint:
2020
if: github.repository == 'awslabs/aws-sdk-swift' || github.event_name == 'pull_request'
21-
runs-on: ubuntu-latest
22-
container:
23-
image: ghcr.io/realm/swiftlint:0.58.2
21+
runs-on: macos-15
2422
steps:
2523
- name: Checkout sources
2624
uses: actions/checkout@v2
27-
- name: Run swiftlint on AWSClientRuntime
25+
- name: Install Swiftlint
26+
run: |
27+
HOMEBREW_NO_AUTO_UPDATE=1 brew install swiftlint
28+
which swiftlint
29+
swiftlint --version
30+
- name: Run swiftlint
2831
run: swiftlint --strict --reporter github-actions-logging
32+
- name: Eliminate AWS service clients
33+
run: |
34+
rm -rf Sources/Services/*
35+
cd AWSSDKSwiftCLI
36+
swift run AWSSDKSwiftCLI generate-package-manifest ..
37+
cd ..
38+
echo
39+
cat Package.swift
40+
- name: Compile project with Xcode
41+
run: xcodebuild -scheme aws-sdk-swift-Package -destination platform=macOS > xcodebuild.log
42+
- name: Run swiftlint analyzer
43+
run: swiftlint analyze --strict --reporter github-actions-logging --compiler-log-path xcodebuild.log

Sources/Core/AWSClientRuntime/Sources/AWSClientRuntime/Customizations/AuthTokenGenerator.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import struct AwsCommonRuntimeKit.CommonRuntimeKit
99
import class AWSSDKHTTPAuth.AWSSigV4Signer
10-
import ClientRuntime
1110
import Smithy
1211
import SmithyHTTPAPI
1312
import SmithyHTTPAuth

Sources/Core/AWSClientRuntime/Sources/AWSClientRuntime/Errors/AWSS3ServiceError.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* SPDX-License-Identifier: Apache-2.0.
44
*/
55

6-
import ClientRuntime
7-
86
public protocol AWSS3ServiceError: AWSServiceError {
97
var requestID2: String? { get }
108
}

Sources/Core/AWSClientRuntime/Sources/AWSClientRuntime/HTTP/HttpResponse+AWS.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55

66
import class SmithyHTTPAPI.HTTPResponse
7-
import ClientRuntime
87

98
public extension HTTPResponse {
109

Sources/Core/AWSClientRuntime/Sources/AWSClientRuntime/Middlewares/AmzSdkInvocationIdMiddleware.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//
77

88
import ClientRuntime
9-
import Smithy
109
import SmithyHTTPAPI
1110
import struct Foundation.UUID
1211

Sources/Core/AWSClientRuntime/Sources/AWSClientRuntime/Middlewares/Sha256TreeHashMiddleware.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// SPDX-License-Identifier: Apache-2.0.
33

44
import class Smithy.Context
5-
import AwsCCal
65
import ClientRuntime
76
import SmithyHTTPAPI
87
import struct Foundation.Data

Sources/Core/AWSClientRuntime/Sources/AWSClientRuntime/Middlewares/UserAgentMiddleware.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import SmithyHTTPAPI
1212
public struct UserAgentMiddleware<OperationStackInput, OperationStackOutput> {
1313
public let id: String = "UserAgentHeader"
1414

15-
private let X_AMZ_USER_AGENT: String = "x-amz-user-agent"
1615
private let USER_AGENT: String = "User-Agent"
1716

1817
let serviceID: String

Sources/Core/AWSClientRuntime/Sources/AWSClientRuntime/Regions/DefaultRegionResolver.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import struct Smithy.SwiftLogger
99
@_spi(FileBasedConfig) import AWSSDKCommon
10-
import ClientRuntime
1110

1211
@_spi(DefaultRegionResolver)
1312
public struct DefaultRegionResolver: RegionResolver {

Sources/Core/AWSClientRuntime/Sources/AWSClientRuntime/Retry/AWSRetryMode.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// SPDX-License-Identifier: Apache-2.0
66
//
77

8-
import Foundation
9-
108
/// The mode of operation for the SDK's retry mechanism.
119
///
1210
/// This may be specified using the `AWS_RETRY_MODE` environment var, or the `retry_mode` field of the AWS config file.

Sources/Core/AWSClientRuntime/Sources/AWSClientRuntime/UserAgent/AdditionalMetadata.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// SPDX-License-Identifier: Apache-2.0
66
//
77

8-
import Foundation
9-
108
struct AdditionalMetadata {
119
let name: String
1210
let value: String?

0 commit comments

Comments
 (0)