-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
significant api changes for consistency
- Loading branch information
1 parent
64b8a15
commit 3d411d5
Showing
58 changed files
with
1,304 additions
and
465 deletions.
There are no files selected for viewing
This file contains 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 +1 @@ | ||
5.7 | ||
5.8 |
This file contains 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,83 +1,115 @@ | ||
--exclude Sources/AnyCodable | ||
|
||
# options | ||
--swiftversion 5.7 | ||
--self remove # redundantSelf | ||
--importgrouping testable-bottom # sortedImports | ||
--commas always # trailingCommas | ||
--trimwhitespace always # trailingSpace | ||
--indent 2 #indent | ||
--ifdef no-indent #indent | ||
--indentstrings true #indent | ||
--wraparguments before-first # wrapArguments | ||
--wrapparameters before-first # wrapArguments | ||
--wrapcollections before-first # wrapArguments | ||
--wrapconditions before-first # wrapArguments | ||
--wrapreturntype if-multiline #wrapArguments | ||
--closingparen balanced # wrapArguments | ||
--wraptypealiases before-first # wrapArguments | ||
--funcattributes prev-line # wrapAttributes | ||
--typeattributes prev-line # wrapAttributes | ||
--wrapternary before-operators # wrap | ||
--structthreshold 30 # organizeDeclarations | ||
--enumthreshold 30 # organizeDeclarations | ||
--organizetypes class,struct,enum,extension,actor # organizeDeclarations | ||
--markcategories false #organizeDeclarations | ||
--extensionacl on-declarations # extensionAccessControl | ||
--patternlet inline # hoistPatternLet | ||
--redundanttype inferred # redundantType | ||
--typeblanklines preserve # blankLinesAtStartOfScope, blankLinesAtEndOfScope | ||
--emptybraces no-space # emptyBraces | ||
--maxwidth 120 # wrap | ||
|
||
# rules | ||
--rules acronyms | ||
--rules andOperator | ||
--rules anyObjectProtocol | ||
--rules blankLinesAtEndOfScope | ||
--rules blankLinesAtStartOfScope | ||
--rules blankLinesBetweenImports | ||
--rules blankLinesBetweenScopes | ||
--rules blockComments | ||
--rules braces | ||
--rules consecutiveBlankLines | ||
--rules consecutiveSpaces | ||
--rules docComments | ||
--rules duplicateImports | ||
--rules elseOnSameLine | ||
--rules emptyBraces | ||
--rules enumNamespaces | ||
--rules extensionAccessControl | ||
--rules fileHeader | ||
--rules genericExtensions | ||
--rules hoistPatternLet | ||
--rules indent | ||
--rules initCoderUnavailable | ||
--rules isEmpty | ||
--rules markTypes | ||
--rules modifierOrder | ||
--rules numberFormatting | ||
--rules opaqueGenericParameters | ||
--rules organizeDeclarations | ||
--rules preferKeyPath | ||
--rules redundantBackticks | ||
--rules redundantBreak | ||
--rules redundantClosure | ||
--rules redundantExtensionACL | ||
--rules redundantFileprivate | ||
--rules redundantGet | ||
--rules redundantInit | ||
--rules redundantLet | ||
--rules redundantNilInit | ||
--rules redundantObjc | ||
--rules redundantParens | ||
--rules redundantPattern | ||
--rules redundantRawValues | ||
--rules redundantReturn | ||
--rules redundantSelf | ||
--rules redundantType | ||
--rules redundantVoidReturnType | ||
--rules semicolons | ||
--rules sortDeclarations | ||
--rules sortedImports | ||
--rules sortedSwitchCases | ||
--rules spaceAroundBraces | ||
--rules spaceAroundComments | ||
--rules spaceAroundGenerics | ||
--rules spaceAroundOperators | ||
--rules spaceAroundParens | ||
--rules spaceInsideBraces | ||
--rules spaceInsideBrackets | ||
--rules spaceInsideComments | ||
--rules spaceInsideGenerics | ||
--rules spaceInsideParens | ||
--rules strongifiedSelf | ||
--rules todos | ||
--rules trailingClosures | ||
--rules trailingCommas | ||
--rules trailingSpace | ||
--rules typeSugar | ||
--rules unusedArguments | ||
--rules void | ||
--rules wrap | ||
--rules wrapArguments | ||
--rules wrapAttributes | ||
--rules wrapConditionalBodies | ||
--rules wrapEnumCases | ||
--rules wrapMultilineStatementBraces | ||
--rules wrapSingleLineComments | ||
--rules wrapSwitchCases | ||
|
||
--acronyms ID,URL,UUID # acronyms | ||
--closingparen balanced # wrapArguments | ||
--closurevoid remove # redundantVoidReturnType | ||
--commas always # trailingCommas | ||
--decimalgrouping 3,6 # numberFormatting | ||
--emptybraces spaced # emptyBraces | ||
--enumthreshold 30 # organizeDeclarations | ||
--extensionacl on-declarations # extensionAccessControl | ||
--funcattributes prev-line # wrapAttributes | ||
--header strip # fileHeader | ||
--ifdef noindent #indent | ||
--importgrouping testable-bottom # sortedImports | ||
--indent 2 #indent | ||
--indentcase false #indent | ||
--indentstrings true #indent | ||
--lifecycle # organizeDeclarations | ||
--markcategories true #organizeDeclarations | ||
--maxwidth 100 # wrap | ||
--modifierorder public,private(set),private,internal,final,override,convenience # modifierOrder | ||
--operatorfunc spaced # spaceAroundOperators | ||
--organizetypes class,struct,enum,extension,actor # organizeDeclarations | ||
--patternlet inline # hoistPatternLet | ||
--ranges spaced # spaceAroundOperators | ||
--redundanttype infer-locals-only # redundantType | ||
--self init-only # redundantSelf | ||
--structthreshold 30 # organizeDeclarations | ||
--tabwidth 2 # indent | ||
--trimwhitespace always # trailingSpace | ||
--typeattributes prev-line # wrapAttributes | ||
--typeblanklines preserve # blankLinesAtStartOfScope, blankLinesAtEndOfScope | ||
--varattributes same-line # wrapAttributes | ||
--wraparguments before-first # wrapArguments | ||
--wrapcollections before-first # wrapArguments | ||
--wrapconditions before-first # wrapArguments | ||
--wrapparameters before-first # wrapArguments | ||
--wrapreturntype if-multiline # wrapArguments | ||
--wrapternary before-operators # wrapAttributes | ||
--wraptypealiases before-first # wrapArguments |
This file contains 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 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 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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,41 @@ | ||
|
||
extension Emitter { | ||
public static func bridge<Seq: AsyncSequence>(_ sequence: Seq) -> some Emitting<Seq.Element> { | ||
AsyncToEmitterBridge(sequence) | ||
} | ||
} | ||
|
||
// MARK: - AsyncToEmitterBridge | ||
|
||
public struct AsyncToEmitterBridge<Seq: AsyncSequence>: Emitting, @unchecked Sendable { | ||
public typealias Output = Seq.Element | ||
|
||
public func subscribe<S: Subscriber>(_ subscriber: S) -> AnyDisposable | ||
where Seq.Element == S.Value | ||
{ | ||
let stage = DisposableStage() | ||
Emitter | ||
.create(Output.self) { emit in | ||
AnyDisposable(Task { | ||
do { | ||
for try await value in seq { | ||
emit(.value(value)) | ||
} | ||
emit(.finished) | ||
} catch { | ||
emit(.failed(error)) | ||
} | ||
}) | ||
.stage(on: stage) | ||
} | ||
.subscribe(subscriber) | ||
.stage(on: stage) | ||
return stage.erase() | ||
} | ||
|
||
private let seq: Seq | ||
|
||
public init(_ sequence: Seq) where Output == Seq.Element { | ||
self.seq = sequence | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.