Skip to content

Commit d9c1273

Browse files
Merge pull request #7 from lemo-nade-room/migrate-swift6
Swift6移行
2 parents d74df3d + 2334fcf commit d9c1273

File tree

13 files changed

+155
-166
lines changed

13 files changed

+155
-166
lines changed

.github/workflows/build.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/ci.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: ci
2+
on:
3+
push:
4+
branches: [ main ]
5+
paths:
6+
- ".github/workflows/ci.yaml"
7+
- "**.swift"
8+
- ".swift-format"
9+
- "Package.resolved"
10+
pull_request:
11+
branches: [ main ]
12+
paths:
13+
- ".github/workflows/ci.yaml"
14+
- "**.swift"
15+
- ".swift-format"
16+
- "Package.resolved"
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
lint:
24+
timeout-minutes: 5
25+
runs-on: macos-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: Homebrew/actions/setup-homebrew@master
29+
- run: brew install swift-format
30+
- run: swift format lint -s --configuration .swift-format -r Sources Tests Package.swift
31+
build:
32+
timeout-minutes: 10
33+
runs-on: ubuntu-latest
34+
needs: lint
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: actions/cache@v4
38+
with:
39+
key: swift-build-package-resolved-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Package.resolved') }}
40+
path: .build
41+
- uses: swift-actions/setup-swift@v2
42+
with:
43+
swift-version: "6.0"
44+
- run: swift build
45+
test:
46+
timeout-minutes: 10
47+
runs-on: ubuntu-latest
48+
needs: build
49+
steps:
50+
- uses: actions/checkout@v4
51+
- uses: actions/cache@v4
52+
with:
53+
key: swift-build-package-resolved-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Package.resolved') }}
54+
path: .build
55+
- uses: swift-actions/setup-swift@v2
56+
with:
57+
swift-version: "6.0"
58+
- run: swift test

.github/workflows/swiftlint.yaml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/test.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ DerivedData/
66
.swiftpm/configuration/registries.json
77
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
88
.netrc
9+
docs
10+
.idea

.swift-format

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"fileScopedDeclarationPrivacy" : {
3+
"accessLevel" : "private"
4+
},
5+
"indentConditionalCompilationBlocks" : true,
6+
"indentSwitchCaseLabels" : false,
7+
"indentation" : {
8+
"spaces" : 4
9+
},
10+
"lineBreakAroundMultilineExpressionChainComponents" : false,
11+
"lineBreakBeforeControlFlowKeywords" : false,
12+
"lineBreakBeforeEachArgument" : false,
13+
"lineBreakBeforeEachGenericRequirement" : false,
14+
"lineLength" : 100,
15+
"maximumBlankLines" : 1,
16+
"multiElementCollectionTrailingCommas" : true,
17+
"noAssignmentInExpressions" : {
18+
"allowedFunctions" : [
19+
"XCTAssertNoThrow"
20+
]
21+
},
22+
"prioritizeKeepingFunctionOutputTogether" : false,
23+
"respectsExistingLineBreaks" : true,
24+
"rules" : {
25+
"AllPublicDeclarationsHaveDocumentation" : true,
26+
"AlwaysUseLiteralForEmptyCollectionInit" : false,
27+
"AlwaysUseLowerCamelCase" : false,
28+
"AmbiguousTrailingClosureOverload" : true,
29+
"BeginDocumentationCommentWithOneLineSummary" : false,
30+
"DoNotUseSemicolons" : true,
31+
"DontRepeatTypeInStaticProperties" : true,
32+
"FileScopedDeclarationPrivacy" : true,
33+
"FullyIndirectEnum" : true,
34+
"GroupNumericLiterals" : true,
35+
"IdentifiersMustBeASCII" : false,
36+
"NeverForceUnwrap" : false,
37+
"NeverUseForceTry" : false,
38+
"NeverUseImplicitlyUnwrappedOptionals" : false,
39+
"NoAccessLevelOnExtensionDeclaration" : true,
40+
"NoAssignmentInExpressions" : true,
41+
"NoBlockComments" : false,
42+
"NoCasesWithOnlyFallthrough" : true,
43+
"NoEmptyTrailingClosureParentheses" : true,
44+
"NoLabelsInCasePatterns" : true,
45+
"NoLeadingUnderscores" : false,
46+
"NoParensAroundConditions" : true,
47+
"NoPlaygroundLiterals" : true,
48+
"NoVoidReturnOnFunctionSignature" : true,
49+
"OmitExplicitReturns" : false,
50+
"OneCasePerLine" : true,
51+
"OneVariableDeclarationPerLine" : true,
52+
"OnlyOneTrailingClosureArgument" : true,
53+
"OrderedImports" : true,
54+
"ReplaceForEachWithForLoop" : true,
55+
"ReturnVoidInsteadOfEmptyTuple" : true,
56+
"TypeNamesShouldBeCapitalized" : true,
57+
"UseEarlyExits" : false,
58+
"UseExplicitNilCheckInConditions" : true,
59+
"UseLetInEveryBoundCaseVariable" : true,
60+
"UseShorthandTypeNames" : true,
61+
"UseSingleLinePropertyGetter" : true,
62+
"UseSynthesizedInitializer" : true,
63+
"UseTripleSlashForDocumentationComments" : true,
64+
"UseWhereClausesInForLoops" : false,
65+
"ValidateDocumentationComments" : true
66+
},
67+
"spacesAroundRangeFormationOperators" : false,
68+
"tabWidth" : 8,
69+
"version" : 1
70+
}
71+

