Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: GitHub Action for SwiftLint
uses: norio-nomura/action-swiftlint@3.0.1
uses: norio-nomura/action-swiftlint@3.2.1
with:
args: lint --no-cache --strict
8 changes: 3 additions & 5 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ disabled_rules:
- superfluous_disable_command # Disabled since we disable some rules pre-emptively to avoid issues in the future
- todo # Disabled while we are filling out the framework; re-enable when we get closer to completion
- nesting # Does not make sense anymore since Swift 4 uses nested `CodingKeys` enums for example

- implicit_return # Suddenly started firing for existing code on PRs, should investigate later

opt_in_rules:
- anyobject_protocol
- attributes
- closure_end_indentation
- closure_spacing
Expand All @@ -29,7 +27,6 @@ opt_in_rules:
- first_where
- identical_operands
- implicit_return
- inert_defer
- joined_default_parameter
- literal_expression_end_indentation
- legacy_hashing
Expand All @@ -55,6 +52,7 @@ opt_in_rules:
- trailing_whitespace
- unneeded_parentheses_in_closure_argument
- vertical_parameter_alignment_on_call
- weak_delegate
- yoda_condition

excluded:
Expand All @@ -71,8 +69,8 @@ attributes:
- "@NSManaged"
- "@objc"
closure_spacing: warning
empty_count: warning
explicit_init: warning
empty_count:
severity: warning
fatal_error_message: warning
file_header:
severity: warning
Expand Down
2 changes: 1 addition & 1 deletion MobiusCore/Test/AnonymousDisposableTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Nimble
import Quick

class AnonymousDisposableTests: QuickSpec {
// swiftlint:disable function_body_length
// swiftlint:disable:next function_body_length
override func spec() {
describe("AnonymousDisposable") {
var disposable: AnonymousDisposable!
Expand Down
2 changes: 1 addition & 1 deletion MobiusCore/Test/ConnectablePublisherTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Nimble
import Quick

class ConnectablePublisherTests: QuickSpec {
// swiftlint:disable function_body_length
// swiftlint:disable:next function_body_length
override func spec() {
describe("ConnectablePublisher") {
var publisher: ConnectablePublisher<String>!
Expand Down
2 changes: 1 addition & 1 deletion MobiusCore/Test/EffectHandlers/AnyEffectHandlerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ private typealias Effect = String
private typealias Event = String

class AnyEffectHandlerTests: QuickSpec {
// swiftlint:disable function_body_length
// swiftlint:disable:next function_body_length
override func spec() {
describe("AnyEffectHandler") {
var effectHandler: AnyEffectHandler<Effect, Event>!
Expand Down
2 changes: 1 addition & 1 deletion MobiusCore/Test/EffectHandlers/CallbackTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Nimble
import Quick

class CallbackTests: QuickSpec {
// swiftlint:disable function_body_length
// swiftlint:disable:next function_body_length
override func spec() {
describe("Callbacks") {
context("Ending a Callback") {
Expand Down
4 changes: 1 addition & 3 deletions MobiusCore/Test/EffectHandlers/EffectHandlerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ private enum Event {
case eventForEffect1
}

// swiftlint:disable type_body_length file_length

class EffectHandlerTests: QuickSpec {
// swiftlint:disable function_body_length
override func spec() {
describe("Handling effects with EffectHandler") {
var effectHandler: AnyEffectHandler<Effect, Event>!
Expand Down Expand Up @@ -63,6 +60,7 @@ class EffectHandlerTests: QuickSpec {
}
}
}

describe("Disposing EffectHandler") {
it("calls the returned disposable when disposing") {
var disposed = false
Expand Down
4 changes: 1 addition & 3 deletions MobiusCore/Test/EffectHandlers/EffectRouterDSLTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import MobiusCore
import Nimble
import Quick

// swiftlint:disable type_body_length file_length

private enum Effect: Equatable {
case effect1
case effect2
Expand All @@ -29,7 +27,7 @@ private enum Event: Equatable {
}

class EffectRouterDSLTests: QuickSpec {
// swiftlint:disable function_body_length
// swiftlint:disable:next function_body_length
override func spec() {
context("An EffectHandler which always ends as soon as it is called") {
var wasDisposed: Bool!
Expand Down
4 changes: 1 addition & 3 deletions MobiusCore/Test/EffectHandlers/EffectRouterTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import MobiusCore
import Nimble
import Quick

// swiftlint:disable type_body_length file_length

private enum Effect {
case effect1
case effect2
Expand All @@ -32,7 +30,7 @@ private enum Event {
}

class EffectRouterTests: QuickSpec {
// swiftlint:disable function_body_length
// swiftlint:disable:next function_body_length
override func spec() {
context("Router happy paths") {
var receivedEvents: [Event]!
Expand Down
3 changes: 0 additions & 3 deletions MobiusCore/Test/EffectHandlers/EnumRouteTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import MobiusCore
import Nimble
import Quick

// swiftlint:disable type_body_length file_length

private typealias Event = ()

private enum Effect {
Expand Down Expand Up @@ -48,7 +46,6 @@ private func unwrap<Input, Parameters, Output>(
}

class ParameterExtractionRouteTests: QuickSpec {
// swiftlint:disable function_body_length
override func spec() {
context("Different types of enums being unwrapped") {
it("supports routing to an effect with nothing to unwrap") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Nimble
import Quick

class CompositeEventSourceBuilderTest: QuickSpec {
// swiftlint:disable function_body_length
// swiftlint:disable:next function_body_length
override func spec() {
var eventsReceived: [Int]!
var compositeEventSource: AnyEventSource<Int>!
Expand Down
6 changes: 3 additions & 3 deletions MobiusCore/Test/MobiusControllerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import Foundation
import Nimble
import Quick

// swiftlint:disable type_body_length file_length

// swiftlint:disable file_length
// swiftlint:disable:next type_body_length
class MobiusControllerTests: QuickSpec {
let loopQueue = DispatchQueue(label: "loop queue")
let viewQueue = DispatchQueue(label: "view queue")

// swiftlint:disable function_body_length
// swiftlint:disable:next function_body_length
override func spec() {
describe("MobiusController") {
var controller: MobiusController<String, String, String>!
Expand Down
2 changes: 1 addition & 1 deletion MobiusCore/Test/MobiusIntegrationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Quick

// Should only test public APIs
class MobiusIntegrationTests: QuickSpec {
// swiftlint:disable function_body_length
// swiftlint:disable:next function_body_length
override func spec() {
describe("Mobius integration tests") {
let update = Update<String, String, String> { _, event in
Expand Down
2 changes: 1 addition & 1 deletion MobiusCore/Test/MobiusLoopTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Nimble
import Quick

class MobiusLoopTests: QuickSpec {
// swiftlint:disable function_body_length
// swiftlint:disable:next function_body_length
override func spec() {
describe("MobiusLoop") {
var builder: Mobius.Builder<String, String, String>!
Expand Down
2 changes: 1 addition & 1 deletion MobiusCore/Test/NonReentrancyTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private enum Effect: String, CustomStringConvertible, Equatable {
}

class NonReentrancyTests: QuickSpec {
// swiftlint:disable function_body_length
// swiftlint:disable:next function_body_length
override func spec() {
describe("MobiusLoop") {
var loop: MobiusLoop<Model, Event, Effect>!
Expand Down
2 changes: 1 addition & 1 deletion MobiusCore/Test/WorkBagTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Nimble
import Quick

class WorkBagTests: QuickSpec {
// swiftlint:disable function_body_length
// swiftlint:disable:next function_body_length
override func spec() {
describe("WorkBag") {
var workBag: WorkBag!
Expand Down
2 changes: 1 addition & 1 deletion MobiusExtras/Test/ConnectableClassTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import Quick
@testable import MobiusExtras

class ConnectableTests: QuickSpec {
// swiftlint:disable function_body_length
// swiftlint:disable:next function_body_length
override func spec() {
describe("ConnectableClass") {
beforeEach {
Expand Down
4 changes: 2 additions & 2 deletions MobiusExtras/Test/WikiTutorialTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import XCTest

/// Test cases that reproduce the Getting Started section of the GitHub wiki
class WikiTutorialTest: XCTestCase {
// swiftlint:disable function_body_length

// swiftlint:disable:next function_body_length
func testWikiCreatingALoop() {
// Standin implementation of print()
var printedValues: [String] = []
Expand Down Expand Up @@ -62,6 +61,7 @@ class WikiTutorialTest: XCTestCase {
XCTAssertEqual(printedValues, ["2", "1", "0", "0", "1", "2", "1"])
}

// swiftlint:disable:next function_body_length
func testWikiCreatingALoop_addingEffects() {
// Standin implementation of print()
var printedValues: [String] = []
Expand Down
3 changes: 2 additions & 1 deletion MobiusNimble/Test/NimbleFirstMatchersTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ import Nimble
import Quick
import XCTest

// swiftlint:disable:next type_body_length
class NimbleFirstMatchersTests: QuickSpec {
// swiftlint:disable function_body_length
// swiftlint:disable:next function_body_length
override func spec() {
let assertionHandler = AssertionRecorder()
var defaultHandler: AssertionHandler?
Expand Down
4 changes: 2 additions & 2 deletions MobiusNimble/Test/NimbleNextMatchersTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import XCTest
// is replaced in order to be inspected

// swiftlint:disable file_length
// swiftlint:disable type_body_length
// swiftlint:disable:next type_body_length
class NimbleNextMatchersTests: QuickSpec {
// swiftlint:disable function_body_length
// swiftlint:disable:next function_body_length
override func spec() {
let assertionHandler = AssertionRecorder()
var defaultHandler: AssertionHandler?
Expand Down
4 changes: 2 additions & 2 deletions MobiusTest/Test/DebugDiffTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ enum TestEnum: Equatable {
case first, second(String), third(Int)
}

// swiftlint:disable type_body_length
// swiftlint:disable:next type_body_length
class DebugDiffTests: QuickSpec {
// swiftlint:disable function_body_length
// swiftlint:disable:next function_body_length
override func spec() {
describe("DumpDiff") {
var diff: String?
Expand Down
2 changes: 1 addition & 1 deletion MobiusTest/Test/FirstMatchersTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Nimble
import Quick

class FirstMatchersTests: QuickSpec {
// swiftlint:disable function_body_length
// swiftlint:disable:next function_body_length
override func spec() {
describe("assertThatFirst") {
var failureMessages: [String] = []
Expand Down
4 changes: 2 additions & 2 deletions MobiusTest/Test/NextMatchersTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import XCTest
// is replaced in order to be inspected

// swiftlint:disable file_length
// swiftlint:disable type_body_length
// swiftlint:disable:next type_body_length
class XCTestNextMatchersTests: QuickSpec {
// swiftlint:disable function_body_length
// swiftlint:disable:next function_body_length
override func spec() {
describe("AssertThatNext") {
var failMessages: [String] = []
Expand Down
2 changes: 1 addition & 1 deletion MobiusTest/Test/UpdateSpecTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ enum MyEffect {
}

class UpdateSpecTests: QuickSpec {
// swiftlint:disable function_body_length
// swiftlint:disable:next function_body_length
override func spec() {
let updateSpec = UpdateSpec(myUpdate)

Expand Down