Skip to content

Commit 18f343f

Browse files
authored
swift 6 update (#7)
* swift 6 updates * improve some test * update readme, update comments
1 parent af34612 commit 18f343f

File tree

243 files changed

+947
-931
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

243 files changed

+947
-931
lines changed

.github/workflows/actions.yml

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

.github/workflows/deployment.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Deployment
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
- '[0-9]*'
8+
9+
jobs:
10+
11+
create-docc-and-deploy:
12+
uses: BinaryBirds/github-workflows/.github/workflows/docc_deploy.yml@main
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write

.github/workflows/testing.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Testing
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
10+
swiftlang_checks:
11+
name: Swiftlang Checks
12+
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
13+
with:
14+
license_header_check_project_name: "project"
15+
format_check_enabled : true
16+
broken_symlink_check_enabled : true
17+
unacceptable_language_check_enabled : true
18+
shell_check_enabled : true
19+
docs_check_enabled : false
20+
api_breakage_check_enabled : false
21+
license_header_check_enabled : false
22+
yamllint_check_enabled : false
23+
python_lint_check_enabled : false
24+
25+
bb_checks:
26+
name: BB Checks
27+
uses: BinaryBirds/github-workflows/.github/workflows/extra_soundness.yml@main
28+
with:
29+
local_swift_dependencies_check_enabled : true
30+
headers_check_enabled : true
31+
docc_warnings_check_enabled : true
32+
33+
swiftlang_tests:
34+
name: Swiftlang Tests
35+
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
36+
with:
37+
enable_windows_checks : false
38+
linux_build_command: "swift test --parallel --enable-code-coverage"
39+
linux_exclude_swift_versions: "[{\"swift_version\": \"5.8\"}, {\"swift_version\": \"5.9\"}, {\"swift_version\": \"5.10\"}, {\"swift_version\": \"nightly\"}, {\"swift_version\": \"nightly-main\"}, {\"swift_version\": \"6.0\"}, {\"swift_version\": \"nightly-6.0\"}, {\"swift_version\": \"nightly-6.1\"}, {\"swift_version\": \"nightly-6.3\"}]"

.swift-format

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

.swiftformatignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Package.swift

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
MIT License
22

33
Copyright (c) 2018-2022 Tibor Bödecs
4-
Copyright (c) 2022-2023 Binary Birds Ltd.
4+
Copyright (c) 2022-2026 Binary Birds Kft.
55

66
Permission is hereby granted, free of charge, to any person
77
obtaining a copy of this software and associated documentation

Makefile

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,42 @@
1-
build:
2-
swift build
1+
SHELL=/bin/bash
32

4-
release:
5-
swift build -c release
6-
7-
test:
8-
swift test --parallel
3+
baseUrl = https://raw.githubusercontent.com/BinaryBirds/github-workflows/refs/heads/main/scripts
94

10-
test-with-coverage:
11-
swift test --parallel --enable-code-coverage
5+
check: symlinks language deps lint docc-warnings headers
126

13-
clean:
14-
rm -rf .build
7+
symlinks:
8+
curl -s $(baseUrl)/check-broken-symlinks.sh | bash
9+
10+
language:
11+
curl -s $(baseUrl)/check-unacceptable-language.sh | bash
12+
13+
deps:
14+
curl -s $(baseUrl)/check-local-swift-dependencies.sh | bash
15+
16+
lint:
17+
curl -s $(baseUrl)/run-swift-format.sh | bash
1518

1619
format:
17-
swift-format -i -r ./Sources && swift-format -i -r ./Tests
20+
curl -s $(baseUrl)/run-swift-format.sh | bash -s -- --fix
21+
22+
docc-local:
23+
curl -s $(baseUrl)/generate-docc.sh | bash -s -- --local
1824

19-
doc:
20-
swift package --allow-writing-to-directory ./docs \
21-
generate-documentation --target FeatherSpec \
22-
--include-extended-types \
23-
--disable-indexing \
24-
--transform-for-static-hosting \
25-
--hosting-base-path feather-spec \
26-
--output-path ./docs
25+
run-docc:
26+
curl -s $(baseUrl)/run-docc-docker.sh | bash
27+
28+
docc-warnings:
29+
curl -s $(baseUrl)/check-docc-warnings.sh | bash
30+
31+
headers:
32+
curl -s $(baseUrl)/check-swift-headers.sh | bash
33+
34+
fix-headers:
35+
curl -s $(baseUrl)/check-swift-headers.sh | bash -s -- --fix
2736

28-
preview:
29-
swift package --disable-sandbox preview-documentation --target FeatherSpec
37+
test:
38+
swift test --parallel
39+
40+
docker-test:
41+
docker build -t tests . -f ./docker/tests/Dockerfile && docker run --rm tests
42+

Package.resolved

Lines changed: 2 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,40 @@
1-
// swift-tools-version:5.9
1+
// swift-tools-version:6.1
22
import PackageDescription
33

4+
// NOTE: https://github.com/swift-server/swift-http-server/blob/main/Package.swift
5+
var defaultSwiftSettings: [SwiftSetting] =
6+
[
7+
// https://github.com/swiftlang/swift-evolution/blob/main/proposals/0441-formalize-language-mode-terminology.md
8+
.swiftLanguageMode(.v6),
9+
// https://github.com/swiftlang/swift-evolution/blob/main/proposals/0444-member-import-visibility.md
10+
.enableUpcomingFeature("MemberImportVisibility"),
11+
// https://forums.swift.org/t/experimental-support-for-lifetime-dependencies-in-swift-6-2-and-beyond/78638
12+
.enableExperimentalFeature("Lifetimes"),
13+
// https://github.com/swiftlang/swift/pull/65218
14+
.enableExperimentalFeature("AvailabilityMacro=featherDatabase 1.0:macOS 15.0, iOS 18.0, tvOS 18.0, watchOS 11.0, visionOS 2.0"),
15+
]
16+
17+
#if compiler(>=6.2)
18+
defaultSwiftSettings.append(
19+
// https://github.com/swiftlang/swift-evolution/blob/main/proposals/0461-async-function-isolation.md
20+
.enableUpcomingFeature("NonisolatedNonsendingByDefault")
21+
)
22+
#endif
23+
424
let package = Package(
525
name: "feather-spec",
626
platforms: [
7-
.macOS(.v13),
8-
.iOS(.v16),
9-
.tvOS(.v16),
10-
.watchOS(.v9),
11-
.visionOS(.v1),
27+
.macOS(.v15),
28+
.iOS(.v18),
29+
.tvOS(.v18),
30+
.watchOS(.v11),
31+
.visionOS(.v2),
1232
],
1333
products: [
1434
.library(name: "FeatherSpec", targets: ["FeatherSpec"]),
1535
],
1636
dependencies: [
1737
.package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.0.0"),
18-
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")
1938
],
2039
targets: [
2140
.target(name: "FeatherSpec", dependencies: [

0 commit comments

Comments
 (0)