Skip to content

Commit 6e49ecb

Browse files
committed
Initial adoption of github actions
1 parent c8f217f commit 6e49ecb

File tree

82 files changed

+2054
-1602
lines changed

Some content is hidden

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

82 files changed

+2054
-1602
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
_[One line description of your change]_
2+
3+
### Motivation:
4+
5+
_[Explain here the context, and why you're making that change. What is the problem you're trying to solve.]_
6+
7+
### Modifications:
8+
9+
_[Describe the modifications you've done.]_
10+
11+
### Result:
12+
13+
- Resolves #
14+
- _[After your change, what will change.]_

.github/release.yml

-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ changelog:
1515
- title: 🚨🚨🚨 Missing Labels - Add labels to the prs listed here and generate the release notes again
1616
labels:
1717
- "*"
18-

.github/workflows/pull_request.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PR
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize]
6+
7+
jobs:
8+
soundness:
9+
name: Soundness
10+
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
11+
with:
12+
license_header_check_project_name: "RediStack"
13+
14+
unit-tests:
15+
name: Unit tests
16+
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
17+
with:
18+
linux_exclude_swift_versions: "[{\"swift_version\": \"5.8\"}]"
19+
# since we don't have systemctl, we run the redis server manually in the background
20+
linux_pre_build_command: apt-get update -y && apt-get install redis -y
21+
linux_env_vars: REDIS_URL=redis
22+
linux_build_command: bash -c 'redis-server &; swift test'
23+
enable_windows_checks: false
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: PR label
2+
3+
on:
4+
pull_request:
5+
types: [labeled, unlabeled, opened, reopened, synchronize]
6+
7+
jobs:
8+
semver-label-check:
9+
name: Semantic Version label check
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 1
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
with:
16+
persist-credentials: false
17+
- name: Check for Semantic Version label
18+
uses: apple/swift-nio/.github/actions/pull_request_semver_label_checker@main

