-
-
Notifications
You must be signed in to change notification settings - Fork 4
Update for Swift 6 #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ptoffy
wants to merge
10
commits into
main
Choose a base branch
from
swift-6
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b8ffb2d
Update for Swift 6
ptoffy e65d02b
Add import for Linux
ptoffy 40d3d8c
Code review and nits
ptoffy 8cbe61c
Merge branch 'main' into swift-6
ptoffy 8534d36
Fix
ptoffy 131b7de
Update CI with matrix
ptoffy 4cecfd7
Remove minor versions in CI
ptoffy 04cfb89
Re-add minor versions in CI
ptoffy 077a414
Address review
ptoffy 3302503
Configurable max body size
ptoffy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
name: Run Tests on Elasticsearch ${{ matrix.es-version }} | ||
strategy: | ||
matrix: | ||
es-version: ['7.6.2', '8.4.1', '9.1.0'] | ||
services: | ||
elasticsearch: | ||
image: "docker.elastic.co/elasticsearch/elasticsearch:${{ matrix.es-version }}" | ||
ports: | ||
- 9200:9200 | ||
env: | ||
discovery.type: single-node | ||
xpack.security.enabled: false | ||
steps: | ||
- uses: actions/checkout@v5 | ||
- name: Test | ||
run: swift test | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
.DS_Store | ||
/.build | ||
/.index-build | ||
/Packages | ||
/*.xcodeproj | ||
xcuserdata/ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
"fileScopedDeclarationPrivacy": { | ||
"accessLevel": "private" | ||
}, | ||
"indentation": { | ||
"spaces": 4 | ||
}, | ||
"indentConditionalCompilationBlocks": true, | ||
"indentSwitchCaseLabels": false, | ||
"lineBreakAroundMultilineExpressionChainComponents": false, | ||
"lineBreakBeforeControlFlowKeywords": false, | ||
"lineBreakBeforeEachArgument": false, | ||
"lineBreakBeforeEachGenericRequirement": false, | ||
"lineLength": 140, | ||
"maximumBlankLines": 1, | ||
"multiElementCollectionTrailingCommas": true, | ||
"noAssignmentInExpressions": { | ||
"allowedFunctions": [ | ||
"XCTAssertNoThrow" | ||
] | ||
}, | ||
"prioritizeKeepingFunctionOutputTogether": false, | ||
"respectsExistingLineBreaks": true, | ||
"rules": { | ||
"AllPublicDeclarationsHaveDocumentation": false, | ||
"AlwaysUseLiteralForEmptyCollectionInit": false, | ||
"AlwaysUseLowerCamelCase": true, | ||
"AmbiguousTrailingClosureOverload": true, | ||
"BeginDocumentationCommentWithOneLineSummary": false, | ||
"DoNotUseSemicolons": true, | ||
"DontRepeatTypeInStaticProperties": true, | ||
"FileScopedDeclarationPrivacy": true, | ||
"FullyIndirectEnum": true, | ||
"GroupNumericLiterals": true, | ||
"IdentifiersMustBeASCII": true, | ||
"NeverForceUnwrap": false, | ||
"NeverUseForceTry": false, | ||
"NeverUseImplicitlyUnwrappedOptionals": false, | ||
"NoAccessLevelOnExtensionDeclaration": true, | ||
"NoAssignmentInExpressions": true, | ||
"NoBlockComments": true, | ||
"NoCasesWithOnlyFallthrough": true, | ||
"NoEmptyTrailingClosureParentheses": true, | ||
"NoLabelsInCasePatterns": true, | ||
"NoLeadingUnderscores": false, | ||
"NoParensAroundConditions": true, | ||
"NoPlaygroundLiterals": true, | ||
"NoVoidReturnOnFunctionSignature": true, | ||
"OmitExplicitReturns": false, | ||
"OneCasePerLine": true, | ||
"OneVariableDeclarationPerLine": true, | ||
"OnlyOneTrailingClosureArgument": true, | ||
"OrderedImports": true, | ||
"ReplaceForEachWithForLoop": true, | ||
"ReturnVoidInsteadOfEmptyTuple": true, | ||
"TypeNamesShouldBeCapitalized": true, | ||
"UseEarlyExits": false, | ||
"UseExplicitNilCheckInConditions": true, | ||
"UseLetInEveryBoundCaseVariable": true, | ||
"UseShorthandTypeNames": true, | ||
"UseSingleLinePropertyGetter": true, | ||
"UseSynthesizedInitializer": true, | ||
"UseTripleSlashForDocumentationComments": true, | ||
"UseWhereClausesInForLoops": false, | ||
"ValidateDocumentationComments": false | ||
}, | ||
"spacesAroundRangeFormationOperators": false, | ||
"tabWidth": 4, | ||
"version": 1 | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,33 @@ | ||
// swift-tools-version:5.3 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
// swift-tools-version:6.0 | ||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "elasticsearch-nio-client", | ||
name: "elasticsearch-swift", | ||
platforms: [ | ||
.macOS(.v10_15), | ||
.iOS(.v13) | ||
.macOS(.v13), | ||
.iOS(.v15), | ||
], | ||
products: [ | ||
// Products define the executables and libraries a package produces, and make them visible to other packages. | ||
.library( | ||
name: "ElasticsearchNIOClient", | ||
targets: ["ElasticsearchNIOClient"]), | ||
name: "Elasticsearch", | ||
targets: ["Elasticsearch"] | ||
) | ||
], | ||
dependencies: [ | ||
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.0.0"), | ||
.package(url: "https://github.com/apple/swift-nio.git", from: "2.33.0"), | ||
.package(url: "https://github.com/apple/swift-http-types.git", from: "1.4.0"), | ||
], | ||
targets: [ | ||
// Targets are the basic building blocks of a package. A target can define a module or a test suite. | ||
// Targets can depend on other targets in this package, and on products in packages this package depends on. | ||
.target( | ||
name: "ElasticsearchNIOClient", | ||
name: "Elasticsearch", | ||
dependencies: [ | ||
.product(name: "AsyncHTTPClient", package: "async-http-client"), | ||
.product(name: "NIOCore", package: "swift-nio"), | ||
.product(name: "NIOHTTP1", package: "swift-nio"), | ||
.product(name: "NIOFoundationCompat", package: "swift-nio"), | ||
]), | ||
.product(name: "HTTPTypes", package: "swift-http-types"), | ||
] | ||
), | ||
.testTarget( | ||
name: "ElasticsearchNIOClientTests", | ||
dependencies: ["ElasticsearchNIOClient"]), | ||
name: "ElasticsearchTests", | ||
dependencies: ["Elasticsearch"] | ||
), | ||
] | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably keep the client suffix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree, I'd argue the norm is to have
import <Service>
, likeimport Valkey
,import GRCP
,import Soto
etc. We can then havelet client: ElasticsearchClient