.swiftlint.yml

Lines changed: 0 additions & 67 deletions
This file was deleted.

Package.resolved

Lines changed: 1 addition & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.10
1+
// swift-tools-version: 6.0
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import Foundation
@@ -11,10 +11,9 @@ let package = Package(
1111
.library(
1212
name: "CryptoCodable",
1313
targets: ["CryptoCodable"]
14-
),
14+
)
1515
],
1616
dependencies: [
17-
.package(url: "https://github.com/apple/swift-testing.git", from: "0.10.0"),
1817
.package(url: "https://github.com/swiftlang/swift-docc-plugin.git", from: "1.0.0"),
1918
.package(url: "https://github.com/realm/SwiftLint.git", branch: "main"),
2019
.package(url: "https://github.com/apple/swift-crypto.git", from: "3.0.0"),
@@ -23,27 +22,28 @@ let package = Package(
2322
.target(
2423
name: "CryptoCodable",
2524
dependencies: [
26-
.product(name: "Crypto", package: "swift-crypto"),
25+
.product(name: "Crypto", package: "swift-crypto")
2726
],
2827
swiftSettings: swiftSettings,
2928
plugins: swiftLintPlugins
3029
),
3130
.testTarget(
3231
name: "CryptoCodableTests",
3332
dependencies: [
34-
"CryptoCodable",
35-
.product(name: "Testing", package: "swift-testing"),
33+
"CryptoCodable"
3634
],
3735
swiftSettings: swiftSettings,
3836
plugins: swiftLintPlugins
3937
),
40-
]
38+
],
39+
swiftLanguageModes: [.v6]
4140
)
4241

43-
var swiftSettings: [SwiftSetting] { [
44-
.enableUpcomingFeature("DisableOutwardActorInference"),
45-
.enableExperimentalFeature("StrictConcurrency"),
46-
] }
42+
var swiftSettings: [SwiftSetting] {
43+
[
44+
.enableExperimentalFeature("StrictConcurrency")
45+
]
46+
}
4747

4848
var swiftLintPlugins: [Target.PluginUsage] {
4949
guard Environment.enableSwiftLint else { return [] }

Sources/CryptoCodable/CryptoField.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ public struct CryptoField<T>: Codable, Sendable, Hashable where T: Sendable & Co
8080
let plainData: Data
8181
do {
8282
plainData = try AES.GCM.open(.init(combined: cipherData), using: key)
83-
} catch CryptoKitError.authenticationFailure, CryptoKitError.underlyingCoreCryptoError(error: _) {
83+
} catch CryptoKitError.authenticationFailure, CryptoKitError.underlyingCoreCryptoError(
84+
error: _)
85+
{
8486
throw DecryptFailure()
8587
}
8688
wrappedValue = try CryptoConfigContainer.decoder.decode(T.self, from: plainData)

0 commit comments

Comments
 (0)