.licenseignore

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
.gitignore
2+
**/.gitignore
3+
.licenseignore
4+
.gitattributes
5+
.git-blame-ignore-revs
6+
.mailfilter
7+
.mailmap
8+
.spi.yml
9+
.swift-format
10+
.editorconfig
11+
.github/*
12+
*.md
13+
*.txt
14+
*.yml
15+
*.yaml
16+
*.json
17+
Package.swift
18+
**/Package.swift
19+
Package@-*.swift
20+
**/Package@-*.swift
21+
Package.resolved
22+
**/Package.resolved
23+
Makefile
24+
*.modulemap
25+
**/*.modulemap
26+
**/*.docc/*
27+
*.xcprivacy
28+
**/*.xcprivacy
29+
*.symlink
30+
**/*.symlink
31+
Dockerfile
32+
**/Dockerfile
33+
Snippets/*
34+
dev/git.commit.template
35+
.unacceptablelanguageignore
36+
IntegrationTests/*.sh

.swift-format

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

.yamllint.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extends: default
2+
3+
rules:
4+
line-length: false
5+
document-start: false
6+
truthy:
7+
check-keys: false # Otherwise we get a false positive on GitHub action's `on` key

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ When editing a file, ensure that the copyright header states the year `2019-<cur
3737

3838
### Git Workflow
3939

40-
`master` is always the development branch.
40+
`main` is always the development branch.
4141

4242
For **minor** or **patch** SemVer changes, create a branch off of the tagged commit.
4343

Package.swift

+9-9
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ let package = Package(
2020
products: [
2121
.library(name: "RediStack", targets: ["RediStack"]),
2222
.library(name: "RediStackTestUtils", targets: ["RediStackTestUtils"]),
23-
.library(name: "RedisTypes", targets: ["RedisTypes"])
23+
.library(name: "RedisTypes", targets: ["RedisTypes"]),
2424
],
2525
dependencies: [
2626
.package(url: "https://github.com/apple/swift-atomics.git", from: "1.1.0"),
2727
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
28-
.package(url: "https://github.com/apple/swift-metrics.git", "1.0.0" ..< "3.0.0"),
28+
.package(url: "https://github.com/apple/swift-metrics.git", "1.0.0"..<"3.0.0"),
2929
.package(url: "https://github.com/apple/swift-nio.git", from: "2.43.0"),
3030
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.23.1"),
3131
],
@@ -40,7 +40,7 @@ let package = Package(
4040
.product(name: "NIOSSL", package: "swift-nio-ssl"),
4141
.product(name: "Atomics", package: "swift-atomics"),
4242
.product(name: "Logging", package: "swift-log"),
43-
.product(name: "Metrics", package: "swift-metrics")
43+
.product(name: "Metrics", package: "swift-metrics"),
4444
]
4545
),
4646
.target(name: "RedisTypes", dependencies: ["RediStack"]),
@@ -49,13 +49,13 @@ let package = Package(
4949
dependencies: [
5050
.product(name: "NIOCore", package: "swift-nio"),
5151
.product(name: "NIOEmbedded", package: "swift-nio"),
52-
"RediStack"
52+
"RediStack",
5353
]
5454
),
5555
.target(
5656
name: "RESP3",
5757
dependencies: [
58-
.product(name: "NIOCore", package: "swift-nio"),
58+
.product(name: "NIOCore", package: "swift-nio")
5959
]
6060
),
6161
.testTarget(
@@ -65,14 +65,14 @@ let package = Package(
6565
"RediStackTestUtils",
6666
.product(name: "Atomics", package: "swift-atomics"),
6767
.product(name: "NIO", package: "swift-nio"),
68-
.product(name: "NIOTestUtils", package: "swift-nio")
68+
.product(name: "NIOTestUtils", package: "swift-nio"),
6969
]
7070
),
7171
.testTarget(
7272
name: "RedisTypesTests",
7373
dependencies: [
7474
"RediStack", "RedisTypes", "RediStackTestUtils",
75-
.product(name: "NIO", package: "swift-nio")
75+
.product(name: "NIO", package: "swift-nio"),
7676
]
7777
),
7878
.testTarget(
@@ -88,8 +88,8 @@ let package = Package(
8888
name: "RediStackIntegrationTests",
8989
dependencies: [
9090
"RediStack", "RediStackTestUtils",
91-
.product(name: "NIO", package: "swift-nio")
91+
.product(name: "NIO", package: "swift-nio"),
9292
]
93-
)
93+
),
9494
]
9595
)

Sources/RESP3/RESP3Token.swift

+8-9
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public struct RESP3Token: Hashable, Sendable {
3535
}
3636

3737
public mutating func next() -> RESP3Token? {
38-
return try! RESP3Token(consuming: &self.buffer)
38+
try! RESP3Token(consuming: &self.buffer)
3939
}
4040
}
4141
}
@@ -194,19 +194,19 @@ public struct RESP3Token: Hashable, Sendable {
194194
validated = try buffer.readRESPBooleanSlice()
195195

196196
case .some(.blobString),
197-
.some(.verbatimString),
198-
.some(.blobError):
197+
.some(.verbatimString),
198+
.some(.blobError):
199199
validated = try buffer.readRESPBlobStringSlice()
200200

201201
case .some(.simpleString),
202-
.some(.simpleError):
202+
.some(.simpleError):
203203
validated = try buffer.readRESPSimpleStringSlice()
204204

205205
case .some(.array),
206-
.some(.push),
207-
.some(.set),
208-
.some(.map),
209-
.some(.attribute):
206+
.some(.push),
207+
.some(.set),
208+
.some(.map),
209+
.some(.attribute):
210210
validated = try buffer.readRESPAggregateSlice(depth: depth)
211211

212212
case .some(.integer):
@@ -514,4 +514,3 @@ extension UInt32 {
514514
return value
515515
}()
516516
}
517-

Sources/RESP3/RESP3TypeIdentifier.swift

+15-15
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
enum RESP3TypeIdentifier: UInt8 {
16-
case integer = 58 // UInt8(ascii: ":")
17-
case double = 44 // UInt8.comma
18-
case simpleString = 43 // UInt8.plus
19-
case simpleError = 45 // UInt8.min
20-
case blobString = 36 // UInt8.dollar
21-
case blobError = 33 // UInt8.exclamationMark
22-
case verbatimString = 61 // UInt8.equals
23-
case boolean = 35 // UInt8.pound
24-
case null = 95 // UInt8.underscore
25-
case bigNumber = 40 // UInt8.leftRoundBracket
26-
case array = 42 // UInt8.asterisk
27-
case map = 37 // UInt8.percent
28-
case set = 126 // UInt8.tilde
29-
case attribute = 124 // UInt8.pipe
30-
case push = 62 // UInt8.rightAngledBracket
16+
case integer = 58 // UInt8(ascii: ":")
17+
case double = 44 // UInt8.comma
18+
case simpleString = 43 // UInt8.plus
19+
case simpleError = 45 // UInt8.min
20+
case blobString = 36 // UInt8.dollar
21+
case blobError = 33 // UInt8.exclamationMark
22+
case verbatimString = 61 // UInt8.equals
23+
case boolean = 35 // UInt8.pound
24+
case null = 95 // UInt8.underscore
25+
case bigNumber = 40 // UInt8.leftRoundBracket
26+
case array = 42 // UInt8.asterisk
27+
case map = 37 // UInt8.percent
28+
case set = 126 // UInt8.tilde
29+
case attribute = 124 // UInt8.pipe
30+
case push = 62 // UInt8.rightAngledBracket
3131
}
3232

3333
extension UInt8 {

Sources/RediStack/ChannelHandlers/RedisByteDecoder.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import NIOCore
2121
public final class RedisByteDecoder: NIOSingleStepByteToMessageDecoder {
2222
/// `ByteToMessageDecoder.InboundOut`
2323
public typealias InboundOut = RESPValue
24-
24+
2525
private let parser: RESPTranslator
26-
26+
2727
public init() {
2828
self.parser = RESPTranslator()
2929
}

0 commit comments

Comments
 (0)