diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2721b935cc5c..9507cb47ef87 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,6 +35,8 @@ jobs: - uses: actions/checkout@v2 - name: Select Xcode ${{ matrix.xcode }} run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app + - name: Compile documentation + run: make test-docs - name: Run tests run: make test-library - name: Run benchmark diff --git a/Makefile b/Makefile index dbe6a20c6558..955a313242bf 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,19 @@ test-library: -scheme ComposableArchitecture_watchOS \ -destination platform="$(PLATFORM_WATCHOS)" +DOC_WARNINGS := $(shell xcodebuild clean docbuild \ + -scheme ComposableArchitecture \ + -destination platform="$(PLATFORM_MACOS)" \ + -quiet \ + 2>&1 \ + | grep "couldn't be resolved to known documentation" \ + | sed 's|$(PWD)|.|g' \ + | tr '\n' '\1') +test-docs: + @test "$(DOC_WARNINGS)" = "" \ + || (echo "xcodebuild docbuild failed:\n\n$(DOC_WARNINGS)" | tr '\1' '\n' \ + && exit 1) + test-examples: xcodebuild test \ -scheme "CaseStudies (SwiftUI)" \ diff --git a/Sources/ComposableArchitecture/Debugging/ReducerDebugging.swift b/Sources/ComposableArchitecture/Debugging/ReducerDebugging.swift index 8eb277ec99e9..2c62b645f5eb 100644 --- a/Sources/ComposableArchitecture/Debugging/ReducerDebugging.swift +++ b/Sources/ComposableArchitecture/Debugging/ReducerDebugging.swift @@ -1,8 +1,8 @@ import CasePaths import Dispatch -/// Determines how the string description of an action should be printed when using the ``Reducer/debug(prefix:state:action:environment:)`` -/// higher-order reducer. +/// Determines how the string description of an action should be printed when using the +/// ``Reducer/debug(_:state:action:actionFormat:environment:)`` higher-order reducer. public enum ActionFormat { /// Prints the action in a single line by only specifying the labels of the associated values: /// diff --git a/Sources/ComposableArchitecture/Reducer.swift b/Sources/ComposableArchitecture/Reducer.swift index 8507d9171d86..eaa20a8ccbc4 100644 --- a/Sources/ComposableArchitecture/Reducer.swift +++ b/Sources/ComposableArchitecture/Reducer.swift @@ -75,10 +75,11 @@ public struct Reducer { /// action. /// /// Similar can be said for a - /// ``Reducer/forEach(state:action:environment:breakpointOnNil:_:_:)-3ic87`` reducer. If the + /// ``Reducer/forEach(state:action:environment:breakpointOnNil:file:line:)-7h573`` reducer. If the /// parent domain modifies the child collection by moving, removing, or modifying an element - /// before the ``Reducer/forEach(state:action:environment:breakpointOnNil:_:_:)-3ic87`` reducer - /// runs, the ``Reducer/forEach(state:action:environment:breakpointOnNil:_:_:)-3ic87`` reducer may + /// before the ``Reducer/forEach(state:action:environment:breakpointOnNil:file:line:)-7h573`` + /// reducer runs, the + /// ``Reducer/forEach(state:action:environment:breakpointOnNil:file:line:)-7h573`` reducer may /// perform its action against the wrong element, an element that no longer exists, or an element /// in an unexpected state. /// @@ -132,10 +133,11 @@ public struct Reducer { /// action. /// /// Similar can be said for a - /// ``Reducer/forEach(state:action:environment:breakpointOnNil:_:_:)-3ic87`` reducer. If the + /// ``Reducer/forEach(state:action:environment:breakpointOnNil:file:line:)-7h573`` reducer. If the /// parent domain modifies the child collection by moving, removing, or modifying an element - /// before the ``Reducer/forEach(state:action:environment:breakpointOnNil:_:_:)-3ic87`` reducer - /// runs, the ``Reducer/forEach(state:action:environment:breakpointOnNil:_:_:)-3ic87`` reducer may + /// before the ``Reducer/forEach(state:action:environment:breakpointOnNil:file:line:)-7h573`` + /// reducer runs, the + /// ``Reducer/forEach(state:action:environment:breakpointOnNil:file:line:)-7h573`` reducer may /// perform its action against the wrong element, an element that no longer exists, or an element /// in an unexpected state. /// @@ -191,10 +193,11 @@ public struct Reducer { /// action. /// /// Similar can be said for a - /// ``Reducer/forEach(state:action:environment:breakpointOnNil:_:_:)-3ic87`` reducer. If the + /// ``Reducer/forEach(state:action:environment:breakpointOnNil:file:line:)-7h573`` reducer. If the /// parent domain modifies the child collection by moving, removing, or modifying an element - /// before the ``Reducer/forEach(state:action:environment:breakpointOnNil:_:_:)-3ic87`` reducer - /// runs, the ``Reducer/forEach(state:action:environment:breakpointOnNil:_:_:)-3ic87`` reducer may + /// before the ``Reducer/forEach(state:action:environment:breakpointOnNil:file:line:)-7h573`` + /// reducer runs, the + /// ``Reducer/forEach(state:action:environment:breakpointOnNil:file:line:)-7h573`` reducer may /// perform its action against the wrong element, an element that no longer exists, or an element /// in an unexpected state. /// @@ -305,7 +308,7 @@ public struct Reducer { /// operator to pullback a reducer that operates on a single case of some state enum to work on /// the entire state enum. /// - /// When used with the ``combine(_:)-994ake`` operator you can define many reducers that work each + /// When used with the ``combine(_:)-994ak`` operator you can define many reducers that work each /// case of the state enum, and then _pull them back_ and _combine_ them into one big reducer that /// works on a large domain. /// @@ -736,10 +739,11 @@ public struct Reducer { /// ) /// ``` /// - /// Take care when combining ``forEach(state:action:environment:breakpointOnNil:_:_:)-90ox5`` - /// reducers into parent domains, as order matters. Always combine - /// ``forEach(state:action:environment:breakpointOnNil:_:_:)-90ox5`` reducers _before_ parent - /// reducers that can modify the collection. + /// Take care when combining + /// ``forEach(state:action:environment:breakpointOnNil:file:line:)-7h573`` reducers into parent + /// domains, as order matters. Always combine + /// ``forEach(state:action:environment:breakpointOnNil:file:line:)-7h573`` reducers _before_ + /// parent reducers that can modify the collection. /// /// - Parameters: /// - toLocalState: A key path that can get/set a collection of `State` elements inside @@ -808,10 +812,11 @@ public struct Reducer { /// A version of ``pullback(state:action:environment:)`` that transforms a reducer that works on /// an element into one that works on a dictionary of element values. /// - /// Take care when combining ``forEach(state:action:environment:breakpointOnNil:_:_:)-xv1z`` + /// Take care when combining + /// ``forEach(state:action:environment:breakpointOnNil:file:line:)-1h7qx`` /// reducers into parent domains, as order matters. Always combine - /// ``forEach(state:action:environment:breakpointOnNil:_:_:)-xv1z`` reducers _before_ parent - /// reducers that can modify the dictionary. + /// ``forEach(state:action:environment:breakpointOnNil:file:line:)-1h7qx`` reducers _before_ + /// parent reducers that can modify the dictionary. /// /// - Parameters: /// - toLocalState: A key path that can get/set a dictionary of `State` values inside diff --git a/Sources/ComposableArchitecture/SwiftUI/ForEachStore.swift b/Sources/ComposableArchitecture/SwiftUI/ForEachStore.swift index 90e183e5a52a..8a52c913fdd0 100644 --- a/Sources/ComposableArchitecture/SwiftUI/ForEachStore.swift +++ b/Sources/ComposableArchitecture/SwiftUI/ForEachStore.swift @@ -51,7 +51,7 @@ import SwiftUI /// ``` /// /// Enhance its reducer using -/// ``Reducer/forEach(state:action:environment:breakpointOnNil:_:_:)-3ic87``: +/// ``Reducer/forEach(state:action:environment:breakpointOnNil:file:line:)-7h573``: /// /// ```swift /// let appReducer = todoReducer.forEach( diff --git a/Sources/ComposableArchitecture/SwiftUI/SwitchStore.swift b/Sources/ComposableArchitecture/SwiftUI/SwitchStore.swift index 37b135bb50fd..e49898d8f9d2 100644 --- a/Sources/ComposableArchitecture/SwiftUI/SwitchStore.swift +++ b/Sources/ComposableArchitecture/SwiftUI/SwitchStore.swift @@ -47,10 +47,9 @@ import SwiftUI /// } /// ``` /// -/// - See also: ``Reducer/pullback(state:action:environment:breakpointOnNil:_:_:)``, a method that -/// aids in transforming reducers that operate on each case of an enum into reducers that operate -/// on the entire enum. -/// +/// - See also: ``Reducer/pullback(state:action:environment:breakpointOnNil:file:line:)``, a method +/// that aids in transforming reducers that operate on each case of an enum into reducers that +/// operate on the entire enum. public struct SwitchStore: View where Content: View { public let store: Store public let content: () -> Content