lint
This commit is contained in:
parent
655c716b62
commit
4cd608d123
|
@ -1,10 +1,9 @@
|
||||||
included:
|
included:
|
||||||
- Sources
|
- Sources
|
||||||
|
- Tests
|
||||||
|
|
||||||
disabled_rules:
|
disabled_rules:
|
||||||
- cyclomatic_complexity
|
- cyclomatic_complexity
|
||||||
- file_length
|
- file_length
|
||||||
- function_body_length
|
- function_body_length
|
||||||
- identifier_name
|
- identifier_name
|
||||||
|
|
||||||
line_length: 200
|
|
||||||
|
|
|
@ -64,7 +64,9 @@ extension Plan {
|
||||||
/// > "2001-01-01 00:00:03"
|
/// > "2001-01-01 00:00:03"
|
||||||
/// > "2001-01-01 00:00:06"
|
/// > "2001-01-01 00:00:06"
|
||||||
/// ...
|
/// ...
|
||||||
public static func make<I>(_ makeUnderlyingIterator: @escaping () -> I) -> Plan where I: IteratorProtocol, I.Element == Interval {
|
public static func make<I>(
|
||||||
|
_ makeUnderlyingIterator: @escaping () -> I
|
||||||
|
) -> Plan where I: IteratorProtocol, I.Element == Interval {
|
||||||
return Plan(AnySequence(makeUnderlyingIterator))
|
return Plan(AnySequence(makeUnderlyingIterator))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +111,9 @@ extension Plan {
|
||||||
/// You are not supposed to return `Date()` in making interator.
|
/// You are not supposed to return `Date()` in making interator.
|
||||||
/// If you want to execute a task immediately,
|
/// If you want to execute a task immediately,
|
||||||
/// use `Plan.now` then `concat` another plan instead.
|
/// use `Plan.now` then `concat` another plan instead.
|
||||||
public static func make<I>(_ makeUnderlyingIterator: @escaping () -> I) -> Plan where I: IteratorProtocol, I.Element == Date {
|
public static func make<I>(
|
||||||
|
_ makeUnderlyingIterator: @escaping () -> I
|
||||||
|
) -> Plan where I: IteratorProtocol, I.Element == Date {
|
||||||
return Plan.make { () -> AnyIterator<Interval> in
|
return Plan.make { () -> AnyIterator<Interval> in
|
||||||
var iterator = makeUnderlyingIterator()
|
var iterator = makeUnderlyingIterator()
|
||||||
var last: Date!
|
var last: Date!
|
||||||
|
|
|
@ -51,7 +51,6 @@ open class Task {
|
||||||
/// The mutex used to guard task center operations.
|
/// The mutex used to guard task center operations.
|
||||||
let taskCenterMutex = NSRecursiveLock()
|
let taskCenterMutex = NSRecursiveLock()
|
||||||
|
|
||||||
|
|
||||||
/// Initializes a normal task with specified plan and dispatch queue.
|
/// Initializes a normal task with specified plan and dispatch queue.
|
||||||
///
|
///
|
||||||
/// - Parameters:
|
/// - Parameters:
|
||||||
|
|
|
@ -221,6 +221,6 @@ final class PlanTests: XCTestCase {
|
||||||
("testPassingEmptyArrays", testPassingEmptyArrays),
|
("testPassingEmptyArrays", testPassingEmptyArrays),
|
||||||
("testIntervalOffset", testIntervalOffset),
|
("testIntervalOffset", testIntervalOffset),
|
||||||
("testNegativeIntervalOffset", testNegativeIntervalOffset),
|
("testNegativeIntervalOffset", testNegativeIntervalOffset),
|
||||||
("testNilIntervalOffset", testNilIntervalOffset),
|
("testNilIntervalOffset", testNilIntervalOffset)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,7 +107,7 @@ final class TaskTests: XCTestCase {
|
||||||
let fn = {
|
let fn = {
|
||||||
let obj = NSObject()
|
let obj = NSObject()
|
||||||
let task = Plan.after(0.1.second).do(queue: .main, onElapse: {
|
let task = Plan.after(0.1.second).do(queue: .main, onElapse: {
|
||||||
XCTFail()
|
XCTFail("should never come here")
|
||||||
})
|
})
|
||||||
task.host(on: obj)
|
task.host(on: obj)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue