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
35 changes: 16 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,35 @@
name: CI
name: ci

on:
push:
branches:
- main
pull_request:
branches:
- '*'
- "*"
workflow_dispatch:

jobs:
lint:
runs-on: macos-13
runs-on: macos-latest
environment: default
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- name: SwiftFormat version
run: swiftformat --version
- name: Format lint
run: swiftformat --lint .
- name: Install SwiftLint
run: brew install swiftlint
- name: SwiftLint version
run: swiftlint --version
- name: Lint
run: swiftlint .
run: swiftlint lint --quiet
macos-test:
runs-on: macos-14
environment: default
strategy:
matrix:
include:
- os: macos-14
xcode: 15.2 # Swift 5.9
- os: macos-14
xcode: 15.3 # Swift 5.10
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
- uses: actions/checkout@v3
- name: Run Tests
run: swift test --enable-code-coverage --parallel
- name: Swift Coverage Report
Expand All @@ -44,8 +41,8 @@ jobs:
linux-test:
runs-on: ubuntu-latest
environment: default

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- name: Run Tests
run: swift test --parallel
run: swift test --parallel
6 changes: 3 additions & 3 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--extensionacl on-declarations
--redundanttype explicit
--swiftversion 5.5
--swiftversion 5.9
--maxwidth 120
--header "{file}\nFilter\n\n\nMIT License\n\nCopyright © {year} Andrew Roan"
--allman false
--header "{file}\nFilter\n\n\nMIT License\n\nCopyright Andrew Roan"
--allman false
6 changes: 3 additions & 3 deletions Sources/Filter/Collection/AnyCollectionPredicate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2024 Andrew Roan
// Copyright Andrew Roan

import Foundation

Expand All @@ -17,7 +17,7 @@ public protocol AnyCollectionPredicate {
/// - keyPath: KeyPath<Root, Value>
/// - Returns
/// - Output
static func build<Root, Value>(from filter: CollectionFilter<Value>, on keyPath: KeyPath<Root, Value>) -> Output
static func build<Value>(from filter: CollectionFilter<Value>, on keyPath: KeyPath<some Any, Value>) -> Output
where Value: Collection
}

