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
Deprecate Task, use a Promise-based approach. v2.0.0 proposal #15
Conversation
SwiftLint found issuesWarnings
Errors
Generated by 🚫 Danger |
Codecov Report
@@ Coverage Diff @@
## master #15 +/- ##
===========================================
+ Coverage 51.98% 81.53% +29.54%
===========================================
Files 18 16 -2
Lines 504 601 +97
===========================================
+ Hits 262 490 +228
+ Misses 242 111 -131
Continue to review full report at Codecov.
|
Package.swift
Outdated
@@ -29,7 +30,7 @@ let package = Package( | |||
dependencies: ["RxSwift", "NIOConcurrencyHelpers"]), | |||
.testTarget( | |||
name: "MiniSwiftTests", | |||
dependencies: ["MiniSwift", "RxSwift"]), | |||
dependencies: ["MiniSwift", "NIOConcurrencyHelpers", "RxSwift", "Nimble", "RxTest", "RxBlocking"]), |
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.
Trailing Comma Violation: Collection literals should not have trailing commas. (trailing_comma)
Sources/MiniSwift/Promise.swift
Outdated
self.box.seal(.failure(error)) | ||
return self | ||
} | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
Scripts/update_docs.rb
Outdated
interface = JSON.parse(response) | ||
|
||
# Write just the interface all to a file, in theory we can make a HTML version of this in the future | ||
File.write("Documentation/Reference/Mini.swift", interface["key.sourcetext"]) |
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.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
||
interface = JSON.parse(response) | ||
|
||
# Write just the interface all to a file, in theory we can make a HTML version of this in the future |
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.
Metrics/LineLength: Line is too long. [100/80]
.gsub("[CWD]", Dir.pwd) | ||
.gsub("[TMP_DIR]", tmp_dir) | ||
|
||
File.write("Scripts/data/request.yml", file) |
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.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Scripts/update_docs.rb
Outdated
.gsub("[DEBUG_ROOT]", debug_dir) | ||
.gsub("[SDK_ROOT]", sdk_dir) | ||
.gsub("[CWD]", Dir.pwd) | ||
.gsub("[TMP_DIR]", tmp_dir) |
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.
Layout/MultilineMethodCallIndentation: Align .gsub with template on line 16.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Scripts/update_docs.rb
Outdated
file = template | ||
.gsub("[DEBUG_ROOT]", debug_dir) | ||
.gsub("[SDK_ROOT]", sdk_dir) | ||
.gsub("[CWD]", Dir.pwd) |
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.
Layout/MultilineMethodCallIndentation: Align .gsub with template on line 16.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
@@ -0,0 +1,33 @@ | |||
#!/usr/bin/env ruby |
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.
Lint/ScriptPermission: Script file update_docs.rb doesn't have execute permission.
Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.
Rakefile
Outdated
@@ -27,3 +27,8 @@ end | |||
task(:test) do | |||
sh('swift test') | |||
end | |||
|
|||
task(:docs) do | |||
sh('swift run sourcedocs generate --spm-module MiniSwift --output-folder Documentation/reference') |
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.
Metrics/LineLength: Line is too long. [100/80]
"rake docs", | ||
"Scripts/update_changelog.sh", | ||
], | ||
], |
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.
Trailing Comma Violation: Collection literals should not have trailing commas. (trailing_comma)
"before": [ | ||
"rake docs", | ||
"Scripts/update_changelog.sh", | ||
], |
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.
Trailing Comma Violation: Collection literals should not have trailing commas. (trailing_comma)
"rocket": [ | ||
"before": [ | ||
"rake docs", | ||
"Scripts/update_changelog.sh", |
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.
Trailing Comma Violation: Collection literals should not have trailing commas. (trailing_comma)
Package.swift
Outdated
.package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.35.8"), // dev | ||
.package(url: "https://github.com/shibapm/Rocket", from: "0.4.0"), // dev | ||
.package(url: "https://github.com/Realm/SwiftLint", from: "0.28.1"), // dev | ||
.package(url: "https://github.com/eneko/SourceDocs", from: "0.5.1"), // dev |
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.
Trailing Comma Violation: Collection literals should not have trailing commas. (trailing_comma)
Documentation/reference/Mini.swift
Outdated
extension PrimitiveSequenceType where Self: RxSwift.ObservableConvertibleType, Self.Trait == RxSwift.SingleTrait { | ||
public func dispatch<A>(action: A.Type, on dispatcher: MiniSwift.Dispatcher, mode: MiniSwift.Dispatcher.DispatchMode.UI = .async, fillOnError errorPayload: A.Payload? = nil) -> RxSwift.Disposable where A: MiniSwift.CompletableAction, Self.Element == A.Payload | ||
|
||
public func dispatch<A>(action: A.Type, key: A.Key, on dispatcher: MiniSwift.Dispatcher, mode: MiniSwift.Dispatcher.DispatchMode.UI = .async, fillOnError errorPayload: A.Payload? = nil) -> RxSwift.Disposable where A: MiniSwift.KeyedCompletableAction, Self.Element == A.Payload |
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.
Line Length Violation: Line should be 250 characters or less: currently 280 characters (line_length)
Documentation/reference/Mini.swift
Outdated
} | ||
|
||
extension PrimitiveSequenceType where Self: RxSwift.ObservableConvertibleType, Self.Trait == RxSwift.SingleTrait { | ||
public func dispatch<A>(action: A.Type, on dispatcher: MiniSwift.Dispatcher, mode: MiniSwift.Dispatcher.DispatchMode.UI = .async, fillOnError errorPayload: A.Payload? = nil) -> RxSwift.Disposable where A: MiniSwift.CompletableAction, Self.Element == A.Payload |
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.
Line Length Violation: Line should be 250 characters or less: currently 263 characters (line_length)
Documentation/reference/Mini.swift
Outdated
extension ObservableType where Self.Element: MiniSwift.StoreType, Self.Element: RxSwift.ObservableType, Self.Element.Element == Self.Element.State { | ||
public static func dispatch<A, Type, T>(using dispatcher: MiniSwift.Dispatcher, factory action: @autoclosure @escaping () -> A, taskMap: @escaping (Self.Element.State) -> T?, on store: Self.Element, lifetime: MiniSwift.Promises.Lifetime = .once) -> RxSwift.Observable<Self.Element.State> where A: MiniSwift.Action, T: MiniSwift.Promise<Type> | ||
|
||
public static func dispatch<A, K, Type, T>(using dispatcher: MiniSwift.Dispatcher, factory action: @autoclosure @escaping () -> A, key: K, taskMap: @escaping (Self.Element.State) -> [K: T], on store: Self.Element, lifetime: MiniSwift.Promises.Lifetime = .once) -> RxSwift.Observable<Self.Element.State> where A: MiniSwift.Action, K: Hashable, T: MiniSwift.Promise<Type> |
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.
Line Length Violation: Line should be 250 characters or less: currently 373 characters (line_length)
Documentation/reference/Mini.swift
Outdated
} | ||
|
||
extension ObservableType where Self.Element: MiniSwift.StoreType, Self.Element: RxSwift.ObservableType, Self.Element.Element == Self.Element.State { | ||
public static func dispatch<A, Type, T>(using dispatcher: MiniSwift.Dispatcher, factory action: @autoclosure @escaping () -> A, taskMap: @escaping (Self.Element.State) -> T?, on store: Self.Element, lifetime: MiniSwift.Promises.Lifetime = .once) -> RxSwift.Observable<Self.Element.State> where A: MiniSwift.Action, T: MiniSwift.Promise<Type> |
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.
Line Length Violation: Line should be 250 characters or less: currently 345 characters (line_length)
Documentation/reference/Mini.swift
Outdated
|
||
public subscript(_: Key, orPut _: @autoclosure () -> Value) -> Value { get } | ||
|
||
public subscript(_: Key) -> Value? { get } |
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.
Implicit Getter Violation: Computed read-only subscripts should avoid using the get keyword. (implicit_getter)
Documentation/reference/Mini.swift
Outdated
|
||
public func get(withKey key: Key) -> Value? | ||
|
||
public subscript(_: Key, orPut _: @autoclosure () -> Value) -> Value { get } |
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.
Implicit Getter Violation: Computed read-only subscripts should avoid using the get keyword. (implicit_getter)
Documentation/reference/Mini.swift
Outdated
init(promise: MiniSwift.Promise<Self.Payload?>) | ||
} | ||
|
||
@dynamicMemberLookup public final class Promise<T>: MiniSwift.PromiseType { |
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.
Attributes Violation: Attributes should be on their own lines in functions and types, but on the same line as variables and imports. (attributes)
Documentation/reference/Mini.swift
Outdated
|
||
/// Returns the item at the given index. | ||
/// Assertion fails if the index is out of the range of [0, count). | ||
public subscript(_: Int) -> T { get } |
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.
Implicit Getter Violation: Computed read-only subscripts should avoid using the get keyword. (implicit_getter)
Documentation/reference/Mini.swift
Outdated
|
||
public final class Dispatcher { | ||
public struct DispatchMode { | ||
public enum UI { |
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.
Nesting Violation: Types should be nested at most 1 level deep (nesting)
Type Name Violation: Type name should be between 3 and 40 characters long: 'UI' (type_name)
("test_reset_state", test_reset_state), | ||
("test_state_received_in_store", test_state_received_in_store), | ||
("test_subscribe_to_store_receive_actions", test_subscribe_to_store_receive_actions), | ||
("test_subscribe_to_store_receive_multiple_actions", test_subscribe_to_store_receive_multiple_actions), |
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.
Trailing Comma Violation: Collection literals should not have trailing commas. (trailing_comma)
("test_success_task_with_expiration_setted", test_success_task_with_expiration_setted), | ||
("test_success_task_with_expiration_setted_to_immediately", test_success_task_with_expiration_setted_to_immediately) | ||
static let __allTests__ReducerTests = [ | ||
("test_dispatcher_triggers_action_in_reducer_group_reducer", test_dispatcher_triggers_action_in_reducer_group_reducer), |
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.
Line Length Violation: Line should be 120 characters or less: currently 127 characters (line_length)
("test_expiration_of_task_created_with_past_date", test_expiration_of_task_created_with_past_date), | ||
("test_success_task_with_expiration_setted", test_success_task_with_expiration_setted), | ||
("test_success_task_with_expiration_setted_to_immediately", test_success_task_with_expiration_setted_to_immediately) | ||
static let __allTests__ReducerTests = [ |
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.
Identifier Name Violation: Variable name should only contain alphanumeric characters: '__allTests__ReducerTests' (identifier_name)
("test_is_rejected", test_is_rejected), | ||
("test_is_resolved", test_is_resolved), | ||
("test_promise_properties", test_promise_properties), | ||
("test_reject", test_reject), |
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.
Trailing Comma Violation: Collection literals should not have trailing commas. (trailing_comma)
// DO NOT MODIFY: This is autogenerated, use: | ||
// `swift test --generate-linuxmain` | ||
// to regenerate. | ||
static let __allTests__PromiseTests = [ |
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.
Identifier Name Violation: Variable name should only contain alphanumeric characters: '__allTests__PromiseTests' (identifier_name)
// DO NOT MODIFY: This is autogenerated, use: | ||
// `swift test --generate-linuxmain` | ||
// to regenerate. | ||
static let __allTests__DispatchQueueTests = [ |
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.
Identifier Name Violation: Variable name should only contain alphanumeric characters: '__allTests__DispatchQueueTests' (identifier_name)
@@ -16,7 +16,16 @@ extension DictionaryExtensionsTests { | |||
// to regenerate. | |||
static let __allTests__DictionaryExtensionsTests = [ | |||
("test_get_or_put", test_get_or_put), | |||
("test_unrapping_subscript", test_unrapping_subscript) | |||
("test_unrapping_subscript", test_unrapping_subscript), |
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.
Trailing Comma Violation: Collection literals should not have trailing commas. (trailing_comma)
@@ -6,7 +6,7 @@ extension ChainTests { | |||
// `swift test --generate-linuxmain` | |||
// to regenerate. | |||
static let __allTests__ChainTests = [ | |||
("test_forwarding_chain_forwards_action", test_forwarding_chain_forwards_action) | |||
("test_forwarding_chain_forwards_action", test_forwarding_chain_forwards_action), |
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.
Trailing Comma Violation: Collection literals should not have trailing commas. (trailing_comma)
@testable import MiniSwift | ||
|
||
final class DispatchQueueTests: XCTestCase { | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
.just(1) | ||
.action(TestCompletableAction.self) | ||
.toBlocking(timeout: 5.0).first() else { fatalError() } | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
} | ||
|
||
func test_completable_action_action() throws { | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
.contains(action: TestKeyedCompletableAction(promise: ["hello": .error(Error.dummy)])) | ||
).toEventually(beTrue()) | ||
} | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
.error(Error.dummy) | ||
.dispatch(action: TestKeyedCompletableAction.self, key: "hello", on: dispatcher) | ||
.disposed(by: disposeBag) | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
} | ||
|
||
func test_keyed_completable_action_dispatch_error() { | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
.contains(action: TestKeyedCompletableAction(promise: ["hello": .value(1)])) | ||
).toEventually(beTrue()) | ||
} | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
self.testMiddleware.actions(of: TestCompletableAction.self).count | ||
).toEventually(be(1)) | ||
} | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
.just(1) | ||
.dispatch(action: TestCompletableAction.self, on: dispatcher) | ||
.disposed(by: disposeBag) | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
} | ||
|
||
func test_completable_action_dispatch() { | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
testMiddleware = TestMiddleware() | ||
dispatcher.add(middleware: testMiddleware) | ||
} | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
|
||
override func setUp() { | ||
super.setUp() | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
var dispatcher: Dispatcher! | ||
var disposeBag: DisposeBag! | ||
var testMiddleware: TestMiddleware! | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
} | ||
|
||
} | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
guard let action = other as? TestEmptyAction else { return false } | ||
return promise == action.promise | ||
} | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
required init(promise: Promise<Void>) { | ||
self.promise = promise | ||
} | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
class TestEmptyAction: EmptyAction { | ||
|
||
let promise: Promise<Void> | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
class TestKeyedCompletableAction: KeyedCompletableAction { | ||
|
||
typealias Payload = Int | ||
typealias Key = String |
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.
Nesting Violation: Types should be nested at most 1 level deep (nesting)
|
||
class TestKeyedCompletableAction: KeyedCompletableAction { | ||
|
||
typealias Payload = Int |
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.
Nesting Violation: Types should be nested at most 1 level deep (nesting)
} | ||
|
||
class TestKeyedCompletableAction: KeyedCompletableAction { | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
return counter == action.counter | ||
} | ||
} | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
required init(promise: Promise<Payload?>) { | ||
counter = promise | ||
} | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
typealias Payload = Int | ||
|
||
let counter: Promise<Payload?> | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
class TestCompletableAction: CompletableAction { | ||
|
||
typealias Payload = Int | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
|
||
class TestCompletableAction: CompletableAction { | ||
|
||
typealias Payload = Int |
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.
Nesting Violation: Types should be nested at most 1 level deep (nesting)
fileprivate enum Error: Swift.Error { case dummy } | ||
|
||
class TestCompletableAction: CompletableAction { | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
final class PrimitiveSequenceTypeTests: XCTestCase { | ||
|
||
fileprivate enum Error: Swift.Error { case dummy } | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
XCTAssertTrue(state.counter.error == nil) | ||
XCTAssertEqual(state.counter.value, 1) | ||
} | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
else { | ||
fatalError() | ||
} | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
store | ||
.reducerGroup | ||
.disposed(by: disposeBag) | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
func test_dispatch_action_from_store() throws { | ||
let dispatcher = Dispatcher() | ||
let store = Store<TestState, TestStoreController>(TestState(), dispatcher: dispatcher, storeController: TestStoreController(dispatcher: dispatcher)) | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
|
||
func test_dispatch_action_from_store() throws { | ||
let dispatcher = Dispatcher() | ||
let store = Store<TestState, TestStoreController>(TestState(), dispatcher: dispatcher, storeController: TestStoreController(dispatcher: dispatcher)) |
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.
Line Length Violation: Line should be 120 characters or less: currently 156 characters (line_length)
.completed(20) | ||
]) | ||
} | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
.disposed(by: disposeBag) | ||
|
||
scheduler.start() | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
.filterOne { $0 == 20 } | ||
.subscribe(filterOneObserver) | ||
.disposed(by: disposeBag) | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
|
||
func test_filter_one() { | ||
let filterOneObserver = scheduler.createObserver(Int.self) | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
|
||
var scheduler: TestScheduler! | ||
var disposeBag: DisposeBag! | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
XCTAssertTrue(promise1 == promise2) | ||
|
||
} | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
let promise2: Promise<Int> = .pending() | ||
|
||
XCTAssertTrue(promise1 == promise2) | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
|
||
let promise1: Promise<Int> = .pending() | ||
let promise2: Promise<Int> = .pending() | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
} | ||
|
||
func test_equality_pending() { | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
XCTAssertFalse(promise1 == promise2) | ||
|
||
} | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
let promise2: Promise<Int> = .value(2) | ||
|
||
XCTAssertFalse(promise1 == promise2) | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
|
||
let promise1: Promise<Int> = .value(1) | ||
let promise2: Promise<Int> = .value(2) | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
} | ||
|
||
func test_equality_with_value() { | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
|
||
XCTAssertFalse(promise.value! == 2) | ||
} | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
XCTAssertFalse(promise.isPending) | ||
|
||
promise.fulfill(2) | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
XCTAssertFalse(promise.isPending) | ||
|
||
if case .success? = promise.result { | ||
XCTFail() |
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.
XCTFail Message Violation: An XCTFail call should include a description of the assertion. (xctfail_message)
XCTAssertFalse(promise.isFulfilled) | ||
XCTAssertTrue(promise.isResolved) | ||
XCTAssertFalse(promise.isPending) | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
XCTAssertFalse(promise.isFulfilled) | ||
|
||
promise.reject(Error.dummy) | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
let promise: Promise<Int> = Promise<Int>() | ||
|
||
XCTAssertFalse(promise.isFulfilled) | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
|
||
func test_reject() { | ||
let promise: Promise<Int> = Promise<Int>() | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
-> Single<A> { | ||
return Single.create { single in | ||
let subscription = self.subscribe { event in | ||
switch event { | ||
case .completed: | ||
let action = A(task: Task.requestSuccess(expiration), payload: nil) | ||
let action = A.init(promise: .value(())) |
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.
Explicit Init Violation: Explicitly calling .init() should be avoided. (explicit_init)
public func resolve(with other: [Key: Value]) -> Self { | ||
return self.merging(other, uniquingKeysWith: { _, new in new }) | ||
} | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
Sources/Mini/Promise.swift
Outdated
} | ||
|
||
extension Promise where T == Never { | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
Sources/Mini/Promise.swift
Outdated
var isPending: Bool { | ||
return !isIdle && (result == nil && !isCompleted) | ||
} | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
Sources/Mini/Promise.swift
Outdated
box.fill(sealant) | ||
properties = options | ||
} | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
Sources/Mini/Box.swift
Outdated
override func seal(_: T) { | ||
// NO-OP | ||
} | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
Sources/Mini/Box.swift
Outdated
override func inspect() -> Sealant<T> { | ||
return sealant | ||
} | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
Sources/Mini/Box.swift
Outdated
final class PreSealedBox<T>: Box<T> { | ||
|
||
private var sealant: Sealant<T> = .completed | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
Sources/Mini/Box.swift
Outdated
} | ||
|
||
final class PreSealedBox<T>: Box<T> { | ||
|
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.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
@@ -159,7 +159,13 @@ public class OrderedSet<T: Comparable> { | |||
|
|||
/// For each function | |||
public func forEach(_ body: (T) -> Swift.Void) { | |||
return internalSet.forEach(body) |
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.
why do you use NSArray?
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.
Only NSArray
has the functionality to make a concurrent access to its items, speeding up the Action
spreading.
// swiftlint:disable:next explicit_init | ||
let action = A.init(task: .requestFailure(error)) | ||
let action = A(promise: .error(error)) |
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.
Superfluous Disable Command Violation: SwiftLint rule 'explicit_init' did not trigger a violation in the disabled region. Please remove the disable command. (superfluous_disable_command)
switch completable { | ||
case .completed: | ||
// swiftlint:disable:next explicit_init | ||
let action = A.init(task: .requestSuccess(expiration)) | ||
let action = A(promise: .never()) |
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.
Superfluous Disable Command Violation: SwiftLint rule 'explicit_init' did not trigger a violation in the disabled region. Please remove the disable command. (superfluous_disable_command)
action = A(promise: .value(errorPayload)) | ||
} else { | ||
// swiftlint:disable:next explicit_init | ||
action = A(promise: .error(error)) |
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.
Superfluous Disable Command Violation: SwiftLint rule 'explicit_init' did not trigger a violation in the disabled region. Please remove the disable command. (superfluous_disable_command)
var action: A | ||
if let errorPayload = errorPayload { | ||
// swiftlint:disable:next explicit_init | ||
action = A(promise: .value(errorPayload)) |
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.
Superfluous Disable Command Violation: SwiftLint rule 'explicit_init' did not trigger a violation in the disabled region. Please remove the disable command. (superfluous_disable_command)
let subscription = self.subscribe( | ||
onSuccess: { payload in | ||
// swiftlint:disable:next explicit_init | ||
let action = A.init(task: .requestSuccess(expiration), payload: payload) | ||
let action = A(promise: .value(payload)) |
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.
Superfluous Disable Command Violation: SwiftLint rule 'explicit_init' did not trigger a violation in the disabled region. Please remove the disable command. (superfluous_disable_command)
var action: A | ||
if let errorPayload = errorPayload { | ||
// swiftlint:disable:next explicit_init | ||
action = A(promise: .value(errorPayload)) |
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.
Superfluous Disable Command Violation: SwiftLint rule 'explicit_init' did not trigger a violation in the disabled region. Please remove the disable command. (superfluous_disable_command)
onSuccess: { payload in | ||
// swiftlint:disable:next explicit_init | ||
let action = A.init(task: .requestSuccess(expiration), payload: payload) | ||
let action = A(promise: .value(payload)) |
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.
Superfluous Disable Command Violation: SwiftLint rule 'explicit_init' did not trigger a violation in the disabled region. Please remove the disable command. (superfluous_disable_command)
Package.swift
Outdated
.testTarget( | ||
name: "MiniSwiftTests", | ||
dependencies: ["MiniSwift", "RxSwift"]), | ||
dependencies: ["Mini", "TestMiddleware", "NIOConcurrencyHelpers", "RxSwift", "Nimble", "RxTest", "RxBlocking"] | ||
), // dev |
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.
Trailing Comma Violation: Collection literals should not have trailing commas. (trailing_comma)
Package.swift
Outdated
.library( | ||
name: "Mini/Test", | ||
targets: ["Mini", "TestMiddleware"] | ||
), |
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.
Trailing Comma Violation: Collection literals should not have trailing commas. (trailing_comma)
Package.swift
Outdated
@@ -8,28 +8,67 @@ let package = Package( | |||
platforms: [ | |||
.iOS(.v11), | |||
.macOS(.v10_13), | |||
.tvOS(.v11) | |||
.tvOS(.v11), |
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.
Trailing Comma Violation: Collection literals should not have trailing commas. (trailing_comma)
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 need to talk about the integrations made in this PR because you have several changes in tools, scripts, dependencies and this changes should be discussed with the team.
extension PrimitiveSequenceType where Self: RxSwift.ObservableConvertibleType, Self.Trait == RxSwift.SingleTrait { | ||
public func dispatch<A>(action: A.Type, on dispatcher: MiniSwift.Dispatcher, mode: MiniSwift.Dispatcher.DispatchMode.UI = .async, fillOnError errorPayload: A.Payload? = nil) -> RxSwift.Disposable where A: MiniSwift.CompletableAction, Self.Element == A.Payload | ||
|
||
public func dispatch<A>(action: A.Type, key: A.Key, on dispatcher: MiniSwift.Dispatcher, mode: MiniSwift.Dispatcher.DispatchMode.UI = .async, fillOnError errorPayload: A.Payload? = nil) -> RxSwift.Disposable where A: MiniSwift.KeyedCompletableAction, Self.Element == A.Payload |
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.
Line Length Violation: Line should be 250 characters or less: currently 280 characters (line_length)
} | ||
|
||
extension PrimitiveSequenceType where Self: RxSwift.ObservableConvertibleType, Self.Trait == RxSwift.SingleTrait { | ||
public func dispatch<A>(action: A.Type, on dispatcher: MiniSwift.Dispatcher, mode: MiniSwift.Dispatcher.DispatchMode.UI = .async, fillOnError errorPayload: A.Payload? = nil) -> RxSwift.Disposable where A: MiniSwift.CompletableAction, Self.Element == A.Payload |
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.
Line Length Violation: Line should be 250 characters or less: currently 263 characters (line_length)
extension ObservableType where Self.Element: MiniSwift.StoreType, Self.Element: RxSwift.ObservableType, Self.Element.Element == Self.Element.State { | ||
public static func dispatch<A, Type, T>(using dispatcher: MiniSwift.Dispatcher, factory action: @autoclosure @escaping () -> A, taskMap: @escaping (Self.Element.State) -> T?, on store: Self.Element, lifetime: MiniSwift.Promises.Lifetime = .once) -> RxSwift.Observable<Self.Element.State> where A: MiniSwift.Action, T: MiniSwift.Promise<Type> | ||
|
||
public static func dispatch<A, K, Type, T>(using dispatcher: MiniSwift.Dispatcher, factory action: @autoclosure @escaping () -> A, key: K, taskMap: @escaping (Self.Element.State) -> [K: T], on store: Self.Element, lifetime: MiniSwift.Promises.Lifetime = .once) -> RxSwift.Observable<Self.Element.State> where A: MiniSwift.Action, K: Hashable, T: MiniSwift.Promise<Type> |
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.
Line Length Violation: Line should be 250 characters or less: currently 373 characters (line_length)
} | ||
|
||
extension ObservableType where Self.Element: MiniSwift.StoreType, Self.Element: RxSwift.ObservableType, Self.Element.Element == Self.Element.State { | ||
public static func dispatch<A, Type, T>(using dispatcher: MiniSwift.Dispatcher, factory action: @autoclosure @escaping () -> A, taskMap: @escaping (Self.Element.State) -> T?, on store: Self.Element, lifetime: MiniSwift.Promises.Lifetime = .once) -> RxSwift.Observable<Self.Element.State> where A: MiniSwift.Action, T: MiniSwift.Promise<Type> |
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.
Line Length Violation: Line should be 250 characters or less: currently 345 characters (line_length)
} | ||
|
||
extension DispatchQueue { | ||
public static var isMain: Bool { get } |
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.
Implicit Getter Violation: Computed read-only properties should avoid using the get keyword. (implicit_getter)
|
||
public subscript(_: Key, orPut _: @autoclosure () -> Value) -> Value { get } | ||
|
||
public subscript(_: Key) -> Value? { get } |
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.
Implicit Getter Violation: Computed read-only subscripts should avoid using the get keyword. (implicit_getter)
|
||
public func get(withKey key: Key) -> Value? | ||
|
||
public subscript(_: Key, orPut _: @autoclosure () -> Value) -> Value { get } |
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.
Implicit Getter Violation: Computed read-only subscripts should avoid using the get keyword. (implicit_getter)
} | ||
|
||
public final class RootChain: MiniSwift.Chain { | ||
public var proceed: MiniSwift.Next { get } |
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.
Implicit Getter Violation: Computed read-only properties should avoid using the get keyword. (implicit_getter)
/** | ||
- Returns: The error with which this promise was rejected or `nil` if this promise is pending or fulfilled. | ||
*/ | ||
public var error: Error? { get } |
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.
Implicit Getter Violation: Computed read-only properties should avoid using the get keyword. (implicit_getter)
/** | ||
- Returns: The value with which this promise was fulfilled or `nil` if this promise is pending or rejected. | ||
*/ | ||
public var value: T? { get } |
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.
Implicit Getter Violation: Computed read-only properties should avoid using the get keyword. (implicit_getter)
- Fixed Cocoapods subspecs - Added different Mini targets for Testing and Logging.
Added more tests
194e6e1
to
b11dc8b
Compare
/** | ||
- Returns: `true` if the promise was rejected. | ||
*/ | ||
public var isRejected: Bool { get } |
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.
Implicit Getter Violation: Computed read-only properties should avoid using the get keyword. (implicit_getter)
/** | ||
- Returns: `true` if the promise was fulfilled. | ||
*/ | ||
public var isFulfilled: Bool { get } |
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.
Implicit Getter Violation: Computed read-only properties should avoid using the get keyword. (implicit_getter)
/** | ||
- Returns: `true` if the promise has resolved. | ||
*/ | ||
public var isResolved: Bool { get } |
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.
Implicit Getter Violation: Computed read-only properties should avoid using the get keyword. (implicit_getter)
/** | ||
- Returns: `true` if the promise has not yet resolved. | ||
*/ | ||
public var isPending: Bool { get } |
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.
Implicit Getter Violation: Computed read-only properties should avoid using the get keyword. (implicit_getter)
/** | ||
- Returns: `true` if the promise has not yet resolved nor pending. | ||
*/ | ||
public var isIdle: Bool { get } |
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.
Implicit Getter Violation: Computed read-only properties should avoid using the get keyword. (implicit_getter)
public init(initial: [T] = []) | ||
|
||
/// Returns the number of elements in the OrderedSet. | ||
public var count: Int { get } |
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.
Implicit Getter Violation: Computed read-only properties should avoid using the get keyword. (implicit_getter)
public class LoggingService: MiniSwift.Service { | ||
public var id: UUID | ||
|
||
public var perform: MiniSwift.ServiceChain { get } |
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.
Implicit Getter Violation: Computed read-only properties should avoid using the get keyword. (implicit_getter)
} | ||
|
||
public final class ForwardingChain: MiniSwift.Chain { | ||
public var proceed: MiniSwift.Next { get } |
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.
Implicit Getter Violation: Computed read-only properties should avoid using the get keyword. (implicit_getter)
} | ||
} | ||
|
||
public var subscriptionCount: Int { get } |
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.
Implicit Getter Violation: Computed read-only properties should avoid using the get keyword. (implicit_getter)
|
||
public final class Dispatcher { | ||
public struct DispatchMode { | ||
public enum UI { |
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.
Nesting Violation: Types should be nested at most 1 level deep (nesting)
Type Name Violation: Type name should be between 3 and 40 characters long: 'UI' (type_name)
] | ||
} | ||
|
||
public func __allTests() -> [XCTestCaseEntry] { |
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.
Identifier Name Violation: Function name should start with a lowercase character: '__allTests()' (identifier_name)
// DO NOT MODIFY: This is autogenerated, use: | ||
// `swift test --generate-linuxmain` | ||
// to regenerate. | ||
static let __allTests__ReducerTests = [ |
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.
Identifier Name Violation: Variable name should only contain alphanumeric characters: '__allTests__ReducerTests' (identifier_name)
// DO NOT MODIFY: This is autogenerated, use: | ||
// `swift test --generate-linuxmain` | ||
// to regenerate. | ||
static let __allTests__PromiseTests = [ |
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.
Identifier Name Violation: Variable name should only contain alphanumeric characters: '__allTests__PromiseTests' (identifier_name)
// DO NOT MODIFY: This is autogenerated, use: | ||
// `swift test --generate-linuxmain` | ||
// to regenerate. | ||
static let __allTests__PrimitiveSequenceTypeTests = [ |
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.
Identifier Name Violation: Variable name should only contain alphanumeric characters: '__allTests__PrimitiveSequenceTypeTests' (identifier_name)
// DO NOT MODIFY: This is autogenerated, use: | ||
// `swift test --generate-linuxmain` | ||
// to regenerate. | ||
static let __allTests__ObservableTypeTests = [ |
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.
Identifier Name Violation: Variable name should only contain alphanumeric characters: '__allTests__ObservableTypeTests' (identifier_name)
store | ||
.map { $0.counter.value } | ||
.filter { $0 != nil } | ||
.subscribe(onNext: { _counter in |
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.
Identifier Name Violation: Variable name should only contain alphanumeric characters: '_counter' (identifier_name)
store | ||
.map { $0.counter.value } | ||
.filter { $0 != nil } | ||
.subscribe(onNext: { _counter in |
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.
Identifier Name Violation: Variable name should only contain alphanumeric characters: '_counter' (identifier_name)
store | ||
.map { $0.counter.value } | ||
.filter { $0 != nil } | ||
.subscribe(onNext: { _counter in |
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.
Identifier Name Violation: Variable name should only contain alphanumeric characters: '_counter' (identifier_name)
store | ||
.map { $0.counter.value } | ||
.filter { $0 != nil } | ||
.subscribe(onNext: { _counter in |
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.
Identifier Name Violation: Variable name should only contain alphanumeric characters: '_counter' (identifier_name)
XCTAssertFalse(promise.isPending) | ||
|
||
if case .failure? = promise.result { | ||
XCTFail() |
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.
XCTFail Message Violation: An XCTFail call should include a description of the assertion. (xctfail_message)
This PR deprecates a
Task
-based approach in favor of a more widespread architecture based inPromises
see this for more information about the topic.This highly simplifies the modeling of how the
State
s are defined, being converted into promises with theirfulfilled
orrejected
inner state andSwift.Result
value with the final representation of the Promise.