Expand All @@ -28,7 +28,7 @@ extension AnyCollectionPredicate {
/// - Returns
/// - Output
@inlinable
public static func build<Value>(from filter: CollectionFilter<Value>) -> Output where Value: Collection {
public static func build(from filter: CollectionFilter<some Collection>) -> Output {
build(from: filter, on: \.self)
}
}
8 changes: 4 additions & 4 deletions Sources/Filter/Collection/CollectionFilter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2024 Andrew Roan
// Copyright Andrew Roan

import Foundation

Expand All @@ -28,11 +28,11 @@ public enum CollectionFilter<C>: Equatable where C: Collection, C: Equatable, C.
public var unwrapped: CollectionFilter<C>? {
switch self {
case let .orNil(unwrapped):
return unwrapped
unwrapped
case let .notNil(unwrapped):
return unwrapped
unwrapped
case .isNil:
return nil
nil
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Filter/Collection/CollectionPredicate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2024 Andrew Roan
// Copyright Andrew Roan

import Foundation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2024 Andrew Roan
// Copyright Andrew Roan

import Foundation

Expand All @@ -16,7 +16,7 @@ public protocol OptionalAnyCollectionPredicate: AnyCollectionPredicate {
/// - keyPath: KeyPath<Root, Value?>
/// - Returns
/// - Output
static func build<Model, Value>(from filter: CollectionFilter<Value>.Optional, on keyPath: KeyPath<Model, Value?>)
static func build<Value>(from filter: CollectionFilter<Value>.Optional, on keyPath: KeyPath<some Any, Value?>)
-> Output where Value: Collection
}

Expand All @@ -27,7 +27,7 @@ extension OptionalAnyCollectionPredicate {
/// - Returns
/// - Output
@inlinable
public static func build<Value>(from filter: CollectionFilter<Value>.Optional) -> Output where Value: Collection {
public static func build(from filter: CollectionFilter<some Collection>.Optional) -> Output {
build(from: filter, on: \.self)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2024 Andrew Roan
// Copyright Andrew Roan

import Foundation

Expand Down
6 changes: 3 additions & 3 deletions Sources/Filter/Comparable/AnyComparablePredicate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2024 Andrew Roan
// Copyright Andrew Roan

import Foundation

Expand All @@ -16,7 +16,7 @@ public protocol AnyComparablePredicate: AnyEquatablePredicate {
/// - keyPath: KeyPath<Root, Value>
/// - Returns
/// - Output
static func build<Root, Value>(from filter: ComparableFilter<Value>, on keyPath: KeyPath<Root, Value>) -> Output
static func build<Value>(from filter: ComparableFilter<Value>, on keyPath: KeyPath<some Any, Value>) -> Output
where Value: Comparable
}

Expand All @@ -27,7 +27,7 @@ extension AnyComparablePredicate {
/// - Returns
/// - Output
@inlinable
public static func build<Value>(from filter: ComparableFilter<Value>) -> Output where Value: Comparable {
public static func build(from filter: ComparableFilter<some Comparable>) -> Output {
build(from: filter, on: \.self)
}
}
8 changes: 4 additions & 4 deletions Sources/Filter/Comparable/ComparableFilter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2024 Andrew Roan
// Copyright Andrew Roan

import Foundation

Expand Down Expand Up @@ -69,11 +69,11 @@ public enum ComparableFilter<T: Comparable>: Equatable {
public var unwrapped: ComparableFilter<T>? {
switch self {
case let .orNil(unwrapped):
return unwrapped
unwrapped
case let .notNil(unwrapped):
return unwrapped
unwrapped
case .isNil:
return nil
nil
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Filter/Comparable/ComparablePredicate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2024 Andrew Roan
// Copyright Andrew Roan

import Foundation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2024 Andrew Roan
// Copyright Andrew Roan

import Foundation

Expand All @@ -16,7 +16,7 @@ public protocol OptionalAnyComparablePredicate: AnyComparablePredicate, Optional
/// - keyPath: KeyPath<Root, Value?>
/// - Returns
/// - Output
static func build<Model, Value>(from filter: ComparableFilter<Value>.Optional, on keyPath: KeyPath<Model, Value?>)
static func build<Value>(from filter: ComparableFilter<Value>.Optional, on keyPath: KeyPath<some Any, Value?>)
-> Output where Value: Comparable
}

Expand All @@ -27,7 +27,7 @@ extension OptionalAnyComparablePredicate {
/// - Returns
/// - Output
@inlinable
public static func build<Value>(from filter: ComparableFilter<Value>.Optional) -> Output where Value: Comparable {
public static func build(from filter: ComparableFilter<some Comparable>.Optional) -> Output {
build(from: filter, on: \.self)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2024 Andrew Roan
// Copyright Andrew Roan

import Foundation

Expand Down
6 changes: 3 additions & 3 deletions Sources/Filter/Equatable/AnyEquatablePredicate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2024 Andrew Roan
// Copyright Andrew Roan

import Foundation

Expand All @@ -17,7 +17,7 @@ public protocol AnyEquatablePredicate {
/// - keyPath: KeyPath<Root, Value>
/// - Returns
/// - Output
static func build<Root, Value>(from filter: EquatableFilter<Value>, on keyPath: KeyPath<Root, Value>) -> Output
static func build<Value>(from filter: EquatableFilter<Value>, on keyPath: KeyPath<some Any, Value>) -> Output
where Value: Equatable
}

Expand All @@ -28,7 +28,7 @@ extension AnyEquatablePredicate {
/// - Returns
/// - Output
@inlinable
public static func build<Value>(from filter: EquatableFilter<Value>) -> Output where Value: Equatable {
public static func build(from filter: EquatableFilter<some Equatable>) -> Output {
build(from: filter, on: \.self)
}
}
8 changes: 4 additions & 4 deletions Sources/Filter/Equatable/EquatableFilter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2024 Andrew Roan
// Copyright Andrew Roan

import Foundation

Expand Down Expand Up @@ -60,11 +60,11 @@ public enum EquatableFilter<T: Equatable>: Equatable {
public var unwrapped: EquatableFilter<T>? {
switch self {
case let .orNil(unwrapped):
return unwrapped
unwrapped
case let .notNil(unwrapped):
return unwrapped
unwrapped
case .isNil:
return nil
nil
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Filter/Equatable/EquatablePredicate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2024 Andrew Roan
// Copyright Andrew Roan

import Foundation

Expand Down
6 changes: 3 additions & 3 deletions Sources/Filter/Equatable/OptionalAnyEquatablePredicate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2024 Andrew Roan
// Copyright Andrew Roan

import Foundation

Expand All @@ -16,7 +16,7 @@ public protocol OptionalAnyEquatablePredicate: AnyEquatablePredicate {
/// - keyPath: KeyPath<Root, Value?>
/// - Returns
/// - Output
static func build<Model, Value>(from filter: EquatableFilter<Value>.Optional, on keyPath: KeyPath<Model, Value?>)
static func build<Value>(from filter: EquatableFilter<Value>.Optional, on keyPath: KeyPath<some Any, Value?>)
-> Output where Value: Equatable
}

Expand All @@ -27,7 +27,7 @@ extension OptionalAnyEquatablePredicate {
/// - Returns
/// - Output
@inlinable
public static func build<Value>(from filter: EquatableFilter<Value>.Optional) -> Output where Value: Equatable {
public static func build(from filter: EquatableFilter<some Equatable>.Optional) -> Output {
build(from: filter, on: \.self)
}
}
2 changes: 1 addition & 1 deletion Sources/Filter/Equatable/OptionalEquatablePredicate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2024 Andrew Roan
// Copyright Andrew Roan

import Foundation

Expand Down
6 changes: 3 additions & 3 deletions Sources/Filter/Sequence/AnySequencePredicate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2024 Andrew Roan
// Copyright Andrew Roan

import Foundation

Expand All @@ -17,7 +17,7 @@ public protocol AnySequencePredicate {
/// - keyPath: KeyPath<Root, Value>
/// - Returns
/// - Output
static func build<Root, Value>(from filter: SequenceFilter<Value>, on keyPath: KeyPath<Root, Value>) -> Output
static func build<Value>(from filter: SequenceFilter<Value>, on keyPath: KeyPath<some Any, Value>) -> Output
where Value: Sequence
}

Expand All @@ -28,7 +28,7 @@ extension AnySequencePredicate {
/// - Returns
/// - Output
@inlinable
public static func build<Value>(from filter: SequenceFilter<Value>) -> Output where Value: Sequence {
public static func build(from filter: SequenceFilter<some Sequence>) -> Output {
build(from: filter, on: \.self)
}
}
Loading